summaryrefslogtreecommitdiff
path: root/plugins/OStatus/actions
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-02-18 06:36:47 -0500
committerEvan Prodromou <evan@status.net>2010-02-18 06:36:47 -0500
commitb6e5d4ecc39aa0ee8618e2907aa3ad8f4e9af8a5 (patch)
treeb45314ad86becbda16fb475ac36d1431492069dd /plugins/OStatus/actions
parent80ef3946d016eeeef1682e73eddffb222d8db149 (diff)
parent07f145049e8f0de848255d7b21ddb64866db0c83 (diff)
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing
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