modify leaving message

This commit is contained in:
Ryan ZHAO 2020-09-30 09:39:59 +10:00
parent cd7197bfbd
commit 4bbc6fe044

View File

@ -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