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

Commit 0a4a150

Browse files
committed
Use ignoreSelfEvent in the RoomListStore (which doesn't work!)
Signed-off-by: Šimon Brandner <[email protected]>
1 parent f2dccbc commit 0a4a150

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/stores/room-list/RoomListStore.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import { SpaceWatcher } from "./SpaceWatcher";
3838
import SpaceStore from "../SpaceStore";
3939
import { Action } from "../../dispatcher/actions";
4040
import { SettingUpdatedPayload } from "../../dispatcher/payloads/SettingUpdatedPayload";
41+
import { ignoreSelfEvent } from "./algorithms/tag-sorting/RecentAlgorithm";
4142

4243
interface IState {
4344
tagsEnabled?: boolean;
@@ -270,6 +271,9 @@ export class RoomListStoreClass extends AsyncStoreWithClient<IState> {
270271
// Ignore non-live events (backfill)
271272
if (!eventPayload.isLiveEvent || !payload.isLiveUnfilteredRoomTimelineEvent) return;
272273

274+
// Avoid re-ordering on status, profile etc. changes
275+
if (ignoreSelfEvent(eventPayload.event)) return;
276+
273277
const roomId = eventPayload.event.getRoomId();
274278
const room = this.matrixClient.getRoom(roomId);
275279
const tryUpdate = async (updatedRoom: Room) => {

src/stores/room-list/algorithms/tag-sorting/RecentAlgorithm.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,7 @@ export const sortRooms = (rooms: Room[]): Room[] => {
8787
const ev = r.timeline[i];
8888
if (!ev.getTs()) continue; // skip events that don't have timestamps (tests only?)
8989

90-
if (
91-
(ev.getSender() === myUserId && !ignoreSelfEvent(ev)) ||
92-
Unread.eventTriggersUnreadCount(ev)
93-
) {
90+
if (ev.getSender() === myUserId || Unread.eventTriggersUnreadCount(ev)) {
9491
return ev.getTs();
9592
}
9693
}

0 commit comments

Comments
 (0)