Commit graph

1346 commits

Author SHA1 Message Date
TChin ceeba5efe6 Replace deprecated Title::newFromIDs
Bug: T291288
Change-Id: I259d3f8d4c4fc7cd8ce008f3e63d1208c2b002b7
2021-10-01 16:22:36 -04:00
Alexander Vorwerk 393aace621 Use namespaced CentralAuthSessionProvider
Change-Id: I56fbd065cbb4f1f0c882759e8a5d6d0ffb4dcec1
2021-09-29 22:28:47 +02:00
Umherirrender 58fb5c28a7 Implement MessageLocalizer in EchoEventPresentationModel
Change-Id: I759a4797ec143f9434d2aa00c84fd8021eda6ccb
2021-09-27 20:32:52 +02:00
Alexander Vorwerk 89dec69155 Avoid using MWNamespace
The MWNamespace class has been deprecated in favor of the NamespaceInfo
service. All methods in the MWNamespace should be replaced with the
equivalent methods of the NamespaceInfo service.

Bug: T291389
Change-Id: I396c50c7537b21b2f88dd9433180a8317c5c27f3
2021-09-26 16:40:27 +02:00
Umherirrender a0cb29f1a2 Check for empty strings in markasread query param
explode always returns an array with one item, even for the empty string
Filter out every possible empty string

Change-Id: I0cf0794c0f3e0eedab7e5626e973d8458b28e46a
2021-09-20 22:57:17 +02:00
Umherirrender 76227585f9 Avoid non-namespaced aliases for Wikimedia\Rdbms namespace
Change-Id: Ic924c72cb06d09bebd42272f204c3666ce62844b
2021-09-18 20:06:54 +02:00
libraryupgrader 43efb95e8b build: Updating composer dependencies
* mediawiki/mediawiki-phan-config: 0.10.6 → 0.11.0
* php-parallel-lint/php-parallel-lint: 1.3.0 → 1.3.1

Change-Id: If2e235fb97c0d39c3c14ba7c423ef45f5c0013d0
2021-09-08 23:40:19 +00:00
James D. Forrester a47a421696 Alter use of deprecated methods to ones called 'Primary'
This extension already depends on MW 1.37, so all these methods exist.

Bug: T254646
Depends-On: I9a90b4f74eb65cd9e20ae9faa6d1949be96543c0
Change-Id: Iebfdd33d3a967c87fbf87382a010a01da5cd4fc8
2021-09-03 17:46:20 -07:00
jdlrobson bd02290724 You have talk page messages item should never have icon
talk-alert copies the mytalk link but does not disable the icon.
In future this will cause an unexpected icon to appear on the
message bar which is not wanted.

Change-Id: Icd585ad846275a140eb08edf99e1b27257484941
2021-09-03 19:22:12 +00:00
jenkins-bot d94e62fde5 Merge "Push: Make default notification options mirror web if push is enabled" 2021-08-29 03:57:37 +00:00
jenkins-bot 7e9565cba1 Merge "Fix camelCase of getUserEnabledEventsBySections" 2021-08-23 20:48:28 +00:00
Matěj Suchánek 628122e155 Fix camelCase of getUserEnabledEventsBySections
Change-Id: I14b6750f7f3cc5334e3143f0e85ca033681b4e35
2021-08-20 17:03:28 +00:00
Matěj Suchánek 6cd82d25a7 Make DEFAULT_SECTION a constant
Change-Id: I565f1e127cfffcbdad8fe5f6cb81a71bf86136f8
2021-08-20 18:59:34 +02:00
jenkins-bot 31a5ab4e7b Merge "Parse messages in hook onSkinTemplateNavigationUniversal" 2021-08-20 08:06:48 +00:00
Umherirrender 6c3dc7449f Parse messages in hook onSkinTemplateNavigationUniversal
Using 'text' in skins must provide a string,
not a message (see Skin->makeLink)
Avoid also global state by using the SkinTemplate as ContextSource for
the message

Change-Id: Ie736487023d7aeb31cdb1829ba59adeb0ba2b022
2021-08-20 00:44:31 +02:00
Umherirrender b4617bfa31 Use EchoEventPresentationModel::msg inside models
Avoid global state for the message

