mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-05 15:00:30 +03:00
New create chat screen (#2463)
Some checks are pending
Deploy to Netlify (dev) / Deploy to Netlify (push) Waiting to run
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:
parent
23aa5c6f94
commit
b4266c26b0
8 changed files with 246 additions and 66 deletions
|
|
@ -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]: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue