Commit graph

1236 commits

Author SHA1 Message Date
James D. Forrester eec3ac85bb Use User->isRegistered(), not deprecated isLoggedIn()
Bug: T270450
Change-Id: Ieb3f78a7e5f71fc28f31c01d981d246cdd895581
2020-12-17 18:32:42 -08:00
Umherirrender d7556b1d96 Add missing @var and improve documentation
Change-Id: I729d5ff5afd4d45022fa0a4e42d060d35543b567
2020-12-17 20:55:49 +01:00
Umherirrender 1a922d4443 Remove unused SpecialNotificationsMarkRead::$eventId
Change-Id: I37b647fb1bb35b13d72c56619db6d4007db61f82
2020-12-17 19:05:58 +01:00
libraryupgrader b391178348 build: Updating mediawiki/mediawiki-phan-config to 0.10.5
Change-Id: I8892cea01993f0ae51eebabaaf40685889124943
2020-12-10 18:20:15 +00:00
jenkins-bot 2f15134088 Merge "push: die with error if providertokens param is empty" 2020-11-10 18:24:46 +00:00
mbsantos 86d45a66ca push: die with error if providertokens param is empty
Bug: T267263
Change-Id: Icf98189726602dd8e43e1f9daf19e3f73efb91b0
2020-11-10 16:50:37 +01:00
jenkins-bot 6135c62518 Merge "Avoid enqueueing delayed jobs if not supported." 2020-11-02 16:52:31 +00:00
jgiannelos 4f4786c62c Avoid enqueueing delayed jobs if not supported.
Change-Id: Ibb065f77a67bf47daafb6caaf8a338d0bcd479e7
2020-11-02 16:06:09 +01:00
shubham656 90887d290c Modify EchoHooks.php to make hook not pass the entire special page
Bug: T257183
Depends-on: I7af57455d412dc5e93617ca0b3d6e7aac8ef500f
Change-Id: I4ec64e5d94a788d0cc1ed3c6e71096e9c830cbd1
2020-11-02 13:46:34 +05:30
jdlrobson 2f020163ee Restore old Echo styling through several reverts
These dont work. Timeless provides its own skinStyles for this module:
* Revert "Timeless skinStyles should be additive not replace"
This reverts commit 98d0d296a8.
* Revert "Use skinStyles for deciding where the text-indent should apply"
This reverts commit 8adab78547.

A new implementation in Vector means these are redundant:
*  Revert "Item label can now use overflow hidden"
This reverts commit b5dd7baa08.
* Revert "Drop text indent in modern Vector"
This reverts commit 150fc7a16c.

Bug: T264339
Depends-On: I2afc12504d7184583fa8331479125474c68017dc
Change-Id: Ifd0dd5a0479588664b772fb839dbbcd8d7c47320
2020-10-29 16:59:45 +00:00
libraryupgrader f5ff16571e build: Updating mediawiki/mediawiki-codesniffer to 32.0.0
The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.ObjectTypeHintParam
* MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationPrivate
* MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationProtected
* MediaWiki.Commenting.PropertyDocumentation.MissingVar
* MediaWiki.Usage.ExtendClassUsage.FunctionConfigUsage

Additional changes:
* Dropped .inc files from .phpcs.xml (T200956).

Change-Id: I46e3dacb3da1266ff52d614003ad911feeb7504e
2020-10-29 14:24:24 +00:00
jenkins-bot cf0e87d18e Merge "Fix DiscussionParser failing in certain languages" 2020-10-29 00:16:32 +00:00
jenkins-bot ba63c30715 Merge "Implement delayed echo notifications" 2020-10-28 17:52:37 +00:00
jgiannelos c97b8e6851 Implement delayed echo notifications
* EchoEvent now supports `extra` params for job delay and deduplication
* When Echo identifies this type of param it creates a
  DelayedEchoNotificationJob that will be executed after `delay` seconds

Change-Id: Ib0c6789dfe42e9703a67835909e5932c0054089f
2020-10-28 12:11:15 +01:00
Thiemo Kreuz 8880df4123 Fix DiscussionParser failing in certain languages
It appears like the initial \h in this non-Unicode regular
expression matches parts of an UTF-8 character, destroying it.
This makes the final preg_match() in this method fail, when
$output is going to be used as a pattern.

Bug: T264922
Change-Id: Iaf240bc2e0808c2f57c1f8bab2589d3207915afe
2020-10-27 20:03:18 +01:00
jdlrobson b5dd7baa08 Item label can now use overflow hidden
Since the icon is applied to the link element it is now possible
to apply overflow hidden to the label itself when its wrapped in
a span.

Bug: T264339
Change-Id: Ifdc1d152702c1f5338fd2969cccf07971d622fc7
2020-10-21 10:04:40 -07:00
James D. Forrester 61cda882f5 Drop private EchoCachedList::ONE_DAY, unused
Change-Id: I14e53bcd593161c2fb6e29a5d280615d8694ebb4
2020-09-20 13:38:01 +01:00
Reedy 2afb728a10 Fix PSR12.Properties.ConstantVisibility.NotFound
Bug: T253169
Change-Id: I506e43629a30ef34c9154b8212878255de7d90b9
2020-09-19 21:26:38 +00:00
jgiannelos 4abfbd3c96 Normalize eps_topic
* DB changes
 - Create a table for push topics NameTableStore
 - Add a foreign key on subscriptions to normalize push topics

