summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'Echo/includes/formatters/UserRightsPresentationModel.php')
-rw-r--r--Echo/includes/formatters/UserRightsPresentationModel.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/Echo/includes/formatters/UserRightsPresentationModel.php b/Echo/includes/formatters/UserRightsPresentationModel.php
index 53f20d03..ba29a3e4 100644
--- a/Echo/includes/formatters/UserRightsPresentationModel.php
+++ b/Echo/includes/formatters/UserRightsPresentationModel.php
@@ -58,7 +58,11 @@ class EchoUserRightsPresentationModel extends EchoEventPresentationModel {
public function getBodyMessage() {
$reason = $this->event->getExtraParam( 'reason' );
- return $reason ? $this->msg( 'notification-body-user-rights' )->params( $reason ) : false;
+ if ( $reason ) {
+ $text = EchoDiscussionParser::getTextSnippet( $reason, $this->language );
+ return new RawMessage( "$1", [ $text ] );
+ }
+ return false;
}
private function getLocalizedGroupNames( $names ) {
@@ -71,9 +75,9 @@ class EchoUserRightsPresentationModel extends EchoEventPresentationModel {
public function getPrimaryLink() {
$addedGroups = array_values( $this->event->getExtraParam( 'add', [] ) );
$removedGroups = array_values( $this->event->getExtraParam( 'remove', [] ) );
- if ( count( $addedGroups ) >= 1 && count( $removedGroups ) === 0 ) {
+ if ( $addedGroups !== [] && $removedGroups === [] ) {
$fragment = $addedGroups[0];
- } elseif ( count( $addedGroups ) === 0 && count( $removedGroups ) >= 1 ) {
+ } elseif ( $addedGroups === [] && $removedGroups !== [] ) {
$fragment = $removedGroups[0];
} else {
$fragment = '';