Browse Source

Ignore group updates from before the thread was created

pull/331/head
Niels Andriesse 2 years ago
parent
commit
284205303f
  1. 4
      SessionMessagingKit/Sending & Receiving/MessageReceiver+Handling.swift

4
SessionMessagingKit/Sending & Receiving/MessageReceiver+Handling.swift

@ -269,6 +269,10 @@ extension MessageReceiver {
}
let group = thread.groupModel
let oldMembers = group.groupMemberIds
// Check that the message isn't from before the group was created
guard Double(message.sentTimestamp!) > thread.creationDate.timeIntervalSince1970 else {
return SNLog("Ignoring closed group update from before thread was created.")
}
// Check that the sender is a member of the group (before the update)
guard Set(group.groupMemberIds).contains(message.sender!) else {
return SNLog("Ignoring closed group update message from non-member.")

Loading…
Cancel
Save