* @param $logComment
* @param $params
* @param $newId int
+ * @param $actionCommentIRC string
* @return bool
*/
- public static function notifyLog( $timestamp, &$title, &$user, $actionComment, $ip='', $type,
- $action, $target, $logComment, $params, $newId=0 )
+ public static function notifyLog( $timestamp, &$title, &$user, $actionComment, $ip, $type,
+ $action, $target, $logComment, $params, $newId=0, $actionCommentIRC='' )
{
global $wgLogRestrictions;
# Don't add private logs to RC!
return false;
}
$rc = self::newLogEntry( $timestamp, $title, $user, $actionComment, $ip, $type, $action,
- $target, $logComment, $params, $newId );
+ $target, $logComment, $params, $newId, $actionCommentIRC );
$rc->save();
return true;
}
* @param $logComment
* @param $params
* @param $newId int
+ * @param $actionCommentIRC string
* @return RecentChange
*/
- public static function newLogEntry( $timestamp, &$title, &$user, $actionComment, $ip='',
- $type, $action, $target, $logComment, $params, $newId=0 ) {
+ public static function newLogEntry( $timestamp, &$title, &$user, $actionComment, $ip,
+ $type, $action, $target, $logComment, $params, $newId=0, $actionCommentIRC='' ) {
global $wgRequest;
if( !$ip ) {
$ip = $wgRequest->getIP();
'prefixedDBkey' => $title->getPrefixedDBkey(),
'lastTimestamp' => 0,
'actionComment' => $actionComment, // the comment appended to the action, passed from LogPage
+ 'actionCommentIRC' => $actionCommentIRC
);
return $rc;
}
if ( $this->mAttribs['rc_type'] == RC_LOG ) {
$targetText = $this->getTitle()->getPrefixedText();
- $comment = self::cleanupForIRC( str_replace( "[[$targetText]]", "[[\00302$targetText\00310]]", $this->mExtra['actionComment'] ) );
+ $comment = self::cleanupForIRC( str_replace( "[[$targetText]]", "[[\00302$targetText\00310]]", $this->mExtra['actionCommentIRC'] ) );
$flag = $this->mAttribs['rc_log_action'];
} else {
$comment = self::cleanupForIRC( $this->mAttribs['rc_comment'] );
RecentChange::notifyLog(
$now, $titleObj, $this->doer, $this->getRcComment(), '',
$this->type, $this->action, $this->target, $this->comment,
- $this->params, $newId
+ $this->params, $newId, $this->getRcCommentIRC()
);
} elseif( $this->sendToUDP ) {
# Don't send private logs to UDP
$rc = RecentChange::newLogEntry(
$now, $titleObj, $this->doer, $this->getRcComment(), '',
$this->type, $this->action, $this->target, $this->comment,
- $this->params, $newId
+ $this->params, $newId, $this->getRcCommentIRC()
);
$rc->notifyRC2UDP();
}
return $rcComment;
}
+ /**
+ * Get the RC comment from the last addEntry() call for IRC
+ *
+ * @return string
+ */
+ public function getRcCommentIRC() {
+ $rcComment = $this->ircActionText;
+
+ if( $this->comment != '' ) {
+ if ( $rcComment == '' ) {
+ $rcComment = $this->comment;
+ } else {
+ $rcComment .= wfMsgForContent( 'colon-separator' ) . $this->comment;
+ }
+ }
+
+ return $rcComment;
+ }
+
/**
* Get the comment from the last addEntry() call
*/
$formatter->setContext( $context );
$this->actionText = $formatter->getPlainActionText();
+ $this->ircActionText = $formatter->getPlainActionText();
return $this->saveContent();
}