* Implement NameTableStore to normalize topics
* Update DB query joins to include topic from foreignkey
* Adapt code to use IDs instead of the actual topic

Bug: T261756
Change-Id: Ia7589f4a607993352d45b2dd3bcb3867d12d6e97
2020-09-14 15:52:23 -04:00
Reedy 257de880c1 Make use of BatchRow(Iterator|Writer)::setCaller
Bug: T261014
Change-Id: I51df93a9ed998c25e632c35b0fcc531615ddfb80
2020-09-05 03:45:55 +00:00
Reedy 82896eff62 Ignore usage of $wgUser
Bug: T262110
Change-Id: Ia4a24d0216ce33d3ae915c12619c149d54d321b2
2020-09-05 03:16:37 +00:00
jenkins-bot 763e7ab1bb Merge "Create push subscription manager group/right to clean up dead subs" 2020-08-24 10:23:31 +00:00
Michael Holloway 3513c642dd Create push subscription manager group/right to clean up dead subs
Creates a new push-subscription-manager group and an associated
right, manage-all-push-subscriptions. The purpose of this is to
allow privileged accounts to purge expired subscriptions from the
database on behalf of other users. A user with this right will be
permitted to delete any subscription from the DB based on the token
alone. For all other users, deletion requests will be limited to
those associated with the requesting user's central ID.

This right will be granted to a bot account on Metawiki associated
with the Wikimedia push notifications service, and the push
notifications service account will make push subscription delete
requests to the API for subscriptions for which vendor APIs return bad
subscription responses.

Additionally, the providertoken parameter to ApiPushSubscriptionDelete
is updated to allow multiple providertoken values.

Bug: T259148
Change-Id: Ia6c17588ee94e6be74e5e3a75eb33e38f172fc93
2020-08-20 17:08:48 -04:00
Michael Holloway 74c1a5bbc7 Collect baseline event and notification stats
Adds statsd counters for events and notifications, both overall and by
type. (Events and notifications have a one-to-many relationship, as
notifications may be created for multiple users per event.)

These are specifically of interest to estimate the potential volume of
notifications to be handled by the new push service.

Bug: T260836
Change-Id: I41974cd30a90c674f56003e15d540a5581d19c7d
2020-08-20 13:55:03 -04:00
Mateus Santos c188dac23f push: send apns topic when present
1) send apns topic when present in subscription metadata
2) check if subscription metadata is a valid JSON string
3) make epp_id column at echo_push_provider table auto_increment,
otherwise it will fail when trying to add a second row in the table

Bug: T259394
Change-Id: I785435e9f2d4ba9c14977d431d271f0fa2d0c795
2020-08-18 13:21:20 +00:00
jenkins-bot abb59057e9 Merge "Fix query condition building in EmailBatch" 2020-08-18 01:13:25 +00:00
DannyS712 d24df030a3 Remove legacy ApiBase::getTokenSalt() overrides
Method was removed in 1.24, extension requires MW 1.35+,
so overrides aren't used

Change-Id: Ia543a06c3fcefce3429c0031b813b742feee76f1
2020-08-15 05:30:58 +00:00
Matěj Suchánek 52f4babb26 Fix query condition building in EmailBatch
array_plus (+=) does a union over keys and does not merge
sequential (integer) keys like array_merge. This probably
broke the "do not notify me of seen notifications" feature.
Use cleaner syntax for query building.

Change-Id: Ie0e8d562aec94060c18eed989bb54a9484ccb5d3
2020-08-14 11:18:07 +00:00
jenkins-bot aa1f1801e4 Merge "Create and enforce a config setting for max subscriptions per user" 2020-08-13 17:03:05 +00:00
jenkins-bot 79f06475f3 Merge "Use more canonical (object)[] instead of new stdClass" 2020-08-13 11:03:26 +00:00
jenkins-bot 63e2dd4efa Merge "Remove calls to ParserOptions::setTidy()" 2020-08-13 10:19:17 +00:00
Thiemo Kreuz e5fead8b42 Use more canonical (object)[] instead of new stdClass
Both styles create the exact same object. Casting an array to an
object creates an stdClass object as well. The main benefit of this
syntax is that there is much less repetition. Everything is one
token instead of individual lines, where each line might contain a
typo.

Change-Id: Id43fa2c4b6bd5d9dbc60008427d4a9e14ae3811c
2020-08-13 09:58:14 +00:00
Thiemo Kreuz 9474b9c942 Remove Phan exceptions reported as unused
Change-Id: I89fa328e8878d64887518a3f49145b19ea599676
2020-08-13 09:25:05 +00:00
C. Scott Ananian 37261f977e Remove calls to ParserOptions::setTidy()
ParserOptions::setTidy() was already a no-op in MW 1.35, and
Echo already requires MW >= 1.35 in extension.json.
ParserOptions::setTidy() was deprecated in MW 1.35 and will be removed
in a future release.

