mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-23 23:44:53 +00:00
Echo hook needs to consider other hook modifications
Follow up to 7880cc1
Bug: T274428
Change-Id: Ia4520a3df28027d43ecdeb217b108669e7cb6795
This commit is contained in:
parent
ec23570c91
commit
4c58a85bb1
|
@ -1125,18 +1125,20 @@ class EchoHooks implements RecentChange_saveHook {
|
|||
$alertLinkClasses[] = 'mw-echo-notifications-badge-long-label';
|
||||
}
|
||||
|
||||
$mytalk = $links['user-menu']['mytalk'] ?? false;
|
||||
if (
|
||||
$mytalk &&
|
||||
self::shouldDisplayTalkAlert( $user, $title ) &&
|
||||
MediaWikiServices::getInstance()
|
||||
->getHookContainer()->run( 'BeforeDisplayOrangeAlert', [ $user, $title ] )
|
||||
) {
|
||||
// Move `mytalk` from `user-menu` to `notifications`.
|
||||
$links['notifications']['mytalk'] = [
|
||||
'href' => $links['user-menu']['mytalk']['href'],
|
||||
'text' => $skinTemplate->msg( 'echo-new-messages' ),
|
||||
'href' => $mytalk['href'],
|
||||
'text' => $skinTemplate->msg( 'echo-new-messages' )->text(),
|
||||
|
||||
'active' => $links['user-menu']['mytalk']['active'],
|
||||
'exists' => $links['user-menu']['mytalk']['exists'],
|
||||
'active' => $mytalk['active'],
|
||||
'exists' => $mytalk['exists'],
|
||||
'link-class' => [ 'mw-echo-alert' ],
|
||||
// Id of `pt-mytalk` is important for Linker to set the `title` and
|
||||
// `accesskey` attributes.
|
||||
|
|
Loading…
Reference in a new issue