mirror of
https://github.com/friendica/friendica
synced 2025-04-27 04:30:11 +00:00
refactor "which link to show" logic
This commit is contained in:
parent
34f3cb68a6
commit
2c63b65e3c
3 changed files with 106 additions and 114 deletions
|
@ -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'])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue