fix to avoid zombies to be cleared when new group update received

This commit is contained in:
Brice-W 2021-06-04 12:20:21 +10:00
parent 6fb461f7d8
commit 1d0b61cf89
2 changed files with 3 additions and 2 deletions

View File

@ -294,7 +294,6 @@ public class GroupDatabase extends Database implements LokiOpenGroupDatabaseProt
ContentValues contents = new ContentValues();
contents.put(ZOMBIE_MEMBERS, Address.toSerializedList(members, ','));
contents.put(ACTIVE, 1);
databaseHelper.getWritableDatabase().update(TABLE_NAME, contents, GROUP_ID + " = ?",
new String[] {groupId});
}

View File

@ -266,9 +266,11 @@ private fun handleNewClosedGroup(sender: String, sentTimestamp: Long, groupPubli
val groupID = GroupUtil.doubleEncodeGroupID(groupPublicKey)
if (storage.getGroup(groupID) != null) {
// Update the group
// clearing zombie list if the group was not active before the update is received
if (!storage.isGroupActive(groupID))
storage.setZombieMembers(groupID, listOf<String>().map { Address.fromSerialized(it) })
storage.updateTitle(groupID, name)
storage.updateMembers(groupID, members.map { Address.fromSerialized(it) })
storage.setZombieMembers(groupID, listOf<String>().map { Address.fromSerialized(it) })
} else {
storage.createGroup(groupID, name, LinkedList(members.map { Address.fromSerialized(it) }),
null, null, LinkedList(admins.map { Address.fromSerialized(it) }), formationTimestamp)