From c352047228126ab439ca4582995f83f119188588 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 16 Jul 2017 22:51:36 -0700 Subject: mis-attributed profile photo when Mastodon comment author has no profile photo --- include/feedutils.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/feedutils.php') diff --git a/include/feedutils.php b/include/feedutils.php index 6ee53e2f6..be7c926d4 100644 --- a/include/feedutils.php +++ b/include/feedutils.php @@ -1040,6 +1040,11 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) { $datarray['comment_policy'] = 'none'; } + // if we have everything but a photo, provide the default profile photo + + if($author['author_name'] && $author['author_link'] && (! $author['author_photo'])) + $author['author_photo'] = z_root() . '/' . get_default_profile_photo(80); + if((! x($author,'author_name')) || ($author['author_is_feed'])) $author['author_name'] = $contact['xchan_name']; if((! x($author,'author_link')) || ($author['author_is_feed'])) @@ -1244,6 +1249,12 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) { $datarray['comment_policy'] = 'none'; } + + // if we have everything but a photo, provide the default profile photo + + if($author['author_name'] && $author['author_link'] && (! $author['author_photo'])) + $author['author_photo'] = z_root() . '/' . get_default_profile_photo(80); + if(is_array($contact)) { if((! x($author,'author_name')) || ($author['author_is_feed'])) $author['author_name'] = $contact['xchan_name']; -- cgit v1.2.3