shut up ApplicationService Logger
This commit is contained in:
parent
093cb7cd3e
commit
b80cf737f9
|
@ -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,12 +286,14 @@ class PPfunMatrixBridge {
|
||||||
* make a user admin in a room
|
* make a user admin in a room
|
||||||
*/
|
*/
|
||||||
async makeAdminInRoom(userId, roomId) {
|
async makeAdminInRoom(userId, roomId) {
|
||||||
|
if (userId.startsWith(`@${this.prefix}_`)) {
|
||||||
try {
|
try {
|
||||||
const userIntent = this.matrixBridge.getIntent(userId);
|
const userIntent = this.matrixBridge.getIntent(userId);
|
||||||
await userIntent.join(roomId);
|
await userIntent.join(roomId);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.warn(`Couldn't join room ${roomId} with user ${userId}: ${err.message}`);
|
console.warn(`Couldn't join room ${roomId} with user ${userId}: ${err.message}`);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
const intent = this.matrixBridge.getIntent();
|
const intent = this.matrixBridge.getIntent();
|
||||||
await intent.setPowerLevel(roomId, userId, 100);
|
await intent.setPowerLevel(roomId, userId, 100);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user