From a8a3812890a23ece4bfff6fe009609f579479bc4 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 10 Aug 2016 20:01:52 -0700 Subject: [PATCH] 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. --- Zotlabs/Daemon/Onepoll.php | 9 +++++++++ 1 file changed, 9 insertions(+) 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']);