diff options
author | zotlabs <mike@macgirvin.com> | 2017-06-29 22:38:43 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-06-29 22:38:43 -0700 |
commit | b73c844d1aec260c323715b55f2b290ce339615b (patch) | |
tree | 5fa9ec418cbf67d97192e5915abce058c05709d8 | |
parent | da1b10b741ec7525b9d76b2bdfaa3b794a39dde3 (diff) | |
download | volse-hubzilla-b73c844d1aec260c323715b55f2b290ce339615b.tar.gz volse-hubzilla-b73c844d1aec260c323715b55f2b290ce339615b.tar.bz2 volse-hubzilla-b73c844d1aec260c323715b55f2b290ce339615b.zip |
use "Full Name (username)" for ostatus commenter xchans
-rw-r--r-- | include/feedutils.php | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/include/feedutils.php b/include/feedutils.php index 2755a7e3f..27f189119 100644 --- a/include/feedutils.php +++ b/include/feedutils.php @@ -246,9 +246,17 @@ function get_atom_elements($feed, $item, &$author) { $found_author = $item->get_author(); if($found_author) { + if($rawauthor) { + if($rawauthor[0]['child'][NAMESPACE_POCO]['displayName'][0]['data']) + $author['full_name'] = unxmlify($rawauthor[0]['child'][NAMESPACE_POCO]['displayName'][0]['data']); + } $author['author_name'] = unxmlify($found_author->get_name()); $author['author_link'] = unxmlify($found_author->get_link()); $author['author_is_feed'] = false; + + $rawauthor = $feed->get_feed_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'author'); + logger('rawauthor: ' . print_r($rawauthor, true)); + } else { $author['author_name'] = unxmlify($feed->get_title()); @@ -1022,7 +1030,16 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) { $datarray['author_xchan'] = ''; if($author['author_link'] != $contact['xchan_url']) { - $x = import_author_unknown(array('name' => $author['author_name'],'url' => $author['author_link'],'photo' => array('src' => $author['author_photo']))); + $name = ''; + if($author['full_name']) { + $name = $author['full_name']; + if($author['author_name']) + $name .= ' (' . $author['author_name'] . ')'; + } + else { + $name = $author['author_name']; + } + $x = import_author_unknown(array('name' => $name,'url' => $author['author_link'],'photo' => array('src' => $author['author_photo']))); if($x) $datarray['author_xchan'] = $x; } @@ -1170,7 +1187,16 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) { } if($author['author_link'] != $contact['xchan_url']) { - $x = import_author_unknown(array('name' => $author['author_name'],'url' => $author['author_link'],'photo' => array('src' => $author['author_photo']))); + $name = ''; + if($author['full_name']) { + $name = $author['full_name']; + if($author['author_name']) + $name .= ' (' . $author['author_name'] . ')'; + } + else { + $name = $author['author_name']; + } + $x = import_author_unknown(array('name' => $name,'url' => $author['author_link'],'photo' => array('src' => $author['author_photo']))); if($x) $datarray['author_xchan'] = $x; } |