Commit graph

64 commits

Author SHA1 Message Date
DannyS712 0917ab16cc Reduce use of Revision objects in ThanksHooks
Can't remove entirely, since the hooks don't have replacements yet,
but can prepare for the switch while waiting and remove use of
Revision objects to the extent possible

Bug: T251073
Bug: T251593
Change-Id: I5f9e41d58c8d1693b23c84bbfe085d3b33ad0c75
2020-05-27 23:06:13 +00:00
James D. Forrester 84448301ef Use QUnitTestModule instead of deprecated ResourceLoaderTestModules
CI already ensures that MobileFrontend is loaded alongside Thanks, so
the defensive check in the code isn't needed; ext.thanks.mobilediff is
defined statically, it's just injected into the page dynamically in the
onBeforeSpecialMobileDiffDisplay hook handler.

Bug: T232875
Change-Id: I5612a9be65f4d4adf4912645856540dbb04d2b34
2020-05-11 19:43:17 +00:00
Reedy 7768edc7ec Update to use Flow\Notifications\FlowPresentationModel
Change-Id: I419af406f86c495d1448d2be07f8e891bdd7e47a
Depends-On: I25c65cbbc6d43dae7b2515a7b93f02b7180ba89f
2020-04-18 00:19:57 +00:00
DannyS712 859f6a4b57 BeforeSpecialMobileDiffDisplay hook: Prepare to accept RevisionRecord
So that MobileFrontend can pass Revision objects without breaking

Bug: T246284
Change-Id: I2adb63bac52bd721ebffd06082f9c553f50d5cd8
2020-04-15 04:48:50 +00:00
ArtBaltai b6b2c3dfdb Replace usage of deprecated Page in favor of WikiPage/Article
change comment for Page argument

Bug: T239975
Change-Id: If3243d59b129360e1790c68ea193de27d1943462
2020-02-21 08:49:12 +00:00
libraryupgrader a54db3f84e build: Updating composer dependencies
* jakub-onderka/php-console-highlighter: 0.3.2 → 0.4.0
* mediawiki/minus-x: 0.3.2 → 1.0.0
* mediawiki/mediawiki-phan-config: 0.9.0 → 0.9.1

Change-Id: If99754eddc6ba783278142fdd880e39211dd60af
2020-01-31 12:20:18 +00:00
jenkins-bot 388b63445d Merge "build: Updating mediawiki/mediawiki-phan-config to 0.9.0" 2020-01-02 09:04:54 +00:00
Fomafix 5e6f6d8d0f Use $this->getConfig() instead of global variable
Change-Id: Id368f934087b97d33d6404ceed5099034973509a
2019-12-28 21:37:59 +01:00
Fomafix 1a4d901caa Remove bad tab in source code
Change-Id: I868b36dadb2ad0166e94277eda9993fe38cfec37
2019-12-28 20:55:52 +01:00
libraryupgrader 5e473e662d build: Updating mediawiki/mediawiki-phan-config to 0.9.0
Additional changes:
* Added .eslintcache to .gitignore.

Change-Id: I6b7b79e697d7555bb1316fa3d4f821f7a81e02e4
2019-12-28 17:12:46 +00:00
DannyS712 9f495fcedb Don't allow thanking system users
Bug: T237356
Change-Id: I3d7968276a59a66ed4d1931b03310e571d070167
Depends-On: I73f25a10df2c28a69f612eb1db3e91b7125383d9
2019-11-05 22:50:12 +00:00
Umherirrender b8e317d9fb build: Updating mediawiki/mediawiki-phan-config to 0.8.0
Bug: T235049
Depends-On: I381718e52f8764544adec011ca8ca7dde6b489a4
Change-Id: Ia7e7b34b5d263317215d6d35530fe48acec9c858
2019-11-05 18:46:52 +01:00
Derick Alangi 1acb40ee42 Avoid using deprecated Revision class constants, use RevisionRecord
Change-Id: I1932a66c5e6d815680d79770116111266c9db9e3
2019-10-21 15:12:06 +01:00
David Barratt c773e01787 Read the block status from the replicas for the 'thank' link
User::isBlocked() by default reads from the replicas;
PermissionManager::isBlockedFrom() reads from master by default. The
'thank' link is not critical so it should be read from the replicas.

Bug: T231617
Change-Id: I262ed63df82e97862a8dfc8da49fc09465ac8507
2019-08-30 13:28:59 +01:00
Matěj Suchánek 2c94ba17ed Replace $wgUser
Bug: T159299
Change-Id: I023c46a99b96ae9141ac75830c03979e90263ae0
2019-08-27 14:20:39 +02:00
jenkins-bot e044574c08 Merge "Improve EchoCoreThanksPresentationModel" 2019-08-06 23:14:51 +00:00
Matěj Suchánek 8a05d03f67 Improve EchoCoreThanksPresentationModel
Call EchoEvent::getRevision to use cache.

