r17281 - Code Review

From MediaWiki.org

Jump to: navigation, search
Repository:MediaWiki
Revision:r17280 | r17281 (on ViewVC) | r17282 >
Date:12:11, 29 October 2006
Author:brion
Status:new
Tags:
Comment:* (bug 3224) Allow minor edits by bots to skip new message notification on
user talk pages. This can be disabled by adjusting the 'nominornewtalk'
permission. Patch by Werdna.
Modified paths:

Diff [purge]

Index: trunk/phase3/includes/Article.php
===================================================================
--- trunk/phase3/includes/Article.php	(revision 17280)
+++ trunk/phase3/includes/Article.php	(revision 17281)
@@ -2140,8 +2140,10 @@
 
 		# If this is another user's talk page, update newtalk
 		# Don't do this if $changed = false otherwise some idiot can null-edit a
-		# load of user talk pages and piss people off
-		if( $this->mTitle->getNamespace() == NS_USER_TALK && $shortTitle != $wgUser->getTitleKey() && $changed ) {
+		# load of user talk pages and piss people off, nor if it's a minor edit
+		# by a properly-flagged bot.
+		if( $this->mTitle->getNamespace() == NS_USER_TALK && $shortTitle != $wgUser->getTitleKey() && $changed
+			&& !($minoredit && $wgUser->isAllowed('nominornewtalk') ) ) {
 			if (wfRunHooks('ArticleEditUpdateNewTalk', array(&$this)) ) {
 				$other = User::newFromName( $shortTitle );
 				if( is_null( $other ) && User::isIP( $shortTitle ) ) {
Index: trunk/phase3/includes/DefaultSettings.php
===================================================================
--- trunk/phase3/includes/DefaultSettings.php	(revision 17280)
+++ trunk/phase3/includes/DefaultSettings.php	(revision 17281)
@@ -919,6 +919,7 @@
 // from various log pages by default
 $wgGroupPermissions['bot'  ]['bot']             = true;
 $wgGroupPermissions['bot'  ]['autoconfirmed']   = true;
+$wgGroupPermissions['bot'  ]['nominornewtalk']  = true;
 
 // Most extra permission abilities go to this group
 $wgGroupPermissions['sysop']['block']           = true;
Index: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES	(revision 17280)
+++ trunk/phase3/RELEASE-NOTES	(revision 17281)
@@ -97,6 +97,9 @@
 * Added 'UndeleteShowRevision' hook in Special:Undelete
 * Error message on attempt to view invalid or missing deleted revisions
 * Remove unsightly "_" from namespace in Special:Allpages, Special:Prefixindex
+* (bug 3224) Allow minor edits by bots to skip new message notification on
+  user talk pages. This can be disabled by adjusting the 'nominornewtalk'
+  permission. Patch by Werdna.
 
 
 == Languages updated ==
Views
Toolbox