Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Fix: pick last active DM for verification request #4286

Merged
merged 1 commit into from
Mar 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/createRoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ export function findDMForUser(client, userId) {
return member && (member.membership === "invite" || member.membership === "join");
}
return false;
}).sort((r1, r2) => {
return r2.getLastActiveTimestamp() -
r1.getLastActiveTimestamp();
});
bwindels marked this conversation as resolved.
Show resolved Hide resolved
if (suitableDMRooms.length) {
return suitableDMRooms[0];
Expand Down