use helper method for knowing whether a user was kicked

mainly for readability, but also to discourage grabbing into the member
because of lazy loading changes
This commit is contained in:
Bruno Windels 2018-07-13 14:25:12 +02:00
parent e237a02fa5
commit 8529bc55e3
2 changed files with 2 additions and 4 deletions

View file

@ -81,8 +81,7 @@ export function isConfCallRoom(room, me, conferenceHandler) {
} }
export function looksLikeDirectMessageRoom(room, me) { export function looksLikeDirectMessageRoom(room, me) {
if (me.membership == "join" || me.membership === "ban" || if (me.membership == "join" || me.membership === "ban" || me.isKicked()) {
(me.membership === "leave" && me.events.member.getSender() !== me.events.member.getStateKey())) {
// Used to split rooms via tags // Used to split rooms via tags
const tagNames = Object.keys(room.tags); const tagNames = Object.keys(room.tags);
// Used for 1:1 direct chats // Used for 1:1 direct chats

View file

@ -178,8 +178,7 @@ class RoomListStore extends Store {
if (me.membership == "invite") { if (me.membership == "invite") {
lists["im.vector.fake.invite"].push(room); lists["im.vector.fake.invite"].push(room);
} else if (me.membership == "join" || me.membership === "ban" || } else if (me.membership == "join" || me.membership === "ban" || me.isKicked()) {
(me.membership === "leave" && me.events.member.getSender() !== me.events.member.getStateKey())) {
// Used to split rooms via tags // Used to split rooms via tags
let tagNames = Object.keys(room.tags); let tagNames = Object.keys(room.tags);