I tried to stick as close to the existing code as possible.
Special:Notifications is slightly different from the overlay,
however. I made it add .mw-echo-unread class for consistency,
but that JS doesn't record seen time (it only loads older
entries), not does the CSS fadeout apply there (it marks
everything as read as soon as it's displayed, so different
behavior from overlay)
PS: I'm not sure about browser compat for the fadeout. But
even if some obscure browsers don't support this, meh. It's
not an "important" feature that can't be missed.
Bug: T94634
Change-Id: Ibb201823fb52ef8a3d5eaa39b0b724ede8d271d1
The only issue is that the badge is not up to date till
you refresh the page, I think that's fine for now
Change-Id: I585b4cc185bf859ddb06829df75309ff3d56d8b8
* Moved most of the content from notify to getEventNotifyTypes
* Added phpunit test verifying per-event config overrides defaults
* Remove special-snowflake welcome handling with proper configuration
Change-Id: Ic1aae11d37f23f2b7b8abe3c1edaa414e29be021
Core titleCache doesn't do what I expect it to do, issuing
Title::newFromId( 1 ) mulitple times would issue multiple
idential queries to the database. It doesn't return what's
already in the cache.
The goal of this patch is to batch load titles via newFromIDs,
and save the number of mysql queries
Change-Id: I8fe767ac2669e67bdf7d17eecccfc0dcb6b5fc7d
The new locateUsersWatchingTitle implementation could end up returning
thousands of users, currently on enwiki there are 25 titles with more
than 10k subscribed users and aprox 550 titles with more than 1k subscribed
users.
This switches the user collection to an iterator based implementation so that
we no longer need to have the entire users list at any one time.
Change-Id: I3d3fa9328f348bb48682d3658622952ce82d3925
This will be used for marking a notificaiton as read when
a user visits a target page. The new table should keep the
volume as low as possible for fast data loopup. records
should be removed from the table once it's marked as read.
Change-Id: I605cbc79adfc12d22bd889c5bb513d05c479fe6e
* Shared function can be put in the abstract class and this also enforces some interface methods
* Initialize a default dbFactory when it's not passed to the mapper
Change-Id: I1033dafaa90a1f683fbe9ad69bed04f4844e357b
Replace implementation specific code with generalized user-locator
implementations that can be re-used by more notifications in other
extensions.
This patch adjusts the `user-locators` notification parameter to allow
arrays which facilitate passing options to the locator.
Previously(still works):
'user-locators' => array( 'foo', 'bar' ),
New functionality:
'user-locators' => array(
'foo',
array( 'bar', 42 )
)
In the second example the callback specified by `bar` will receive
an EchoEvent as the first argument and array( 42 ) as its second
argument.
Change-Id: I7305279bc91d1e40e7054e2fd42a819a35526b82
There are a variety of generic strategies you could define to choose
which users should be notified about an event, such as 'users watching
the title' or 'talk page owner' (User_talk only).
This adds a new way to generically implement these in Echo and expose them
to other extensions rather than having each extension implement these
generic strategies themselves.
This patch only converts one notification, edit-user-talk. The remaining
notifications will be converted in future patches. The first user of this
will be Flow for notifying all users watching a particular talk page in
I4e46a9c003fbdde274b20ac7aef8455eab4a5222
The users watching title implementation provided here is minimalist, a larger
refactor to accomidate pages with thousands of watchers is being handled
in I3d3fa9328f348bb48682d3658622952ce82d3925
Change-Id: I19bb6a794d22565f3bb5421de92426d390197796
* Get rid of EchoBackend by separating responsibilities into smaller objects
* Move main fetchNotification logic from API to a more appropriate place
* Add more unit testing coverage
Change-Id: I42f4d7566543332588431c21c220c0d64d026b70
Otherwise, it explodes when trying to run tests via PHPUnit:
Error: 1146 Table 'osmiumwiki.parsertest_echo_notification' doesn't exist (localhost)
Change-Id: I8a3e0171ab022e8e2973ea8bed9aacba73a35f34
This will allow users to disable them if they wish to.
By default, both web and email are enabled for all users, which
is the current default.
This also fixes a bug in the EventLogging portion where user rights
changes would be logged with a user id of -1, instead of the
actual user.
Bug: 55337
Change-Id: I026b9392b085e295fbcd375095c9aed682fc29a2
If a user is watching his/her own talk, an edit to the talk page
may trigger an echo notification and watchlist notification. We
only want to send one of them
Depends on core patch: https://gerrit.wikimedia.org/r/#/c/114682/
Bug: 53569
Change-Id: Ib1bb71e047789d3a857f028aaa45384022bb35c7
Fallback to 'emailsender' message if not set
Change-Id: Id136692b80b7582a515501672259394e8db74112
Follows-Up: Id20e4ec1cdae94fadb278146cd72d5a9b247dccf
* 9e4e58bce8d10f65cf298b39f48e86c41b6a82b8 separated mediawiki.ui.button
into a separate module (for modularity, and potentially to allow
wiki content to use mw.ui buttons by default in the future).
* Currently, the button code is in both mediawiki.ui and
mediawiki.ui.button for backwards compatibility. However, it will be
removed from mediawiki.ui when existing uses transition over.
* Echo does not use any mw.ui features other than buttons.
Change-Id: I429d8f2424d6218439eed01fe5ea6497e7697ba2
If a user is mentioned in an area that does not have a section
title (for example, the lead section of a talk page), use the new
'notification-mention-nosection' message, to avoid an awkward and
incorrect "[[Page#|]]".
Bug: 52507
Change-Id: I40628b76c460c79008053222c9780bb23549731d
Cache groups should only be used when it is worth to have the
module(s) in a separate request. Echo is relatively small and
stable in terms of cache combination, not worth it to force
its modules to be in a separate http request as all other modules.
Change-Id: I198b5664d662c93c593d048efcfaf4aac765a6b9
Core styles for Monobook include high-specificity background: transparent;
rule for #p-personal li a, we need to match it to set our background.
Also change hover behavior: switch to a deeper orange instead of
default white, similarly to how the badge already behaves.
Partially reverts I682182fe.
Bug: 56214
Change-Id: I9f343264c395ecf09c1e34e03d208ec2119fb622
This patch updates Echo to revision 6081131 of Schema:Echo, adding a 'rev_id'
field and the code to populate it. The patch also increments the logging
version identifier to 1.5.
Bug: 46045
Change-Id: I4ac1a25c306b0e0983a3490a29fe3dc4aa4bfc6f
* In some languages like persian, the number 0 is represented as '.', we can't compare
'.' with either 0 or '0' to detect the no-notification status of the badge
* The markread API doesn't respect uselang param, it would return 0 instead of . in a url with uselang=fa
Note: we need to provide raw and formatted count in the API since client side javascript
doesn't provide fancy function like $wgLang->formatNum()
bug: 54575
Change-Id: I0a49828253ec346ed27c5b9a976f8bdff4e1fa90
mediawiki.api and mediawiki.Uri are desktop-only modules that are
not actually needed by ext.echo.base. Moving the dependency
declarations to more specific modules so that ext.echo.base is
usable by mobile notifications. ResourceLoader is smart enough to
not double-load them, so there should be no performance difference.
Also removing unused 'cancel' message.
Change-Id: I9fa8c4501e038ded9125c3b43e5207c355af2db9