mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-28 01:30:15 +00:00
Add diff link to page-linked notification
Will only show for new instances, because the information will be unavailable for old ones. Bug: T135959 Depends-On: I3d894acaf3d85b790e5034c7d9f76bf94672f445 Change-Id: I04620678dd0ebffb3b1a92a9a0587cb7557d77f4
This commit is contained in:
parent
46e69972c6
commit
71eacf3fad
|
@ -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--;
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue