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