This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ import { SpaceWatcher } from "./SpaceWatcher";
3838import SpaceStore from "../SpaceStore" ;
3939import { Action } from "../../dispatcher/actions" ;
4040import { SettingUpdatedPayload } from "../../dispatcher/payloads/SettingUpdatedPayload" ;
41+ import { ignoreSelfEvent } from "./algorithms/tag-sorting/RecentAlgorithm" ;
4142
4243interface 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 ) => {
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments