From 93e93f58bd703dc4dbe254e1e6ca80fc41739971 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 19 Jul 2015 10:40:33 +0200 Subject: [PATCH] Query Redmatrix contacts for their contacts as well. --- include/socgraph.php | 9 +++++++-- mod/admin.php | 6 +++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/include/socgraph.php b/include/socgraph.php index 18c2c7c4c1..c97a0f15cd 100644 --- a/include/socgraph.php +++ b/include/socgraph.php @@ -939,6 +939,7 @@ function update_suggestions() { $done = array(); + // To-Do: Check if it is really neccessary to poll the own server poco_load(0,0,0,$a->get_baseurl() . '/poco'); $done[] = $a->get_baseurl() . '/poco'; @@ -949,6 +950,9 @@ function update_suggestions() { $j = json_decode($x); if($j->entries) { foreach($j->entries as $entry) { + + poco_check_server($entry->url); + $url = $entry->url . '/poco'; if(! in_array($url,$done)) poco_load(0,0,0,$entry->url . '/poco'); @@ -957,8 +961,9 @@ function update_suggestions() { } } - $r = q("select distinct(poco) as poco from contact where network = '%s'", - dbesc(NETWORK_DFRN) + // Query your contacts from Friendica and Redmatrix/Hubzilla for their contacts + $r = q("SELECT DISTINCT(`poco`) AS `poco` FROM `contact` WHERE `network` IN ('%s', '%s')", + dbesc(NETWORK_DFRN), dbesc(NETWORK_DIASPORA) ); if(count($r)) { diff --git a/mod/admin.php b/mod/admin.php index 8c3e2441bc..a079bdabf8 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -641,7 +641,7 @@ function admin_page_site(&$a) { '$upload' => t('File upload'), '$corporate' => t('Policies'), '$advanced' => t('Advanced'), - '$portable_contacts' => t('Portable Contact Directory'), + '$portable_contacts' => t('Auto Discovered Contact Directory'), '$performance' => t('Performance'), '$relocate'=> t('Relocate - WARNING: advanced function. Could make this server unreachable.'), '$baseurl' => $a->get_baseurl(true), @@ -699,8 +699,8 @@ function admin_page_site(&$a) { '$maxloadavg' => array('maxloadavg', t("Maximum Load Average"), ((intval(get_config('system','maxloadavg')) > 0)?get_config('system','maxloadavg'):50), t("Maximum system load before delivery and poll processes are deferred - default 50.")), '$maxloadavg_frontend' => array('maxloadavg_frontend', t("Maximum Load Average (Frontend)"), ((intval(get_config('system','maxloadavg_frontend')) > 0)?get_config('system','maxloadavg_frontend'):50), t("Maximum system load before the frontend quits service - default 50.")), - '$poco_completion' => array('poco_completion', t("Completion of incoming contacts"), get_config('system','poco_completion'), t("Complete data of incomplete incoming contacts that are provided by the 'portable contacts' functionality. (Useful for poco exchange with Redmatrix and friendica servers before 3.3)")), - '$poco_discovery' => array('poco_discovery', t("Discover contacts from other servers"), (string) intval(get_config('system','poco_discovery')), t("Periodically query other servers for profiles. You can choose between 'users': the users on the remote system, 'Global Contacts': active contacts that are known on the system. The fallback is meant for Redmatrix servers and older friendica servers, where global contacts weren't available."), $poco_discovery_choices), + '$poco_completion' => array('poco_completion', t("Completion of incoming contacts"), get_config('system','poco_completion'), t("Complete data of incomplete incoming contacts that are provided by the 'portable contacts' functionality. (Useful when communicating with Redmatrix and friendica servers before 3.3)")), + '$poco_discovery' => array('poco_discovery', t("Discover contacts from other servers"), (string) intval(get_config('system','poco_discovery')), t("Periodically query other servers for contacts. You can choose between 'users': the users on the remote system, 'Global Contacts': active contacts that are known on the system. The fallback is meant for Redmatrix servers and older friendica servers, where global contacts weren't available."), $poco_discovery_choices), '$use_fulltext_engine' => array('use_fulltext_engine', t("Use MySQL full text engine"), get_config('system','use_fulltext_engine'), t("Activates the full text engine. Speeds up search - but can only search for four and more characters.")), '$suppress_language' => array('suppress_language', t("Suppress Language"), get_config('system','suppress_language'), t("Suppress language information in meta information about a posting.")), -- 2.39.5