mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Thanks
synced 2024-11-15 19:09:52 +00:00
Merge "Stop using legacy ActorMigration field "log_user""
This commit is contained in:
commit
9bd53fc8a1
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace MediaWiki\Extension\Thanks;
|
||||
|
||||
use ActorMigration;
|
||||
use ApiBase;
|
||||
use ExtensionRegistry;
|
||||
use ManualLogEntry;
|
||||
|
@ -84,18 +83,19 @@ abstract class ApiThank extends ApiBase {
|
|||
*/
|
||||
protected function haveAlreadyThanked( User $thanker, $uniqueId ) {
|
||||
$dbw = wfGetDB( DB_MASTER );
|
||||
$logWhere = ActorMigration::newMigration()->getWhere( $dbw, 'log_user', $thanker );
|
||||
$thankerActor = MediaWikiServices::getInstance()->getActorNormalization()
|
||||
->acquireActorId( $thanker, $dbw );
|
||||
return (bool)$dbw->selectRow(
|
||||
[ 'log_search', 'logging' ] + $logWhere['tables'],
|
||||
[ 'log_search', 'logging' ],
|
||||
[ 'ls_value' ],
|
||||
[
|
||||
$logWhere['conds'],
|
||||
'log_actor' => $thankerActor,
|
||||
'ls_field' => 'thankid',
|
||||
'ls_value' => $uniqueId,
|
||||
],
|
||||
__METHOD__,
|
||||
[],
|
||||
[ 'logging' => [ 'INNER JOIN', 'ls_log_id=log_id' ] ] + $logWhere['joins']
|
||||
[ 'logging' => [ 'INNER JOIN', 'ls_log_id=log_id' ] ]
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue