handle sync message of closed groups

This commit is contained in:
Ryan ZHAO 2020-02-12 17:14:52 +11:00
parent b5ce94c6ab
commit 9e1681558e
1 changed files with 5 additions and 0 deletions

View File

@ -1108,6 +1108,11 @@ NS_ASSUME_NONNULL_BEGIN
NSData *data = syncMessage.groups.data;
// TODO: decode the data and handle the group info
GroupParser *parser = [[GroupParser alloc] initWithData:data];
NSArray<TSGroupModel *> *groupModels = [parser parseGroupModels];
for (TSGroupModel *groupModel in groupModels) {
TSGroupThread *thread = [TSGroupThread getOrCreateThreadWithGroupModel:groupModel];
[self establishSessionsWithMembersIfNeeded:groupModel.groupMemberIds forThread:thread transaction:transaction];
}
}
} else {
OWSLogWarn(@"Ignoring unsupported sync message.");