Commit graph

93 commits

Author SHA1 Message Date
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
jenkins-bot 3dbf781571 Merge "Add revision-thanking links to some log entries" 2018-03-23 01:09:20 +00:00
Matěj Suchánek ac9f8908ca Add GENDER support to thanks-thanked-notice
Change-Id: If23ce8d7ee8ff1edf484c217a70aa34046590fd6
2018-03-22 08:35:26 +00:00
Sam Wilson 2059e3ff4b Add revision-thanking links to some log entries
Many log entries are associated to (exactly one) revision,
and for these (only, and only where the log type is
whitelisted) we add a thank-link that behaves exactly
as the thank-link on diff and history pages.

Bug: T189752
Change-Id: I5f4e84c65d4fe2d95b20cdb3c3f9522ad3e5f422
2018-03-22 11:57:55 +08:00
Brad Jorsch c3f508cdd8 Update for the actor table change
Core change I8d825eb0 begins the process of changing core database
tables from using xx_user and xx_user_text fields to using xx_actor.
This updates the extension to continue to function during and after the
transition.

Bug: T167246
Change-Id: Ib84a5a7a9f80fa321f7482d4c27c5f58add47230
2018-03-20 15:29:32 -04:00
Sam Wilson 30e582bd96 Add support for log-thanks to Special:Thanks
A new "Special:Thanks/Log/123" subpage format is added for
sending thanks for the given log entry. The 'Log' part of the
subpage is case-insensitive.

The form field labels are removed because the fields are hidden
and need no labels.

Bug: T186920
Change-Id: Ic2279d9a6dc170d1eeee519392d3a930a37bc2ec
2018-03-19 10:59:20 +08:00
Reedy 2735468029 Revert "Add revision-thanking links to some log entries"
This reverts commit 9f393ef9dd.

Change-Id: Ie76fef8dc25b1134f1f60da50a87b00115154041
2018-03-14 21:49:25 +00:00
Sam Wilson 9f393ef9dd Add revision-thanking links to some log entries
Many log entries are associated to (exactly one) revision,
and for these (only, and only where the log type is
whitelisted) we add a thank-link that behaves exactly
as the thank-link on diff and history pages.

Bug: T186763
Change-Id: I2af380d5cb06f19ef9eb5b232d95ad87379b5d9b
2018-03-13 09:33:15 +08:00
Max Semenik ed087b044c Reintroduce the API to thank for log entries
Originally introduced in b84eedc74e, it was reverted for security concerns.
New changes:
* Instead of bundling the log summary with notification, load it on display
* If the log event has been suppressed after the thanks for it has been sent,
  silently delete the event to prevent the confusion of linking to something
  zapped.
* Keep the 'already sent' cache key compatible with old format
* Validate the log id in the API
* Change ApiCoreThank::getRevisionFromParams() to ApiCoreThank::getRevisionFromId()

Bug: T186855
Bug: T188791
Depends-On: Ic5e9db0def857d9dcecbd06bf081c8c83712c1ea
Change-Id: I03aea7d9f4dfa0fe49639c53968deabf89999d2d
2018-03-06 13:08:47 +08:00
MaxSem 3b2397fea9 Revert "Add support to the Thanks API for thanking log entries"
This reverts commit b84eedc74e.

Bug: T188791
Change-Id: If55ed6cbb5da34c0034da3cc564c6a8ff82448d2
2018-03-02 22:59:20 +00:00
Sam Wilson b84eedc74e Add support to the Thanks API for thanking log entries
Add a 'log' API parameter (for the log ID to thank), and add
a whitelist config variable for specifying which log types are
thankable.

Bug: T186855
Change-Id: I58ae90c9729c0066f952e90fca2cf99b029d0d9b
2018-03-01 14:57:57 -08:00
Sam Wilson 78831d2b68 Rename files and classes in preparation for adding log-thanks
Bug: T186855
Change-Id: I20f5d200c33e395aca9489b73d0ed9b1d0ad5b8c
2018-02-21 12:49:21 +08:00
Sam Wilson 499dc04960 Remove a coding-standard exclusion
Add some parameter comments etc.

Change-Id: Ifb663c69711036ea01cb2b90acaa81d22c74a3af
2018-02-12 09:26:19 +08:00
addshore d2c420878b Import MediaWikiServices in ThanksHooks
Bug: T186618
Change-Id: I62de4a2a88b81d27c12b364848cd237236484aa0
2018-02-06 17:01:25 +00:00
Sam Wilson 2e7e5e0190 Move classes to includes/ and rename some to match class names
For conformance to coding standards. This removes an exclusion
from the phpcs config.

Change-Id: I1481a3e7e68a81daf310ea3c7bf9dc48cdaf140b
2018-01-30 10:32:03 +08:00