Skip to content

Commit ba18d25

Browse files
committed
fix(pk-compat-proxy): extracting message from proxied message
1 parent 5f22d86 commit ba18d25

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

src/app/features/room/RoomInput.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,8 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
728728
// check if its a pk command
729729
if (pkCompatEnable && PKitCommandMessageHandler.isPKCommand(plainText)) {
730730
pluralkitCmdMessageHandler.handleMessage(plainText);
731+
resetEditor(editor); // clear the editor
732+
return; // don't do anything besides handling the command
731733
}
732734

733735
if (commandName) {

src/app/plugins/pluralkit-handler/PKitProxyMessageHandler.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ export class PKitProxyMessageHandler {
7979
return getPerMessageProfileById(this.mx, profileId);
8080
}
8181

82+
/**
83+
* this runs synchronously, so it needs to be inited beforehand
84+
*
85+
* @param {string} message the message you want to extract from
86+
* @return {*} {(string | undefined)} the message without the proxy
87+
* @memberof PKitProxyMessageHandler
88+
*/
8289
public stripProxyFromMessage(message: string): string | undefined {
8390
if (!this.succInit) throw new Error('PK proxy message handler is not initialized');
8491
let m;

0 commit comments

Comments
 (0)