From 01229863235a24f6d10f20e57a2e7e8e164de17d Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sat, 22 Feb 2020 02:21:20 +0200 Subject: Fix duplicate locking case --- matrix/rooms/room.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'matrix/rooms') 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"}} -- cgit v1.2.3