Merge branch 'develop' into weeman1337/prettier

This commit is contained in:
Michael Weimann 2022-12-12 16:09:11 +01:00
commit 27c5b793e9
No known key found for this signature in database
GPG key ID: 53F535A266BB9584
11 changed files with 286 additions and 29 deletions

View file

@ -31,6 +31,7 @@ import defaultDispatcher from "../dispatcher/dispatcher";
import { TimelineRenderingType } from "../contexts/RoomContext";
import { launchPollEditor } from "../components/views/messages/MPollBody";
import { Action } from "../dispatcher/actions";
import { ViewRoomPayload } from '../dispatcher/payloads/ViewRoomPayload';
/**
* Returns whether an event should allow actions like reply, reactions, edit, etc.
@ -281,3 +282,13 @@ export function hasThreadSummary(event: MatrixEvent): boolean {
export function canPinEvent(event: MatrixEvent): boolean {
return !M_BEACON_INFO.matches(event.getType());
}
export const highlightEvent = (roomId: string, eventId: string): void => {
defaultDispatcher.dispatch<ViewRoomPayload>({
action: Action.ViewRoom,
event_id: eventId,
highlighted: true,
room_id: roomId,
metricsTrigger: undefined, // room doesn't change
});
};