mirror of https://github.com/vector-im/riot-web
Merge pull request #4286 from matrix-org/bwindels/picklastactivedmforverifreq
Fix: pick last active DM for verification requestpull/21833/head
commit
491dad3669
|
@ -174,6 +174,9 @@ export function findDMForUser(client, userId) {
|
||||||
return member && (member.membership === "invite" || member.membership === "join");
|
return member && (member.membership === "invite" || member.membership === "join");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
}).sort((r1, r2) => {
|
||||||
|
return r2.getLastActiveTimestamp() -
|
||||||
|
r1.getLastActiveTimestamp();
|
||||||
});
|
});
|
||||||
if (suitableDMRooms.length) {
|
if (suitableDMRooms.length) {
|
||||||
return suitableDMRooms[0];
|
return suitableDMRooms[0];
|
||||||
|
|
Loading…
Reference in New Issue