Make time-based room list sorting persistent (ref #11)

This commit is contained in:
Tulir Asokan
2018-04-23 23:22:18 +03:00
parent 1e8705319a
commit 135fcbf284
4 changed files with 30 additions and 4 deletions

View File

@ -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))
}

View File

@ -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