fix to avoid zombies to be cleared when new group update received
This commit is contained in:
parent
6fb461f7d8
commit
1d0b61cf89
|
@ -294,7 +294,6 @@ public class GroupDatabase extends Database implements LokiOpenGroupDatabaseProt
|
||||||
|
|
||||||
ContentValues contents = new ContentValues();
|
ContentValues contents = new ContentValues();
|
||||||
contents.put(ZOMBIE_MEMBERS, Address.toSerializedList(members, ','));
|
contents.put(ZOMBIE_MEMBERS, Address.toSerializedList(members, ','));
|
||||||
contents.put(ACTIVE, 1);
|
|
||||||
databaseHelper.getWritableDatabase().update(TABLE_NAME, contents, GROUP_ID + " = ?",
|
databaseHelper.getWritableDatabase().update(TABLE_NAME, contents, GROUP_ID + " = ?",
|
||||||
new String[] {groupId});
|
new String[] {groupId});
|
||||||
}
|
}
|
||||||
|
|
|
@ -266,9 +266,11 @@ private fun handleNewClosedGroup(sender: String, sentTimestamp: Long, groupPubli
|
||||||
val groupID = GroupUtil.doubleEncodeGroupID(groupPublicKey)
|
val groupID = GroupUtil.doubleEncodeGroupID(groupPublicKey)
|
||||||
if (storage.getGroup(groupID) != null) {
|
if (storage.getGroup(groupID) != null) {
|
||||||
// Update the group
|
// 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.updateTitle(groupID, name)
|
||||||
storage.updateMembers(groupID, members.map { Address.fromSerialized(it) })
|
storage.updateMembers(groupID, members.map { Address.fromSerialized(it) })
|
||||||
storage.setZombieMembers(groupID, listOf<String>().map { Address.fromSerialized(it) })
|
|
||||||
} else {
|
} else {
|
||||||
storage.createGroup(groupID, name, LinkedList(members.map { Address.fromSerialized(it) }),
|
storage.createGroup(groupID, name, LinkedList(members.map { Address.fromSerialized(it) }),
|
||||||
null, null, LinkedList(admins.map { Address.fromSerialized(it) }), formationTimestamp)
|
null, null, LinkedList(admins.map { Address.fromSerialized(it) }), formationTimestamp)
|
||||||
|
|
Loading…
Reference in New Issue