You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-05 23:10:41 +03:00
Added commands for DM conversion
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
@@ -48,6 +48,7 @@ import SettingsStore from "./settings/SettingsStore";
|
|||||||
import {UIFeature} from "./settings/UIFeature";
|
import {UIFeature} from "./settings/UIFeature";
|
||||||
import {CHAT_EFFECTS} from "./effects"
|
import {CHAT_EFFECTS} from "./effects"
|
||||||
import CallHandler from "./CallHandler";
|
import CallHandler from "./CallHandler";
|
||||||
|
import {guessAndSetDMRoom} from "./Rooms";
|
||||||
|
|
||||||
// XXX: workaround for https://github.com/microsoft/TypeScript/issues/31816
|
// XXX: workaround for https://github.com/microsoft/TypeScript/issues/31816
|
||||||
interface HTMLInputEvent extends Event {
|
interface HTMLInputEvent extends Event {
|
||||||
@@ -1112,6 +1113,24 @@ export const Commands = [
|
|||||||
return success();
|
return success();
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
new Command({
|
||||||
|
command: "converttodm",
|
||||||
|
description: _td("Converts the room to a DM"),
|
||||||
|
category: CommandCategories.other,
|
||||||
|
runFn: function(roomId, args) {
|
||||||
|
const room = MatrixClientPeg.get().getRoom(roomId);
|
||||||
|
return success(guessAndSetDMRoom(room, true));
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
new Command({
|
||||||
|
command: "converttoroom",
|
||||||
|
description: _td("Converts the DM to a room"),
|
||||||
|
category: CommandCategories.other,
|
||||||
|
runFn: function(roomId, args) {
|
||||||
|
const room = MatrixClientPeg.get().getRoom(roomId);
|
||||||
|
return success(guessAndSetDMRoom(room, false));
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
|
||||||
// Command definitions for autocompletion ONLY:
|
// Command definitions for autocompletion ONLY:
|
||||||
// /me is special because its not handled by SlashCommands.js and is instead done inside the Composer classes
|
// /me is special because its not handled by SlashCommands.js and is instead done inside the Composer classes
|
||||||
|
|||||||
Reference in New Issue
Block a user