Skip to content

Commit

Permalink
- Fixed null edits triggering notifications.
Browse files Browse the repository at this point in the history
  • Loading branch information
kulttuuri committed Dec 16, 2021
1 parent c06cdb1 commit e8e6632
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion SlackNotificationsCore.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static function getSlackArticleText(WikiPage $article, $diff = false)
"watch"*/);
if ($diff)
{
$out .= " | ".$prefix."&".$wgSlackNotificationWikiUrlEndingDiff.$article->getRevisionRecord()->getID()."|diff>)";
$out .= " | ".$prefix."&".$wgSlackNotificationWikiUrlEndingDiff.$article->getRevisionRecord()->getID()."|diff>)";
}
else
{
Expand Down Expand Up @@ -121,6 +121,8 @@ static function slack_article_saved($wikiPage, $user, $summary, $flags, $revisio
if ( !$wgSlackNotificationEditedArticle && !$isNew ) return true;
if ( !$wgSlackNotificationAddedArticle && $isNew ) return true;
if ( self::titleIsExcluded( $wikiPage->getTitle() ) ) return true;
// Ignore null / empty edits (https://en.wikipedia.org/wiki/Wikipedia:Purge#Null_edit)
if ($editResult->isNullEdit() == 1) return true;

// Do not announce newly added file uploads as articles...
if ( $wikiPage->getTitle()->getNsText() && $wikiPage->getTitle()->getNsText() == 'File' ) return true;
Expand Down

0 comments on commit e8e6632

Please sign in to comment.