mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Merge pull request #114 from loki-project/performance
Fix Freeze on Joining an Open Group
This commit is contained in:
commit
fd4b3b7d96
|
@ -350,21 +350,21 @@ static const NSUInteger OWSMessageSchemaVersion = 4;
|
|||
|
||||
if (attachmentDescription.length > 0 && bodyDescription.length > 0) {
|
||||
// Attachment with caption.
|
||||
if ([CurrentAppContext() isRTL]) {
|
||||
return [[bodyDescription stringByAppendingString:@": "] stringByAppendingString:attachmentDescription];
|
||||
} else {
|
||||
// if ([CurrentAppContext() isRTL]) {
|
||||
// return [[bodyDescription stringByAppendingString:@": "] stringByAppendingString:attachmentDescription];
|
||||
// } else {
|
||||
return [[attachmentDescription stringByAppendingString:@": "] stringByAppendingString:bodyDescription];
|
||||
}
|
||||
// }
|
||||
} else if (bodyDescription.length > 0) {
|
||||
return bodyDescription;
|
||||
} else if (attachmentDescription.length > 0) {
|
||||
return attachmentDescription;
|
||||
} else if (self.contactShare) {
|
||||
if (CurrentAppContext().isRTL) {
|
||||
return [self.contactShare.name.displayName stringByAppendingString:@" 👤"];
|
||||
} else {
|
||||
// if (CurrentAppContext().isRTL) {
|
||||
// return [self.contactShare.name.displayName stringByAppendingString:@" 👤"];
|
||||
// } else {
|
||||
return [@"👤 " stringByAppendingString:self.contactShare.name.displayName];
|
||||
}
|
||||
// }
|
||||
} else {
|
||||
// OWSFailDebug(@"message has neither body nor attachment.");
|
||||
// TODO: We should do better here.
|
||||
|
|
|
@ -1399,14 +1399,14 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
|
||||
// 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);
|
||||
[[LKAPI getDestinationsFor:envelope.source inTransaction:transaction].ensureOn(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^() {
|
||||
dispatch_semaphore_signal(semaphore);
|
||||
}).catchOn(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(NSError *error) {
|
||||
dispatch_semaphore_signal(semaphore);
|
||||
}) retainUntilComplete];
|
||||
dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, 10 * NSEC_PER_SEC));
|
||||
dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, 4 * NSEC_PER_SEC));
|
||||
}
|
||||
|
||||
if (groupId.length > 0) {
|
||||
|
|
Loading…
Reference in a new issue