mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-01-19 00:31:39 +01:00
also consider rooms without a name and just you and the other a DM
as we don't process m.direct account data yet
This commit is contained in:
parent
955a6bd6f9
commit
75bbde598d
@ -421,7 +421,18 @@ export class BaseRoom extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isDirectMessageForUserId(userId) {
|
isDirectMessageForUserId(userId) {
|
||||||
return this._summary.data.dmUserId === userId;
|
if (this._summary.data.dmUserId === userId) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
// fall back to considering any room a DM containing heroes (e.g. no name) and 2 members,
|
||||||
|
// on of which the userId we're looking for.
|
||||||
|
// We need this because we're not yet processing m.direct account data correctly.
|
||||||
|
const {heroes, joinCount, inviteCount} = this._summary.data;
|
||||||
|
if (heroes && heroes.includes(userId) && (joinCount + inviteCount) === 2) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
async _loadPowerLevels() {
|
async _loadPowerLevels() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user