Respond to CR.

// FREEBIE
This commit is contained in:
Matthew Chen 2017-09-18 16:12:51 -04:00
parent e222b9df68
commit 2c68b06412
3 changed files with 12 additions and 0 deletions

View File

@ -544,6 +544,9 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
keyboardOnViewAppearing:(BOOL)keyboardOnViewAppearing
callOnViewAppearing:(BOOL)callOnViewAppearing
{
// At most one.
OWSAssert(!keyboardOnViewAppearing || !callOnViewAppearing);
if (callOnViewAppearing) {
keyboardOnViewAppearing = NO;
}

View File

@ -743,6 +743,9 @@ typedef NS_ENUM(NSInteger, CellState) { kArchiveState, kInboxState };
keyboardOnViewAppearing:(BOOL)keyboardOnViewAppearing
callOnViewAppearing:(BOOL)callOnViewAppearing
{
// At most one.
OWSAssert(!keyboardOnViewAppearing || !callOnViewAppearing);
if (thread == nil) {
OWSFail(@"Thread unexpectedly nil");
return;

View File

@ -200,6 +200,9 @@ static Environment *environment = nil;
keyboardOnViewAppearing:(BOOL)keyboardOnViewAppearing
callOnViewAppearing:(BOOL)callOnViewAppearing
{
// At most one.
OWSAssert(!keyboardOnViewAppearing || !callOnViewAppearing);
DispatchMainThreadSafe(^{
__block TSThread *thread = nil;
[[TSStorageManager sharedManager].dbReadWriteConnection
@ -221,6 +224,9 @@ static Environment *environment = nil;
keyboardOnViewAppearing:(BOOL)keyboardOnViewAppearing
callOnViewAppearing:(BOOL)callOnViewAppearing
{
// At most one.
OWSAssert(!keyboardOnViewAppearing || !callOnViewAppearing);
if (!thread) {
OWSFail(@"%@ Can't present nil thread.", self.tag);
return;