X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fitems.php;h=1d2a775c49d27c822ef474bec1fa0093ea808393;hb=75be187216255c7c45421cb5f9596118a954f878;hp=203b7d0eee6755d0699d8261e3d2da2dedae7d46;hpb=7dc5fc8b9f3d2bb1a9dc8d743ee413778eb59a0e;p=friendica.git diff --git a/include/items.php b/include/items.php index 203b7d0eee..1d2a775c49 100644 --- a/include/items.php +++ b/include/items.php @@ -584,6 +584,12 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa "photo" => $arr['author-avatar'], "name" => $arr['author-name'])); } + if ($arr["author-id"] == 0) + $arr["author-id"] = get_contact($arr["author-link"], 0); + + if ($arr["owner-id"] == 0) + $arr["owner-id"] = get_contact($arr["owner-link"], 0); + if ($arr['guid'] != "") { // Checking if there is already an item with the same guid logger('checking for an item for user '.$arr['uid'].' on network '.$arr['network'].' with the guid '.$arr['guid'], LOGGER_DEBUG); @@ -1398,16 +1404,8 @@ function new_follower($importer,$contact,$datarray,$item,$sharing = false) { dbesc($url) ); if(count($r)) { - $contact_record = $r[0]; - - $photos = import_profile_photo($photo,$importer["uid"],$contact_record["id"]); - - q("UPDATE `contact` SET `photo` = '%s', `thumb` = '%s', `micro` = '%s' WHERE `id` = %d", - dbesc($photos[0]), - dbesc($photos[1]), - dbesc($photos[2]), - intval($contact_record["id"]) - ); + $contact_record = $r[0]; + update_contact_avatar($photo, $importer["uid"], $contact_record["id"], true); }