From 4bbc6fe044418e7be7854d2e56a3eeed71393eaa Mon Sep 17 00:00:00 2001 From: Ryan ZHAO Date: Wed, 30 Sep 2020 09:39:59 +1000 Subject: [PATCH] modify leaving message --- .../securesms/loki/protocol/ClosedGroupsProtocol.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/loki/protocol/ClosedGroupsProtocol.kt b/src/org/thoughtcrime/securesms/loki/protocol/ClosedGroupsProtocol.kt index a2cb862fae..7dfce87259 100644 --- a/src/org/thoughtcrime/securesms/loki/protocol/ClosedGroupsProtocol.kt +++ b/src/org/thoughtcrime/securesms/loki/protocol/ClosedGroupsProtocol.kt @@ -192,8 +192,12 @@ object ClosedGroupsProtocol { groupDB.updateMembers(groupID, members.map { Address.fromSerialized(it) }) } // Notify the user + var infoType = GroupContext.Type.UPDATE + if (isUserLeaving) { + infoType = GroupContext.Type.QUIT + } val threadID = DatabaseFactory.getThreadDatabase(context).getThreadIdFor(Recipient.from(context, Address.fromSerialized(groupID), false)) - insertOutgoingInfoMessage(context, groupID, GroupContext.Type.UPDATE, name, members, admins, threadID) + insertOutgoingInfoMessage(context, groupID, infoType, name, members, admins, threadID) } @JvmStatic