Don't deduplicate group create events with empty create key

This commit is contained in:
Tulir Asokan 2023-06-02 15:42:43 +03:00
parent f1c07b6b49
commit 5eba642a4d

View file

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