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
pull/21833/head
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) {
if (me.membership == "join" || me.membership === "ban" ||
(me.membership === "leave" && me.events.member.getSender() !== me.events.member.getStateKey())) {
if (me.membership == "join" || me.membership === "ban" || me.isKicked()) {
// Used to split rooms via tags
const tagNames = Object.keys(room.tags);
// Used for 1:1 direct chats

View File

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