$network = null;
$diaspora = false;
$diaspora_base = '';
- $diaspora_guid = '';
+ $diaspora_guid = '';
$diaspora_key = '';
$has_lrdd = false;
$email_conversant = false;
}
}
}
- }
+ }
if($mode == PROBE_NORMAL) {
if(strlen($zot)) {
}
if(strpos($url,'@'))
$addr = str_replace('acct:', '', $url);
- }
+ }
if($network !== NETWORK_ZOT && $network !== NETWORK_DFRN && $network !== NETWORK_MAIL) {
if($diaspora)
$vcard = scrape_vcard($hcard);
// Google doesn't use absolute url in profile photos
-
+
if((x($vcard,'photo')) && substr($vcard['photo'],0,1) == '/') {
$h = @parse_url($hcard);
if($h)
$vcard['photo'] = $h['scheme'] . '://' . $h['host'] . $vcard['photo'];
}
-
+
logger('probe_url: scrape_vcard: ' . print_r($vcard,true), LOGGER_DATA);
}
$vcard['nick'] = $addr_parts[0];
}
- if($twitter) {
+ if($twitter) {
logger('twitter: setup');
$tid = basename($url);
$tapi = 'https://api.twitter.com/1/statuses/user_timeline.rss';
}
-
+
function diaspora_request($importer,$xml) {
$a = get_app();
if(! $sender_handle || ! $recipient_handle)
return;
-
+
$contact = diaspora_get_contact_by_handle($importer['uid'],$sender_handle);
if($contact) {
}
function diaspora_post_allow($importer,$contact) {
+
+ // perhaps we were already sharing with this person. Now they're sharing with us.
+ // That makes us friends.
+ // Normally this should have handled by getting a request - but this could get lost
+ if($contact['rel'] == CONTACT_IS_FOLLOWER && $importer['page-flags'] != PAGE_COMMUNITY) {
+ q("UPDATE `contact` SET `rel` = %d, `writable` = 1 WHERE `id` = %d AND `uid` = %d LIMIT 1",
+ intval(CONTACT_IS_FRIEND),
+ intval($contact['id']),
+ intval($importer['uid'])
+ );
+ $contact['rel'] = CONTACT_IS_FRIEND;
+ logger('diaspora_post_allow: defining user '.$contact["nick"].' as friend');
+ }
+
if(($contact['blocked']) || ($contact['readonly']) || ($contact['archive']))
return false;
if($contact['rel'] == CONTACT_IS_SHARING || $contact['rel'] == CONTACT_IS_FRIEND)
$myaddr = bin2hex($a->get_baseurl() . '/profile/' . $a->user['nickname']);
else
$myaddr = bin2hex($a->user['nickname'] . '@' . $a->get_hostname());
-
+
goaway($ret['request'] . "&addr=$myaddr");
-
+
// NOTREACHED
}
}
return $result;
}
}
-
+
logger('lrdd: constructed url: ' . $url);
$xml = fetch_url($url);
+
$headers = $a->get_curl_headers();
if (! $xml)
if(is_null($a)) {
$a = new App;
}
-
+
if(is_null($db)) {
@include(".htconfig.php");
require_once("include/dba.php");
load_hooks();
logger('poller: start');
-
+
// run queue delivery process in the background
proc_run('php',"include/queue.php");
-
+
// expire any expired accounts
q("UPDATE user SET `account_expired` = 1 where `account_expired` = 0
AND `account_expires_on` != '0000-00-00 00:00:00'
AND `account_expires_on` < UTC_TIMESTAMP() ");
-
+
// delete user and contact records for recently removed accounts
$r = q("SELECT * FROM `user` WHERE `account_removed` = 1 AND `account_expires_on` < UTC_TIMESTAMP() - INTERVAL 3 DAY");
q("DELETE FROM `user` WHERE `uid` = %d", intval($user['uid']));
}
}
-
+
$abandon_days = intval(get_config('system','account_abandon_days'));
if($abandon_days < 1)
$abandon_days = 0;
-
+
// once daily run birthday_updates and then expire in background
</ul>
</div>
{{ else }}
- <!-- <div class="profile-edit-side-div"><a class="profile-edit-side-link icon edit" title="$editprofile" href="profiles/$profid" ></a></div> -->
+ <div class="profile-edit-side-div"><a class="profile-edit-side-link icon edit" title="$editprofile" href="profiles" ></a></div>
{{ endif }}
</div>