Bug: T198214
Change-Id: I6a5378a42a6cf035296ad549525c25438803970a
2020-08-12 23:41:49 -04:00
Michael Holloway 15d48278be Create and enforce a config setting for max subscriptions per user
Creates a EchoPushMaxSubscriptionsPerUser config setting (default: 0)
that controls the maximum number of subscriptions a user may associate
with the user's central user ID.

The setting is enforced in EchoPush\SubscriptionManager::create().

To allow creating push subscriptions for development, set
$wgEchoPushMaxSubscriptionsPerUser to a positive integer value in
LocalSettings.php:

 $wgEchoPushMaxSubscriptionsPerUser = 10;

Bug: T259150
Change-Id: Ib97b6b6cbb8161dd75dad92c54b4fe4fff80c421
2020-08-12 17:58:11 -04:00
jenkins-bot 0d414cf1ec Merge "Add all ResourceLoaderModules using supported hook" 2020-08-10 20:21:21 +00:00
Thiemo Kreuz d046adfd99 Remove obsolete property name from @var docs
Change-Id: I72faac7f0f88b0e3c4f145aa1def0acae0398488
2020-08-10 12:53:14 +02:00
Ammar Abdulhamid 95a0dff88c Add all ResourceLoaderModules using supported hook
PersonalUrls hooks is not meant to be used to add RL modules,
its documentation says it's meant to "alter the user-specific
navigation links (e.g. "my page, * my talk page, my contributions" etc)."

Echo is already using BeforePageDisplay hook to add modules, let's
now register all our modules via that

Bug: T259872
Change-Id: I12616a9947ea0e574287443361e2180c42e48d4b
2020-08-09 00:35:56 +01:00
Amir Sarabadani 532fdbf294 Stop using ResourceLoaderTestModules hook
This hook is deprecated and we should use QUnitTestModule in extension.json instead

Bug: T232875
Change-Id: I7b3e22856adc64ee36e0b696e2371bb9673e4899
2020-08-03 13:18:29 +02:00
jenkins-bot d8d0e52c03 Merge "Use user IDs, not User objects, for reverted-user-id" 2020-07-28 12:11:24 +00:00
Roan Kattouw c87cae39d7 Make Echo QUnit tests run again
The automatic registration for these was broken, because
$wgResourceModules no longer contains Echo's modules (since they are now
registered in extension.json).

Instead, add the test files in tests/qunit/model/ explicitly in
onResourceLoaderTestModules. The tests in tests/qunit/mobile/ are
already added through QUnitTestModule in extension.json.

Delete the ext.echo.overlay tests, they were testing code that was
removed years ago.

Bug: T258818
Change-Id: I7b996dc8631a86033830cf532f1b8e85251788ad
2020-07-24 13:26:34 -07:00
jenkins-bot f44df2f728 Merge "Make default snippet length (150) a constant" 2020-07-24 00:03:15 +00:00
Ed Sanders 1b40b69481 Make default snippet length (150) a constant
Change-Id: Idb53b226618fa0d625c7e4713c780538bd6a76ea
2020-07-23 13:00:44 +01:00
jenkins-bot 3ea911c8a9 Merge "DiscussionParser: Use strict (in)equality" 2020-07-23 10:03:45 +00:00
Ed Sanders b5c919db25 DiscussionParser: Use strict (in)equality
Change-Id: I7c6a8453a5f7a6603c8f8c173e5bcfd3cafc25d6
2020-07-22 21:50:54 +01:00
Kosta Harlan 910df7a190 Use user IDs, not User objects, for reverted-user-id
The Revision->RevisionStore migration accidentally injected User
objects for reverted-user-id in two different places at different times.
This doesn't break, because there's backwards compatibility logic that
handles User objects appropriately, but we shouldn't be doing this.

Co-authored-by: Roan Kattouw <roan.kattouw@gmail.com>
Change-Id: I4170c207c3d4fc7f0d869c0b367b53389a70ce80
2020-07-21 13:19:30 +02:00
Kosta Harlan 07dc8ef425 Rename variable to revertedUser
See https://en.wiktionary.org/wiki/victim

"Reverted user" is more descriptive in any case.

Bug: T254646
Change-Id: I70964850e63cdd832b2cc1799161c480f283d08c
2020-07-21 13:15:09 +02:00
Kosta Harlan efecfc07dc Hooks: Use new style hook registration to allow for DI
Implement RecentChange_saveHook interface and pass Config via hook handler
declaration in extension.json.

Change-Id: I2bc5950eb6fc066b2f2a83ea84b700d02b075de9
2020-07-03 04:06:58 +00:00
jenkins-bot d891751f11 Merge "Don't make unchecked method call on object that might be null" 2020-07-01 16:07:53 +00:00
jenkins-bot a2c6b21925 Merge "Update hooks to use PageSaveComplete" 2020-06-30 10:40:51 +00:00