aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-03-04 17:36:52 -0800
committerzotlabs <mike@macgirvin.com>2018-03-04 17:40:38 -0800
commit59a2057fa0faac2db7b36a5d6c40435c6e13d378 (patch)
treeddedcaf3c023d4f9670063d6afaa230def78df1b
parentbe6619d9c06a31fa211c6200aad377d94c1fd0b5 (diff)
downloadvolse-hubzilla-59a2057fa0faac2db7b36a5d6c40435c6e13d378.tar.gz
volse-hubzilla-59a2057fa0faac2db7b36a5d6c40435c6e13d378.tar.bz2
volse-hubzilla-59a2057fa0faac2db7b36a5d6c40435c6e13d378.zip
fix some issues with friend suggestions on standalone sites with no 'suggestme' volunteers. This wrongly pulled up a site directory suggesting everybody on the site. While a better outcome than finding nobody, this does not fit with our ethical design goals. If there are no friends of friends, we will only suggest those who volunteer to be on the default suggestion list. Also do not attempt to load poco data from dead sites.
-rw-r--r--Zotlabs/Module/Directory.php5
-rw-r--r--Zotlabs/Module/Sitelist.php4
-rw-r--r--include/channel.php3
-rw-r--r--include/socgraph.php13
4 files changed, 16 insertions, 9 deletions
diff --git a/Zotlabs/Module/Directory.php b/Zotlabs/Module/Directory.php
index 85c0be6b6..62a1670f9 100644
--- a/Zotlabs/Module/Directory.php
+++ b/Zotlabs/Module/Directory.php
@@ -101,6 +101,11 @@ class Directory extends \Zotlabs\Web\Controller {
if($suggest) {
$r = suggestion_query(local_channel(),get_observer_hash());
+
+ if(! $r) {
+ notice( t('No default suggestions were found.') . EOL);
+ return;
+ }
// Remember in which order the suggestions were
$addresses = array();
diff --git a/Zotlabs/Module/Sitelist.php b/Zotlabs/Module/Sitelist.php
index e7d4187b7..2ac5ed1b8 100644
--- a/Zotlabs/Module/Sitelist.php
+++ b/Zotlabs/Module/Sitelist.php
@@ -32,7 +32,7 @@ class Sitelist extends \Zotlabs\Web\Controller {
$result = array('success' => false);
- $r = q("select count(site_url) as total from site where site_type = %d $sql_extra ",
+ $r = q("select count(site_url) as total from site where site_type = %d and site_dead = 0 $sql_extra ",
intval(SITE_TYPE_ZOT)
);
@@ -42,7 +42,7 @@ class Sitelist extends \Zotlabs\Web\Controller {
$result['start'] = $start;
$result['limit'] = $limit;
- $r = q("select * from site where site_type = %d $sql_extra $sql_order $sql_limit",
+ $r = q("select * from site where site_type = %d and site_dead = 0 $sql_extra $sql_order $sql_limit",
intval(SITE_TYPE_ZOT)
);
diff --git a/include/channel.php b/include/channel.php
index 204c1e64f..a754d3504 100644
--- a/include/channel.php
+++ b/include/channel.php
@@ -1126,8 +1126,7 @@ function channel_export_items($channel_id, $start, $finish) {
/**
* @brief Loads a profile into the App structure.
*
- * The function requires a writeable copy of the main App structure, and the
- * nickname of a valid channel.
+ * The function requires the nickname of a valid channel.
*
* Permissions of the current observer are checked. If a restricted profile is available
* to the current observer, that will be loaded instead of the channel default profile.
diff --git a/include/socgraph.php b/include/socgraph.php
index 87a880202..6cddbbaac 100644
--- a/include/socgraph.php
+++ b/include/socgraph.php
@@ -52,7 +52,7 @@ function poco_load($xchan = '', $url = null) {
elseif($s['return_code'] == 404)
logger('poco_load: nothing found');
else
- logger('poco_load: returns ' . print_r($s,true));
+ logger('poco_load: returns ' . print_r($s,true), LOGGER_DATA);
return;
}
@@ -288,11 +288,14 @@ function suggestion_query($uid, $myxchan, $start = 0, $limit = 80) {
function update_suggestions() {
- $dirmode = get_config('system', 'directory_mode');
- if($dirmode === false)
- $dirmode = DIRECTORY_MODE_NORMAL;
+ $dirmode = get_config('system', 'directory_mode', DIRECTORY_MODE_NORMAL);
- if(($dirmode == DIRECTORY_MODE_PRIMARY) || ($dirmode == DIRECTORY_MODE_STANDALONE)) {
+ if($dirmode == DIRECTORY_MODE_STANDALONE) {
+ poco_load('', z_root() . '/poco');
+ return;
+ }
+
+ if($dirmode == DIRECTORY_MODE_PRIMARY) {
$url = z_root() . '/sitelist';
}
else {