diff options
author | Tulir Asokan <tulir@maunium.net> | 2020-02-22 02:21:20 +0200 |
---|---|---|
committer | Tulir Asokan <tulir@maunium.net> | 2020-02-22 02:21:20 +0200 |
commit | 01229863235a24f6d10f20e57a2e7e8e164de17d (patch) | |
tree | 847006a6e41c5f5d21c16bc3ce59e5f34fc0773b | |
parent | 272ab738e67abbe7c510c61daed4cc8643e34b94 (diff) |
Fix duplicate locking case
-rw-r--r-- | matrix/rooms/room.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/matrix/rooms/room.go b/matrix/rooms/room.go index 7df29ad..fd7d53b 100644 --- a/matrix/rooms/room.go +++ b/matrix/rooms/room.go @@ -345,12 +345,11 @@ func (room *Room) Tags() []RoomTag { room.lock.RLock() defer room.lock.RUnlock() if len(room.RawTags) == 0 { - sessionMember := room.GetMember(room.SessionUserID) if room.IsDirect { return []RoomTag{{"net.maunium.gomuks.fake.direct", "0.5"}} - } else if sessionMember != nil && sessionMember.Membership == mautrix.MembershipInvite { + } else if room.SessionMember != nil && room.SessionMember.Membership == mautrix.MembershipInvite { return []RoomTag{{"net.maunium.gomuks.fake.invite", "0.5"}} - } else if sessionMember != nil && sessionMember.Membership != mautrix.MembershipJoin { + } else if room.SessionMember != nil && room.SessionMember.Membership != mautrix.MembershipJoin { return []RoomTag{{"net.maunium.gomuks.fake.leave", "0.5"}} } return []RoomTag{{"", "0.5"}} |