|
|
@ -1,9 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
@objc public extension SSKProtoPrekeyBundleMessage {
|
|
|
|
@objc public extension SSKProtoPrekeyBundleMessage {
|
|
|
|
|
|
|
|
|
|
|
|
@objc public static func builder(fromPreKeyBundle preKeyBundle: PreKeyBundle) -> SSKProtoPrekeyBundleMessageBuilder {
|
|
|
|
@objc(builderFromPreKeyBundle:)
|
|
|
|
|
|
|
|
public static func builder(from preKeyBundle: PreKeyBundle) -> SSKProtoPrekeyBundleMessageBuilder {
|
|
|
|
let builder = self.builder()
|
|
|
|
let builder = self.builder()
|
|
|
|
|
|
|
|
|
|
|
|
builder.setIdentityKey(preKeyBundle.identityKey)
|
|
|
|
builder.setIdentityKey(preKeyBundle.identityKey)
|
|
|
|
builder.setDeviceID(UInt32(preKeyBundle.deviceId))
|
|
|
|
builder.setDeviceID(UInt32(preKeyBundle.deviceId))
|
|
|
|
builder.setPrekeyID(UInt32(preKeyBundle.preKeyId))
|
|
|
|
builder.setPrekeyID(UInt32(preKeyBundle.preKeyId))
|
|
|
@ -11,11 +11,11 @@
|
|
|
|
builder.setSignedKeyID(UInt32(preKeyBundle.signedPreKeyId))
|
|
|
|
builder.setSignedKeyID(UInt32(preKeyBundle.signedPreKeyId))
|
|
|
|
builder.setSignedKey(preKeyBundle.signedPreKeyPublic)
|
|
|
|
builder.setSignedKey(preKeyBundle.signedPreKeyPublic)
|
|
|
|
builder.setSignature(preKeyBundle.signedPreKeySignature)
|
|
|
|
builder.setSignature(preKeyBundle.signedPreKeySignature)
|
|
|
|
|
|
|
|
|
|
|
|
return builder
|
|
|
|
return builder
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@objc public func createPreKeyBundle(withTransaction transaction: YapDatabaseReadWriteTransaction) -> PreKeyBundle? {
|
|
|
|
@objc(getPreKeyBundleWithTransaction:)
|
|
|
|
|
|
|
|
public func getPreKeyBundle(with transaction: YapDatabaseReadWriteTransaction) -> PreKeyBundle? {
|
|
|
|
let registrationId = TSAccountManager.sharedInstance().getOrGenerateRegistrationId(transaction)
|
|
|
|
let registrationId = TSAccountManager.sharedInstance().getOrGenerateRegistrationId(transaction)
|
|
|
|
return PreKeyBundle(registrationId: Int32(registrationId), deviceId: Int32(deviceID), preKeyId: Int32(prekeyID), preKeyPublic: prekey,
|
|
|
|
return PreKeyBundle(registrationId: Int32(registrationId), deviceId: Int32(deviceID), preKeyId: Int32(prekeyID), preKeyPublic: prekey,
|
|
|
|
signedPreKeyPublic: signedKey, signedPreKeyId: Int32(signedKeyID), signedPreKeySignature: signature, identityKey: identityKey)
|
|
|
|
signedPreKeyPublic: signedKey, signedPreKeyId: Int32(signedKeyID), signedPreKeySignature: signature, identityKey: identityKey)
|
|
|
|