Display user when restoring articles

This commit is contained in:
Jayden Bailey
2018-09-11 19:16:57 +01:00
parent 458dab64b1
commit 2b53dc2d28
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
"onPageContentInsertComplete": "$1 created new page $2",
"onTitleMoveComplete": "$1 moved page $2 to $3",
"onArticleDeleteComplete": "$1 deleted page $2",
"onArticleUndelete": "Deleted page $1 restored",
"onArticleUndelete": "$1 restored page $1",
"onArticleProtectComplete": "$1 changed protection of page $2",
"onUploadComplete": "$1 uploaded file $2",
"onUploadComplete_NewVersion": "$1 uploaded new version of file $2",
+4 -2
View File
@@ -202,16 +202,18 @@ final class MediawikiDiscordHooks
static function onArticleUndelete($title, $create, $comment)
{
global $wgUser;
if (MediawikiDiscord::isNotificationExcluded("onArticleUndelete"))
{
return;
}
$message = MediawikiDiscord::translate('onArticleUndelete', MediawikiDiscord::getTitleText($title));
$message = MediawikiDiscord::translate('onArticleUndelete', MediawikiDiscord::getUserText($wgUser), MediawikiDiscord::getTitleText($title));
if (empty($comment) == false)
{
$message .= sprintf(" `%s`",
$message .= sprintf(": `%s`",
$comment);
}