]> git.mxchange.org Git - friendica.git/commitdiff
don't allow ignored contacts to post through the hub, change default poll
authorMike Macgirvin <mike@macgirvin.com>
Fri, 15 Oct 2010 11:58:13 +0000 (04:58 -0700)
committerMike Macgirvin <mike@macgirvin.com>
Fri, 15 Oct 2010 11:58:13 +0000 (04:58 -0700)
for hub subscribers to once a day now that we can utilise multiple hubs.

include/poller.php
mod/pubsub.php

index bb82e5eda74b90d6791ddab001528d21df854a9b..720163fef7b29cdb180ebf5d48361b0755daa652 100644 (file)
                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']) {
                                        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;
index b0157fbc35ded3b3ffdac9faa4f53ae93a1adf17..b47b2eedf3fc5cf3194e81ba55f558b0c77a3a6d 100644 (file)
@@ -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'])
        );