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

Commit 9adfdb8

Browse files
dbkranoadragon453
andauthored
Open native room when clicking notification from a virtual room (#7709)
* Handle virtual rooms when showing a notification * This should be using sharedInstance() Co-authored-by: Andrew Morgan <[email protected]>
1 parent 760d269 commit 9adfdb8

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/Notifier.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ import RoomViewStore from "./stores/RoomViewStore";
4040
import UserActivity from "./UserActivity";
4141
import { mediaFromMxc } from "./customisations/Media";
4242
import ErrorDialog from "./components/views/dialogs/ErrorDialog";
43+
import CallHandler from "./CallHandler";
44+
import VoipUserMapper from "./VoipUserMapper";
4345

4446
/*
4547
* Dispatches:
@@ -386,7 +388,16 @@ export const Notifier = {
386388
},
387389

388390
_evaluateEvent: function(ev: MatrixEvent) {
389-
const room = MatrixClientPeg.get().getRoom(ev.getRoomId());
391+
let roomId = ev.getRoomId();
392+
if (CallHandler.instance.getSupportsVirtualRooms()) {
393+
// Attempt to translate a virtual room to a native one
394+
const nativeRoomId = VoipUserMapper.sharedInstance().nativeRoomForVirtualRoom(roomId);
395+
if (nativeRoomId) {
396+
roomId = nativeRoomId;
397+
}
398+
}
399+
const room = MatrixClientPeg.get().getRoom(roomId);
400+
390401
const actions = MatrixClientPeg.get().getPushActionsForEvent(ev);
391402
if (actions?.notify) {
392403
if (RoomViewStore.getRoomId() === room.roomId &&

0 commit comments

Comments
 (0)