fix(pk-compat-proxy): extracting message from proxied message
This commit is contained in:
2 files changed
+9
No files matched your search
@@ -728,6 +728,8 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
|
||||
// check if its a pk command
|
||||
if (pkCompatEnable && PKitCommandMessageHandler.isPKCommand(plainText)) {
|
||||
pluralkitCmdMessageHandler.handleMessage(plainText);
|
||||
resetEditor(editor); // clear the editor
|
||||
return; // don't do anything besides handling the command
|
||||
}
|
||||
|
||||
if (commandName) {
|
||||
|
||||
@@ -79,6 +79,13 @@ export class PKitProxyMessageHandler {
|
||||
return getPerMessageProfileById(this.mx, profileId);
|
||||
}
|
||||
|
||||
/**
|
||||
* this runs synchronously, so it needs to be inited beforehand
|
||||
*
|
||||
* @param {string} message the message you want to extract from
|
||||
* @return {*} {(string | undefined)} the message without the proxy
|
||||
* @memberof PKitProxyMessageHandler
|
||||
*/
|
||||
public stripProxyFromMessage(message: string): string | undefined {
|
||||
if (!this.succInit) throw new Error('PK proxy message handler is not initialized');
|
||||
let m;
|
||||
|
||||
Reference in new issue
Block a user