1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-12-08 17:48:33 +03:00

Add analytics for the ViewRoom action (#7666)

This commit is contained in:
Michael Telatynski
2022-02-10 14:29:55 +00:00
committed by GitHub
parent 20e9d0c159
commit 0d6ef76605
53 changed files with 332 additions and 159 deletions

View File

@@ -45,6 +45,7 @@ import { ROOM_SECURITY_TAB } from "./components/views/dialogs/RoomSettingsDialog
import AccessibleButton from './components/views/elements/AccessibleButton';
import RightPanelStore from './stores/right-panel/RightPanelStore';
import UserIdentifierCustomisations from './customisations/UserIdentifier';
import { ViewRoomPayload } from "./dispatcher/payloads/ViewRoomPayload";
export function getSenderName(event: MatrixEvent): string {
return event.sender?.name ?? event.getSender() ?? _t("Someone");
@@ -522,11 +523,12 @@ function textForPowerEvent(event: MatrixEvent): () => string | null {
}
const onPinnedOrUnpinnedMessageClick = (messageId: string, roomId: string): void => {
defaultDispatcher.dispatch({
defaultDispatcher.dispatch<ViewRoomPayload>({
action: Action.ViewRoom,
event_id: messageId,
highlighted: true,
room_id: roomId,
_trigger: undefined, // room doesn't change
});
};