Also:
* Clear the newtalk flag when they mark all their edit-user-talk
read.
* Remove the section caching system. It was designed to avoid
performance problems with Flow messages, but now that standard talk pages
are in 'messages', messages should be relatively common (alerts
were already not cached by this).
* Minor cleanups to reflect that messages are not only Flow (and
a typo fix in the Gruntfile).
Bug: T108760
Change-Id: I82d7b1d08331693830d6a1749612b55e96b95cf9
The key used was empty, and therefore did not work. Use the correct
key when caching 'hasMessages' for the user to see their message
badge when receiving the first message.
Change-Id: Ib5b07854f96efed974d53267d9ed573c6ca1cf04
So we're not abusing user preferences for the last seen time.
EchoSeenTime is a small wrapper around ObjectCache that handles the
fallback to user preferences during the transition.
All JavaScript code now needs to use mw.config.get('wgEchoSeenTime').
Bug: T95839
Change-Id: Ia45ba5e30eb4564250539d04d5886d2598ebd49a
Split the notifications into 'alert' and 'message' badget with two
different flyouts. Also clean up styling and module behavior.
** Depends on ooui change Id4bbe14ba0bf6c for footers in popups.
** Depends on ooui change Ie93e4d6ed5637c for fixing a bug in
inverted icons.
** MobileFrontend must also be updated to support the new modules
in this patch I168f485d6e54cb4067
In this change:
* Split notifcations into alert and messages and display those in
two different badges.
* Create two separate flyout/popups for each category with their
notifications.
* Create a view-model to control notification state and emit events
for both the popup and the badge to intercept and react to.
* Clean up module load and distribution:
* Create an ext.echo.ui module for javascript-ui support and ooui
widgets.
* Create an ext.echo.nojs module that unifies all base classes that
are needed for both nojs and js support, that the js version
builds upon.
* Create a separate ext.echo.logger module as a singleton that can
be called to perform all logging.
* Clean up style uses
* Move the special page LESS file into nojs module so all styles
load properly even in nojs mode.
* Transfer some of the styling from JS to LESS for consistency.
* Make the 'read more' button load already with the styles it
needs to look like a button, since its behavior is similar in
nojs and js vesions, but before its classes were applied only
by the js, making it inconsistent and also making its appearance
'jump' from a link to a button.
* Delete and clean up all old and unused files.
* Moved 'Help.png' icon from modules/overlay to modules/icons for
later use.
Bug: T108190
Change-Id: I55f440ed9f64c46817f620328a6bb522d44c9ca9
To avoid using $wgLang directly. We still have to use it in
detectSectionTitleAndText for now though.
Change-Id: Ic901ed05d4e8f6291caa55d866ce58f7300880f5
Although it wasn't here even before
c94c3f3dad , loadFromRow will make
use if it if it's present. Otherwise, it's the current timestamp
(which seems odd; if we really don't need the timestamp in a
particular scenario, null would be more straightforward).
This is also public (getTimestamp()).
Change-Id: I9d88d86dde5b7f9b5965c81225a2aab4354c2baa
Follow-up I6c956738, which started trying to pull notification_timestamp out
of nowhere. Although EchoEvent::newFromRow may try to use this if it's set, it
wasn't previously getting selected and this is now causing exceptions.
Bug: T105890
Change-Id: I2dd9e268428d651813d8c43d85d54fc97634cd41
As needed by EchoEvent::loadFromRow().
Alternatively, just '*' as in MWEchoEmailBatch::getEvents().
Bug: T105890
Change-Id: I6c956738125658607d5e548efad4031c3298020f
* These tend to log errors many times in a row for the same few
users in any given time period. There is probably some usage
pattern issue in JS on top of the abuse of preferences for
such tracking state. In any case, this should help.
Bug: T95839
Change-Id: I4d57b1db43a63300a412a5de220b66081da754f1
Push the $wgEchoNotifications dependency to
NotificationFormatter::factory(), and only catch exceptions we're
actually expecting (NotificationFormatter::format()).
And clean up the logging to use structured logging while we're at it.
Change-Id: I7e18c318c5c81b6a38e55f27ef8f604654f10858
The logic to get the URL for an icon was duplicated in the
EmailFormatter and BasicFormatter. It is now in the abstract
NotificationFormatter, which EmailFormatter and BasicFormatter now
use.
Changes in logic:
* Throw an exception if an invalid notification type is provided instead
of a PHP notice
* icons using 'url' may have different ltr/rtl icons
* Throw exception if icon is supposed to have different icons for
ltr/rtl, but doesn't, instead of debug logging
The new function is static so it can be used in EmailFormatter as it
does not inherit from NotificationFormatter.
Bug: T60726
Change-Id: Ia3c01c35f58eed8cc2c039249ab1ec1a80a8abbb
Fixes: PHP Notice: Found alias defined for Userlogin when
searching for special page aliases for UserLogin.
Change-Id: Ib64d4c76d3915ae752a9c56eb9635653e0da5623
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
Old jobs were queued with array( $userId => $userId ), so there will be no
'0' index. Use array_values() since we don't care about the keys.
Change-Id: I1155d310c7fa09c728797d35d63c7cec0383511c
Rather than making each notification type opt-in to using the job queue,
make them opt-out by setting an 'immediate' => true flag.
Configure the 'edit-user-talk' notification type to be immediate since
it should not lag behind the orange bar indicator.
Change-Id: I707bc01a97082887c3f1c353d45cdf1c1eaeff04
EchoNotificationDeleteJob now only processes one user at a time. If
given multiple user ids, it will queue individual jobs for each user id
rather than processing many at once.
Bug: T102574
Change-Id: I627f059280d8fab3854d9ca8417f22179478772c
Instead, have subclasses implement checking required parameters
manually.
The only subclass that was using this was EchoBasicFormatter and has
been updated.
Change-Id: I23e2fa7044e0d59125530024f8c6c35516d3b90b