Fix freeze on joining an open group

pull/114/head
Niels Andriesse 6 years ago
parent 1b7ee85645
commit 2461432917

@ -350,21 +350,21 @@ static const NSUInteger OWSMessageSchemaVersion = 4;
if (attachmentDescription.length > 0 && bodyDescription.length > 0) { if (attachmentDescription.length > 0 && bodyDescription.length > 0) {
// Attachment with caption. // Attachment with caption.
if ([CurrentAppContext() isRTL]) { // if ([CurrentAppContext() isRTL]) {
return [[bodyDescription stringByAppendingString:@": "] stringByAppendingString:attachmentDescription]; // return [[bodyDescription stringByAppendingString:@": "] stringByAppendingString:attachmentDescription];
} else { // } else {
return [[attachmentDescription stringByAppendingString:@": "] stringByAppendingString:bodyDescription]; return [[attachmentDescription stringByAppendingString:@": "] stringByAppendingString:bodyDescription];
} // }
} else if (bodyDescription.length > 0) { } else if (bodyDescription.length > 0) {
return bodyDescription; return bodyDescription;
} else if (attachmentDescription.length > 0) { } else if (attachmentDescription.length > 0) {
return attachmentDescription; return attachmentDescription;
} else if (self.contactShare) { } else if (self.contactShare) {
if (CurrentAppContext().isRTL) { // if (CurrentAppContext().isRTL) {
return [self.contactShare.name.displayName stringByAppendingString:@" 👤"]; // return [self.contactShare.name.displayName stringByAppendingString:@" 👤"];
} else { // } else {
return [@"👤 " stringByAppendingString:self.contactShare.name.displayName]; return [@"👤 " stringByAppendingString:self.contactShare.name.displayName];
} // }
} else { } else {
// OWSFailDebug(@"message has neither body nor attachment."); // OWSFailDebug(@"message has neither body nor attachment.");
// TODO: We should do better here. // TODO: We should do better here.

@ -1399,7 +1399,7 @@ NS_ASSUME_NONNULL_BEGIN
// The envelope source is set during UD decryption. // The envelope source is set during UD decryption.
if ([ECKeyPair isValidHexEncodedPublicKeyWithCandidate:envelope.source]) { if ([ECKeyPair isValidHexEncodedPublicKeyWithCandidate:envelope.source] && dataMessage.publicChatInfo == nil) { // Handled in LokiPublicChatPoller for open group messages
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
[[LKAPI getDestinationsFor:envelope.source inTransaction:transaction].ensureOn(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^() { [[LKAPI getDestinationsFor:envelope.source inTransaction:transaction].ensureOn(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^() {
dispatch_semaphore_signal(semaphore); dispatch_semaphore_signal(semaphore);

Loading…
Cancel
Save