mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-09-23 18:30:06 +00:00
Merge "Extract getMessageWithAgent
"
This commit is contained in:
commit
5100bba74f
|
@ -131,6 +131,20 @@ abstract class EchoEventPresentationModel {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a message with the given key and the agent's
|
||||
* formatted name and name for GENDER as 1st and
|
||||
* 2nd parameters.
|
||||
* @param string $key
|
||||
* @return Message
|
||||
*/
|
||||
final protected function getMessageWithAgent( $key ) {
|
||||
$msg = $this->msg( $key );
|
||||
list( $formattedName, $genderName ) = $this->getAgentForOutput();
|
||||
$msg->params( $formattedName, $genderName );
|
||||
return $msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the viewing user's name for usage in GENDER
|
||||
*
|
||||
|
@ -167,11 +181,7 @@ abstract class EchoEventPresentationModel {
|
|||
* @return Message
|
||||
*/
|
||||
public function getHeaderMessage() {
|
||||
$msg = $this->msg( $this->getHeaderMessageKey() );
|
||||
list( $formattedName, $genderName ) = $this->getAgentForOutput();
|
||||
$msg->params( $formattedName, $genderName );
|
||||
|
||||
return $msg;
|
||||
return $this->getMessageWithAgent( $this->getHeaderMessageKey() );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue