r96329 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96328‎ | r96329 | r96330 >
Date:13:19, 6 September 2011
Author:demon
Status:ok
Tags:
Comment:
Cleanup to r81612: this functionality was removed from core, so LQT doesn't need to hook in and change behavior here.
Modified paths:
  • /trunk/extensions/LiquidThreads/LiquidThreads.php (modified) (history)
  • /trunk/extensions/LiquidThreads/classes/Hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/LiquidThreads.php
@@ -149,12 +149,7 @@
150150 // New User Messages
151151 $wgHooks['SetupNewUserMessageSubject'][] = 'LqtHooks::setupNewUserMessageSubject';
152152 $wgHooks['SetupNewUserMessageBody'][] = 'LqtHooks::setupNewUserMessageBody';
153 -$wgHooks['FormatUserMessage'][] = 'LqtHooks::formatUserMessage';
154153
155 -// User Message
156 -$wgHooks['SetupUserMessageArticle'][] = 'LqtHooks::setupUserMessageArticle';
157 -$wgHooks['AfterUserMessage'][] = 'LqtHooks::afterUserMessage';
158 -
159154 // JS variables
160155 $wgHooks['MakeGlobalVariablesScript'][] = 'LqtHooks::onMakeGlobalVariablesScript';
161156
Index: trunk/extensions/LiquidThreads/classes/Hooks.php
@@ -528,68 +528,6 @@
529529 return true;
530530 }
531531
532 - static function setupUserMessageArticle( $user, &$article, $subject, $text, $signature, $summary, $editor ) {
533 - global $wgLqtTalkPages;
534 -
535 - if ( $wgLqtTalkPages && LqtDispatch::isLqtPage( $article->getTitle() ) ) {
536 - $threadTitle = Threads::newThreadTitle( $subject, $article );
537 -
538 - if ( !$threadTitle ) {
539 - wfDebug( __METHOD__ . ": invalid title $threadTitle\n" );
540 - return true;
541 - }
542 -
543 - $article = new Article( $threadTitle );
544 - return false;
545 - }
546 - return true;
547 - }
548 -
549 - /**
550 - * Take care of formatting a user message. We don't really need
551 - * to do anything, we just need to stop others from doing stuff.
552 - */
553 - static function formatUserMessage( $subject, &$text, $signature ) {
554 - return false;
555 - }
556 -
557 - static function afterUserMessage( $user, $article, $subject, $text, $signature, $summary, $editor ) {
558 - global $wgLqtTalkPages;
559 -
560 - $talk = $user->getTalkPage();
561 -
562 - if ( $wgLqtTalkPages && LqtDispatch::isLqtPage( $talk ) ) {
563 - // Need to edit as another user. Lqt does not provide an interface to alternative users,
564 - // so replacing $wgUser here.
565 - global $wgUser;
566 -
567 - $parkedUser = $wgUser;
568 - $wgUser = $editor;
569 -
570 - $title = preg_replace( "{/[^/]+}", "", $article->getTitle()->getBaseText() );
571 - $baseArticle = new Article( Title::newFromText( $title ) );
572 - $threadTitle = preg_replace( "{.*/([^/]+)}", '$1', $article->getTitle()->getBaseText() );
573 -
574 - LqtView::newPostMetadataUpdates(
575 - array(
576 - 'talkpage' => $baseArticle,
577 - 'text' => $text,
578 - 'summary' => $summary,
579 - 'root' => $article,
580 - 'subject' => $threadTitle,
581 - 'signature' => $signature,
582 - )
583 - );
584 -
585 - // Set $wgUser back to the newly created user
586 - $wgUser = $parkedUser;
587 -
588 - return false;
589 - }
590 -
591 - return true;
592 - }
593 -
594532 public static function onMakeGlobalVariablesScript( &$vars ) {
595533 $vars += self::$scriptVariables;
596534

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r81612Per CR r66438 and IRC, revert User::leaveNewMessage for now. Copied the funct...btongminh22:44, 6 February 2011

Status & tagging log