From c92bb6176a79ef575c9a9b5dec8fde7034c6421c Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 1 Feb 2018 15:09:51 -0800 Subject: more separation of complex code into separate functions --- Zotlabs/Module/Connedit.php | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) (limited to 'Zotlabs/Module/Connedit.php') diff --git a/Zotlabs/Module/Connedit.php b/Zotlabs/Module/Connedit.php index 8288886cd..e23a751d9 100644 --- a/Zotlabs/Module/Connedit.php +++ b/Zotlabs/Module/Connedit.php @@ -826,27 +826,10 @@ class Connedit extends \Zotlabs\Web\Controller { } } - $locstr = ''; - - $locs = q("select hubloc_addr as location from hubloc left join site on hubloc_url = site_url where hubloc_hash = '%s' - and hubloc_deleted = 0 and site_dead = 0", - dbesc($contact['xchan_hash']) - ); - - if($locs) { - foreach($locs as $l) { - if(!($l['location'])) - continue; - if(strpos($locstr,$l['location']) !== false) - continue; - if(strlen($locstr)) - $locstr .= ', '; - $locstr .= $l['location']; - } - } - else + $locstr = locations_by_netid($contact['xchan_hash']); + if(! $locstr) $locstr = $contact['xchan_url']; - + $clone_warn = ''; $clonable = (in_array($contact['xchan_network'],['zot','rss']) ? true : false); if(! $clonable) { -- cgit v1.2.3