diff --git a/Signal/src/AppDelegate.m b/Signal/src/AppDelegate.m index d6a4b1d7e..5d08199dc 100644 --- a/Signal/src/AppDelegate.m +++ b/Signal/src/AppDelegate.m @@ -1580,7 +1580,7 @@ static NSTimeInterval launchStartedAt; NSString *userDefaultsKey = [@"isRSSFeedSetUp." stringByAppendingString:feed.id]; BOOL isFeedSetUp = [NSUserDefaults.standardUserDefaults boolForKey:userDefaultsKey]; if (!isFeedSetUp || !feed.isDeletable) { - TSGroupModel *group = [[TSGroupModel alloc] initWithTitle:feed.displayName memberIds:@[ userHexEncodedPublicKey, feed.server ] image:nil groupId:[feed.id dataUsingEncoding:NSUTF8StringEncoding]]; + TSGroupModel *group = [[TSGroupModel alloc] initWithTitle:feed.displayName memberIds:@[ userHexEncodedPublicKey, feed.server ] image:nil groupId:[feed.id dataUsingEncoding:NSUTF8StringEncoding] groupType:RSS_FEED]; __block TSGroupThread *thread; [OWSPrimaryStorage.dbReadWriteConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) { thread = [TSGroupThread getOrCreateThreadWithGroupModel:group transaction:transaction]; diff --git a/Signal/src/Loki/View Controllers/NewPrivateChatVC.swift b/Signal/src/Loki/View Controllers/NewPrivateChatVC.swift index 10d32e377..8a51abf07 100644 --- a/Signal/src/Loki/View Controllers/NewPrivateChatVC.swift +++ b/Signal/src/Loki/View Controllers/NewPrivateChatVC.swift @@ -57,6 +57,10 @@ final class NewPrivateChatVC : UIViewController, UIPageViewControllerDataSource, let closeButton = UIBarButtonItem(image: #imageLiteral(resourceName: "X"), style: .plain, target: self, action: #selector(close)) closeButton.tintColor = Colors.text navigationItem.leftBarButtonItem = closeButton + + let newPrivateGroupButton = UIBarButtonItem(image: #imageLiteral(resourceName: "btnGroup--white"), style: .plain, target: self, action: #selector(showNewPrivateGroupVC)) + newPrivateGroupButton.tintColor = Colors.text + navigationItem.rightBarButtonItem = newPrivateGroupButton // Customize title let titleLabel = UILabel() titleLabel.text = NSLocalizedString("New Conversation", comment: "") @@ -121,6 +125,12 @@ final class NewPrivateChatVC : UIViewController, UIPageViewControllerDataSource, dismiss(animated: true, completion: nil) } + // Loki - Show the VC of creating new private group chat + @objc private func showNewPrivateGroupVC() { + let newPrivateGroupVC = NewGroupViewController() + navigationController?.pushViewController(newPrivateGroupVC, animated: true) + } + func controller(_ controller: OWSQRCodeScanningViewController, didDetectQRCodeWith string: String) { let hexEncodedPublicKey = string startNewPrivateChatIfPossible(with: hexEncodedPublicKey) diff --git a/Signal/src/Signal-Bridging-Header.h b/Signal/src/Signal-Bridging-Header.h index 90a923fac..cd89d686f 100644 --- a/Signal/src/Signal-Bridging-Header.h +++ b/Signal/src/Signal-Bridging-Header.h @@ -130,3 +130,4 @@ #import #import #import +#import "NewGroupViewController.h" diff --git a/Signal/src/ViewControllers/DebugUI/DebugUIContacts.m b/Signal/src/ViewControllers/DebugUI/DebugUIContacts.m index 28061fb4f..78d3741f6 100644 --- a/Signal/src/ViewControllers/DebugUI/DebugUIContacts.m +++ b/Signal/src/ViewControllers/DebugUI/DebugUIContacts.m @@ -109,8 +109,9 @@ NS_ASSUME_NONNULL_BEGIN [TSAccountManager localNumber], ] mutableCopy]; NSData *groupId = [Randomness generateRandomBytes:16]; + //TODO: Figure out if this is correct TSGroupModel *model = - [[TSGroupModel alloc] initWithTitle:groupName memberIds:recipientIds image:nil groupId:groupId]; + [[TSGroupModel alloc] initWithTitle:groupName memberIds:recipientIds image:nil groupId:groupId groupType:SIGNAL]; TSGroupThread *thread = [TSGroupThread getOrCreateThreadWithGroupModel:model]; [SignalApp.sharedApp presentConversationForThread:thread animated:YES]; diff --git a/Signal/src/ViewControllers/DebugUI/DebugUIMessages.m b/Signal/src/ViewControllers/DebugUI/DebugUIMessages.m index 23a2caee2..4d1e39d5f 100644 --- a/Signal/src/ViewControllers/DebugUI/DebugUIMessages.m +++ b/Signal/src/ViewControllers/DebugUI/DebugUIMessages.m @@ -3878,8 +3878,9 @@ typedef OWSContact * (^OWSContactBlock)(YapDatabaseReadWriteTransaction *transac [TSAccountManager localNumber], ] mutableCopy]; NSData *groupId = [Randomness generateRandomBytes:kGroupIdLength]; + //TODO: Figure out if this is correct TSGroupModel *groupModel = - [[TSGroupModel alloc] initWithTitle:groupName memberIds:recipientIds image:nil groupId:groupId]; + [[TSGroupModel alloc] initWithTitle:groupName memberIds:recipientIds image:nil groupId:groupId groupType:SIGNAL]; __block TSGroupThread *thread; [self.dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *_Nonnull transaction) { @@ -4384,8 +4385,9 @@ typedef OWSContact * (^OWSContactBlock)(YapDatabaseReadWriteTransaction *transac [TSAccountManager localNumber], ] mutableCopy]; NSData *groupId = [Randomness generateRandomBytes:kGroupIdLength]; + //TODO: Figure out if this is correct TSGroupModel *groupModel = - [[TSGroupModel alloc] initWithTitle:groupName memberIds:recipientIds image:nil groupId:groupId]; + [[TSGroupModel alloc] initWithTitle:groupName memberIds:recipientIds image:nil groupId:groupId groupType:SIGNAL]; TSGroupThread *groupThread = [TSGroupThread getOrCreateThreadWithGroupModel:groupModel transaction:transaction]; @@ -4425,8 +4427,9 @@ typedef OWSContact * (^OWSContactBlock)(YapDatabaseReadWriteTransaction *transac [TSAccountManager localNumber], ] mutableCopy]; NSData *groupId = [Randomness generateRandomBytes:kGroupIdLength]; + //TODO: Figure out if this is correct TSGroupModel *groupModel = - [[TSGroupModel alloc] initWithTitle:groupName memberIds:recipientIds image:nil groupId:groupId]; + [[TSGroupModel alloc] initWithTitle:groupName memberIds:recipientIds image:nil groupId:groupId groupType:SIGNAL]; TSGroupThread *groupThread = [TSGroupThread getOrCreateThreadWithGroupModel:groupModel transaction:transaction]; @@ -4464,8 +4467,9 @@ typedef OWSContact * (^OWSContactBlock)(YapDatabaseReadWriteTransaction *transac [TSAccountManager localNumber], ] mutableCopy]; NSData *groupId = [Randomness generateRandomBytes:kGroupIdLength]; + //TODO: Figure out if this is correct TSGroupModel *groupModel = - [[TSGroupModel alloc] initWithTitle:groupName memberIds:recipientIds image:nil groupId:groupId]; + [[TSGroupModel alloc] initWithTitle:groupName memberIds:recipientIds image:nil groupId:groupId groupType:SIGNAL]; TSGroupThread *groupThread = [TSGroupThread getOrCreateThreadWithGroupModel:groupModel transaction:transaction]; diff --git a/Signal/src/ViewControllers/DebugUI/DebugUIStress.m b/Signal/src/ViewControllers/DebugUI/DebugUIStress.m index a13bd9f87..9c5cd5566 100644 --- a/Signal/src/ViewControllers/DebugUI/DebugUIStress.m +++ b/Signal/src/ViewControllers/DebugUI/DebugUIStress.m @@ -530,11 +530,13 @@ NS_ASSUME_NONNULL_BEGIN __block TSGroupThread *thread; [OWSPrimaryStorage.dbReadWriteConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *_Nonnull transaction) { + //TODO: Figure out if this is correct TSGroupModel *groupModel = [[TSGroupModel alloc] initWithTitle:[groupThread.groupModel.groupName stringByAppendingString:@" Copy"] memberIds:groupThread.groupModel.groupMemberIds image:groupThread.groupModel.groupImage - groupId:[Randomness generateRandomBytes:kGroupIdLength]]; + groupId:[Randomness generateRandomBytes:kGroupIdLength] + groupType:SIGNAL]; thread = [TSGroupThread getOrCreateThreadWithGroupModel:groupModel transaction:transaction]; }]; OWSAssertDebug(thread); @@ -558,10 +560,12 @@ NS_ASSUME_NONNULL_BEGIN __block TSGroupThread *thread; [OWSPrimaryStorage.dbReadWriteConnection readWriteWithBlock:^( YapDatabaseReadWriteTransaction *_Nonnull transaction) { + //TODO: Figure out if this is correct TSGroupModel *groupModel = [[TSGroupModel alloc] initWithTitle:NSUUID.UUID.UUIDString memberIds:recipientIds image:nil - groupId:[Randomness generateRandomBytes:kGroupIdLength]]; + groupId:[Randomness generateRandomBytes:kGroupIdLength] + groupType:SIGNAL]; thread = [TSGroupThread getOrCreateThreadWithGroupModel:groupModel transaction:transaction]; }]; OWSAssertDebug(thread); diff --git a/Signal/src/ViewControllers/NewGroupViewController.m b/Signal/src/ViewControllers/NewGroupViewController.m index d58dd6677..4ef622c86 100644 --- a/Signal/src/ViewControllers/NewGroupViewController.m +++ b/Signal/src/ViewControllers/NewGroupViewController.m @@ -51,6 +51,8 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, nullable) UIImage *groupAvatar; @property (nonatomic) NSMutableSet *memberRecipientIds; +@property (nonatomic) GroupType groupType; + @property (nonatomic) BOOL hasUnsavedChanges; @property (nonatomic) BOOL hasAppeared; @@ -530,7 +532,8 @@ NS_ASSUME_NONNULL_BEGIN return [[TSGroupModel alloc] initWithTitle:groupName memberIds:recipientIds image:self.groupAvatar - groupId:self.groupId]; + groupId:self.groupId + groupType:self.groupType]; } #pragma mark - Group Avatar diff --git a/Signal/src/ViewControllers/ThreadSettings/UpdateGroupViewController.m b/Signal/src/ViewControllers/ThreadSettings/UpdateGroupViewController.m index 68997170c..42a1d0c02 100644 --- a/Signal/src/ViewControllers/ThreadSettings/UpdateGroupViewController.m +++ b/Signal/src/ViewControllers/ThreadSettings/UpdateGroupViewController.m @@ -379,7 +379,8 @@ NS_ASSUME_NONNULL_BEGIN TSGroupModel *groupModel = [[TSGroupModel alloc] initWithTitle:groupName memberIds:self.memberRecipientIds.allObjects image:self.groupAvatar - groupId:self.thread.groupModel.groupId]; + groupId:self.thread.groupModel.groupId + groupType:self.thread.groupModel.groupType]; [self.conversationSettingsViewDelegate groupWasUpdated:groupModel]; } diff --git a/SignalServiceKit/src/Contacts/Threads/TSGroupThread.h b/SignalServiceKit/src/Contacts/Threads/TSGroupThread.h index e38fa3314..50d685d68 100644 --- a/SignalServiceKit/src/Contacts/Threads/TSGroupThread.h +++ b/SignalServiceKit/src/Contacts/Threads/TSGroupThread.h @@ -22,8 +22,10 @@ extern NSString *const TSGroupThread_NotificationKey_UniqueId; + (instancetype)getOrCreateThreadWithGroupModel:(TSGroupModel *)groupModel transaction:(YapDatabaseReadWriteTransaction *)transaction; -+ (instancetype)getOrCreateThreadWithGroupId:(NSData *)groupId; + (instancetype)getOrCreateThreadWithGroupId:(NSData *)groupId + groupType:(GroupType) groupType; ++ (instancetype)getOrCreateThreadWithGroupId:(NSData *)groupId + groupType:(GroupType) groupType transaction:(YapDatabaseReadWriteTransaction *)transaction; + (nullable instancetype)threadWithGroupId:(NSData *)groupId transaction:(YapDatabaseReadTransaction *)transaction; diff --git a/SignalServiceKit/src/Contacts/Threads/TSGroupThread.m b/SignalServiceKit/src/Contacts/Threads/TSGroupThread.m index c7b5b135a..937247f5f 100644 --- a/SignalServiceKit/src/Contacts/Threads/TSGroupThread.m +++ b/SignalServiceKit/src/Contacts/Threads/TSGroupThread.m @@ -17,6 +17,9 @@ NSString *const TSGroupThread_NotificationKey_UniqueId = @"TSGroupThread_Notific @implementation TSGroupThread #define TSGroupThreadPrefix @"g" +//#define TSGroupThreadPrefix @"__signal_mms_group__!" +//#define TSPublicChatGroupThreadPrefix @"__loki_public_chat_group__!" +//#define TSRssFeedGroupThreadPrefix @"__loki_rss_feed_group__!" - (instancetype)initWithGroupModel:(TSGroupModel *)groupModel { @@ -38,7 +41,7 @@ NSString *const TSGroupThread_NotificationKey_UniqueId = @"TSGroupThread_Notific return self; } -- (instancetype)initWithGroupId:(NSData *)groupId +- (instancetype)initWithGroupId:(NSData *)groupId groupType:(GroupType) groupType { OWSAssertDebug(groupId.length > 0); @@ -48,7 +51,8 @@ NSString *const TSGroupThread_NotificationKey_UniqueId = @"TSGroupThread_Notific TSGroupModel *groupModel = [[TSGroupModel alloc] initWithTitle:nil memberIds:@[ localNumber ] image:nil - groupId:groupId]; + groupId:groupId + groupType:groupType]; self = [self initWithGroupModel:groupModel]; if (!self) { @@ -66,6 +70,7 @@ NSString *const TSGroupThread_NotificationKey_UniqueId = @"TSGroupThread_Notific } + (instancetype)getOrCreateThreadWithGroupId:(NSData *)groupId + groupType:(GroupType)groupType transaction:(YapDatabaseReadWriteTransaction *)transaction { OWSAssertDebug(groupId.length > 0); @@ -73,19 +78,19 @@ NSString *const TSGroupThread_NotificationKey_UniqueId = @"TSGroupThread_Notific TSGroupThread *thread = [self fetchObjectWithUniqueID:[self threadIdFromGroupId:groupId] transaction:transaction]; if (!thread) { - thread = [[self alloc] initWithGroupId:groupId]; + thread = [[self alloc] initWithGroupId:groupId groupType:groupType]; [thread saveWithTransaction:transaction]; } return thread; } -+ (instancetype)getOrCreateThreadWithGroupId:(NSData *)groupId ++ (instancetype)getOrCreateThreadWithGroupId:(NSData *)groupId groupType:(GroupType)groupType { OWSAssertDebug(groupId.length > 0); __block TSGroupThread *thread; [[self dbReadWriteConnection] readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) { - thread = [self getOrCreateThreadWithGroupId:groupId transaction:transaction]; + thread = [self getOrCreateThreadWithGroupId:groupId groupType:groupType transaction:transaction]; }]; return thread; } @@ -121,6 +126,15 @@ NSString *const TSGroupThread_NotificationKey_UniqueId = @"TSGroupThread_Notific + (NSString *)threadIdFromGroupId:(NSData *)groupId { OWSAssertDebug(groupId.length > 0); + +// switch (groupType) { +// case PUBLIC_CHAT: +// return [TSPublicChatGroupThreadPrefix stringByAppendingString:[groupId base64EncodedString]]; +// case RSS_FEED: +// return [TSRssFeedGroupThreadPrefix stringByAppendingString:[groupId base64EncodedString]]; +// default: +// return [TSGroupThreadPrefix stringByAppendingString:[groupId base64EncodedString]]; +// } return [TSGroupThreadPrefix stringByAppendingString:[groupId base64EncodedString]]; } @@ -130,6 +144,7 @@ NSString *const TSGroupThread_NotificationKey_UniqueId = @"TSGroupThread_Notific OWSAssertDebug(threadId.length > 0); return [NSData dataFromBase64String:[threadId substringWithRange:NSMakeRange(1, threadId.length - 1)]]; +// return [NSData dataFromBase64String:[threadId componentsSeparatedByString:@"!"][1]]; } - (NSArray *)recipientIdentifiers @@ -173,6 +188,22 @@ NSString *const TSGroupThread_NotificationKey_UniqueId = @"TSGroupThread_Notific return true; } +- (BOOL)isPublicChat +{ + if (self.groupModel.groupType == PUBLIC_CHAT) { + return true; + } + return false; +} + +- (BOOL)isRSSFeed +{ + if (self.groupModel.groupType == RSS_FEED) { + return true; + } + return false; +} + - (BOOL)isLocalUserInGroup { NSString *_Nullable localNumber = TSAccountManager.localNumber; @@ -266,11 +297,11 @@ NSString *const TSGroupThread_NotificationKey_UniqueId = @"TSGroupThread_Notific return [self.class stableColorNameForNewConversationWithString:[self threadIdFromGroupId:groupId]]; } -- (BOOL)isRSSFeed -{ - NSString *groupID = [[NSString alloc] initWithData:self.groupModel.groupId encoding:NSUTF8StringEncoding]; - return groupID != nil && [groupID hasPrefix:@"rss://"]; -} +//- (BOOL)isRSSFeed +//{ +// NSString *groupID = [[NSString alloc] initWithData:self.groupModel.groupId encoding:NSUTF8StringEncoding]; +// return groupID != nil && [groupID hasPrefix:@"rss://"]; +//} @end diff --git a/SignalServiceKit/src/Loki/API/Public Chat/LokiPublicChatManager.swift b/SignalServiceKit/src/Loki/API/Public Chat/LokiPublicChatManager.swift index 074939404..e123f2a2e 100644 --- a/SignalServiceKit/src/Loki/API/Public Chat/LokiPublicChatManager.swift +++ b/SignalServiceKit/src/Loki/API/Public Chat/LokiPublicChatManager.swift @@ -66,7 +66,7 @@ public final class LokiPublicChatManager : NSObject { @objc(addChatWithServer:channel:name:) public func addChat(server: String, channel: UInt64, name: String) -> LokiPublicChat? { guard let chat = LokiPublicChat(channel: channel, server: server, displayName: name, isDeletable: true) else { return nil } - let model = TSGroupModel(title: chat.displayName, memberIds: [userHexEncodedPublicKey!, chat.server], image: nil, groupId: chat.idAsData) + let model = TSGroupModel(title: chat.displayName, memberIds: [userHexEncodedPublicKey!, chat.server], image: nil, groupId: chat.idAsData, groupType: .PUBLIC_CHAT) // Store the group chat mapping self.storage.dbReadWriteConnection.readWrite { transaction in diff --git a/SignalServiceKit/src/Messages/DeviceSyncing/OWSIncomingSentMessageTranscript.m b/SignalServiceKit/src/Messages/DeviceSyncing/OWSIncomingSentMessageTranscript.m index 87ee6ddbb..e864a5329 100644 --- a/SignalServiceKit/src/Messages/DeviceSyncing/OWSIncomingSentMessageTranscript.m +++ b/SignalServiceKit/src/Messages/DeviceSyncing/OWSIncomingSentMessageTranscript.m @@ -48,7 +48,8 @@ NS_ASSUME_NONNULL_BEGIN // Skip the other processing for recipient updates. } else { if (self.dataMessage.group) { - _thread = [TSGroupThread getOrCreateThreadWithGroupId:_dataMessage.group.id transaction:transaction]; + //TODO: Figure out if this is correct + _thread = [TSGroupThread getOrCreateThreadWithGroupId:_dataMessage.group.id groupType:SIGNAL transaction:transaction]; } else { _thread = [TSContactThread getOrCreateThreadWithContactId:_recipientId transaction:transaction]; } diff --git a/SignalServiceKit/src/Messages/OWSMessageManager.m b/SignalServiceKit/src/Messages/OWSMessageManager.m index b7af39a1c..9c869df7e 100644 --- a/SignalServiceKit/src/Messages/OWSMessageManager.m +++ b/SignalServiceKit/src/Messages/OWSMessageManager.m @@ -1389,12 +1389,13 @@ NS_ASSUME_NONNULL_BEGIN case SSKProtoGroupContextTypeUpdate: { // Ensures that the thread exists but doesn't update it. TSGroupThread *newGroupThread = - [TSGroupThread getOrCreateThreadWithGroupId:groupId transaction:transaction]; + [TSGroupThread getOrCreateThreadWithGroupId:groupId groupType:oldGroupThread.groupModel.groupType transaction:transaction]; TSGroupModel *newGroupModel = [[TSGroupModel alloc] initWithTitle:dataMessage.group.name memberIds:newMemberIds.allObjects image:oldGroupThread.groupModel.groupImage - groupId:dataMessage.group.id]; + groupId:dataMessage.group.id + groupType:oldGroupThread.groupModel.groupType]; NSString *updateGroupInfo = [newGroupThread.groupModel getInfoStringAboutUpdateTo:newGroupModel contactsManager:self.contactsManager]; newGroupThread.groupModel = newGroupModel; diff --git a/SignalServiceKit/src/Messages/TSGroupModel.h b/SignalServiceKit/src/Messages/TSGroupModel.h index 562d84bf8..87919e106 100644 --- a/SignalServiceKit/src/Messages/TSGroupModel.h +++ b/SignalServiceKit/src/Messages/TSGroupModel.h @@ -5,15 +5,24 @@ #import "ContactsManagerProtocol.h" #import "TSYapDatabaseObject.h" + NS_ASSUME_NONNULL_BEGIN +typedef NS_ENUM(NSInteger, GroupType) { + SIGNAL = 0, + PUBLIC_CHAT = 1, + RSS_FEED = 2 +}; + extern const int32_t kGroupIdLength; @interface TSGroupModel : TSYapDatabaseObject @property (nonatomic) NSArray *groupMemberIds; +@property (nonatomic) NSArray *groupAdminIds; @property (nullable, readonly, nonatomic) NSString *groupName; @property (readonly, nonatomic) NSData *groupId; +@property (nonatomic) GroupType groupType; #if TARGET_OS_IOS @property (nullable, nonatomic, strong) UIImage *groupImage; @@ -21,7 +30,8 @@ extern const int32_t kGroupIdLength; - (instancetype)initWithTitle:(nullable NSString *)title memberIds:(NSArray *)memberIds image:(nullable UIImage *)image - groupId:(NSData *)groupId; + groupId:(NSData *)groupId + groupType:(GroupType)groupType; - (BOOL)isEqual:(id)other; - (BOOL)isEqualToGroupModel:(TSGroupModel *)model; diff --git a/SignalServiceKit/src/Messages/TSGroupModel.m b/SignalServiceKit/src/Messages/TSGroupModel.m index 3dd811f60..46c5c1fea 100644 --- a/SignalServiceKit/src/Messages/TSGroupModel.m +++ b/SignalServiceKit/src/Messages/TSGroupModel.m @@ -25,6 +25,7 @@ const int32_t kGroupIdLength = 16; memberIds:(NSArray *)memberIds image:(nullable UIImage *)image groupId:(NSData *)groupId + groupType:(GroupType)groupType { OWSAssertDebug(memberIds); @@ -32,6 +33,7 @@ const int32_t kGroupIdLength = 16; _groupMemberIds = [memberIds copy]; _groupImage = image; // image is stored in DB _groupId = groupId; + _groupType = groupType; return self; } @@ -75,6 +77,9 @@ const int32_t kGroupIdLength = 16; [UIImagePNGRepresentation(_groupImage) isEqualToData:UIImagePNGRepresentation(other.groupImage)])) { return NO; } + if (_groupType != other.groupType) { + return NO; + } NSMutableArray *compareMyGroupMemberIds = [NSMutableArray arrayWithArray:_groupMemberIds]; [compareMyGroupMemberIds removeObjectsInArray:other.groupMemberIds]; if ([compareMyGroupMemberIds count] > 0) { diff --git a/SignalServiceKit/src/TestUtils/Factories.swift b/SignalServiceKit/src/TestUtils/Factories.swift index 93d897be6..14a92bbcb 100644 --- a/SignalServiceKit/src/TestUtils/Factories.swift +++ b/SignalServiceKit/src/TestUtils/Factories.swift @@ -371,7 +371,8 @@ class GroupThreadFactory: NSObject, Factory { return TSGroupModel(title: groupThreadFactory.titleBuilder(), memberIds: groupThreadFactory.memberIdsBuilder(), image: groupThreadFactory.imageBuilder(), - groupId: groupThreadFactory.groupIdBuilder()) + groupId: groupThreadFactory.groupIdBuilder(), + groupType: .SIGNAL) } @objc diff --git a/SignalServiceKit/tests/Util/TSMessageStorageTests.m b/SignalServiceKit/tests/Util/TSMessageStorageTests.m index a9592db74..5f702fae1 100644 --- a/SignalServiceKit/tests/Util/TSMessageStorageTests.m +++ b/SignalServiceKit/tests/Util/TSMessageStorageTests.m @@ -133,7 +133,8 @@ thread = [TSGroupThread getOrCreateThreadWithGroupModel:[[TSGroupModel alloc] initWithTitle:@"fdsfsd" memberIds:[@[] mutableCopy] image:nil - groupId:[NSData data]] + groupId:[NSData data] + groupType:SIGNAL] transaction:transaction]; [thread saveWithTransaction:transaction];