|
|
|
@ -1179,18 +1179,15 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException";
|
|
|
|
|
BOOL isPing = ((NSNumber *)signalMessageInfo[@"isPing"]).boolValue;
|
|
|
|
|
BOOL isFriendRequest = ((NSNumber *)signalMessageInfo[@"isFriendRequest"]).boolValue;
|
|
|
|
|
LKSignalMessage *signalMessage = [[LKSignalMessage alloc] initWithType:type timestamp:timestamp senderID:senderID senderDeviceID:senderDeviceID content:content recipientID:recipientID ttl:ttl isPing:isPing isFriendRequest:isFriendRequest];
|
|
|
|
|
|
|
|
|
|
[self.dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
|
|
|
|
if (!message.skipSave) {
|
|
|
|
|
// Update the PoW calculation status
|
|
|
|
|
[message saveIsCalculatingProofOfWork:YES withTransaction:transaction];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (signalMessage.isFriendRequest) {
|
|
|
|
|
[LKFriendRequestProtocol setFriendRequestStatusToSendingIfNeededForHexEncodedPublicKey:recipientID transaction:transaction];
|
|
|
|
|
}
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
// Convenience
|
|
|
|
|
void (^onP2PSuccess)() = ^() { message.isP2P = YES; };
|
|
|
|
|
void (^handleError)(NSError *error) = ^(NSError *error) {
|
|
|
|
@ -1199,7 +1196,6 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException";
|
|
|
|
|
// Update the PoW calculation status
|
|
|
|
|
[message saveIsCalculatingProofOfWork:NO withTransaction:transaction];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (signalMessage.isFriendRequest) {
|
|
|
|
|
[LKFriendRequestProtocol setFriendRequestStatusToFailedIfNeededForHexEncodedPublicKey:recipientID transaction:transaction];
|
|
|
|
|
}
|
|
|
|
|