diff options
author | Tulir Asokan <tulir@maunium.net> | 2020-07-24 21:47:22 +0300 |
---|---|---|
committer | Tulir Asokan <tulir@maunium.net> | 2020-07-24 21:47:22 +0300 |
commit | 77a1514c900a0d422a616a548496a48cf6baf35f (patch) | |
tree | da882d048c74e7e7e922216fc753a4eb2eaa84f3 /matrix/rooms | |
parent | ecdd4f08cb262c8f0c988209e6296c068e1d4cf3 (diff) |
Add device list and legacy verification commands
Diffstat (limited to 'matrix/rooms')
-rw-r--r-- | matrix/rooms/roomcache.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/matrix/rooms/roomcache.go b/matrix/rooms/roomcache.go index 5af0c5b..168278b 100644 --- a/matrix/rooms/roomcache.go +++ b/matrix/rooms/roomcache.go @@ -73,6 +73,19 @@ func (cache *RoomCache) IsEncrypted(roomID id.RoomID) bool { return room != nil && room.Encrypted } +func (cache *RoomCache) GetEncryptionEvent(roomID id.RoomID) *event.EncryptionEventContent { + room := cache.Get(roomID) + evt := room.GetStateEvent(event.StateEncryption, "") + if evt == nil { + return nil + } + content, ok := evt.Content.Parsed.(*event.EncryptionEventContent) + if !ok { + return nil + } + return content +} + func (cache *RoomCache) FindSharedRooms(userID id.UserID) (shared []id.RoomID) { // FIXME this disables unloading so TouchNode wouldn't try to double-lock cache.DisableUnloading() |