summaryrefslogtreecommitdiff
path: root/plugins/OStatus/actions
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/OStatus/actions')
-rw-r--r--plugins/OStatus/actions/pushcallback.php3
-rw-r--r--plugins/OStatus/actions/pushhub.php6
2 files changed, 8 insertions, 1 deletions
diff --git a/plugins/OStatus/actions/pushcallback.php b/plugins/OStatus/actions/pushcallback.php
index 2601a377a..388c8f9c3 100644
--- a/plugins/OStatus/actions/pushcallback.php
+++ b/plugins/OStatus/actions/pushcallback.php
@@ -59,6 +59,9 @@ class PushCallbackAction extends Action
}
$post = file_get_contents('php://input');
+
+ // @fixme Queue this to a background process; we should return
+ // as quickly as possible from a distribution POST.
$profile->postUpdates($post, $hmac);
}
diff --git a/plugins/OStatus/actions/pushhub.php b/plugins/OStatus/actions/pushhub.php
index 901c18f70..13ec09d52 100644
--- a/plugins/OStatus/actions/pushhub.php
+++ b/plugins/OStatus/actions/pushhub.php
@@ -44,7 +44,7 @@ class PushHubAction extends Action
// PHP converts '.'s in incoming var names to '_'s.
// It also merges multiple values, which'll break hub.verify and hub.topic for publishing
// @fixme handle multiple args
- $arg = str_replace('.', '_', $arg);
+ $arg = str_replace('hub.', 'hub_', $arg);
return parent::arg($arg, $def);
}
@@ -96,7 +96,11 @@ class PushHubAction extends Action
$sub = new HubSub();
$sub->topic = $feed;
$sub->callback = $callback;
+ $sub->verify_token = $this->arg('hub.verify_token', null);
$sub->secret = $this->arg('hub.secret', null);
+ if (strlen($sub->secret) > 200) {
+ throw new ClientException("hub.secret must be no longer than 200 chars", 400);
+ }
$sub->setLease(intval($this->arg('hub.lease_seconds')));
// @fixme check for feeds we don't manage