Merge branch 'charlesmchen/typingIndicatorsBug' into release/2.32.0

This commit is contained in:
Matthew Chen 2018-12-05 13:32:10 -05:00
commit 9921a6fe46
3 changed files with 7 additions and 2 deletions

View File

@ -1352,7 +1352,7 @@ static const int kYapDatabaseRangeMinLength = 0;
OWSAssertDebug([notification.object isKindOfClass:[NSString class]]);
OWSAssertDebug(self.thread);
if (![notification.object isEqual:self.thread.uniqueId]) {
if (notification.object && ![notification.object isEqual:self.thread.uniqueId]) {
return;
}

View File

@ -548,7 +548,7 @@ NS_ASSUME_NONNULL_BEGIN
OWSAssertDebug([notification.object isKindOfClass:[NSString class]]);
OWSAssertDebug(self.thread);
if (![notification.object isEqual:self.thread.threadRecord.uniqueId]) {
if (notification.object && ![notification.object isEqual:self.thread.threadRecord.uniqueId]) {
return;
}

View File

@ -88,6 +88,8 @@ public class TypingIndicatorsImpl: NSObject, TypingIndicators {
primaryStorage.dbReadWriteConnection.setBool(value, forKey: kDatabaseKey_TypingIndicatorsEnabled, inCollection: kDatabaseCollection)
syncManager.sendConfigurationSyncMessage()
NotificationCenter.default.postNotificationNameAsync(TypingIndicatorsImpl.typingIndicatorStateDidChange, object: nil)
}
@objc
@ -132,6 +134,7 @@ public class TypingIndicatorsImpl: NSObject, TypingIndicators {
@objc
public func didReceiveTypingStartedMessage(inThread thread: TSThread, recipientId: String, deviceId: UInt) {
AssertIsOnMainThread()
Logger.info("")
let incomingIndicators = ensureIncomingIndicators(forThread: thread, recipientId: recipientId, deviceId: deviceId)
incomingIndicators.didReceiveTypingStartedMessage()
}
@ -139,6 +142,7 @@ public class TypingIndicatorsImpl: NSObject, TypingIndicators {
@objc
public func didReceiveTypingStoppedMessage(inThread thread: TSThread, recipientId: String, deviceId: UInt) {
AssertIsOnMainThread()
Logger.info("")
let incomingIndicators = ensureIncomingIndicators(forThread: thread, recipientId: recipientId, deviceId: deviceId)
incomingIndicators.didReceiveTypingStoppedMessage()
}
@ -146,6 +150,7 @@ public class TypingIndicatorsImpl: NSObject, TypingIndicators {
@objc
public func didReceiveIncomingMessage(inThread thread: TSThread, recipientId: String, deviceId: UInt) {
AssertIsOnMainThread()
Logger.info("")
let incomingIndicators = ensureIncomingIndicators(forThread: thread, recipientId: recipientId, deviceId: deviceId)
incomingIndicators.didReceiveIncomingMessage()
}