Merge pull request #5330 from matrix-org/travis/fix-user-info

Don't show admin tooling if we're not in the room
pull/21833/head
Travis Ralston 2020-10-16 15:04:06 -06:00 committed by GitHub
commit d5e9d5306a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -801,6 +801,11 @@ const RoomAdminToolsContainer: React.FC<IBaseRoomProps> = ({
} = powerLevels;
const me = room.getMember(cli.getUserId());
if (!me) {
// we aren't in the room, so return no admin tooling
return <div />;
}
const isMe = me.userId === member.userId;
const canAffectUser = member.powerLevel < me.powerLevel || isMe;