aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-08-10 20:01:52 -0700
committerredmatrix <git@macgirvin.com>2016-08-10 20:01:52 -0700
commita8a3812890a23ece4bfff6fe009609f579479bc4 (patch)
tree0668669b46bfde3e6a4e63ce103101bef2866737 /Zotlabs
parent6c672d2575764b48c8570e8d10d3434abec1ab5e (diff)
downloadvolse-hubzilla-a8a3812890a23ece4bfff6fe009609f579479bc4.tar.gz
volse-hubzilla-a8a3812890a23ece4bfff6fe009609f579479bc4.tar.bz2
volse-hubzilla-a8a3812890a23ece4bfff6fe009609f579479bc4.zip
optimise Onepoll so it doesn't try and fetch posts for a channel that we've not given permission to send us their stream and posts. Currently the posts are fetched, processed, and ultimately discarded. Since we know they are going to be discarded, there's not much point fetching them in the first place.
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Daemon/Onepoll.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/Zotlabs/Daemon/Onepoll.php b/Zotlabs/Daemon/Onepoll.php
index 21c46cec5..bebf8bf17 100644
--- a/Zotlabs/Daemon/Onepoll.php
+++ b/Zotlabs/Daemon/Onepoll.php
@@ -102,11 +102,20 @@ class Onepoll {
$fetch_feed = true;
$x = null;
+ // They haven't given us permission to see their stream
+
$can_view_stream = intval(get_abconfig($importer_uid,$contact['abook_xchan'],'their_perms','view_stream'));
if(! $can_view_stream)
$fetch_feed = false;
+ // we haven't given them permission to send us their stream
+
+ $can_send_stream = intval(get_abconfig($importer_uid,$contact['abook_xchan'],'my_perms','send_stream'));
+
+ if(! $can_send_stream)
+ $fetch_feed = false;
+
if($fetch_feed) {
$feedurl = str_replace('/poco/','/zotfeed/',$contact['xchan_connurl']);