Merge branch 'charlesmchen/callsStuckOnConnecting'

pull/1/head
Matthew Chen 8 years ago
commit 7052b97c72

@ -605,6 +605,8 @@ NS_ASSUME_NONNULL_BEGIN
return; return;
} }
DDLogDebug(@"%@ incoming attachment message: %@", self.tag, createdMessage.debugDescription);
[attachmentsProcessor fetchAttachmentsForMessage:createdMessage [attachmentsProcessor fetchAttachmentsForMessage:createdMessage
success:^(TSAttachmentStream *attachmentStream) { success:^(TSAttachmentStream *attachmentStream) {
DDLogDebug( DDLogDebug(
@ -892,7 +894,7 @@ NS_ASSUME_NONNULL_BEGIN
messageBody:body messageBody:body
attachmentIds:attachmentIds attachmentIds:attachmentIds
expiresInSeconds:dataMessage.expireTimer]; expiresInSeconds:dataMessage.expireTimer];
DDLogDebug(@"%@ incoming group text message: %@", self.tag, incomingMessage.debugDescription);
[incomingMessage saveWithTransaction:transaction]; [incomingMessage saveWithTransaction:transaction];
break; break;
} }
@ -914,12 +916,12 @@ NS_ASSUME_NONNULL_BEGIN
messageBody:body messageBody:body
attachmentIds:attachmentIds attachmentIds:attachmentIds
expiresInSeconds:dataMessage.expireTimer]; expiresInSeconds:dataMessage.expireTimer];
DDLogDebug(@"%@ incoming 1:1 text message: %@", self.tag, incomingMessage.debugDescription);
[incomingMessage saveWithTransaction:transaction];
thread = cThread; thread = cThread;
} }
if (thread && incomingMessage) { if (thread && incomingMessage) {
[incomingMessage saveWithTransaction:transaction];
// Any messages sent from the current user - from this device or another - should be // Any messages sent from the current user - from this device or another - should be
// automatically marked as read. // automatically marked as read.
BOOL shouldMarkMessageAsRead = [envelope.source isEqualToString:localNumber]; BOOL shouldMarkMessageAsRead = [envelope.source isEqualToString:localNumber];
@ -928,6 +930,8 @@ NS_ASSUME_NONNULL_BEGIN
[incomingMessage markAsReadWithTransaction:transaction sendReadReceipt:NO updateExpiration:YES]; [incomingMessage markAsReadWithTransaction:transaction sendReadReceipt:NO updateExpiration:YES];
} }
DDLogDebug(@"%@ shouldMarkMessageAsRead: %d (%@)", self.tag, shouldMarkMessageAsRead, envelope.source);
// Other clients allow attachments to be sent along with body, we want the text displayed as a separate // Other clients allow attachments to be sent along with body, we want the text displayed as a separate
// message // message
if ([attachmentIds count] > 0 && body != nil && ![body isEqualToString:@""]) { if ([attachmentIds count] > 0 && body != nil && ![body isEqualToString:@""]) {
@ -940,6 +944,7 @@ NS_ASSUME_NONNULL_BEGIN
messageBody:body messageBody:body
attachmentIds:@[] attachmentIds:@[]
expiresInSeconds:dataMessage.expireTimer]; expiresInSeconds:dataMessage.expireTimer];
DDLogDebug(@"%@ incoming extra text message: %@", self.tag, incomingMessage.debugDescription);
[textMessage saveWithTransaction:transaction]; [textMessage saveWithTransaction:transaction];
} }
} }

Loading…
Cancel
Save