mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Discard PreKeyBundle once session has been built.
This commit is contained in:
parent
705e5f939d
commit
ea7205ce76
|
@ -53,6 +53,13 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
*/
|
||||
- (void)setPreKeyBundle:(PreKeyBundle *)bundle forContact:(NSString *)pubKey;
|
||||
|
||||
/**
|
||||
Remove the PreKeyBundle for the given contact.
|
||||
|
||||
@param pubKey The hex encoded public key of the contact.
|
||||
*/
|
||||
- (void)removePreKeyBundleForContact:(NSString *)pubKey;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
|
@ -91,4 +91,10 @@
|
|||
inCollection:LokiPreKeyBundleCollection];
|
||||
}
|
||||
|
||||
- (void)removePreKeyBundleForContact:(NSString *)pubKey
|
||||
{
|
||||
[self.dbReadWriteConnection removeObjectForKey:pubKey
|
||||
inCollection:LokiPreKeyBundleCollection];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -1665,6 +1665,9 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException";
|
|||
[self.dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
||||
@try {
|
||||
[builder throws_processPrekeyBundle:bundle protocolContext:transaction];
|
||||
|
||||
// Loki: Discard the prekey bundle here since the session is initiated
|
||||
[[OWSPrimaryStorage sharedManager] removePreKeyBundleForContact:recipientId];
|
||||
} @catch (NSException *caughtException) {
|
||||
exception = caughtException;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue