Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge
This commit is contained in:
@@ -777,6 +777,38 @@ function import_author_xchan($x) {
|
||||
}
|
||||
|
||||
return($y);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Imports an author from Diaspora.
|
||||
*
|
||||
* @param array $x an associative array with
|
||||
* * \e string \b address
|
||||
* @return boolean|string false on error, otherwise xchan_hash of the new entry
|
||||
*/
|
||||
function import_author_diaspora($x) {
|
||||
if(! $x['address'])
|
||||
return false;
|
||||
|
||||
$r = q("select * from xchan where xchan_addr = '%s' limit 1",
|
||||
dbesc($x['address'])
|
||||
);
|
||||
if($r) {
|
||||
logger('in_cache: ' . $x['address'], LOGGER_DATA);
|
||||
return $r[0]['xchan_hash'];
|
||||
}
|
||||
|
||||
if(discover_by_webbie($x['address'])) {
|
||||
$r = q("select xchan_hash from xchan where xchan_addr = '%s' limit 1",
|
||||
dbesc($x['address'])
|
||||
);
|
||||
if($r)
|
||||
return $r[0]['xchan_hash'];
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user