|
|
@ -6,18 +6,18 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
|
|
|
|
|
|
@interface OWSPrimaryStorage (Loki)
|
|
|
|
@interface OWSPrimaryStorage (Loki)
|
|
|
|
|
|
|
|
|
|
|
|
# pragma mark - Prekey for contacts
|
|
|
|
# pragma mark - Prekey for Contact
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
Check if we have PreKeyRecord for the given contact.
|
|
|
|
Check if we have a `PreKeyRecord` for the given contact.
|
|
|
|
|
|
|
|
|
|
|
|
@param pubKey The hex encoded public ket of the contact.
|
|
|
|
@param pubKey The hex encoded public key of the contact.
|
|
|
|
@return Whether we have a prekey or not.
|
|
|
|
@return Whether we have a prekey or not.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
- (BOOL)hasPreKeyForContact:(NSString *)pubKey;
|
|
|
|
- (BOOL)hasPreKeyForContact:(NSString *)pubKey;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
Get the PreKeyRecord associated with the given contact.
|
|
|
|
Get the `PreKeyRecord` associated with the given contact.
|
|
|
|
If the record doesn't exist then this will create a new one.
|
|
|
|
If the record doesn't exist then this will create a new one.
|
|
|
|
|
|
|
|
|
|
|
|
@param pubKey The hex encoded public key of the contact.
|
|
|
|
@param pubKey The hex encoded public key of the contact.
|
|
|
@ -28,7 +28,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
# pragma mark - PreKeyBundle
|
|
|
|
# pragma mark - PreKeyBundle
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
Generate a PreKeyBundle for the given contact.
|
|
|
|
Generate a `PreKeyBundle` for the given contact.
|
|
|
|
This doesn't store the pre key bundle, and you shouldn't store this bundle.
|
|
|
|
This doesn't store the pre key bundle, and you shouldn't store this bundle.
|
|
|
|
It's used for generating bundles to send to other users.
|
|
|
|
It's used for generating bundles to send to other users.
|
|
|
|
|
|
|
|
|
|
|
@ -38,15 +38,15 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
- (PreKeyBundle *)generatePreKeyBundleForContact:(NSString *)pubKey;
|
|
|
|
- (PreKeyBundle *)generatePreKeyBundleForContact:(NSString *)pubKey;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
Get the PreKeyBundle associated with the given contact.
|
|
|
|
Get the `PreKeyBundle` associated with the given contact.
|
|
|
|
|
|
|
|
|
|
|
|
@param pubKey The hex encoded public key of the contact.
|
|
|
|
@param pubKey The hex encoded public key of the contact.
|
|
|
|
@return The pre key bundle or nil if it doesn't exist.
|
|
|
|
@return The pre key bundle or `nil` if it doesn't exist.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
- (PreKeyBundle *_Nullable)getPreKeyBundleForContact:(NSString *)pubKey;
|
|
|
|
- (PreKeyBundle *_Nullable)getPreKeyBundleForContact:(NSString *)pubKey;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
Set the PreKeyBundle for the given contact.
|
|
|
|
Set the `PreKeyBundle` for the given contact.
|
|
|
|
|
|
|
|
|
|
|
|
@param bundle The pre key bundle.
|
|
|
|
@param bundle The pre key bundle.
|
|
|
|
@param pubKey The hex encoded public key of the contact.
|
|
|
|
@param pubKey The hex encoded public key of the contact.
|
|
|
@ -54,7 +54,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
- (void)setPreKeyBundle:(PreKeyBundle *)bundle forContact:(NSString *)pubKey;
|
|
|
|
- (void)setPreKeyBundle:(PreKeyBundle *)bundle forContact:(NSString *)pubKey;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
Remove the PreKeyBundle for the given contact.
|
|
|
|
Remove the `PreKeyBundle` for the given contact.
|
|
|
|
|
|
|
|
|
|
|
|
@param pubKey The hex encoded public key of the contact.
|
|
|
|
@param pubKey The hex encoded public key of the contact.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|