Don't hide notification about thanks for log
when just the comment was hidden.

Also simplify code using ternary ?:

Change-Id: I279291727ecd404db18dd68699744284e17a27ef
2019-08-06 10:28:15 +02:00
Martin Urbanec 003172c157 SECURITY: Do not let users thank for a log entry if actor was deleted
This prevents users from accessing information about the actor
by abusing uselang=qqx and the thank button.

Bug: T224240
Change-Id: I3f42d56874776cfa0c9d364217f43253efc14782
2019-07-11 15:39:16 -07:00
Thalia 810de9afbd Allow partially blocked users to use Thanks
Only prohibit users from using Thanks if they are blocked from the
associated page. This allows partially blocked users to use thanks
most of the time.

It also allows blocked users to thank on their own talk page, if
they are allowed to edit it, even if they are sitewide blocked.

Bug: T221371
Change-Id: Ic99ec38ea200e806963951b2dd67e56ecde63752
2019-05-22 22:05:33 +01:00
Derick Alangi ef903f25d7 ApiCoreThank: Replace deprecated Revision::* methods
Depends-On: Icfc85167a636bef95daab236ab80113c1a3cf41b
Change-Id: I31d819f4453032da8deb117254b954fba058e0a3
2019-05-08 00:16:32 +01:00
libraryupgrader e0e2c20127 build: Updating mediawiki/mediawiki-phan-config to 0.5.0
Change-Id: If0aa36ada0eb4b071ce5fe704c4d0c5cff21c4eb
2019-03-10 22:32:43 -07:00
Derick Alangi f9082d1df6 Remove "return true" legacy behavior from hook handler functions
Change-Id: I16224ee276c5e76ff475bce0e1f2c29bf9c7385d
2019-02-02 20:34:32 +01:00
Matěj Suchánek 97e95d5559 Use ExtensionRegistry instead of class_exists
Bug: T183096
Change-Id: Ida0278326291e7bd52cbebd36d1b0a775380043e
2019-01-01 17:07:27 +00:00
jenkins-bot 5d5b82ad65 Merge "Thanks/thank: Add tests for thanked cookie and getUserGender()" 2018-11-16 18:15:38 +00:00
takidelfin 957ee53679 Thanks/thank: Add tests for thanked cookie and getUserGender()
Added two new tests: thanked cookie and gets user gender. First uses jQuery cookies and second uses Sinon fake server

Bug: T160267
Change-Id: I8f5dad9c90e930d557e86acb4b175ec549849e7a
2018-11-16 17:50:58 +01:00
jenkins-bot ae16570c31 Merge "Minor fixes to improve readability and CC" 2018-11-14 20:52:43 +00:00
Alangi Derick f3d1aac4db Minor fixes to improve readability and CC
Minor code formatting. CC stands for Coding Convention.

Change-Id: I5c95d03df7a9362ff7ab71c0aabbfb9ed7e9ce65
2018-11-10 22:06:01 +01:00
Rafid Aslam 55ca549068 Change HTTP links to mediawiki.org to use HTTPS
Several links that link to mediawiki.org still use
"http" protocol which isn't a safe protocol. This commit
changes http links that link to mediawiki.org to use
"https" protocol instead.

Bug: T189687
Change-Id: Ibb5f019e21f5d6ca0b4c40138dab22ae43e9004b
2018-10-30 23:50:40 +07:00
jenkins-bot d6bc51d691 Merge "Fix postid parameter on Flow thanks page" 2018-10-25 11:09:56 +00:00
Mahuton 037a85f623 Fix postid parameter on Flow thanks page
Flow: fix postid parameter

Bug: T191442
Change-Id: Ia031e62a5c6c4a0781cf877f2ca036a4a2af6e4e
2018-10-19 10:56:25 +02:00
Roan Kattouw ebfee91e80 Use User::isBot() rather than rolling our own
We were manually checking for the 'bot' group, but MW core has a method
for this that's more comprehensive.

Bug: T205224
Change-Id: Idce475ce10a21c5593d366470eede7d8dd1f6dfe
2018-10-02 17:29:10 -07:00
Stephane Bisson 8daf575067 Allow thanking discontinuous revisions
Modify the revision continuity check to be
resilient for pages with discontinuous histories
while still catching diff that span multiple
revisions.

Bug: T186470
Change-Id: If9614f6e3e278367530e9a4f5054ac370d1c0699
2018-09-24 16:32:48 +00:00
Framawiki 801eed16b9 Better message when thanking on page creation
Add a new "revcreation" extra param to the stored echo event, that is set to "true" if it's a page creation.
Create notification-header-creation-thank message.

