From 1b6828888f4701023a9d582a0b6269b3102c873c Mon Sep 17 00:00:00 2001 From: Ryan ZHAO Date: Fri, 10 Jan 2020 13:40:43 +1100 Subject: [PATCH] update group type for old version --- Signal/src/AppDelegate.m | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Signal/src/AppDelegate.m b/Signal/src/AppDelegate.m index 5d08199dc..d3aa5ea8d 100644 --- a/Signal/src/AppDelegate.m +++ b/Signal/src/AppDelegate.m @@ -1569,6 +1569,16 @@ static NSTimeInterval launchStartedAt; }]; [NSUserDefaults.standardUserDefaults setBool:YES forKey:userDefaultsKey]; } + else { + [OWSPrimaryStorage.dbReadWriteConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) { + TSGroupThread *thread = [TSGroupThread threadWithGroupId:chat.idAsData transaction:transaction]; + if (!thread.groupModel.groupType) { + thread.groupModel.groupType = PUBLIC_CHAT; + [thread saveWithTransaction:transaction]; + } +// OWSLogInfo(@"GROUP MODEL TYPE %d", thread.groupModel.groupType); + }]; + } } } @@ -1588,6 +1598,16 @@ static NSTimeInterval launchStartedAt; [OWSProfileManager.sharedManager addThreadToProfileWhitelist:thread]; [NSUserDefaults.standardUserDefaults setBool:YES forKey:userDefaultsKey]; } + else { + [OWSPrimaryStorage.dbReadWriteConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) { + TSGroupThread *thread = [TSGroupThread threadWithGroupId: [feed.id dataUsingEncoding:NSUTF8StringEncoding] transaction:transaction]; + if (!thread.groupModel.groupType) { + thread.groupModel.groupType = RSS_FEED; + [thread saveWithTransaction:transaction]; + } +// OWSLogInfo(@"GROUP MODEL TYPE %d", thread.groupModel.groupType); + }]; + } } }