aboutsummaryrefslogtreecommitdiff
path: root/matrix/rooms
diff options
context:
space:
mode:
Diffstat (limited to 'matrix/rooms')
-rw-r--r--matrix/rooms/room.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/matrix/rooms/room.go b/matrix/rooms/room.go
index 0c28a9d..50ec28f 100644
--- a/matrix/rooms/room.go
+++ b/matrix/rooms/room.go
@@ -414,6 +414,10 @@ func (room *Room) UpdateState(evt *event.Event) {
room.updateMemberState(evt)
case event.StateTopic:
room.topicCache = evt.Content.Topic
+ case event.StateEncryption:
+ if evt.Content.Algorithm == "m.megolm.v1.aes-sha2" {
+ room.Encrypted = true
+ }
}
if evt.Type != event.StateMember {
@@ -458,8 +462,8 @@ func (room *Room) GetStateEvent(eventType event.Type, stateKey string) *event.Ev
room.lock.RLock()
defer room.lock.RUnlock()
stateEventMap, _ := room.state[eventType]
- event, _ := stateEventMap[stateKey]
- return event
+ evt, _ := stateEventMap[stateKey]
+ return evt
}
// getStateEvents returns the state events for the given type.