diff --git a/matrix/plugin.json b/matrix/plugin.json index ca9ee1f..c599c38 100644 --- a/matrix/plugin.json +++ b/matrix/plugin.json @@ -3,7 +3,7 @@ "name": "matrix", "description": "Matrix.org Service for Squeebot 3", "tags": ["service", "matrix"], - "version": "1.0.1", + "version": "1.0.2", "dependencies": ["control?"], "npmDependencies": ["matrix-bot-sdk@0.5.19"] } diff --git a/matrix/plugin.ts b/matrix/plugin.ts index 2378eab..5a5fd19 100644 --- a/matrix/plugin.ts +++ b/matrix/plugin.ts @@ -184,12 +184,13 @@ class MatrixProtocol extends Protocol { return; } - this.sendTo(msg.target.id, ...data); + this.sendTo(`${this.fullName}/${msg.target.id}`, ...data); } public async sendTo(target: string, ...data: any[]): Promise { let response = util.format(data[0], ...data.slice(1)); - if (!response || !target) { + const rxSplit = target.split('/'); + if (!response || !target || rxSplit.length !== 3) { return false; } @@ -202,7 +203,7 @@ class MatrixProtocol extends Protocol { } } - await this.client?.sendMessage(target, { + await this.client?.sendMessage(rxSplit[2], { msgtype: 'm.text', body: this.format.strip(response), format: 'org.matrix.custom.html', diff --git a/squeebot.repo.json b/squeebot.repo.json index 22386f2..5218952 100644 --- a/squeebot.repo.json +++ b/squeebot.repo.json @@ -3,7 +3,7 @@ "plugins": [ { "name": "matrix", - "version": "1.0.1" + "version": "1.0.2" } ], "typescript": true