Add handling of users blocking
This commit is contained in:
@@ -108,6 +108,20 @@ final class MediawikiDiscordHooks
|
||||
|
||||
DiscordNotifications::Send($message);
|
||||
}
|
||||
|
||||
static function onBlockIpComplete($block, $user)
|
||||
{
|
||||
$message = "User `" . $user . "` blocked user `" . $block->getTarget() . "`";
|
||||
|
||||
if (empty($block->mReason) == false)
|
||||
{
|
||||
$message .= " with reason: `" . $block->mReason . "`";
|
||||
}
|
||||
|
||||
$message .= " (expires: `" . $block->mExpiry ."`)";
|
||||
|
||||
DiscordNotifications::Send($message);
|
||||
}
|
||||
}
|
||||
|
||||
final class DiscordNotifications
|
||||
|
||||
@@ -17,8 +17,9 @@ This project was developed primarily for the purpose of assisting the SoulFire t
|
||||
- :heavy_check_mark: [UploadComplete](https://www.mediawiki.org/wiki/Manual:Hooks/UploadComplete)
|
||||
- :heavy_check_mark: [FileDeleteComplete](https://www.mediawiki.org/wiki/Manual:Hooks/FileDeleteComplete)
|
||||
- :heavy_check_mark: [LocalUserCreated](https://www.mediawiki.org/wiki/Manual:Hooks/LocalUserCreated)
|
||||
- :x: [BlockIpComplete](https://www.mediawiki.org/wiki/Manual:Hooks/BlockIpComplete)
|
||||
- :heavy_check_mark: [BlockIpComplete](https://www.mediawiki.org/wiki/Manual:Hooks/BlockIpComplete)
|
||||
- :x: [UnblockUserComplete](https://www.mediawiki.org/wiki/Manual:Hooks/UnblockUserComplete)
|
||||
- :x: [UserRights](https://www.mediawiki.org/wiki/Manual:Hooks/UserRights)
|
||||
- :x: `ArticleProtectComplete` - showing new protection settings of page, eg. in embed variables
|
||||
- :x: `UploadComplete` - sending pictures as embeds
|
||||
- :x: i18n
|
||||
|
||||
@@ -37,6 +37,9 @@
|
||||
],
|
||||
"LocalUserCreated": [
|
||||
"MediawikiDiscordHooks::onLocalUserCreated"
|
||||
],
|
||||
"BlockIpComplete": [
|
||||
"MediawikiDiscordHooks::onBlockIpComplete"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user