]> git.mxchange.org Git - friendica.git/blobdiff - mod/content.php
Some more cleanup and code removal.
[friendica.git] / mod / content.php
index 49cff74d2d9f4e4eac2ffcce3529f87fafcabc55..71ed927636623ed5eb504d366772c273b0646256 100644 (file)
@@ -416,11 +416,12 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
                                else
                                        $profile_link = zrl($profile_link);
 
-                               $normalised = normalise_link((strlen($item['author-link'])) ? $item['author-link'] : $item['url']);
-                               if(($normalised != 'mailbox') && (x($a->contacts[$normalised])))
-                                       $profile_avatar = $a->contacts[$normalised]['thumb'];
+                               // Don't rely on the author-avatar. It is better to use the data from the contact table
+                               $author_contact = get_contact_details_by_url($item['author-link'], $profile_owner);
+                               if ($author_contact["thumb"])
+                                       $profile_avatar = $author_contact["thumb"];
                                else
-                                       $profile_avatar = $a->remove_baseurl(((strlen($item['author-avatar'])) ? $item['author-avatar'] : $item['thumb']));
+                                       $profile_avatar = $item['author-avatar'];
 
                                $locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => '');
                                call_hooks('render_location',$locate);
@@ -787,11 +788,12 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
                                else
                                        $profile_link = zrl($profile_link);
 
-                               $normalised = normalise_link((strlen($item['author-link'])) ? $item['author-link'] : $item['url']);
-                               if(($normalised != 'mailbox') && (x($a->contacts,$normalised)))
-                                       $profile_avatar = $a->contacts[$normalised]['thumb'];
+                               // Don't rely on the author-avatar. It is better to use the data from the contact table
+                               $author_contact = get_contact_details_by_url($item['author-link'], $profile_owner);
+                               if ($author_contact["thumb"])
+                                       $profile_avatar = $author_contact["thumb"];
                                else
-                                       $profile_avatar = $a->remove_baseurl(((strlen($item['author-avatar']) && $diff_author) ? $item['author-avatar'] : $thumb));
+                                       $profile_avatar = $item['author-avatar'];
 
                                $like    = ((x($alike,$item['uri'])) ? format_like($alike[$item['uri']],$alike[$item['uri'] . '-l'],'like',$item['uri']) : '');
                                $dislike = ((x($dlike,$item['uri'])) ? format_like($dlike[$item['uri']],$dlike[$item['uri'] . '-l'],'dislike',$item['uri']) : '');
@@ -805,9 +807,9 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
 
                                $shiny = "";
                                if(strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC','now - 12 hours')) > 0)
-                                       $shiny = 'shiny'; 
+                                       $shiny = 'shiny';
 
-                               // 
+                               //
                                localize_item($item);