|
|
|
@ -427,17 +427,27 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
}
|
|
|
|
|
OWSLogInfo(@"handling content: <Content: %@>", [self descriptionForContent:contentProto]);
|
|
|
|
|
|
|
|
|
|
// Loki: Handle device linking message
|
|
|
|
|
if (contentProto.lokiDeviceLinkingMessage != nil) {
|
|
|
|
|
OWSLogInfo(@"[Loki] Received a device linking request from: %@", envelope.source);
|
|
|
|
|
NSData *signature = [contentProto.lokiDeviceLinkingMessage.slaveSignature];
|
|
|
|
|
if (signature == nil) {
|
|
|
|
|
OWSFailDebug(@"Received a device linking request without an attached slave signature.");
|
|
|
|
|
}
|
|
|
|
|
[LKDeviceLinkingSession.current processLinkingRequestFrom:envelope.source with:signature];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Loki: Handle pre key bundle message
|
|
|
|
|
if (contentProto.prekeyBundleMessage) {
|
|
|
|
|
OWSLogInfo(@"Received a pre key bundle message from: %@.", envelope.source);
|
|
|
|
|
OWSLogInfo(@"[Loki] Received a pre key bundle message from: %@.", envelope.source);
|
|
|
|
|
PreKeyBundle *_Nullable bundle = [contentProto.prekeyBundleMessage createPreKeyBundleWithTransaction:transaction];
|
|
|
|
|
if (!bundle) {
|
|
|
|
|
OWSFailDebug(@"Failed to create PreKeyBundle from message.");
|
|
|
|
|
OWSFailDebug(@"Failed to create a pre key bundle.");
|
|
|
|
|
}
|
|
|
|
|
[self.primaryStorage setPreKeyBundle:bundle forContact:envelope.source transaction:transaction];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Loki: Check if we got p2p address
|
|
|
|
|
// Loki: Check if we got a P2P address
|
|
|
|
|
if (contentProto.lokiAddressMessage) {
|
|
|
|
|
NSString *address = contentProto.lokiAddressMessage.ptpAddress;
|
|
|
|
|
uint32_t port = contentProto.lokiAddressMessage.ptpPort;
|
|
|
|
@ -1572,6 +1582,10 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)handleDeviceLinkingMessageIfNeeded:(TSIncomingMessage *)message transaction:(YapDatabaseReadWriteTransaction *)transaction {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)finalizeIncomingMessage:(TSIncomingMessage *)incomingMessage
|
|
|
|
|
thread:(TSThread *)thread
|
|
|
|
|
envelope:(SSKProtoEnvelope *)envelope
|
|
|
|
|