]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Contact.php
Posts from contacts weren't displayed correctly
[friendica.git] / src / Model / Contact.php
index 1b15f1c76d89faafa38bae7187a7184552962ecd..3e8b1f5d65ce26a10956ee7ffc90ce05f9321c55 100644 (file)
@@ -662,7 +662,7 @@ class Contact extends BaseObject
                if (!DBM::is_result($contact)) {
                        // The link could be provided as http although we stored it as https
                        $ssl_url = str_replace('http://', 'https://', $url);
-                       $r = dba::select('contact', array('id', 'avatar-date'), array('`alias` IN (?, ?, ?) AND `uid` = ?', $url, normalise_link($url), $ssl_url, $uid), array('limit' => 1));
+                       $r = dba::select('contact', array('id', 'avatar', 'avatar-date'), array('`alias` IN (?, ?, ?) AND `uid` = ?', $url, normalise_link($url), $ssl_url, $uid), array('limit' => 1));
                        $contact = dba::fetch($r);
                        dba::close($r);
                }
@@ -674,7 +674,7 @@ class Contact extends BaseObject
                        $update_contact = ($contact['avatar-date'] < datetime_convert('', '', 'now -7 days'));
 
                        // We force the update if the avatar is empty
-                       if ($contact['avatar'] == '') {
+                       if (!x($contact, 'avatar')) {
                                $update_contact = true;
                        }
 
@@ -875,11 +875,13 @@ class Contact extends BaseObject
                $contact = ($r[0]["contact-type"] == ACCOUNT_TYPE_COMMUNITY ? 'owner-id' : 'author-id');
 
                $r = q(item_query() . " AND `item`.`" . $contact . "` = %d AND " . $sql .
-                       " ORDER BY `item`.`created` DESC LIMIT %d, %d", intval($author_id), intval(local_user()), intval($a->pager['start']), intval($a->pager['itemspage'])
+                       " AND `item`.`verb` = '%s' ORDER BY `item`.`created` DESC LIMIT %d, %d",
+                       intval($author_id), intval(local_user()), dbesc(ACTIVITY_POST),
+                       intval($a->pager['start']), intval($a->pager['itemspage'])
                );
 
 
-               $o = conversation($a, $r, 'community', false);
+               $o = conversation($a, $r, 'contact-posts', false);
 
                $o .= alt_pager($a, count($r));