Index: trunk/phase3/includes/RecentChange.php |
— | — | @@ -503,10 +503,11 @@ |
504 | 504 | * @param $logComment |
505 | 505 | * @param $params |
506 | 506 | * @param $newId int |
| 507 | + * @param $actionCommentIRC string |
507 | 508 | * @return bool |
508 | 509 | */ |
509 | | - public static function notifyLog( $timestamp, &$title, &$user, $actionComment, $ip='', $type, |
510 | | - $action, $target, $logComment, $params, $newId=0 ) |
| 510 | + public static function notifyLog( $timestamp, &$title, &$user, $actionComment, $ip, $type, |
| 511 | + $action, $target, $logComment, $params, $newId=0, $actionCommentIRC='' ) |
511 | 512 | { |
512 | 513 | global $wgLogRestrictions; |
513 | 514 | # Don't add private logs to RC! |
— | — | @@ -514,7 +515,7 @@ |
515 | 516 | return false; |
516 | 517 | } |
517 | 518 | $rc = self::newLogEntry( $timestamp, $title, $user, $actionComment, $ip, $type, $action, |
518 | | - $target, $logComment, $params, $newId ); |
| 519 | + $target, $logComment, $params, $newId, $actionCommentIRC ); |
519 | 520 | $rc->save(); |
520 | 521 | return true; |
521 | 522 | } |
— | — | @@ -531,10 +532,11 @@ |
532 | 533 | * @param $logComment |
533 | 534 | * @param $params |
534 | 535 | * @param $newId int |
| 536 | + * @param $actionCommentIRC string |
535 | 537 | * @return RecentChange |
536 | 538 | */ |
537 | | - public static function newLogEntry( $timestamp, &$title, &$user, $actionComment, $ip='', |
538 | | - $type, $action, $target, $logComment, $params, $newId=0 ) { |
| 539 | + public static function newLogEntry( $timestamp, &$title, &$user, $actionComment, $ip, |
| 540 | + $type, $action, $target, $logComment, $params, $newId=0, $actionCommentIRC='' ) { |
539 | 541 | global $wgRequest; |
540 | 542 | if( !$ip ) { |
541 | 543 | $ip = $wgRequest->getIP(); |
— | — | @@ -575,6 +577,7 @@ |
576 | 578 | 'prefixedDBkey' => $title->getPrefixedDBkey(), |
577 | 579 | 'lastTimestamp' => 0, |
578 | 580 | 'actionComment' => $actionComment, // the comment appended to the action, passed from LogPage |
| 581 | + 'actionCommentIRC' => $actionCommentIRC |
579 | 582 | ); |
580 | 583 | return $rc; |
581 | 584 | } |
— | — | @@ -712,7 +715,7 @@ |
713 | 716 | |
714 | 717 | if ( $this->mAttribs['rc_type'] == RC_LOG ) { |
715 | 718 | $targetText = $this->getTitle()->getPrefixedText(); |
716 | | - $comment = self::cleanupForIRC( str_replace( "[[$targetText]]", "[[\00302$targetText\00310]]", $this->mExtra['actionComment'] ) ); |
| 719 | + $comment = self::cleanupForIRC( str_replace( "[[$targetText]]", "[[\00302$targetText\00310]]", $this->mExtra['actionCommentIRC'] ) ); |
717 | 720 | $flag = $this->mAttribs['rc_log_action']; |
718 | 721 | } else { |
719 | 722 | $comment = self::cleanupForIRC( $this->mAttribs['rc_comment'] ); |
Index: trunk/phase3/includes/logging/LogPage.php |
— | — | @@ -100,7 +100,7 @@ |
101 | 101 | RecentChange::notifyLog( |
102 | 102 | $now, $titleObj, $this->doer, $this->getRcComment(), '', |
103 | 103 | $this->type, $this->action, $this->target, $this->comment, |
104 | | - $this->params, $newId |
| 104 | + $this->params, $newId, $this->getRcCommentIRC() |
105 | 105 | ); |
106 | 106 | } elseif( $this->sendToUDP ) { |
107 | 107 | # Don't send private logs to UDP |
— | — | @@ -114,7 +114,7 @@ |
115 | 115 | $rc = RecentChange::newLogEntry( |
116 | 116 | $now, $titleObj, $this->doer, $this->getRcComment(), '', |
117 | 117 | $this->type, $this->action, $this->target, $this->comment, |
118 | | - $this->params, $newId |
| 118 | + $this->params, $newId, $this->getRcCommentIRC() |
119 | 119 | ); |
120 | 120 | $rc->notifyRC2UDP(); |
121 | 121 | } |
— | — | @@ -141,6 +141,25 @@ |
142 | 142 | } |
143 | 143 | |
144 | 144 | /** |
| 145 | + * Get the RC comment from the last addEntry() call for IRC |
| 146 | + * |
| 147 | + * @return string |
| 148 | + */ |
| 149 | + public function getRcCommentIRC() { |
| 150 | + $rcComment = $this->ircActionText; |
| 151 | + |
| 152 | + if( $this->comment != '' ) { |
| 153 | + if ( $rcComment == '' ) { |
| 154 | + $rcComment = $this->comment; |
| 155 | + } else { |
| 156 | + $rcComment .= wfMsgForContent( 'colon-separator' ) . $this->comment; |
| 157 | + } |
| 158 | + } |
| 159 | + |
| 160 | + return $rcComment; |
| 161 | + } |
| 162 | + |
| 163 | + /** |
145 | 164 | * Get the comment from the last addEntry() call |
146 | 165 | */ |
147 | 166 | public function getComment() { |
— | — | @@ -459,6 +478,7 @@ |
460 | 479 | $formatter->setContext( $context ); |
461 | 480 | |
462 | 481 | $this->actionText = $formatter->getPlainActionText(); |
| 482 | + $this->ircActionText = $formatter->getPlainActionText(); |
463 | 483 | |
464 | 484 | return $this->saveContent(); |
465 | 485 | } |