You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-12-20 20:42:03 +03:00
Should open new 1:1 chat room after leaving the old one (#9880)
* should open new 1:1 chat room after leaving the old one Signed-off-by: Ahmad Kadri <ahmad.kadri@nordeck.net> * change the copyright * update the test Signed-off-by: AHMAD KADRI <52747422+ahmadkadri@users.noreply.github.com> --------- Signed-off-by: Ahmad Kadri <ahmad.kadri@nordeck.net> Signed-off-by: AHMAD KADRI <52747422+ahmadkadri@users.noreply.github.com> Co-authored-by: Oliver Sand <oliver.sand@nordeck.net> Co-authored-by: Dominik Henneke <dominik.henneke@nordeck.net>
This commit is contained in:
@@ -138,6 +138,7 @@ import { cleanUpBroadcasts, VoiceBroadcastResumer } from "../../voice-broadcast"
|
||||
import GenericToast from "../views/toasts/GenericToast";
|
||||
import { Linkify } from "../views/elements/Linkify";
|
||||
import RovingSpotlightDialog, { Filter } from "../views/dialogs/spotlight/SpotlightDialog";
|
||||
import { findDMForUser } from "../../utils/dm/findDMForUser";
|
||||
|
||||
// legacy export
|
||||
export { default as Views } from "../../Views";
|
||||
@@ -1101,13 +1102,12 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||
// TODO: Immutable DMs replaces this
|
||||
|
||||
const client = MatrixClientPeg.get();
|
||||
const dmRoomMap = new DMRoomMap(client);
|
||||
const dmRooms = dmRoomMap.getDMRoomsForUserId(userId);
|
||||
const dmRoom = findDMForUser(client, userId);
|
||||
|
||||
if (dmRooms.length > 0) {
|
||||
if (dmRoom) {
|
||||
dis.dispatch<ViewRoomPayload>({
|
||||
action: Action.ViewRoom,
|
||||
room_id: dmRooms[0],
|
||||
room_id: dmRoom.roomId,
|
||||
metricsTrigger: "MessageUser",
|
||||
});
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user