aboutsummaryrefslogtreecommitdiff
path: root/matrix/rooms
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/rooms
parent43a7bdab7262c015b50e3e673e80389f9514f9ca (diff)
Fix user list
Diffstat (limited to 'matrix/rooms')
-rw-r--r--matrix/rooms/room.go6
1 files changed, 5 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
}
}