shut up ApplicationService Logger

This commit is contained in:
HF 2023-06-05 02:00:40 +02:00
parent 093cb7cd3e
commit b80cf737f9

View File

@ -1,6 +1,6 @@
"use strict"; "use strict";
import { Bridge } from 'matrix-appservice-bridge'; import { Logger, Bridge } from 'matrix-appservice-bridge';
import parseMsg from './markdown/parse.js' import parseMsg from './markdown/parse.js'
import PPfunSocket from './ppfunsocket.js'; import PPfunSocket from './ppfunsocket.js';
@ -35,10 +35,12 @@ class PPfunMatrixBridge {
domain, domain,
registration, registration,
controller: { controller: {
// auto-provision users with no additional data
onUserQuery: (queriedUser) => {}, onUserQuery: (queriedUser) => {},
onEvent: this.recMatrix.bind(this), onEvent: this.recMatrix.bind(this),
} }
}); });
Logger.configure({ console: "off", json: false });
this.port = port; this.port = port;
this.domain = domain; this.domain = domain;
this.mediaUrl = mediaUrl; this.mediaUrl = mediaUrl;
@ -284,11 +286,13 @@ class PPfunMatrixBridge {
* make a user admin in a room * make a user admin in a room
*/ */
async makeAdminInRoom(userId, roomId) { async makeAdminInRoom(userId, roomId) {
try { if (userId.startsWith(`@${this.prefix}_`)) {
const userIntent = this.matrixBridge.getIntent(userId); try {
await userIntent.join(roomId); const userIntent = this.matrixBridge.getIntent(userId);
} catch (err) { await userIntent.join(roomId);
console.warn(`Couldn't join room ${roomId} with user ${userId}: ${err.message}`); } catch (err) {
console.warn(`Couldn't join room ${roomId} with user ${userId}: ${err.message}`);
}
} }
try { try {
const intent = this.matrixBridge.getIntent(); const intent = this.matrixBridge.getIntent();