mirror of https://github.com/vector-im/riot-web
Use ignoreSelfEvent in the RoomListStore (which doesn't work!)
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>pull/21833/head
parent
f2dccbc9f7
commit
0a4a1506d4
|
@ -38,6 +38,7 @@ import { SpaceWatcher } from "./SpaceWatcher";
|
||||||
import SpaceStore from "../SpaceStore";
|
import SpaceStore from "../SpaceStore";
|
||||||
import { Action } from "../../dispatcher/actions";
|
import { Action } from "../../dispatcher/actions";
|
||||||
import { SettingUpdatedPayload } from "../../dispatcher/payloads/SettingUpdatedPayload";
|
import { SettingUpdatedPayload } from "../../dispatcher/payloads/SettingUpdatedPayload";
|
||||||
|
import { ignoreSelfEvent } from "./algorithms/tag-sorting/RecentAlgorithm";
|
||||||
|
|
||||||
interface IState {
|
interface IState {
|
||||||
tagsEnabled?: boolean;
|
tagsEnabled?: boolean;
|
||||||
|
@ -270,6 +271,9 @@ export class RoomListStoreClass extends AsyncStoreWithClient<IState> {
|
||||||
// Ignore non-live events (backfill)
|
// Ignore non-live events (backfill)
|
||||||
if (!eventPayload.isLiveEvent || !payload.isLiveUnfilteredRoomTimelineEvent) return;
|
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 roomId = eventPayload.event.getRoomId();
|
||||||
const room = this.matrixClient.getRoom(roomId);
|
const room = this.matrixClient.getRoom(roomId);
|
||||||
const tryUpdate = async (updatedRoom: Room) => {
|
const tryUpdate = async (updatedRoom: Room) => {
|
||||||
|
|
|
@ -87,10 +87,7 @@ export const sortRooms = (rooms: Room[]): Room[] => {
|
||||||
const ev = r.timeline[i];
|
const ev = r.timeline[i];
|
||||||
if (!ev.getTs()) continue; // skip events that don't have timestamps (tests only?)
|
if (!ev.getTs()) continue; // skip events that don't have timestamps (tests only?)
|
||||||
|
|
||||||
if (
|
if (ev.getSender() === myUserId || Unread.eventTriggersUnreadCount(ev)) {
|
||||||
(ev.getSender() === myUserId && !ignoreSelfEvent(ev)) ||
|
|
||||||
Unread.eventTriggersUnreadCount(ev)
|
|
||||||
) {
|
|
||||||
return ev.getTs();
|
return ev.getTs();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue