Legoktm has uploaded a new change for review.

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

Change subject: Get rid of disabled 'echo-notify-show-link' preference
......................................................................

Get rid of disabled 'echo-notify-show-link' preference

This preference has been disabled since bug 47562, and doesn't make
sense to keep around given that the flyout is the main interaction most
users have with Echo.

Change-Id: I7e8ddf96dbde9a95ac01a0cc83bad396151d01bd
---
M Echo.php
M Hooks.php
M i18n/en.json
M i18n/qqq.json
M includes/DiscussionParser.php
5 files changed, 25 insertions(+), 43 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/71/223471/1

diff --git a/Echo.php b/Echo.php
index d953995..ab06542 100644
--- a/Echo.php
+++ b/Echo.php
@@ -403,9 +403,6 @@
        ),
 );
 
-// Enable notifications for all logged in users by default
-$wgDefaultUserOptions['echo-notify-show-link'] = true;
-
 // Enable new talk page messages alert for all logged in users by default
 $wgDefaultUserOptions['echo-show-alert'] = true;
 
diff --git a/Hooks.php b/Hooks.php
index deccedd..98b53b7 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -375,14 +375,6 @@
                        unset( $preferences['enotifusertalkpages']['section'] );
                }
 
-               // Show fly-out display prefs
-               // Per bug 47562, we're going to hide this pref for now until 
we see
-               // what the community reaction to Echo is on en.wiki.
-               $preferences['echo-notify-show-link'] = array(
-                       'type' => 'hidden',
-                       'label-message' => 'echo-pref-notify-show-link',
-                       //'section' => 'echo/displaynotifications',
-               );
                return true;
        }
 
@@ -591,9 +583,7 @@
         * @return bool true in all cases
         */
        static function beforePageDisplay( $out, $skin ) {
-               $user = $out->getUser();
-
-               if ( $user->isLoggedIn() && $user->getOption( 
'echo-notify-show-link' ) ) {
+               if ( $out->getUser()->isLoggedIn() ) {
                        // Load the module for the Notifications flyout
                        $out->addModules( array( 'ext.echo.overlay.init' ) );
                        // Load the styles for the Notifications badge
@@ -634,33 +624,31 @@
                }
 
                // Add a "My notifications" item to personal URLs
-               if ( $user->getOption( 'echo-notify-show-link' ) ) {
-                       $notifUser = MWEchoNotifUser::newFromUser( $user );
-                       $notificationCount = $notifUser->getNotificationCount();
-                       $notificationTimestamp = 
$notifUser->getLastUnreadNotificationTime();
-                       $seenTime = $user->getOption( 'echo-seen-time' );
-                       $text = 
EchoNotificationController::formatNotificationCount( $notificationCount );
-                       $url = SpecialPage::getTitleFor( 'Notifications' 
)->getLocalURL();
+               $notifUser = MWEchoNotifUser::newFromUser( $user );
+               $notificationCount = $notifUser->getNotificationCount();
+               $notificationTimestamp = 
$notifUser->getLastUnreadNotificationTime();
+               $seenTime = $user->getOption( 'echo-seen-time' );
+               $text = EchoNotificationController::formatNotificationCount( 
$notificationCount );
+               $url = SpecialPage::getTitleFor( 'Notifications' 
)->getLocalURL();
 
-                       if (
-                               $notificationCount == 0 || // no unread 
notifications
-                               $notificationTimestamp === false || // should 
already always be false if count === 0
-                               ( $seenTime !== null && 
$notificationTimestamp->getTimestamp( TS_MW ) <= $seenTime ) // all 
notifications have already been seen
-                       ) {
-                               $linkClasses = array( 
'mw-echo-notifications-badge' );
-                       } else {
-                               $linkClasses = array( 
'mw-echo-unread-notifications', 'mw-echo-notifications-badge' );
-                       }
-                       $notificationsLink = array(
-                               'href' => $url,
-                               'text' => $text,
-                               'active' => ( $url == $title->getLocalUrl() ),
-                               'class' => $linkClasses,
-                       );
-
-                       $insertUrls = array( 'notifications' => 
$notificationsLink );
-                       $personal_urls = wfArrayInsertAfter( $personal_urls, 
$insertUrls, 'userpage' );
+               if (
+                       $notificationCount == 0 || // no unread notifications
+                       $notificationTimestamp === false || // should already 
always be false if count === 0
+                       ( $seenTime !== null && 
$notificationTimestamp->getTimestamp( TS_MW ) <= $seenTime ) // all 
notifications have already been seen
+               ) {
+                       $linkClasses = array( 'mw-echo-notifications-badge' );
+               } else {
+                       $linkClasses = array( 'mw-echo-unread-notifications', 
'mw-echo-notifications-badge' );
                }
+               $notificationsLink = array(
+                       'href' => $url,
+                       'text' => $text,
+                       'active' => ( $url == $title->getLocalUrl() ),
+                       'class' => $linkClasses,
+               );
+
+               $insertUrls = array( 'notifications' => $notificationsLink );
+               $personal_urls = wfArrayInsertAfter( $personal_urls, 
$insertUrls, 'userpage' );
 
                // If the user has new messages, display a talk page alert
                if ( $wgEchoNewMsgAlert && $user->getOption( 'echo-show-alert' 
) && $user->getNewtalk() ) {
@@ -799,7 +787,6 @@
                // If the user has the notifications flyout turned on and is 
receiving
                // notifications for talk page messages, disable the new 
messages alert.
                if ( $user->isLoggedIn()
-                       && $user->getOption( 'echo-notify-show-link' )
                        && isset( $wgEchoNotifications['edit-user-talk'] )
                ) {
                        // hide new messages alert
diff --git a/i18n/en.json b/i18n/en.json
index 1bc0fd7..d1e2549 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -21,7 +21,6 @@
        "echo-pref-email-frequency-weekly": "A weekly summary of notifications",
        "echo-pref-email-format-html": "HTML",
        "echo-pref-email-format-plain-text": "Plain text",
-       "echo-pref-notify-show-link": "Show notifications in my toolbar",
        "echo-pref-new-message-indicator": "Show talk page message indicator in 
my toolbar",
        "echo-learn-more": "Learn more",
        "echo-new-messages": "You have new messages",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 4f73a41..a48f78f 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -42,7 +42,6 @@
        "echo-pref-email-frequency-weekly": "Option for users who want to 
receive a weekly digest of email notifications",
        "echo-pref-email-format-html": "Option for users who want to receive 
HTML email notification.\n\nSee also:\n* 
{{msg-mw|Echo-pref-email-format}}\n{{Identical|HTML}}",
        "echo-pref-email-format-plain-text": "Option for users who want to 
receive plain text email notification.\n\nSee also:\n* 
{{msg-mw|Echo-pref-email-format}}\n{{Identical|Plain text}}",
-       "echo-pref-notify-show-link": "Label for a preference which enables the 
'Notifications' link in the header and associated fly-out panel",
        "echo-pref-new-message-indicator": "Label for a preference which 
enables the new talk page message alert",
        "echo-learn-more": "Text for link to more information about a 
topic.\n{{Identical|Learn more}}",
        "echo-new-messages": "Message to let the user know that they have new 
talk page messages, displayed in the personal menu (top-right corner on Vector 
and Monobook).\n\nKeep this message short. It '''should not''' end in a full 
stop.",
diff --git a/includes/DiscussionParser.php b/includes/DiscussionParser.php
index e9b9980..7db7eec 100644
--- a/includes/DiscussionParser.php
+++ b/includes/DiscussionParser.php
@@ -51,7 +51,7 @@
                        $notifyUser = User::newFromName( $title->getText() );
                        // If the recipient is a valid non-anonymous user and 
hasn't turned
                        // off their notifications, generate a talk page post 
Echo notification.
-                       if ( $notifyUser && $notifyUser->getID() && 
$notifyUser->getOption( 'echo-notify-show-link' ) ) {
+                       if ( $notifyUser && $notifyUser->getID() ) {
                                // if this is a minor edit, only notify if the 
agent doesn't have talk page minor edit notification blocked
                                if ( !$revision->isMinor() || 
!$user->isAllowed( 'nominornewtalk' ) ) {
                                        $section = 
self::detectSectionTitleAndText( $interpretation, $title );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7e8ddf96dbde9a95ac01a0cc83bad396151d01bd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com>

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

Reply via email to