|
@@ -95,7 +95,9 @@ type User struct {
|
|
resyncQueueLock sync.Mutex
|
|
resyncQueueLock sync.Mutex
|
|
nextResync time.Time
|
|
nextResync time.Time
|
|
|
|
|
|
- createKeyDedup string
|
|
|
|
|
|
+ createKeyDedup string
|
|
|
|
+ skipGroupCreateDelay types.JID
|
|
|
|
+ groupJoinLock sync.Mutex
|
|
}
|
|
}
|
|
|
|
|
|
type resyncQueueItem struct {
|
|
type resyncQueueItem struct {
|
|
@@ -1304,7 +1306,7 @@ func (user *User) markUnread(portal *Portal, unread bool) {
|
|
|
|
|
|
func (user *User) handleGroupCreate(evt *events.JoinedGroup) {
|
|
func (user *User) handleGroupCreate(evt *events.JoinedGroup) {
|
|
portal := user.GetPortalByJID(evt.JID)
|
|
portal := user.GetPortalByJID(evt.JID)
|
|
- if evt.CreateKey == "" && len(portal.MXID) == 0 {
|
|
|
|
|
|
+ if evt.CreateKey == "" && len(portal.MXID) == 0 && portal.Key.JID != user.skipGroupCreateDelay {
|
|
user.log.Debugfln("Delaying handling group create with empty key to avoid race conditions")
|
|
user.log.Debugfln("Delaying handling group create with empty key to avoid race conditions")
|
|
time.Sleep(5 * time.Second)
|
|
time.Sleep(5 * time.Second)
|
|
}
|
|
}
|