Disable mentions in logs, allowing mods to be mentioned (#142)

Optionally you can return to old behavior by setting allow_user_mentions to true
This commit is contained in:
Nils 2021-01-28 00:26:24 +01:00 committed by GitHub
parent dea3c2516c
commit f762a238de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 8 deletions

View file

@ -61,7 +61,12 @@ export async function getLogMessage(
const memberConfig = pluginData.config.getMatchingConfig({ member, userId: user.id }) || ({} as any);
mentions.push(memberConfig.ping_user ? verboseUserMention(user) : verboseUserName(user));
// Revert to old behavior (verbose name w/o ping if allow_user_mentions is enabled (for whatever reason))
if (config.allow_user_mentions) {
mentions.push(memberConfig.ping_user ? verboseUserMention(user) : verboseUserName(user));
} else {
mentions.push(verboseUserMention(user));
}
}
return mentions.join(", ");