aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-10-15 04:58:13 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-10-15 04:58:13 -0700
commit6d646e9df5ccd5c0b5a70f15e242b0c50a0b877b (patch)
treee1a5eb08dd9e9598f812039e9ea3074916673ea4
parenta1d37b6cc42c7f50007fdf081c3b0def5daa4395 (diff)
downloadvolse-hubzilla-6d646e9df5ccd5c0b5a70f15e242b0c50a0b877b.tar.gz
volse-hubzilla-6d646e9df5ccd5c0b5a70f15e242b0c50a0b877b.tar.bz2
volse-hubzilla-6d646e9df5ccd5c0b5a70f15e242b0c50a0b877b.zip
don't allow ignored contacts to post through the hub, change default poll
for hub subscribers to once a day now that we can utilise multiple hubs.
-rw-r--r--include/poller.php15
-rw-r--r--mod/pubsub.php2
2 files changed, 9 insertions, 8 deletions
diff --git a/include/poller.php b/include/poller.php
index bb82e5eda..720163fef 100644
--- a/include/poller.php
+++ b/include/poller.php
@@ -33,6 +33,14 @@
if($contact['priority'] || $contact['subhub']) {
$update = false;
+
+ // We should be getting everything via a hub. But just to be sure, let's check once a day.
+ // This also lets us update our subscription to the hub, and add or replace hubs in case it
+ // changed.
+
+ if($contact['subhub'])
+ $contact['priority'] = 3;
+
$t = $contact['last-update'];
switch ($contact['priority']) {
@@ -54,13 +62,6 @@
break;
case 1:
default:
-
- // if pubsub delivery is in effect, poll no more than once every hour.
- // We shouldn't need to poll at all with pubsub, but the hub isn't
- // always the most reliable postmaster... This way we still get the
- // messages when the hub goes flaky, just perhaps a bit slower.
- // At least it doesn't hurt to get them twice.
-
if(datetime_convert('UTC','UTC', 'now') > datetime_convert('UTC','UTC', $t . " + 1 hour"))
$update = true;
break;
diff --git a/mod/pubsub.php b/mod/pubsub.php
index b0157fbc3..b47b2eedf 100644
--- a/mod/pubsub.php
+++ b/mod/pubsub.php
@@ -104,7 +104,7 @@ function pubsub_post(&$a) {
$importer = $r[0];
- $r = q("SELECT * FROM `contact` WHERE `subhub` = 1 AND `id` = %d AND `uid` = %d AND `blocked` = 0 LIMIT 1",
+ $r = q("SELECT * FROM `contact` WHERE `subhub` = 1 AND `id` = %d AND `uid` = %d AND `blocked` = 0 AND `readonly` = 0 LIMIT 1",
intval($contact_id),
intval($importer['uid'])
);