Add voice broadcast ended message (#9728)

This commit is contained in:
Michael Weimann 2022-12-12 16:03:56 +01:00 committed by GitHub
parent 9de5654353
commit 57e1822add
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 286 additions and 23 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.
@ -292,3 +293,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
});
};