aboutsummaryrefslogtreecommitdiff
path: root/matrix
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2019-04-13 14:27:50 +0300
committerTulir Asokan <tulir@maunium.net>2019-04-13 14:27:50 +0300
commite5264a242d7fc6ac6b3f7bdca548163bb584875b (patch)
tree754f9dcae9cfb1ae8a8b0bd11bab35b5952ac688 /matrix
parent43a7bdab7262c015b50e3e673e80389f9514f9ca (diff)
Fix user list
Diffstat (limited to 'matrix')
-rw-r--r--matrix/rooms/room.go6
-rw-r--r--matrix/sync.go2
2 files changed, 7 insertions, 1 deletions
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,
},