r77698 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77697‎ | r77698 | r77699 >
Date:00:37, 4 December 2010
Author:catrope
Status:ok (Comments)
Tags:
Comment:
Fix $wgCodeReviewCommentWatcher , didn't actually work because canReceiveEmail() returns false for anons (at least on mw.org)
Modified paths:
  • /trunk/extensions/CodeReview/backend/CodeRevision.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/backend/CodeRevision.php
@@ -466,8 +466,10 @@
467467 $users[0] = $watcher; // We don't have any anons, so using 0 is safe
468468 }
469469
470 - foreach ( $users as $user ) {
471 - if ( $user->canReceiveEmail() ) {
 470+ foreach ( $users as $id => $user ) {
 471+ // canReceiveEmail() returns false for the fake watcher user, so exempt it
 472+ // This is ugly
 473+ if ( $id == 0 || $user->canReceiveEmail() ) {
472474 // Send message in receiver's language
473475 $lang = array( 'language' => $user->getOption( 'language' ) );
474476

Follow-up revisions

RevisionCommit summaryAuthorDate
r776991.16wmf4: MFT r77698 (by hand, since the code is different between 1.16wmf4 a...catrope00:40, 4 December 2010

Comments

#Comment by IAlex (talk | contribs)   15:31, 4 December 2010

Wouldn't it be better to add the user to the database so that this hack isn't needed?

#Comment by Catrope (talk | contribs)   21:13, 4 December 2010

I wasn't really thinking about that when I was just trying to get this to work at 2am :)

But I don't think adding a fake user would be a good idea. We don't do it for "MediaWiki default" or "Maintenance script" either.

Status & tagging log