New create chat screen (#2463)
Some checks are pending
Deploy to Netlify (dev) / Deploy to Netlify (push) Waiting to run

* fix dm invite appears in home

* use migrated function for convert to dm/room commands

* add new create chat screen
This commit is contained in:
Ajay Bura 2025-08-24 18:10:44 +05:30 committed by GitHub
parent 23aa5c6f94
commit b4266c26b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 246 additions and 66 deletions

View file

@ -2,12 +2,15 @@ import { Direction, IContextResponse, MatrixClient, Method, Room, RoomMember } f
import { RoomServerAclEventContent } from 'matrix-js-sdk/lib/types';
import { useMemo } from 'react';
import {
addRoomIdToMDirect,
getDMRoomFor,
guessDmRoomUserId,
isRoomAlias,
isRoomId,
isServerName,
isUserId,
rateLimitedActions,
removeRoomIdFromMDirect,
} from '../utils/matrix';
import { hasDevices } from '../../util/matrixUtil';
import * as roomActions from '../../client/action/room';
@ -348,14 +351,15 @@ export const useCommands = (mx: MatrixClient, room: Room): CommandRecord => {
name: Command.ConvertToDm,
description: 'Convert room to direct message',
exe: async () => {
roomActions.convertToDm(mx, room.roomId);
const dmUserId = guessDmRoomUserId(room, mx.getSafeUserId());
await addRoomIdToMDirect(mx, room.roomId, dmUserId);
},
},
[Command.ConvertToRoom]: {
name: Command.ConvertToRoom,
description: 'Convert direct message to room',
exe: async () => {
roomActions.convertToRoom(mx, room.roomId);
await removeRoomIdFromMDirect(mx, room.roomId);
},
},
[Command.Delete]: {