Index: trunk/extensions/CodeReview/backend/CodeRevision.php |
— | — | @@ -423,9 +423,7 @@ |
424 | 424 | $users[0] = $watcher; // We don't have any anons, so using 0 is safe |
425 | 425 | } |
426 | 426 | // Get repo and build comment title (for url) |
427 | | - $title = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/' . $this->mId ); |
428 | | - $title->setFragment( "#c{$commentId}" ); |
429 | | - $url = $title->getFullUrl(); |
| 427 | + $url = $this->getFullUrl( $commentId ); |
430 | 428 | |
431 | 429 | foreach ( $users as $userId => $user ) { |
432 | 430 | // No sense in notifying this commenter |
— | — | @@ -787,8 +785,13 @@ |
788 | 786 | } |
789 | 787 | } |
790 | 788 | |
791 | | - public function getFullUrl() { |
| 789 | + public function getFullUrl( $commentId = '' ) { |
792 | 790 | $title = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/' . $this->mId ); |
| 791 | + |
| 792 | + if ( $commentId !== '' ) { |
| 793 | + $title->setFragment( "#c{$commentId}" ); |
| 794 | + } |
| 795 | + |
793 | 796 | return $title->getFullUrl(); |
794 | 797 | } |
795 | 798 | |
— | — | @@ -797,9 +800,7 @@ |
798 | 801 | |
799 | 802 | if( $wgCodeReviewUDPAddress ) { |
800 | 803 | if( is_null( $url ) ) { |
801 | | - $title = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/' . $this->mId ); |
802 | | - $title->setFragment( "#c{$commentId}" ); |
803 | | - $url = $title->getFullUrl(); |
| 804 | + $url = $this->getFullUrl( $commentId ); |
804 | 805 | } |
805 | 806 | |
806 | 807 | $line = wfMsg( 'code-rev-message' ) . " \00314(" . $this->mRepo->getName() . |
— | — | @@ -814,8 +815,7 @@ |
815 | 816 | global $wgCodeReviewUDPAddress, $wgCodeReviewUDPPort, $wgCodeReviewUDPPrefix, $wgUser; |
816 | 817 | |
817 | 818 | if( $wgCodeReviewUDPAddress ) { |
818 | | - $title = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/' . $this->getId() ); |
819 | | - $url = $title->getFullUrl(); |
| 819 | + $url = $this->getFullUrl(); |
820 | 820 | |
821 | 821 | $line = wfMsg( 'code-rev-status' ) . " \00314(" . $this->mRepo->getName() . |
822 | 822 | ")\00303 " . RecentChange::cleanupForIRC( $wgUser->getName() ) . "\003 " . |