Adjust formatting of user block messages
This commit is contained in:
+1
-1
@@ -10,7 +10,7 @@
|
||||
"onUploadComplete_NewVersion": "$1 uploaded new version of file $2",
|
||||
"onFileDeleteComplete": "$1 deleted file $2",
|
||||
"onLocalUserCreated": "$1 registered",
|
||||
"onBlockIpComplete": "$1 blocked user $2",
|
||||
"onBlockIpComplete": "$1 blocked user $2 until $3",
|
||||
"onUnblockUserComplete": "$1 unblocked user $2",
|
||||
"onUserGroupsChanged": "$1 changed rights of user $1.",
|
||||
|
||||
|
||||
+16
-14
@@ -323,36 +323,38 @@ final class MediawikiDiscordHooks
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$message = MediawikiDiscord::translate('onBlockIpComplete', MediawikiDiscord::getUserText($user),
|
||||
MediawikiDiscord::getUserText($block->getTarget()));
|
||||
|
||||
if (empty($block->mReason) == false)
|
||||
{
|
||||
$message .= sprintf(" `%s`",
|
||||
$block->mReason);
|
||||
}
|
||||
|
||||
|
||||
if (($expires = strtotime($block->mExpiry)))
|
||||
{
|
||||
$message .= sprintf(" `%s`",
|
||||
date('Y-m-d H:i:s', $expires));
|
||||
$expiryMsg = sprintf(" `%s`",
|
||||
date('d F Y H:i', $expires));
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($block->mExpiry == "infinity")
|
||||
{
|
||||
$message .= sprintf(" (`%s`)",
|
||||
$expiryMsg = sprintf(" (`%s`)",
|
||||
MediawikiDiscord::translate('infiniteblock'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$message .= sprintf(" (%s `%s`)",
|
||||
$expiryMsg = sprintf(" (%s `%s`)",
|
||||
MediawikiDiscord::translate('blocklist-expiry'),
|
||||
$block->mExpiry );
|
||||
}
|
||||
}
|
||||
|
||||
$message = MediawikiDiscord::translate('onBlockIpComplete', MediawikiDiscord::getUserText($user),
|
||||
MediawikiDiscord::getUserText($block->getTarget()),
|
||||
$expiryMsg
|
||||
);
|
||||
|
||||
if (empty($block->mReason) == false)
|
||||
{
|
||||
$message .= sprintf(": `%s`",
|
||||
$block->mReason);
|
||||
}
|
||||
|
||||
(new DiscordNotification($message))->Send();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user