mirror of https://github.com/vector-im/riot-web
fixup: don't consider left DM rooms
parent
0a2255ce73
commit
8dd7d8e5c0
|
@ -190,7 +190,10 @@ function openDMForUser(cli, userId) {
|
||||||
const dmRooms = DMRoomMap.shared().getDMRoomsForUserId(userId);
|
const dmRooms = DMRoomMap.shared().getDMRoomsForUserId(userId);
|
||||||
const lastActiveRoom = dmRooms.reduce((lastActiveRoom, roomId) => {
|
const lastActiveRoom = dmRooms.reduce((lastActiveRoom, roomId) => {
|
||||||
const room = cli.getRoom(roomId);
|
const room = cli.getRoom(roomId);
|
||||||
if (!lastActiveRoom || (room && lastActiveRoom.getLastActiveTimestamp() < room.getLastActiveTimestamp())) {
|
if (!room || room.getMyMembership() === "leave") {
|
||||||
|
return lastActiveRoom;
|
||||||
|
}
|
||||||
|
if (!lastActiveRoom || lastActiveRoom.getLastActiveTimestamp() < room.getLastActiveTimestamp()) {
|
||||||
return room;
|
return room;
|
||||||
}
|
}
|
||||||
return lastActiveRoom;
|
return lastActiveRoom;
|
||||||
|
@ -317,7 +320,7 @@ const UserOptionsSection = withLegacyMatrixClient(({matrixClient: cli, member, i
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mx_UserInfo_container">
|
<div className="mx_UserInfo_container">
|
||||||
<h3>{ _t("User Options") }</h3>
|
<h3>{ _t("Options") }</h3>
|
||||||
<div className="mx_UserInfo_buttons">
|
<div className="mx_UserInfo_buttons">
|
||||||
{ directMessageButton }
|
{ directMessageButton }
|
||||||
{ readReceiptButton }
|
{ readReceiptButton }
|
||||||
|
|
|
@ -1068,6 +1068,8 @@
|
||||||
"Files": "Files",
|
"Files": "Files",
|
||||||
"Trust & Devices": "Trust & Devices",
|
"Trust & Devices": "Trust & Devices",
|
||||||
"Direct messages": "Direct messages",
|
"Direct messages": "Direct messages",
|
||||||
|
"Direct message": "Direct message",
|
||||||
|
"Options": "Options",
|
||||||
"Remove from community": "Remove from community",
|
"Remove from community": "Remove from community",
|
||||||
"Disinvite this user from community?": "Disinvite this user from community?",
|
"Disinvite this user from community?": "Disinvite this user from community?",
|
||||||
"Remove this user from community?": "Remove this user from community?",
|
"Remove this user from community?": "Remove this user from community?",
|
||||||
|
@ -1091,7 +1093,6 @@
|
||||||
"Reply": "Reply",
|
"Reply": "Reply",
|
||||||
"Edit": "Edit",
|
"Edit": "Edit",
|
||||||
"Message Actions": "Message Actions",
|
"Message Actions": "Message Actions",
|
||||||
"Options": "Options",
|
|
||||||
"Attachment": "Attachment",
|
"Attachment": "Attachment",
|
||||||
"Error decrypting attachment": "Error decrypting attachment",
|
"Error decrypting attachment": "Error decrypting attachment",
|
||||||
"Decrypt %(text)s": "Decrypt %(text)s",
|
"Decrypt %(text)s": "Decrypt %(text)s",
|
||||||
|
|
Loading…
Reference in New Issue