You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +03:00
if we are the only person in a room, call it an 'Empty room' too, given this is how humans see a room if they're the only person in it...
This commit is contained in:
@@ -711,7 +711,7 @@ function calculateRoomName(room, userId, ignoreRoomNameEvent) {
|
|||||||
return (m.membership !== "leave");
|
return (m.membership !== "leave");
|
||||||
});
|
});
|
||||||
if (memberList.length === 1) {
|
if (memberList.length === 1) {
|
||||||
// we exist, but no one else... self-chat or invite.
|
// self-chat, peeked room with 1 participant, or invite.
|
||||||
if (memberList[0].membership === "invite") {
|
if (memberList[0].membership === "invite") {
|
||||||
if (memberList[0].events.member) {
|
if (memberList[0].events.member) {
|
||||||
// extract who invited us to the room
|
// extract who invited us to the room
|
||||||
@@ -722,7 +722,12 @@ function calculateRoomName(room, userId, ignoreRoomNameEvent) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return memberList[0].name;
|
if (memberList[0].userId === userId) {
|
||||||
|
return "Empty room"
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return memberList[0].name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Reference in New Issue
Block a user