]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Event.php
Standards
[friendica.git] / src / Model / Event.php
index d2bc6ab86a7e6760ac14202c1be6a9111ebd1564..81e33013fb6d2b2606b656a7b9a191b407db330a 100644 (file)
@@ -293,11 +293,10 @@ class Event
                }
                $private = intval($arr['private'] ?? 0);
 
-               $conditions = ['uid' => $event['uid']];
                if ($event['cid']) {
-                       $conditions['id'] = $event['cid'];
+                       $conditions = ['id' => $event['cid']];
                } else {
-                       $conditions['self'] = true;
+                       $conditions = ['uid' => $event['uid'], 'self' => true];
                }
 
                $contact = DBA::selectFirst('contact', [], $conditions);
@@ -587,10 +586,10 @@ class Event
                $last_date = '';
                $fmt = DI::l10n()->t('l, F j');
                foreach ($event_result as $event) {
-                       $item = Post::selectFirst(['plink', 'author-name', 'author-avatar', 'author-link'], ['id' => $event['itemid']]);
+                       $item = Post::selectFirst(['plink', 'author-name', 'author-avatar', 'author-link', 'private'], ['id' => $event['itemid']]);
                        if (!DBA::isResult($item)) {
                                // Using default values when no item had been found
-                               $item = ['plink' => '', 'author-name' => '', 'author-avatar' => '', 'author-link' => ''];
+                               $item = ['plink' => '', 'author-name' => '', 'author-avatar' => '', 'author-link' => '', 'private' => Item::PUBLIC];
                        }
 
                        $event = array_merge($event, $item);