Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Open native room when clicking notification from a virtual room #7709

Merged
merged 2 commits into from
Feb 3, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/Notifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import RoomViewStore from "./stores/RoomViewStore";
import UserActivity from "./UserActivity";
import { mediaFromMxc } from "./customisations/Media";
import ErrorDialog from "./components/views/dialogs/ErrorDialog";
import CallHandler from "./CallHandler";

/*
* Dispatches:
Expand Down Expand Up @@ -386,7 +387,16 @@ export const Notifier = {
},

_evaluateEvent: function(ev: MatrixEvent) {
const room = MatrixClientPeg.get().getRoom(ev.getRoomId());
let roomId = ev.getRoomId();
if (CallHandler.instance.getSupportsVirtualRooms()) {
// Attempt to translate a virtual room to a native one
const nativeRoomId = window.mxVoipUserMapper.nativeRoomForVirtualRoom(roomId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to pass that down to the component or have an import? Rather than relying on an indirect reference?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, yes - it should be using sharedInstance()

if (nativeRoomId) {
roomId = nativeRoomId;
}
}
const room = MatrixClientPeg.get().getRoom(roomId);

const actions = MatrixClientPeg.get().getPushActionsForEvent(ev);
if (actions?.notify) {
if (RoomViewStore.getRoomId() === room.roomId &&
Expand Down