Optionally show invites in room list

Work on issue #109. Also, add a loading indicator for issue #43.
This commit is contained in:
N-Pex 2021-04-14 12:37:42 +02:00
parent 3d8496b956
commit 0aa33c5300
4 changed files with 113 additions and 4 deletions

View file

@ -67,6 +67,12 @@ export default {
return room._selfMembership === 'join'
});
},
invites() {
return this.rooms.filter(room => {
return room._selfMembership === 'invite'
});
}
},
watch: {
@ -264,6 +270,7 @@ export default {
client.on("event", this.onEvent);
client.on("Room", this.onRoom);
client.on("Session.logged_out", this.onSessionLoggedOut);
client.on("Room.myMembership", this.onRoomMyMembership);
}
},
@ -272,6 +279,7 @@ export default {
client.off("event", this.onEvent);
client.off("Room", this.onRoom);
client.off("Session.logged_out", this.onSessionLoggedOut);
client.off("Room.myMembership", this.onRoomMyMembership);
}
},
@ -302,6 +310,15 @@ export default {
this.updateNotificationCount();
},
onRoomMyMembership(room) {
if (room._selfMembership === "invite") {
// Invitation. Need to call "recalculate" to pick
// up room name, not sure why exactly.
room.recalculate();
this.reloadRooms();
}
},
onSessionLoggedOut() {
console.log("Logged out!");
if (this.matrixClient) {