diff --git a/SignalServiceKit/src/Messages/OWSMessageManager.m b/SignalServiceKit/src/Messages/OWSMessageManager.m index 538d36178..e02fc5f85 100644 --- a/SignalServiceKit/src/Messages/OWSMessageManager.m +++ b/SignalServiceKit/src/Messages/OWSMessageManager.m @@ -1362,7 +1362,10 @@ NS_ASSUME_NONNULL_BEGIN if (groupId.length > 0) { NSMutableSet *newMemberIds = [NSMutableSet setWithArray:dataMessage.group.members]; - NSMutableSet *removedMemberIds = [NSMutableSet setWithArray:dataMessage.group.removedMembers]; + NSMutableSet *removedMemberIds = [NSMutableSet new]; + if (dataMessage.group.removedMembers) { + removedMemberIds = [NSMutableSet setWithArray:dataMessage.group.removedMembers]; + } //Ryan TODO: validate the recipientId // for (NSString *recipientId in newMemberIds) { // if (!recipientId.isValidE164) { diff --git a/SignalServiceKit/src/Messages/OWSMessageSender.m b/SignalServiceKit/src/Messages/OWSMessageSender.m index 901d3c11b..8385457db 100644 --- a/SignalServiceKit/src/Messages/OWSMessageSender.m +++ b/SignalServiceKit/src/Messages/OWSMessageSender.m @@ -955,8 +955,9 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException"; TSOutgoingMessage *message = messageSend.message; NSString *contactID = messageSend.recipient.recipientId; BOOL isGroupMessage = messageSend.thread.isGroupThread; + BOOL isPublicChatMessage = isGroupMessage && ((TSGroupThread *)messageSend.thread).isPublicChat; BOOL isDeviceLinkMessage = [message isKindOfClass:LKDeviceLinkMessage.class]; - if (isGroupMessage || isDeviceLinkMessage) { + if (isPublicChatMessage || isDeviceLinkMessage) { [self sendMessage:messageSend]; } else { BOOL isSilentMessage = message.isSilent || [message isKindOfClass:LKEphemeralMessage.class] || [message isKindOfClass:OWSOutgoingSyncMessage.class]; @@ -983,6 +984,7 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException"; NSArray *slaveDestinations = [destinations filtered:^BOOL(LKDestination *destination) { return [destination.kind isEqual:@"slave"]; }]; + OWSLogInfo(@"Slave deveice for %@ %@", contactID, [slaveDestinations count] > 0 ? slaveDestinations[0] : @"None"); // Send to slave destinations (using a best attempt approach (i.e. ignoring the message send result) for now) for (LKDestination *slaveDestination in slaveDestinations) { TSContactThread *thread = [TSContactThread getOrCreateThreadWithContactId:slaveDestination.hexEncodedPublicKey]; @@ -1003,7 +1005,6 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException"; - (void)sendMessage:(OWSMessageSend *)messageSend { - OWSLogInfo(@"message send here %@ %@", messageSend.message.body, messageSend.recipient.recipientId); OWSAssertDebug(messageSend); OWSAssertDebug(messageSend.thread || [messageSend.message isKindOfClass:[OWSOutgoingSyncMessage class]]);