aboutsummaryrefslogtreecommitdiff
path: root/session.go
diff options
context:
space:
mode:
Diffstat (limited to 'session.go')
-rw-r--r--session.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/session.go b/session.go
index 77e4bfa..217ea38 100644
--- a/session.go
+++ b/session.go
@@ -86,7 +86,12 @@ func (s *Session) LoadNextBatch(_ string) string {
}
func (s *Session) LoadRoom(mxid string) *gomatrix.Room {
- return s.Rooms[mxid]
+ room, ok := s.Rooms[mxid]
+ if !ok || room == nil {
+ room := gomatrix.NewRoom(mxid)
+ s.SaveRoom(room)
+ }
+ return room
}
func (s *Session) SaveFilterID(_, filterID string) {