aboutsummaryrefslogtreecommitdiff
path: root/matrix
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2018-04-23 23:22:18 +0300
committerTulir Asokan <tulir@maunium.net>2018-04-24 02:13:43 +0300
commit135fcbf284e941a312567d22af80fe69d49cbd89 (patch)
tree2ebbed34c82f73d88d5041de7a16de68b4d524d5 /matrix
parent1e8705319a2bc6461d8768273aac16df4b6df4be (diff)
Make time-based room list sorting persistent (ref #11)
Diffstat (limited to 'matrix')
-rw-r--r--matrix/matrix.go2
-rw-r--r--matrix/rooms/room.go4
2 files changed, 5 insertions, 1 deletions
diff --git a/matrix/matrix.go b/matrix/matrix.go
index eb0eea5..87013ac 100644
--- a/matrix/matrix.go
+++ b/matrix/matrix.go
@@ -255,7 +255,7 @@ func (c *Container) HandlePushRules(evt *gomatrix.Event) {
// HandleTag is the event handler for the m.tag account data event.
func (c *Container) HandleTag(evt *gomatrix.Event) {
- debug.Print("Received updated tags")
+ debug.Print("Received updated tags for", evt.RoomID)
dat, _ := json.MarshalIndent(&evt.Content, "", " ")
debug.Print(string(dat))
}
diff --git a/matrix/rooms/room.go b/matrix/rooms/room.go
index 61415a9..7b4a8b5 100644
--- a/matrix/rooms/room.go
+++ b/matrix/rooms/room.go
@@ -20,6 +20,7 @@ import (
"fmt"
"sort"
"sync"
+ "time"
"maunium.net/go/gomatrix"
)
@@ -52,6 +53,9 @@ type Room struct {
// a notificationless message like bot notices.
HasNewMessages bool
+ Tags []string
+ LastReceivedMessage time.Time
+
// MXID -> Member cache calculated from membership events.
memberCache map[string]*Member
// The first non-SessionUserID member in the room. Calculated at