Everything is no longer broken

This commit is contained in:
Tulir Asokan
2018-04-24 16:51:40 +03:00
parent fcd9a932cb
commit e64df67ec3
10 changed files with 77 additions and 40 deletions

View File

@ -23,6 +23,7 @@ import (
"time"
"maunium.net/go/gomatrix"
"maunium.net/go/gomuks/debug"
)
type RoomNameSource int
@ -148,6 +149,15 @@ func (room *Room) UpdateState(event *gomatrix.Event) {
case "m.room.topic":
room.topicCache = ""
}
stateKey := ""
if event.StateKey != nil {
stateKey = *event.StateKey
}
if event.Type != "m.room.member" {
debug.Printf("[ROOM] Updating state %s#%s for %s", event.Type, stateKey, room.ID)
}
if event.StateKey == nil {
room.State[event.Type][""] = event
} else {