aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-05-06 06:30:33 -0700
committerFriendika <info@friendika.com>2011-05-06 06:30:33 -0700
commit2c63b65e3c66bcb0a047ce51c04d23376aa6c525 (patch)
treeabb642c3bed1d6fb0ab9ce8bc26b6e37b9aa905c /include/items.php
parent34f3cb68a67110fc75fedca7e5aeb70ab3f9aa4f (diff)
downloadvolse-hubzilla-2c63b65e3c66bcb0a047ce51c04d23376aa6c525.tar.gz
volse-hubzilla-2c63b65e3c66bcb0a047ce51c04d23376aa6c525.tar.bz2
volse-hubzilla-2c63b65e3c66bcb0a047ce51c04d23376aa6c525.zip
refactor "which link to show" logic
Diffstat (limited to 'include/items.php')
-rw-r--r--include/items.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/items.php b/include/items.php
index 3a3085f1b..b7863f838 100644
--- a/include/items.php
+++ b/include/items.php
@@ -1205,6 +1205,13 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $secure_fee
$item_id = $item->get_id();
$datarray = get_atom_elements($feed,$item);
+ if(! x($datarray,'author-name'))
+ $datarray['author-name'] = $contact['name'];
+ if(! x($datarray,'author-link'))
+ $datarray['author-link'] = $contact['url'];
+ if(! x($datarray,'author-avatar'))
+ $datarray['author-avatar'] = $contact['thumb'];
+
$r = q("SELECT `uid`, `last-child`, `edited`, `body` FROM `item` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
dbesc($item_id),
intval($importer['uid'])
@@ -1278,6 +1285,15 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $secure_fee
$datarray = get_atom_elements($feed,$item);
+ if(is_array($contact)) {
+ if(! x($datarray,'author-name'))
+ $datarray['author-name'] = $contact['name'];
+ if(! x($datarray,'author-link'))
+ $datarray['author-link'] = $contact['url'];
+ if(! x($datarray,'author-avatar'))
+ $datarray['author-avatar'] = $contact['thumb'];
+ }
+
$r = q("SELECT `uid`, `last-child`, `edited`, `body` FROM `item` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
dbesc($item_id),
intval($importer['uid'])