From e5264a242d7fc6ac6b3f7bdca548163bb584875b Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sat, 13 Apr 2019 14:27:50 +0300 Subject: Fix user list --- matrix/rooms/room.go | 6 +++++- matrix/sync.go | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'matrix') diff --git a/matrix/rooms/room.go b/matrix/rooms/room.go index 47f5602..53156a3 100644 --- a/matrix/rooms/room.go +++ b/matrix/rooms/room.go @@ -399,10 +399,14 @@ func (room *Room) createMemberCache() map[string]*mautrix.Member { if events != nil { for userID, event := range events { member := &event.Content.Member + member.Membership = event.Content.Membership + if len(member.Displayname) == 0 { + member.Displayname = userID + } if room.firstMemberCache == nil && userID != room.SessionUserID { room.firstMemberCache = member } - if member.Membership != "leave" { + if member.Membership == mautrix.MembershipJoin || member.Membership == mautrix.MembershipInvite { cache[userID] = member } } diff --git a/matrix/sync.go b/matrix/sync.go index 260ba91..e610b89 100644 --- a/matrix/sync.go +++ b/matrix/sync.go @@ -207,6 +207,7 @@ func (s *GomuksSyncer) GetFilterJSON(userID string) json.RawMessage { "m.room.topic", "m.room.canonical_alias", "m.room.aliases", + "m.room.power_levels", }, }, Timeline: mautrix.FilterPart{ @@ -217,6 +218,7 @@ func (s *GomuksSyncer) GetFilterJSON(userID string) json.RawMessage { "m.room.topic", "m.room.canonical_alias", "m.room.aliases", + "m.room.power_levels", }, Limit: 50, }, -- cgit v1.2.3