aboutsummaryrefslogtreecommitdiff
path: root/matrix
diff options
context:
space:
mode:
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,
},