mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-27 09:10:12 +00:00
Replace RecentChange::getPerformer with RecentChange::getPerformerIdentity
Refactor $actor as UserIdentity Refactor Event::getAgent() to return UserIdentity Bug: T276412 Change-Id: Ieb0dbacd2dcab7700b83fb090587b4957c8128c9
This commit is contained in:
parent
f6d71ce1a9
commit
3e65888791
|
@ -1673,6 +1673,7 @@ class EchoHooks implements RecentChange_saveHook {
|
|||
} else {
|
||||
$type = 'watchlist-change';
|
||||
}
|
||||
$user = User::newFromIdentity( $change->getPerformerIdentity() );
|
||||
EchoEvent::create( [
|
||||
'type' => $type,
|
||||
'title' => $change->getTitle(),
|
||||
|
@ -1682,7 +1683,7 @@ class EchoHooks implements RecentChange_saveHook {
|
|||
'status' => $change->mExtra["pageStatus"],
|
||||
'timestamp' => $change->getAttribute( "rc_timestamp" )
|
||||
],
|
||||
'agent' => $change->getPerformer()
|
||||
'agent' => $user
|
||||
] );
|
||||
}
|
||||
|
||||
|
|
|
@ -462,7 +462,8 @@ class EchoEvent extends EchoAbstractEntity implements Bundleable {
|
|||
} else {
|
||||
// Use User::isHidden()
|
||||
$permManager = MediaWikiServices::getInstance()->getPermissionManager();
|
||||
return $permManager->userHasAnyRight( $user, 'viewsuppressed', 'hideuser' ) || !$agent->isHidden();
|
||||
return $permManager->userHasAnyRight( $user, 'viewsuppressed', 'hideuser' )
|
||||
|| !$agent->isHidden();
|
||||
}
|
||||
} elseif ( $revision ) {
|
||||
// A revision is set, use rev_deleted
|
||||
|
|
|
@ -246,7 +246,7 @@ class GenerateSampleNotifications extends Maintenance {
|
|||
$this->output( "{$agent->getName()} is mentioning {$user->getName()} on {$title->getTalkPage()->getPrefixedText()}\n" );
|
||||
$this->addToPageContent( $title->getTalkPage(), $agent, $mention );
|
||||
|
||||
// agent tak
|
||||
// agent talk
|
||||
$this->output( "{$agent->getName()} is mentioning {$user->getName()} on {$agent->getTalkPage()->getPrefixedText()}\n" );
|
||||
$this->addToPageContent( $agent->getTalkPage(), $agent, $mention );
|
||||
|
||||
|
@ -299,6 +299,7 @@ class GenerateSampleNotifications extends Maintenance {
|
|||
);
|
||||
|
||||
$status = $page->doEditContent( $content, 'undo', 0, false, $agent, null, [], $undoRev->getId() );
|
||||
|
||||
if ( !$status->isGood() ) {
|
||||
$this->error( "Failed to undo {$moai->getPrefixedText()}: {$status->getMessage()->text()}" );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue