Skip to content

Commit

Permalink
Version is now 1.12.
Browse files Browse the repository at this point in the history
- Also check when moving article if new or old title of this article should discard notifications.
  • Loading branch information
kulttuuri committed Mar 25, 2018
1 parent 7f88d7f commit e7c98d7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions SlackNotifications/SlackNotificationsCore.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,15 @@ static function slack_article_moved($title, $newtitle, $user, $oldid, $newid, $r
global $wgSlackNotificationMovedArticle;
if (!$wgSlackNotificationMovedArticle) return;

// Discard notifications from excluded pages
global $wgSlackExcludeNotificationsFrom;
if (count($wgSlackExcludeNotificationsFrom) > 0) {
foreach ($wgSlackExcludeNotificationsFrom as &$currentExclude) {
if (0 === strpos($title, $currentExclude)) return;
if (0 === strpos($newtitle, $currentExclude)) return;
}
}

$message = sprintf(
"%s has moved article %s to %s. Reason: %s",
self::getSlackUserText($user),
Expand Down
2 changes: 1 addition & 1 deletion SlackNotifications/extension.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Slack Notifications",
"version": "1.11",
"version": "1.12",
"author": "Aleksi Postari",
"url": "https://github.com/kulttuuri/slack_mediawiki",
"description": "Sends Slack notifications for selected actions that have occurred in your MediaWiki sites.",
Expand Down

0 comments on commit e7c98d7

Please sign in to comment.