diff --git a/Hooks.php b/Hooks.php index 2d9dd8577..640778150 100644 --- a/Hooks.php +++ b/Hooks.php @@ -684,6 +684,8 @@ class EchoHooks { $user = $wgUser; } + $revid = $linksUpdate->getRevision() ? $linksUpdate->getRevision()->getId() : null; + // link notification is boundless as you can include infinite number of links in a page // db insert is expensive, limit it to a reasonable amount, we can increase this limit // once the storage is on Redis @@ -703,6 +705,7 @@ class EchoHooks { 'agent' => $user, 'extra' => array( 'link-from-page-id' => $linksUpdate->mTitle->getArticleId(), + 'revid' => $revid, ) ) ); $max--; diff --git a/includes/formatters/PageLinkedPresentationModel.php b/includes/formatters/PageLinkedPresentationModel.php index 6d7567112..bc3404275 100644 --- a/includes/formatters/PageLinkedPresentationModel.php +++ b/includes/formatters/PageLinkedPresentationModel.php @@ -34,7 +34,20 @@ class EchoPageLinkedPresentationModel extends EchoEventPresentationModel { 'icon' => 'linked', 'prioritized' => true ); - return array( $whatLinksHereLink ); + + $revid = $this->event->getExtraParam( 'revid' ); + $diffLink = null; + if ( $revid !== null ) { + $diffLink = array( + 'url' => $this->event->getTitle()->getFullURL( array( 'diff' => $revid, 'oldid' => 'prev' ) ), + 'label' => $this->msg( 'notification-link-text-view-changes' )->text(), + 'description' => '', + 'icon' => 'changes', + 'prioritized' => true + ); + } + + return array( $whatLinksHereLink, $diffLink ); } protected function getHeaderMessageKey() {