]> git.mxchange.org Git - friendica.git/blobdiff - include/enotify.php
Merge pull request #10486 from nupplaphil/feat/remove_test_data
[friendica.git] / include / enotify.php
index 1edad36ac0c79bd6383a72c60376e8b4660d8877..cfc03626f585459fa4d121f4bb4a3144fe333537 100644 (file)
@@ -184,9 +184,9 @@ function notification($params)
                // First go for the general message
 
                // "George Bull's post"
-               if ($params['activity']['origin_comment']) {
+               if (!empty($params['activity']['origin_comment'])) {
                        $message = $l10n->t('%1$s replied to you on %2$s\'s %3$s %4$s');
-               } elseif ($params['activity']['explicit_tagged']) {
+               } elseif (!empty($params['activity']['explicit_tagged'])) {
                        $message = $l10n->t('%1$s tagged you on %2$s\'s %3$s %4$s');
                } else {
                        $message = $l10n->t('%1$s commented on %2$s\'s %3$s %4$s');
@@ -197,10 +197,10 @@ function notification($params)
                // Then look for the special cases
 
                // "your post"
-               if ($params['activity']['origin_thread']) {
-                       if ($params['activity']['origin_comment']) {
+               if (!empty($params['activity']['origin_thread'])) {
+                       if (!empty($params['activity']['origin_comment'])) {
                                $message = $l10n->t('%1$s replied to you on your %2$s %3$s');
-                       } elseif ($params['activity']['explicit_tagged']) {
+                       } elseif (!empty($params['activity']['explicit_tagged'])) {
                                $message = $l10n->t('%1$s tagged you on your %2$s %3$s');
                        } else {
                                $message = $l10n->t('%1$s commented on your %2$s %3$s');
@@ -209,9 +209,9 @@ function notification($params)
                        $dest_str = sprintf($message, $params['source_name'], $item_post_type, $title);
                // "their post"
                } elseif ($item['author-link'] == $params['source_link']) {
-                       if ($params['activity']['origin_comment']) {
+                       if (!empty($params['activity']['origin_comment'])) {
                                $message = $l10n->t('%1$s replied to you on their %2$s %3$s');
-                       } elseif ($params['activity']['explicit_tagged']) {
+                       } elseif (!empty($params['activity']['explicit_tagged'])) {
                                $message = $l10n->t('%1$s tagged you on their %2$s %3$s');
                        } else {
                                $message = $l10n->t('%1$s commented on their %2$s %3$s');
@@ -224,7 +224,7 @@ function notification($params)
                // So, we cannot have different subjects for notifications of the same thread.
                // Before this we have the name of the replier on the subject rendering
                // different subjects for messages on the same thread.
-               if ($params['activity']['explicit_tagged']) {
+               if (!empty($params['activity']['explicit_tagged'])) {
                        $subject = $l10n->t('%s %s tagged you', $subjectPrefix, $params['source_name']);
 
                        $preamble = $l10n->t('%1$s tagged you at %2$s', $params['source_name'], $sitename);
@@ -474,7 +474,7 @@ function notification($params)
        if ($show_in_notification_page) {
                $fields = [
                        'name'          => $params['source_name'] ?? '',
-                       'name_cache'    => substr(strip_tags(BBCode::convert($params['source_name'])), 0, 255),
+                       'name_cache'    => substr(strip_tags(BBCode::convertForUriId($uri_id, $params['source_name'])), 0, 255),
                        'url'           => $params['source_link'] ?? '',
                        'photo'         => $params['source_photo'] ?? '',
                        'link'          => $itemlink ?? '',