Change-Id: I0a961aeed9c352ebbe24d07f0986cdac2c457e37
2021-08-20 00:39:39 +02:00
jenkins-bot 5cfc33d546 Merge "Add notifiertypes parameter to ApiEchoNotifications" 2021-08-19 05:06:57 +00:00
jenkins-bot fa5a623be0 Merge "Move isBundleExpandable to EchoAttributeManager" 2021-08-19 02:02:46 +00:00
jenkins-bot 25439c471b Merge "Use constant in EchoAttributeManager::getNotificationSection" 2021-08-19 02:02:44 +00:00
Matěj Suchánek 199c9084d4 Move isBundleExpandable to EchoAttributeManager
It's an attribute, so it is definitely the manager's
responsibility. Unit test case included.
(EchoDataOutputFormatter really calls for becoming a service.)

Change-Id: If2658dd8c107246158cd93cbb233d8af62fd4424
2021-08-18 18:23:22 -07:00
Michael Holloway 4a5d1d5ad3 Push: Make default notification options mirror web if push is enabled
Bug: T288770
Change-Id: I445b7a302b7be615a4b796fd8cd946c2a0f98a4e
2021-08-18 17:58:44 -04:00
Michael Holloway 5eb4c6cd1d Add notifiertypes parameter to ApiEchoNotifications
Previously, ApiEchoNotifications returned only events which were
enabled for the `web` notifier type. With this change, the notifier
type or types to consider can be specified by argument to the new
`notifiertypes` parameter.

This change is required so that the apps can request notification
content from the API for push notifications.

Bug: T287909
Change-Id: I2d1155e113f2defb0f02416a7a659c3ee162d3a6
2021-08-17 10:27:14 -04:00
jenkins-bot 8032317d9c Merge "Only ignore user muting for notifications on your talk page (not subpages)" 2021-08-12 06:47:32 +00:00
Matěj Suchánek ab8ea040ca Use constant in EchoAttributeManager::getNotificationSection
And as a bonus, add a unit test case to solve the todo.

Change-Id: Ic2e13eae6583155230be6c184db4836f28378483
2021-08-11 11:27:55 +02:00
jenkins-bot afe6a50d3a Merge "Link to the section (if known) from the orange banner" 2021-08-06 09:27:41 +00:00
Bartosz Dziewoński a6db7325e3 Only ignore user muting for notifications on your talk page (not subpages)
Bug: T288112
Change-Id: I41b8774fe0aea836c771c49ce6542156b686707a
2021-08-04 17:36:50 +02:00
Petr Pchelko e609db33ff Replace deprecated UserLoadOptionHook
Bug: T286576
Change-Id: I36d59813f25268097b822919d4236a41e0ea363a
2021-08-03 07:28:31 -07:00
jenkins-bot d9f43ee2f0 Merge "Replace deprecated UserSaveOptions hook" 2021-08-03 14:20:36 +00:00
jenkins-bot 822e623b7d Merge "Fix variable choice in NotificationController::notify" 2021-08-02 15:40:24 +00:00
jenkins-bot 5566f84378 Merge "Turn push notification token list into a circular buffer." 2021-07-30 14:46:10 +00:00
DannyS712 5d3c416672 Remove ParserTestTables hook handler.
This hook is no longer called in MW 1.36+ by core, and this
extension already requires MW 1.37+

See I5124789fac333a664b73b4b4a1e801ecc0a618ca

Change-Id: I420c2a231cc1c7d6a350a1f04f7c7d4fd942b377
2021-07-30 04:00:17 +00:00
Dmitry Brant 6c5a88107c Turn push notification token list into a circular buffer.
At the moment we support a maximum of 10 tokens per user for subscribing
to push notifications, stored as a basic list that runs out when the
limit is reached.  There may, however, be some edge cases where an app
registers a token and then forgets to unregister it (and repeats this 10
times), after which time it will be unable to register any new token.

This changes the token list to behave more like a circular buffer, by
simply deleting the oldest token before inserting the new one. This way
an app could register a new token even in the rare case of forgetting
the previous ten.

Change-Id: I387de63460882e4e56d1aa6db1f78d73a0495208
2021-07-29 17:22:57 -04:00
Ottomata 7336a1a67c Finalize migration of EchoMail and EchoInteraction to Event Platform
Also remove produciton of inactive Echo schema.

Bug: T287210
Change-Id: Ifc7f5aa22e62e7308f729de5a7fcf3fad9519615
2021-07-28 19:29:26 +01:00
Matěj Suchánek e30b466d9c Fix variable choice in NotificationController::notify
I believe this is a bug. Individual user's option ($userNotifyTypes)
should not influence the options for all users ($notifyTypes).

This piece of code was first introduced in
I51600bbb26594323831d22bc35d34587ff146d47.

