Legoktm has uploaded a new change for review.
https://gerrit.wikimedia.org/r/73918
Change subject: If the local user has the bot userright, mark the edit as bot.
......................................................................
If the local user has the bot userright, mark the edit as bot.
In I0fbe0, I submitted a patch that fixed this for the publishInOtherWiki
function.
This patchset addresses the publishHere function, which WMF wikis use.
The function now checks if the user has the "bot" right, and if so
modify the bitflags to include EDIT_FORCE_BOT. We could theoretically
add the flag even if the user did not have the "bot" right, but this
lets the local wiki choose whether they want it marked as bot or not.
The user receiving the message will always get the new notifications message
since EDIT_FORCE_BOT and EDIT_MINOR will never both be set.
Bug: 41637
Change-Id: I68202241fd83b652fe5fc2cf33f5080ec5961d2f
---
M TranslationNotificationJob.php
1 file changed, 6 insertions(+), 1 deletion(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TranslationNotifications
refs/changes/18/73918/1
diff --git a/TranslationNotificationJob.php b/TranslationNotificationJob.php
index ee857d6..b83edbc 100644
--- a/TranslationNotificationJob.php
+++ b/TranslationNotificationJob.php
@@ -61,12 +61,17 @@
}
global $wgNotificationUsername;
+ $user = User::newFromName( $wgNotificationUsername );
+ if ( $user->isAllowed( 'bot' ) ) {
+ $flags = $flags | EDIT_FORCE_BOT; // If the user has
the bot right, mark edit as bot
+ }
+
$status = $talkPage->doEditContent(
ContentHandler::makeContent( $text, $this->title ),
$this->params['editSummary'],
$flags,
false,
- User::newFromName( $wgNotificationUsername )
+ $user,
);
return $status->isGood();
--
To view, visit https://gerrit.wikimedia.org/r/73918
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I68202241fd83b652fe5fc2cf33f5080ec5961d2f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TranslationNotifications
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits