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
callOnViewAppearing:(BOOL)callOnViewAppearing
{
[[TSStorageManager sharedManager].dbReadWriteConnection
asyncReadWriteWithBlock:^(YapDatabaseReadWriteTransaction *_Nonnull transaction) {
TSThread *thread = [TSContactThread getOrCreateThreadWithContactId:recipientId transaction:transaction];
dispatch_async(dispatch_get_main_queue(), ^{
[self presentConversationForThread:thread
keyboardOnViewAppearing:keyboardOnViewAppearing
callOnViewAppearing:callOnViewAppearing];
});
}];
DispatchMainThreadSafe(^{
__block TSThread *thread = nil;
[[TSStorageManager sharedManager].dbReadWriteConnection
readWriteWithBlock:^(YapDatabaseReadWriteTransaction *_Nonnull transaction) {
thread = [TSContactThread getOrCreateThreadWithContactId:recipientId transaction:transaction];
}];
[self presentConversationForThread:thread
keyboardOnViewAppearing:keyboardOnViewAppearing
callOnViewAppearing:callOnViewAppearing];
});
}
+ (void)presentConversationForThread:(TSThread *)thread

Loading…
Cancel
Save