Kmuthu has uploaded a new change for review.

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

Change subject: Show orange alert when the message is posted on flow
......................................................................

Show orange alert when the message is posted on flow

Bug: T137954
Change-Id: Ie742b2d0ecfa8dfc48e820923516f2ca4f90ffa5
---
M Flow.php
M Hooks.php
2 files changed, 14 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/40/315740/1

diff --git a/Flow.php b/Flow.php
index 813f92c..108df88 100644
--- a/Flow.php
+++ b/Flow.php
@@ -126,6 +126,7 @@
 $wgHooks['ApiFeedContributions::feedItem'][] = 
'FlowHooks::onContributionsFeedItem';
 $wgHooks['AbuseFilter-computeVariable'][] = 
'FlowHooks::onAbuseFilterComputeVariable';
 $wgHooks['AbortEmailNotification'][] = 'FlowHooks::onAbortEmailNotification';
+$wgHooks['AbortOrangeAlert'][] = 'FlowHooks::onAbortOrangeAlert';
 $wgHooks['EchoAbortEmailNotification'][] = 
'FlowHooks::onEchoAbortEmailNotification';
 $wgHooks['BeforeEchoEventInsert'][] = 'FlowHooks::onBeforeEchoEventInsert';
 $wgHooks['ArticleEditUpdateNewTalk'][] = 
'FlowHooks::onArticleEditUpdateNewTalk';
diff --git a/Hooks.php b/Hooks.php
index 1345ac0..9550ccb 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -1015,6 +1015,19 @@
                return true;
        }
 
+       public static function onAbortOrangeAlert( $user, $title ) {
+               if( $title->getNamespace() === NS_TOPIC ) {
+                       $storage = Container::get( 'storage.workflow' );
+                       $uuid = WorkflowLoaderFactory::uuidFromTitle( $title );
+                       $workflow = $storage->get( $uuid );
+                       if ( $workflow ) {
+                               $boardTitle = $workflow->getOwnerTitle();
+                       }
+                       if ( $user->getTalkPage()->equals($boardTitle) ) {
+                               return false;
+                       }
+               }
+       }
 
        public static function onInfoAction( IContextSource $ctx, &$pageinfo ) {
                if ( $ctx->getTitle()->getContentModel() !== 
CONTENT_MODEL_FLOW_BOARD ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie742b2d0ecfa8dfc48e820923516f2ca4f90ffa5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Kmuthu <kmu...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to