mediawiki-extensions-Echo/includes/formatters/MentionFormatter.php
Stephane Bisson 14b842bd34 Add gender support for the viewing user for mention notification
Bug: T119321
Change-Id: I1cd7caa7bfe811bab89a0c6950c1aeaf1739aac6
2015-12-04 16:53:11 -05:00

28 lines
894 B
PHP

<?php
class EchoMentionFormatter extends EchoCommentFormatter {
/**
* {@inheritDoc}
*/
protected function applyChangeBeforeFormatting( EchoEvent $event, User $user, $type ) {
parent::applyChangeBeforeFormatting( $event, $user, $type );
// If we can't find a section title for the mention,
// fall back to `notification-mention-nosection`.
if ( !$this->getSectionTitle( $event, $user ) ) {
$this->title = array(
'message' => 'notification-mention-nosection',
'params' => array( 'agent', 'main-title-text', 'title', 'user' )
);
$this->flyoutTitle = array(
'message' => 'notification-mention-nosection-flyout',
'params' => array( 'agent', 'main-title-text', 'title' )
);
$this->email['batch-body'] = array(
'message' => 'notification-mention-nosection-email-batch-body',
'params' => array( 'agent', 'main-title-text', 'user' )
);
}
}
}