mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-24 07:54:13 +00:00
Merge "Use user IDs, not User objects, for reverted-user-id"
This commit is contained in:
commit
d8d0e52c03
|
@ -622,13 +622,14 @@ class EchoHooks implements RecentChange_saveHook {
|
|||
Title::newFromLinkTarget( $undidRevision->getPageAsLinkTarget() )->equals( $title )
|
||||
) {
|
||||
$revertedUser = $undidRevision->getUser();
|
||||
if ( $revertedUser ) { // No notifications for anonymous users
|
||||
// No notifications for anonymous users
|
||||
if ( $revertedUser && $revertedUser->getId() ) {
|
||||
EchoEvent::create( [
|
||||
'type' => 'reverted',
|
||||
'title' => $title,
|
||||
'extra' => [
|
||||
'revid' => $revisionRecord->getId(),
|
||||
'reverted-user-id' => $revertedUser,
|
||||
'reverted-user-id' => $revertedUser->getId(),
|
||||
'reverted-revision-id' => $undidRevId,
|
||||
'method' => 'undo',
|
||||
'summary' => $summary,
|
||||
|
@ -1291,7 +1292,8 @@ class EchoHooks implements RecentChange_saveHook {
|
|||
self::$lastRevertedRevision = $latestRevision;
|
||||
|
||||
if (
|
||||
$revertedUser && // No notifications for anonymous users
|
||||
$revertedUser &&
|
||||
$revertedUser->getId() && // No notifications for anonymous users
|
||||
!$oldRevision->hasSameContent( $newRevision ) // No notifications for null rollbacks
|
||||
) {
|
||||
EchoEvent::create( [
|
||||
|
@ -1299,7 +1301,7 @@ class EchoHooks implements RecentChange_saveHook {
|
|||
'title' => $wikiPage->getTitle(),
|
||||
'extra' => [
|
||||
'revid' => $latestRevision->getId(),
|
||||
'reverted-user-id' => $revertedUser,
|
||||
'reverted-user-id' => $revertedUser->getId(),
|
||||
'reverted-revision-id' => $oldRevision->getId(),
|
||||
'method' => 'rollback',
|
||||
],
|
||||
|
|
Loading…
Reference in a new issue