mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-28 01:30:15 +00:00
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
This commit is contained in:
parent
09643dc7b4
commit
4d8b977ff9
3
Echo.php
3
Echo.php
|
@ -403,9 +403,6 @@ $wgEchoNotifications = array(
|
|||
),
|
||||
);
|
||||
|
||||
// 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;
|
||||
|
||||
|
|
61
Hooks.php
61
Hooks.php
|
@ -375,14 +375,6 @@ class EchoHooks {
|
|||
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 @@ class EchoHooks {
|
|||
* @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 @@ class EchoHooks {
|
|||
}
|
||||
|
||||
// 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 @@ class EchoHooks {
|
|||
// 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
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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.",
|
||||
|
|
|
@ -51,7 +51,7 @@ abstract class EchoDiscussionParser {
|
|||
$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 );
|
||||
|
|
Loading…
Reference in a new issue