|
|
@ -264,6 +264,10 @@ private fun MessageReceiver.handleClosedGroupUpdated(message: ClosedGroupControl
|
|
|
|
Log.d("Loki", "Ignoring closed group info message for nonexistent group.")
|
|
|
|
Log.d("Loki", "Ignoring closed group info message for nonexistent group.")
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!group.isActive) {
|
|
|
|
|
|
|
|
Log.d("Loki", "Ignoring closed group info message for inactive group")
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
val oldMembers = group.members.map { it.serialize() }
|
|
|
|
val oldMembers = group.members.map { it.serialize() }
|
|
|
|
// Check common group update logic
|
|
|
|
// Check common group update logic
|
|
|
|
if (!isValidGroupUpdate(group, message.sentTimestamp!!, senderPublicKey)) {
|
|
|
|
if (!isValidGroupUpdate(group, message.sentTimestamp!!, senderPublicKey)) {
|
|
|
@ -312,6 +316,10 @@ private fun MessageReceiver.handleClosedGroupEncryptionKeyPair(message: ClosedGr
|
|
|
|
Log.d("Loki", "Ignoring closed group info message for nonexistent group.")
|
|
|
|
Log.d("Loki", "Ignoring closed group info message for nonexistent group.")
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!group.isActive) {
|
|
|
|
|
|
|
|
Log.d("Loki", "Ignoring closed group info message for inactive group")
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
if (!group.members.map { it.toString() }.contains(senderPublicKey)) {
|
|
|
|
if (!group.members.map { it.toString() }.contains(senderPublicKey)) {
|
|
|
|
Log.d("Loki", "Ignoring closed group encryption key pair from non-member.")
|
|
|
|
Log.d("Loki", "Ignoring closed group encryption key pair from non-member.")
|
|
|
|
return
|
|
|
|
return
|
|
|
@ -345,6 +353,10 @@ private fun MessageReceiver.handleClosedGroupNameChanged(message: ClosedGroupCon
|
|
|
|
Log.d("Loki", "Ignoring closed group info message for nonexistent group.")
|
|
|
|
Log.d("Loki", "Ignoring closed group info message for nonexistent group.")
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!group.isActive) {
|
|
|
|
|
|
|
|
Log.d("Loki", "Ignoring closed group info message for inactive group")
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
// Check common group update logic
|
|
|
|
// Check common group update logic
|
|
|
|
if (!isValidGroupUpdate(group, message.sentTimestamp!!, senderPublicKey)) {
|
|
|
|
if (!isValidGroupUpdate(group, message.sentTimestamp!!, senderPublicKey)) {
|
|
|
|
return
|
|
|
|
return
|
|
|
@ -369,6 +381,10 @@ private fun MessageReceiver.handleClosedGroupMembersAdded(message: ClosedGroupCo
|
|
|
|
Log.d("Loki", "Ignoring closed group info message for nonexistent group.")
|
|
|
|
Log.d("Loki", "Ignoring closed group info message for nonexistent group.")
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!group.isActive) {
|
|
|
|
|
|
|
|
Log.d("Loki", "Ignoring closed group info message for inactive group")
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
if (!isValidGroupUpdate(group, message.sentTimestamp!!, senderPublicKey)) { return }
|
|
|
|
if (!isValidGroupUpdate(group, message.sentTimestamp!!, senderPublicKey)) { return }
|
|
|
|
val name = group.title
|
|
|
|
val name = group.title
|
|
|
|
// Check common group update logic
|
|
|
|
// Check common group update logic
|
|
|
@ -411,6 +427,10 @@ private fun MessageReceiver.handleClosedGroupMembersRemoved(message: ClosedGroup
|
|
|
|
Log.d("Loki", "Ignoring closed group info message for nonexistent group.")
|
|
|
|
Log.d("Loki", "Ignoring closed group info message for nonexistent group.")
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!group.isActive) {
|
|
|
|
|
|
|
|
Log.d("Loki", "Ignoring closed group info message for inactive group")
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
val name = group.title
|
|
|
|
val name = group.title
|
|
|
|
// Check common group update logic
|
|
|
|
// Check common group update logic
|
|
|
|
val members = group.members.map { it.serialize() }
|
|
|
|
val members = group.members.map { it.serialize() }
|
|
|
@ -460,6 +480,10 @@ private fun MessageReceiver.handleClosedGroupMemberLeft(message: ClosedGroupCont
|
|
|
|
Log.d("Loki", "Ignoring closed group info message for nonexistent group.")
|
|
|
|
Log.d("Loki", "Ignoring closed group info message for nonexistent group.")
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!group.isActive) {
|
|
|
|
|
|
|
|
Log.d("Loki", "Ignoring closed group info message for inactive group")
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
val name = group.title
|
|
|
|
val name = group.title
|
|
|
|
// Check common group update logic
|
|
|
|
// Check common group update logic
|
|
|
|
val members = group.members.map { it.serialize() }
|
|
|
|
val members = group.members.map { it.serialize() }
|
|
|
|