aboutsummaryrefslogtreecommitdiffstats
path: root/include/diaspora.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-09-20 01:49:08 -0700
committerFriendika <info@friendika.com>2011-09-20 01:49:08 -0700
commit9edf15d3ef0548a35862fab37eee1fd310705285 (patch)
treed8c6e34b8e83116d1c9151b58ca63d24845923cb /include/diaspora.php
parent8a11cec61a87600273f1349e3d112e7fc1e65486 (diff)
downloadvolse-hubzilla-9edf15d3ef0548a35862fab37eee1fd310705285.tar.gz
volse-hubzilla-9edf15d3ef0548a35862fab37eee1fd310705285.tar.bz2
volse-hubzilla-9edf15d3ef0548a35862fab37eee1fd310705285.zip
structures for batch mode (Diaspora/zot)
Diffstat (limited to 'include/diaspora.php')
-rw-r--r--include/diaspora.php11
1 files changed, 4 insertions, 7 deletions
diff --git a/include/diaspora.php b/include/diaspora.php
index 425bc722f..94c4e3098 100644
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -68,6 +68,7 @@ function diaspora_get_contact_by_handle($uid,$handle) {
}
function find_diaspora_person_by_handle($handle) {
+ $update = false;
$r = q("select * from fcontact where network = '%s' and addr = '%s' limit 1",
dbesc(NETWORK_DIASPORA),
dbesc($handle)
@@ -75,18 +76,14 @@ function find_diaspora_person_by_handle($handle) {
if(count($r)) {
// update record occasionally so it doesn't get stale
$d = strtotime($r[0]['updated'] . ' +00:00');
- if($d < strtotime('now - 14 days')) {
- q("delete from fcontact where id = %d limit 1",
- intval($r[0]['id'])
- );
- }
- else
+ if($d > strtotime('now - 14 days'))
return $r[0];
+ $update = true;
}
require_once('include/Scrape.php');
$r = probe_url($handle, PROBE_DIASPORA);
if((count($r)) && ($r['network'] === NETWORK_DIASPORA)) {
- add_fcontact($r);
+ add_fcontact($r,$update);
return ($r);
}
return false;