aboutsummaryrefslogtreecommitdiffstats
path: root/include/diaspora.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-08-12 03:01:11 -0700
committerFriendika <info@friendika.com>2011-08-12 03:01:11 -0700
commitaefc6209a3d07d70835422e690f624c72075c410 (patch)
tree94977d3c9e917ce2f9323783c22eabb0f68db72f /include/diaspora.php
parentfda593caeda997fbd97eed28f69107ce91c16242 (diff)
downloadvolse-hubzilla-aefc6209a3d07d70835422e690f624c72075c410.tar.gz
volse-hubzilla-aefc6209a3d07d70835422e690f624c72075c410.tar.bz2
volse-hubzilla-aefc6209a3d07d70835422e690f624c72075c410.zip
improved diaspora discovery
Diffstat (limited to 'include/diaspora.php')
-rw-r--r--include/diaspora.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/include/diaspora.php b/include/diaspora.php
index f799b6a49..d4e9c530c 100644
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -244,6 +244,39 @@ function diaspora_decode($importer,$xml) {
function diaspora_request($importer,$contact,$xml) {
+ $sender_handle = $xml->sender_handle;
+ $recipient_handle = $xml->recipient_handle;
+
+ if(! $sender_handle || ! $recipient_handle)
+ return;
+
+ if($contact) {
+ q("UPDATE `contact` SET `rel` = %d WHERE `id` = %d AND `uid` = %d LIMIT 1",
+ intval(CONTACT_IS_FRIEND),
+ intval($contact['id']),
+ intval($importer['uid'])
+ );
+ // send notification
+ return;
+ }
+
+ require_once('include/Scrape.php');
+ $ret = probe_url($sender_handle);
+ $errors = false;
+ if((! count($ret)) || ($ret['network'] != NETWORK_DIASPORA)) {
+ logger('diaspora_request: Cannot resolve diaspora handle ' . $sender_handle . ' for ' . $recipient_handle);
+ $errors = true;
+ }
+
+
+ if($errors)
+ return;
+
+
+
+
+
+
}
function diaspora_post($importer,$contact,$xml) {