From b2d2dcc7fe7af1b61e2636ed7e12c805fe67f49b Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 2 May 2017 20:17:47 -0700 Subject: more code refactoring to put external protocol dependencies in plugins. --- include/items.php | 36 +++++------------------------------- 1 file changed, 5 insertions(+), 31 deletions(-) (limited to 'include/items.php') diff --git a/include/items.php b/include/items.php index 30aa30048..a3f423836 100755 --- a/include/items.php +++ b/include/items.php @@ -801,37 +801,6 @@ function import_author_xchan($x) { } -/** - * @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; - -} - /** * @brief Imports an author from a RSS feed. * @@ -889,6 +858,11 @@ function import_author_rss($x) { function import_author_unknown($x) { + $arr = [ 'author' => $x, 'result' => false ]; + call_hooks('import_author', $arr); + if($arr['result']) + return $arr['result']; + if(! $x['url']) return false; -- cgit v1.2.3