]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Notification.php
Reliably diasplay "like" and "share" notifications
[friendica.git] / src / Model / Notification.php
index 2a730c5db1fd7b60bc3b6c9ea159e03fa2944fdf..1df420845c7b610a7be2c6112361b6f28c82a1c4 100644 (file)
@@ -222,10 +222,17 @@ class Notification extends BaseModel
                                }
                        }
 
-                       if (($notification['type'] == Post\UserNotification::NOTIF_SHARED) && !empty($item['causer-id'])) {
-                               $causer = Contact::getById($item['causer-id'], ['id', 'name', 'url']);
+                       if ($item['owner-id'] != $item['author-id']) {
+                               $cid = $item['owner-id'];
+                       }
+                       if (!empty($item['causer-id']) && ($item['causer-id'] != $item['author-id'])) {
+                               $cid = $item['causer-id'];
+                       }
+
+                       if (($notification['type'] == Post\UserNotification::NOTIF_SHARED) && !empty($cid)) {
+                               $causer = Contact::getById($cid, ['id', 'name', 'url']);
                                if (empty($contact)) {
-                                       Logger::info('Causer not found', ['causer' => $item['causer-id']]);
+                                       Logger::info('Causer not found', ['causer' => $cid]);
                                        return $message;
                                }
                        } elseif (in_array($notification['type'], [Post\UserNotification::NOTIF_COMMENT_PARTICIPATION, Post\UserNotification::NOTIF_ACTIVITY_PARTICIPATION])) {