Beispiel #1
0
 function getIRCLine()
 {
     global $wgUseRCPatrol;
     extract($this->mAttribs);
     extract($this->mExtra);
     $titleObj =& $this->getTitle();
     if ($rc_type == RC_LOG) {
         $title = Namespac::getCanonicalName($titleObj->getNamespace()) . $titleObj->getText();
     } else {
         $title = $titleObj->getPrefixedText();
     }
     $title = $this->cleanupForIRC($title);
     $bad = array("\n", "\r");
     $empty = array("", "");
     $title = $titleObj->getPrefixedText();
     $title = str_replace($bad, $empty, $title);
     // FIXME: *HACK* these should be getFullURL(), hacked for SSL madness --brion 2005-12-26
     if ($rc_type == RC_LOG) {
         $url = '';
     } elseif ($rc_new && $wgUseRCPatrol) {
         $url = $titleObj->getInternalURL("rcid={$rc_id}");
     } else {
         if ($rc_new) {
             $url = $titleObj->getInternalURL();
         } else {
             if ($wgUseRCPatrol) {
                 $url = $titleObj->getInternalURL("diff={$rc_this_oldid}&oldid={$rc_last_oldid}&rcid={$rc_id}");
             } else {
                 $url = $titleObj->getInternalURL("diff={$rc_this_oldid}&oldid={$rc_last_oldid}");
             }
         }
     }
     if (isset($oldSize) && isset($newSize)) {
         $szdiff = $newSize - $oldSize;
         if ($szdiff < -500) {
             $szdiff = "{$szdiff}";
         } elseif ($szdiff >= 0) {
             $szdiff = '+' . $szdiff;
         }
         $szdiff = '(' . $szdiff . ')';
     } else {
         $szdiff = '';
     }
     $user = $this->cleanupForIRC($rc_user_text);
     if ($rc_type == RC_LOG) {
         $logTargetText = $logTarget->getPrefixedText();
         $comment = $this->cleanupForIRC(str_replace($logTargetText, "02{$logTargetText}10", $rc_comment));
         $flag = $logAction;
     } else {
         $comment = $this->cleanupForIRC($rc_comment);
         $flag = ($rc_minor ? "M" : "") . ($rc_new ? "N" : "");
     }
     # see http://www.irssi.org/documentation/formats for some colour codes. prefix is \003,
     # no colour (\003) switches back to the term default
     $fullString = "14[[07{$title}14]]4 {$flag}10 " . "02{$url} 5* 03{$user} 5* {$szdiff} 10{$comment}\n";
     return $fullString;
 }