Normalize conversation presentation logic.

// FREEBIE
pull/1/head
Matthew Chen 8 years ago
parent b6d782046a
commit 04d452b074

@ -200,15 +200,16 @@ static Environment *environment = nil;
keyboardOnViewAppearing:(BOOL)keyboardOnViewAppearing keyboardOnViewAppearing:(BOOL)keyboardOnViewAppearing
callOnViewAppearing:(BOOL)callOnViewAppearing callOnViewAppearing:(BOOL)callOnViewAppearing
{ {
[[TSStorageManager sharedManager].dbReadWriteConnection DispatchMainThreadSafe(^{
asyncReadWriteWithBlock:^(YapDatabaseReadWriteTransaction *_Nonnull transaction) { __block TSThread *thread = nil;
TSThread *thread = [TSContactThread getOrCreateThreadWithContactId:recipientId transaction:transaction]; [[TSStorageManager sharedManager].dbReadWriteConnection
dispatch_async(dispatch_get_main_queue(), ^{ readWriteWithBlock:^(YapDatabaseReadWriteTransaction *_Nonnull transaction) {
[self presentConversationForThread:thread thread = [TSContactThread getOrCreateThreadWithContactId:recipientId transaction:transaction];
keyboardOnViewAppearing:keyboardOnViewAppearing }];
callOnViewAppearing:callOnViewAppearing]; [self presentConversationForThread:thread
}); keyboardOnViewAppearing:keyboardOnViewAppearing
}]; callOnViewAppearing:callOnViewAppearing];
});
} }
+ (void)presentConversationForThread:(TSThread *)thread + (void)presentConversationForThread:(TSThread *)thread

Loading…
Cancel
Save