Bug: T201507
Change-Id: I80b206b1d24d53c9a60725bc25318e31f083aef0
2018-09-09 11:46:39 +02:00
Kunal Mehta 478d731771 Remove unneccessary @suppress after phan-taint-check-plugin upgrade
Bug: T201565
Change-Id: Ib35e55e5bebbb7dc6ca8ef4f08b519ec2065037b
2018-09-01 19:59:16 -07:00
Framawiki fe8a3916c2 EchoCoreThanksPresentationModel: Avoid re-implementing getThankType()
Change-Id: I48aa7593cec275ed4e38b22b36a2a998c7202cdc
2018-08-30 02:20:00 +00:00
jenkins-bot defbe0f421 Merge "Suppress taint-check-plugin issue" 2018-08-25 04:38:12 +00:00
Amir Sarabadani 8ca5464a16 Security: Disable thank when the user is globally blocked
Bug: T151910
Change-Id: I3f39dd32cb76d1a20c8711d5de88e8fcbc36507d
2018-08-23 11:37:34 -07:00
Umherirrender f8d82481a8 Suppress taint-check-plugin issue
Suppress the issue with a hint to the task (T201565) allows
to enable the voting jobs and avoids new issues in the future.

Change-Id: I88d09923d1e1a59e285513e56985989fabbb4505
2018-08-23 11:36:19 +02:00
C. Scott Ananian edd6818eb9 Replace uses of deprecated Language::truncate()
See I2291c69d9df17c1a9e4ab1b7d4cbc73bc51d3ebb for the anticipated
hard-deprecation of this method in core.

Bug: T197492
Change-Id: I5d4ec96afe82910ffd18377b5f5f94405f73e9eb
2018-06-15 20:24:32 -04:00
Matěj Suchánek 12c2cc0f92 Correctly bundle thanks notifications for logs
Thanks for logs are created with 'logid' extra param. Param 'id' was
never used and was added accidentally.

Bug: T192041
Change-Id: I1f7e0d53c674509200fc8c704f99fd3d8197636b
2018-05-29 16:18:29 +00:00
jenkins-bot fc4893d833 Merge "Use new Special:Log?logid=xxx URL for notification link" 2018-05-04 05:59:47 +00:00
jenkins-bot a67ec2031d Merge "Update icon to latest from OOUI" 2018-05-01 20:33:11 +00:00
Sam Wilson 862c737aa0 Fix canRender and add greppable messages for dynamic keys
This fixes issues raised in https://gerrit.wikimedia.org/r/#/c/416207/4/includes/EchoCoreThanksPresentationModel.php

Bug: T192711
Change-Id: I5e654f5ae9480aa048326c067129fafd430f0515
2018-04-24 06:38:26 +08:00
Sam Wilson 0fa3196e8b Use new Special:Log?logid=xxx URL for notification link
Avoid redirecting via Special:Redirect/logid/xxx with the new
logid parameter to Special:Log.

Bug: T191608
Depends-On: I5f2e52531cd2ba617a25570e40aa8c5168e284d9
Change-Id: Iffb1b0d9cc44fde69aa53f32d4a066cd3a10c5f4
2018-04-23 12:40:54 +08:00
Ed Sanders b319ae80b3 Update icon to latest from OOUI
Also use same name as in OOUI (with color modifier).

Bug: T183749
Change-Id: I1a1e47398beb5527e3d4e0426691b6b5dc5f9f5e
2018-04-13 18:08:59 +01:00
Kunal Mehta b8b892bb98 Hard depend upon Echo in extension.json
This extension is useless without Echo, and the API modules already
disable themselves if it's not installed. Just absolutely require Echo
to be installed.

Change-Id: I653eea78668bfe0875bc5a33e2d45607106d4ee5
2018-04-11 01:00:30 -07:00
Kunal Mehta e696cba57f Add phan configuration
Change-Id: I6d0a0823404e5e50819ae0997b7d2c5267a4e144
2018-04-09 00:12:28 -07:00
Umherirrender 145b1f1772 Declare nullable argument only in @param
The $oldRev could be null, but when set the null in argument list,
it is an optional parameter and the following argument $user must be
optional too. That is not needed here.

Change-Id: Ia7c1c44b29b191dc602513e07b90d3e2415d3a5d
2018-04-05 12:45:23 +02:00
Sam Wilson 56dfaa8555 Add thanks links to Special:Log for log entries
Only log entries that were associated with revisions were
being thanked. This adds other log entries (if they're of
a whitelisted type still).

Bug: T187485
Change-Id: I9c644590b52bce9b04c7c655dd197c1b78a83777
2018-04-03 06:20:56 +00:00
jenkins-bot 431ca7785b Merge "Add GENDER support to thanks-thanked-notice" 2018-03-25 06:02:57 +00:00