Moved the factory deeper into the code right before the one usage it
still needed a full user object.
Narrow done method arguments from User to UserIdentity
and use the identity directly
Change-Id: I2231db43f525a74e93dba8ea5865b256efd2dfce
Thanks was causing history views to do 4 DB queries per row, due to the
RevisionStore::getPreviousRevision() call. The reason for doing it is
that it doesn't make sense to thank someone for a diff which includes
multiple authors. This does not apply to history pages -- even for
filtered history views, you can thank someone for a specific revision on
the basis of its edit summary.
So, distinguish between history tools and diff tools. Do the expensive
thing only for diff tools.
Bug: T284274
Change-Id: Ib631100b82958065a327dd18c927af4a78b8be15
Die earlier from ApiFlowThank::execute if them user is blocked from
Thanks, now that it is possible to have a partial block against Thanks
without being blocked from pages.
Follow-up to Id86d97a38c041fea4abcdbdd404428622df76669
Bug: T242785
Change-Id: Ia3683c3cab333b1193b2b77c6c18b5c343b5a5c7
Die earlier from ApiCoreThank::execute if them user is blocked from
Thanks, now that it is possible to have a partial block against Thanks
without being blocked from pages.
Follow-up to I290a7c39c6fcb22a8ab4a9ecbad76a239cb18ea0
Bug: T242785
Change-Id: Id86d97a38c041fea4abcdbdd404428622df76669
- Add hook to enable blocking thanks
- Check if user is blocked from 'thanks' action
and disable giving thanks from API and UI if so
Bug: T242785
Change-Id: I290a7c39c6fcb22a8ab4a9ecbad76a239cb18ea0
User::setOption() is deprecated and should be replaced with UserOptionsManager::setOption()
Bug: T277818
Change-Id: Iacc258705c4517c958a2568e47ba4f43963acc2e
This commit adds the technical possibility to restrict ThanksLogTypeWhitelist
to only log subtypes like 'rights/rights' in addition to log types like
'rights'.
Bug: T191599
Change-Id: I31fb591dda2e5ecbfb5ac07352d3356134533540
Compatibility was added so that MobileFrontend could switch from
Revision to RevisionRecord, but now that the switch has occurred no
need to keep checking to see if a Revision is being passed
See [1] for the MobileFrontend change that required compatibility
[1] e42c52527b
Bug: T246284
Change-Id: Ie320454a0e90d7f98004a3b776010aff784bbf4d
Extension requires 1.35+, so the hooks are available
Bug: T255494
Bug: T255495
Change-Id: I334928ebd081d53a7d95466e6c4b75715b941ec4
Depends-On: Ib2ab2e26a95affdd1dfa6b945f752157580ea2d3
Declare a variable which is not set in all branches for static code
analyzer, but at runtime it is
Change-Id: I851bdbf9dc092d5213d74a03427b783f61e8946a
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
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
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
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
This prevents users from accessing information about the actor
by abusing uselang=qqx and the thank button.
Bug: T224240
Change-Id: I3f42d56874776cfa0c9d364217f43253efc14782
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