@ -1,16 +1,7 @@
@objc public extension SSKProtoPrekeyBundleMessage {
@objc public extension SSKProtoPrekeyBundleMessage {
@objc public var preKeyBundle : PreKeyBundle ? {
private var accountManager : TSAccountManager {
let registrationId = TSAccountManager . sharedInstance ( ) . getOrGenerateRegistrationId ( )
return TSAccountManager . sharedInstance ( )
return PreKeyBundle ( registrationId : Int32 ( registrationId ) ,
deviceId : Int32 ( deviceID ) ,
preKeyId : Int32 ( prekeyID ) ,
preKeyPublic : prekey ,
signedPreKeyPublic : signedKey ,
signedPreKeyId : Int32 ( signedKeyID ) ,
signedPreKeySignature : signature ,
identityKey : identityKey )
}
}
@objc public class func builder ( fromPreKeyBundle preKeyBundle : PreKeyBundle ) -> SSKProtoPrekeyBundleMessageBuilder {
@objc public class func builder ( fromPreKeyBundle preKeyBundle : PreKeyBundle ) -> SSKProtoPrekeyBundleMessageBuilder {
@ -25,4 +16,16 @@
return builder
return builder
}
}
@objc public func preKeyBundle ( withTransaction transaction : YapDatabaseReadWriteTransaction ) -> PreKeyBundle ? {
let registrationId = accountManager . getOrGenerateRegistrationId ( transaction )
return PreKeyBundle ( registrationId : Int32 ( registrationId ) ,
deviceId : Int32 ( deviceID ) ,
preKeyId : Int32 ( prekeyID ) ,
preKeyPublic : prekey ,
signedPreKeyPublic : signedKey ,
signedPreKeyId : Int32 ( signedKeyID ) ,
signedPreKeySignature : signature ,
identityKey : identityKey )
}
}
}