diff options
author | Friendika <info@friendika.com> | 2010-12-04 22:09:16 -0800 |
---|---|---|
committer | Friendika <info@friendika.com> | 2010-12-04 22:09:16 -0800 |
commit | 4507a571d3bea1fd32337565d05230ed2b2119a9 (patch) | |
tree | 09c41f57f2ad773a77f4653778427a06ecb4f310 /mod/profile.php | |
parent | b09ab4ef2ce9a9b55e4763418b3358aefe2307fc (diff) | |
download | volse-hubzilla-4507a571d3bea1fd32337565d05230ed2b2119a9.tar.gz volse-hubzilla-4507a571d3bea1fd32337565d05230ed2b2119a9.tar.bz2 volse-hubzilla-4507a571d3bea1fd32337565d05230ed2b2119a9.zip |
profile page not showing remote profile avatars when their site is down
Diffstat (limited to 'mod/profile.php')
-rw-r--r-- | mod/profile.php | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/mod/profile.php b/mod/profile.php index 38061e49d..a19f370de 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -338,12 +338,17 @@ function profile_content(&$a, $update = 0) { else $sparkle = ''; - // We received this post via a remote feed. It's either a wall-to-wall or a remote comment. The author is - // known to us and is reflected in the contact-id for this item. We can use the contact url or redirect rather than - // use the link in the feed. This is different than on the network page where we may not know the author. - - $profile_name = ((strlen($item['author-name'])) ? $item['author-name'] : $item['name']); - $profile_avatar = ((strlen($item['author-avatar'])) ? $item['author-avatar'] : $item['thumb']); + // We would prefer to use our own avatar link for this item because the one in the author-avatar might reference a + // remote site (which could be down). We will use author-avatar if we haven't got something stored locally. + // We use this same logic block in mod/network.php to determine it this is a third party post and we don't have any + // local contact info at all. In this module you should never encounter a third-party author, but we still will do + // the right thing if you ever do. + + $diff_author = (($item['url'] !== $item['author-link']) ? true : false); + + $profile_name = (((strlen($item['author-name'])) && $diff_author) ? $item['author-name'] : $item['name']); + $profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $item['thumb']); + $profile_link = $profile_url; $drop = ''; |