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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
53 changed files with 332 additions and 159 deletions

View file

@ -49,6 +49,7 @@ import RoomContext from '../../../contexts/RoomContext';
import { SettingUpdatedPayload } from "../../../dispatcher/payloads/SettingUpdatedPayload";
import MessageComposerButtons from './MessageComposerButtons';
import { ButtonEvent } from '../elements/AccessibleButton';
import { ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload";
let instanceCount = 0;
const NARROW_MODE_BREAKPOINT = 500;
@ -227,21 +228,17 @@ export default class MessageComposer extends React.Component<IProps, IState> {
}
const viaServers = [this.state.tombstone.getSender().split(':').slice(1).join(':')];
dis.dispatch({
dis.dispatch<ViewRoomPayload>({
action: Action.ViewRoom,
highlighted: true,
event_id: createEventId,
room_id: replacementRoomId,
auto_join: true,
_type: "tombstone", // instrumentation
// Try to join via the server that sent the event. This converts @something:example.org
// into a server domain by splitting on colons and ignoring the first entry ("@something").
via_servers: viaServers,
opts: {
// These are passed down to the js-sdk's /join call
viaServers: viaServers,
},
_trigger: "Tombstone",
_viaKeyboard: ev.type !== "click",
});
};