Legoktm has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/162379

Change subject: Add Flow support
......................................................................

Add Flow support

Implements basic functionality, with some issues:
* Topic titles are not wikitext, so preview is misleading
* New posts are not marked as bot in RecentChanges
* Double signature (LQT also has this issue)

Bug: 71082
Change-Id: I7b27cca71111c23ed7fa3796288602a50720240c
---
M includes/job/MassMessageJob.php
1 file changed, 17 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MassMessage 
refs/changes/79/162379/1

diff --git a/includes/job/MassMessageJob.php b/includes/job/MassMessageJob.php
index 7d54ed6..55146b2 100644
--- a/includes/job/MassMessageJob.php
+++ b/includes/job/MassMessageJob.php
@@ -149,9 +149,11 @@
                        }
                }
 
-               // See if we should use LiquidThreads
+               // If the page is using a different discussion system, handle 
it specially
                if ( class_exists( 'LqtDispatch' ) && LqtDispatch::isLqtPage( 
$title ) ) { // This is the same check that LQT uses internally
                        $this->addLQTThread();
+               } elseif ( $title->hasContentModel( 'flow-board' ) ) {
+                       $this->addFlowTopic();
                } else {
                        $this->editPage();
                }
@@ -189,6 +191,20 @@
                $this->makeAPIRequest( $params );
        }
 
+       function addFlowTopic() {
+               $user = MassMessage::getMessengerUser();
+               $params = array(
+                       'action' => 'flow',
+                       'page' => $this->title->getPrefixedText(),
+                       'submodule' => 'new-topic',
+                       'nttopic' => $this->params['subject'],
+                       'ntcontent' => $this->makeText(),
+                       'token' => $user->getEditToken(),
+               );
+
+               $this->makeAPIRequest( $params );
+       }
+
        /**
         * Add some stuff to the end of the message
         * @return string

-- 
To view, visit https://gerrit.wikimedia.org/r/162379
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7b27cca71111c23ed7fa3796288602a50720240c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MassMessage
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to