Change-Id: I32d56891ac68e82734813280505b4a57d5427f8c
2021-07-28 13:13:00 +02:00
TChin 113230aaed Replace deprecated UserSaveOptions hook
Bug: T287472
Change-Id: I170cd7f5676459f83e7b1abadf5485486b8caaab
2021-07-27 15:24:51 -04:00
jenkins-bot 9e9303221e Merge "SpecialDisplayNotificationsConfiguration: Fix default values of core prefs" 2021-07-27 18:32:19 +00:00
jenkins-bot 0364d96af3 Merge "SpecialDisplayNotificationsConfiguration: Use OOUI checkboxes" 2021-07-27 18:32:18 +00:00
Bartosz Dziewoński 0341634e45 SpecialDisplayNotificationsConfiguration: Fix default values of core prefs
Some of Echo's subscription user preferences are mapped to existing
user preferences defined in core MediaWiki. However, this special page
was checking the Echo preference names, returning incorrect values.

This affected the edit-user-talk preference and watchlist preferences
(not available with the default configuration).

Change-Id: I2de7553f82434505c000c30a71b9f90c4490482b
2021-07-27 19:53:58 +02:00
Bartosz Dziewoński b826dd263c SpecialDisplayNotificationsConfiguration: Use OOUI checkboxes
On some systems, when they are disabled, checked and unchecked
checkboxes are not that easy to distinguish. They're really bad
for me on Windows (apparently a bit less bad on macOS).
https://phabricator.wikimedia.org/F34567120

OOUI checkboxes are clearer (since they're bigger and the
check icon has higher contrast against the background).
https://phabricator.wikimedia.org/F34567121

Change-Id: I124c7e1874d50d5f3883ffcc5264da46ae012e0a
2021-07-27 19:33:30 +02:00
DannyS712 4cc8233ee5 DiscussionParser: fetch UserNameUtils service outside of loop
Change-Id: I6c523dcc2ca1e06136f2f5ad18c0ac371c7f9494
2021-07-26 09:40:49 +00:00
DannyS712 f13dd018c7 Enable and fix ReturnTypeDeclaration sniff
Libup decided to disable the sniff, fix the issues instead

Change-Id: Ibac1c3f32af19edff3f428928efe578d97061b07
2021-07-24 04:36:30 +00:00
libraryupgrader 17a644263a build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 36.0.0 → 37.0.0
  The following sniffs are failing and were disabled:
  * PSR12.Functions.ReturnTypeDeclaration.SpaceBeforeReturnType

npm:
* svgo: 2.3.0 → 2.3.1
  * https://npmjs.com/advisories/1754 (CVE-2021-33587)
* postcss: 7.0.35 → 7.0.36
  * https://npmjs.com/advisories/1693 (CVE-2021-23368)
* trim-newlines: 3.0.0 → 3.0.1
  * https://npmjs.com/advisories/1753 (CVE-2021-33623)

Change-Id: Id866782d39ac02a329bd79539f2d52392fffd296
2021-07-24 01:48:06 +00:00
jdlrobson b4ec1eda88 Fix display of user messages orange bar
The icon in Vector is copied across when Vector is loaded before
Echo in LocalSettings.php

Change-Id: Ida8c78e5c723f9628928f0293f43b2d67616888f
2021-07-22 13:21:53 -07:00
jenkins-bot e8430bd44a Merge "Update vector badge styles" 2021-07-22 17:59:38 +00:00
bwang b0aaa2e4ec Update vector badge styles
- Override echo icon styles for modern vector
- Reverts https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Echo/+/704862

Bug: T285259
Change-Id: Id71d3e248dc6d0ee24278e0ecfbcf8691e1da24b
2021-07-22 11:53:36 -05:00
Petr Pchelko a10b0b07c8 Use CentralIdLookupFactory and pass UserIdentity
Change-Id: I44144df7cf244eb867c1b261c10cc29b020f8409
2021-07-21 19:23:42 -07:00
Matěj Suchánek 3f05f8a71b Drop unused property and inject a service to SpecialDisplayNotificationsConfiguration
Change-Id: I0f238b863638245eef381e540da7d610d01bd25b
2021-07-17 10:40:45 +00:00
jenkins-bot a6dbadb006 Merge "Avoid using User::setOption()" 2021-07-17 10:29:45 +00:00
ZabeMath 3befbe0a69 Avoid using User::setOption()
User::setOption() is deprecated and should be replaced with UserOptionsManager::setOption()

Bug: T277818
Change-Id: I001301fb95635c421a0bbb921fd909c5312dc896
2021-07-17 09:52:53 +00:00
bwang fbde7bd61b Add icon property to echo link data for modern Vector
Bug: T285259
Change-Id: I995f877a6e8574a519aedece31e7889b9735366a
2021-07-16 15:05:29 +00:00