Automatically sync the ban lists after issuing a ban

Workaround for https://github.com/matrix-org/mjolnir/issues/13.

Fixes https://github.com/matrix-org/mjolnir/issues/13
This commit is contained in:
Travis Ralston 2019-12-04 19:12:35 -07:00
parent 1b795c7b17
commit 3be2da5c47

View File

@ -119,6 +119,10 @@ export async function execBanCommand(roomId: string, event: any, mjolnir: Mjolni
await mjolnir.client.sendStateEvent(bits.list.roomId, bits.ruleType, stateKey, ruleContent);
await mjolnir.client.unstableApis.addReactionToEvent(roomId, event['event_id'], '✅');
// Just sync the lists to apply the ban as it might not always come down /sync for some reason
await logMessage(LogLevel.DEBUG, "UnbanBanCommand", `Syncing lists to ensure the ban is applied`);
await mjolnir.syncLists(config.verboseLogging);
}
// !mjolnir unban <shortcode> <user|server|room> <glob> [apply:t/f]