mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-12-13 17:13:11 +01:00
Don't deduplicate group create events with empty create key
This commit is contained in:
parent
f1c07b6b49
commit
5eba642a4d
1 changed files with 5 additions and 1 deletions
6
user.go
6
user.go
|
@ -1304,8 +1304,12 @@ func (user *User) markUnread(portal *Portal, unread bool) {
|
|||
|
||||
func (user *User) handleGroupCreate(evt *events.JoinedGroup) {
|
||||
portal := user.GetPortalByJID(evt.JID)
|
||||
if evt.CreateKey == "" && len(portal.MXID) == 0 {
|
||||
user.log.Debugfln("Delaying handling group create with empty key to avoid race conditions")
|
||||
time.Sleep(5 * time.Second)
|
||||
}
|
||||
if len(portal.MXID) == 0 {
|
||||
if evt.CreateKey == user.createKeyDedup {
|
||||
if user.createKeyDedup != "" && evt.CreateKey == user.createKeyDedup {
|
||||
user.log.Debugfln("Ignoring group create event with key %s", evt.CreateKey)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue