From e64df67ec397795b8c6ebd06b391d953afe5a766 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Tue, 24 Apr 2018 16:51:40 +0300 Subject: Everything is no longer broken --- matrix/rooms/room.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'matrix/rooms') diff --git a/matrix/rooms/room.go b/matrix/rooms/room.go index 44a386b..9aae5ea 100644 --- a/matrix/rooms/room.go +++ b/matrix/rooms/room.go @@ -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 { -- cgit v1.2.3