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

Commit 3dfb971

Browse files
authored
Merge pull request #4916 from matrix-org/travis/room-list/dm-handle
Ensure DMs are not lost in the new room list, and clean up tag logging
2 parents 3e2ae2b + 2488520 commit 3dfb971

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

src/stores/room-list/algorithms/Algorithm.ts

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -501,13 +501,9 @@ export class Algorithm extends EventEmitter {
501501
// Split out the easy rooms first (leave and invite)
502502
const memberships = splitRoomsByMembership(rooms);
503503
for (const room of memberships[EffectiveMembership.Invite]) {
504-
// TODO: Remove debug: https://github.com/vector-im/riot-web/issues/14035
505-
console.log(`[DEBUG] "${room.name}" (${room.roomId}) is an Invite`);
506504
newTags[DefaultTagID.Invite].push(room);
507505
}
508506
for (const room of memberships[EffectiveMembership.Leave]) {
509-
// TODO: Remove debug: https://github.com/vector-im/riot-web/issues/14035
510-
console.log(`[DEBUG] "${room.name}" (${room.roomId}) is Historical`);
511507
newTags[DefaultTagID.Archived].push(room);
512508
}
513509

@@ -518,23 +514,19 @@ export class Algorithm extends EventEmitter {
518514
let inTag = false;
519515
if (tags.length > 0) {
520516
for (const tag of tags) {
521-
// TODO: Remove debug: https://github.com/vector-im/riot-web/issues/14035
522-
console.log(`[DEBUG] "${room.name}" (${room.roomId}) is tagged as ${tag}`);
523517
if (!isNullOrUndefined(newTags[tag])) {
524-
// TODO: Remove debug: https://github.com/vector-im/riot-web/issues/14035
525-
console.log(`[DEBUG] "${room.name}" (${room.roomId}) is tagged with VALID tag ${tag}`);
526518
newTags[tag].push(room);
527519
inTag = true;
528520
}
529521
}
530522
}
531523

532524
if (!inTag) {
533-
// TODO: Determine if DM and push there instead: https://github.com/vector-im/riot-web/issues/14236
534-
newTags[DefaultTagID.Untagged].push(room);
535-
536-
// TODO: Remove debug: https://github.com/vector-im/riot-web/issues/14035
537-
console.log(`[DEBUG] "${room.name}" (${room.roomId}) is Untagged`);
525+
if (DMRoomMap.getUserIdForRoomId(room.roomId)) {
526+
newTags[DefaultTagID.DM].push(room);
527+
} else {
528+
newTags[DefaultTagID.Untagged].push(room);
529+
}
538530
}
539531
}
540532

0 commit comments

Comments
 (0)