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 <andrew@amorgan.xyz>
This commit is contained in:
parent
760d269671
commit
9adfdb8fed
1 changed files with 12 additions and 1 deletions
|
@ -40,6 +40,8 @@ import RoomViewStore from "./stores/RoomViewStore";
|
||||||
import UserActivity from "./UserActivity";
|
import UserActivity from "./UserActivity";
|
||||||
import { mediaFromMxc } from "./customisations/Media";
|
import { mediaFromMxc } from "./customisations/Media";
|
||||||
import ErrorDialog from "./components/views/dialogs/ErrorDialog";
|
import ErrorDialog from "./components/views/dialogs/ErrorDialog";
|
||||||
|
import CallHandler from "./CallHandler";
|
||||||
|
import VoipUserMapper from "./VoipUserMapper";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Dispatches:
|
* Dispatches:
|
||||||
|
@ -386,7 +388,16 @@ export const Notifier = {
|
||||||
},
|
},
|
||||||
|
|
||||||
_evaluateEvent: function(ev: MatrixEvent) {
|
_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 = VoipUserMapper.sharedInstance().nativeRoomForVirtualRoom(roomId);
|
||||||
|
if (nativeRoomId) {
|
||||||
|
roomId = nativeRoomId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const room = MatrixClientPeg.get().getRoom(roomId);
|
||||||
|
|
||||||
const actions = MatrixClientPeg.get().getPushActionsForEvent(ev);
|
const actions = MatrixClientPeg.get().getPushActionsForEvent(ev);
|
||||||
if (actions?.notify) {
|
if (actions?.notify) {
|
||||||
if (RoomViewStore.getRoomId() === room.roomId &&
|
if (RoomViewStore.getRoomId() === room.roomId &&
|
||||||
|
|
Loading…
Reference in a new issue