X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fdfrn_notify.php;h=f284b8b38955cf3ee284d9b4a43d7af85acb4f4e;hb=2d90068ec2b4fc6c918c87fc9321c3954da6a26f;hp=64b5ec479ee61bffd2a5415e8aa9a5df29b43c84;hpb=4e7a5dc56ebb8d99ed06b0b303c4ee24460ae6a8;p=friendica.git diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index 64b5ec479e..f284b8b389 100644 --- a/mod/dfrn_notify.php +++ b/mod/dfrn_notify.php @@ -154,6 +154,31 @@ function dfrn_notify_post(&$a) { $feed->enable_order_by_date(false); $feed->init(); + $reloc = $feed->get_feed_tags( NAMESPACE_DFRN, 'relocate' ); + if(isset($reloc[0]['child'][NAMESPACE_DFRN])) { + $base = $reloc[0]['child'][NAMESPACE_DFRN]; + $newloc = array(); + $newloc['uid'] = $importer['importer_uid']; + $newloc['cid'] = $importer['id']; + $newloc['name'] = notags(unxmlify($base['name'][0]['data'])); + $newloc['photo'] = notags(unxmlify($base['photo'][0]['data'])); + $newloc['url'] = notags(unxmlify($base['url'][0]['data'])); + $newloc['request'] = notags(unxmlify($base['request'][0]['data'])); + $newloc['confirm'] = notags(unxmlify($base['confirm'][0]['data'])); + $newloc['notify'] = notags(unxmlify($base['notify'][0]['data'])); + $newloc['poll'] = notags(unxmlify($base['poll'][0]['data'])); + $newloc['site-pubkey'] = notags(unxmlify($base['site-pubkey'][0]['data'])); + $newloc['pubkey'] = notags(unxmlify($base['pubkey'][0]['data'])); + $newloc['prvkey'] = notags(unxmlify($base['prvkey'][0]['data'])); + + // TODO + // merge with current record, current contents have priority + // update record, set url-updated + // update profile photos + // schedule a scan? + + } + // handle friend suggestion notification $sugg = $feed->get_feed_tags( NAMESPACE_DFRN, 'suggest' ); @@ -679,6 +704,7 @@ function dfrn_notify_post(&$a) { $ev['uid'] = $importer['uid']; $ev['uri'] = $item_id; $ev['edited'] = $datarray['edited']; + $ev['private'] = $datarray['private']; $r = q("SELECT * FROM `event` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1", dbesc($item_id), @@ -722,6 +748,12 @@ function dfrn_notify_post(&$a) { continue; } + // This is my contact on another system, but it's really me. + // Turn this into a wall post. + + if($contact['remote_self']) + $datarray['wall'] = 1; + $datarray['parent-uri'] = $item_id; $datarray['uid'] = $importer['importer_uid']; $datarray['contact-id'] = $importer['id'];