From b7df1127bd7782ba143f71bffc2f19a6691f3eb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Wed, 25 Aug 2021 08:38:47 +0200 Subject: [PATCH] Revert "Use ignoreSelfEvent in the RoomListStore (which doesn't work!)" This reverts commit 0a4a1506d412cdec610196af73fca6401fead15b. --- src/stores/room-list/RoomListStore.ts | 4 ---- .../room-list/algorithms/tag-sorting/RecentAlgorithm.ts | 5 ++++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/stores/room-list/RoomListStore.ts b/src/stores/room-list/RoomListStore.ts index 6a80bcd1e5..1a5ef0484e 100644 --- a/src/stores/room-list/RoomListStore.ts +++ b/src/stores/room-list/RoomListStore.ts @@ -38,7 +38,6 @@ import { SpaceWatcher } from "./SpaceWatcher"; import SpaceStore from "../SpaceStore"; import { Action } from "../../dispatcher/actions"; import { SettingUpdatedPayload } from "../../dispatcher/payloads/SettingUpdatedPayload"; -import { ignoreSelfEvent } from "./algorithms/tag-sorting/RecentAlgorithm"; interface IState { tagsEnabled?: boolean; @@ -271,9 +270,6 @@ export class RoomListStoreClass extends AsyncStoreWithClient { // Ignore non-live events (backfill) if (!eventPayload.isLiveEvent || !payload.isLiveUnfilteredRoomTimelineEvent) return; - // Avoid re-ordering on status, profile etc. changes - if (ignoreSelfEvent(eventPayload.event)) return; - const roomId = eventPayload.event.getRoomId(); const room = this.matrixClient.getRoom(roomId); const tryUpdate = async (updatedRoom: Room) => { diff --git a/src/stores/room-list/algorithms/tag-sorting/RecentAlgorithm.ts b/src/stores/room-list/algorithms/tag-sorting/RecentAlgorithm.ts index bbfac876bc..5ddfd96c8a 100644 --- a/src/stores/room-list/algorithms/tag-sorting/RecentAlgorithm.ts +++ b/src/stores/room-list/algorithms/tag-sorting/RecentAlgorithm.ts @@ -87,7 +87,10 @@ export const sortRooms = (rooms: Room[]): Room[] => { const ev = r.timeline[i]; if (!ev.getTs()) continue; // skip events that don't have timestamps (tests only?) - if (ev.getSender() === myUserId || Unread.eventTriggersUnreadCount(ev)) { + if ( + (ev.getSender() === myUserId && !ignoreSelfEvent(ev)) || + Unread.eventTriggersUnreadCount(ev) + ) { return ev.getTs(); } }