}
/**
-
-
-Things to consider...
-* should we purge incomplete subscriptions that never get a verification pingback?
-* when can we send subscription renewal checks?
- - at next send time probably ok
-* when can we handle trimming of subscriptions?
- - at next send time probably ok
-* should we keep a fail count?
-
-*/
-
+ * Things to consider...
+ * should we purge incomplete subscriptions that never get a verification pingback?
+ * when can we send subscription renewal checks?
+ * - at next send time probably ok
+ * when can we handle trimming of subscriptions?
+ * - at next send time probably ok
+ * should we keep a fail count?
+ */
class PushHubAction extends Action
{
function arg($arg, $def=null)
$verify = $this->arg('hub.verify'); // @fixme may be multiple
if ($verify != 'sync' && $verify != 'async') {
- // TRANS: Client exception.
+ // TRANS: Client exception. %s is sync or async.
throw new ClientException(sprintf(_m('Invalid hub.verify "%s". It must be sync or async.'),$verify));
}
$lease = $this->arg('hub.lease_seconds', null);
if ($mode == 'subscribe' && $lease != '' && !preg_match('/^\d+$/', $lease)) {
- // TRANS: Client exception.
+ // TRANS: Client exception. %s is the invalid lease value.
throw new ClientException(sprintf(_m('Invalid hub.lease "%s". It must be empty or positive integer.'),$lease));
}
$secret = $this->arg('hub.secret', null);
if ($secret != '' && strlen($secret) >= 200) {
- // TRANS: Client exception.
+ // TRANS: Client exception. %s is the invalid hub secret.
throw new ClientException(sprintf(_m('Invalid hub.secret "%s". It must be under 200 bytes.'),$secret));
}
if ($feed == $userFeed) {
$user = User::staticGet('id', $id);
if (!$user) {
- // TRANS: Client exception.
- throw new ClientException(sprintt(_m('Invalid hub.topic "%s". User doesn\'t exist.'),$feed));
+ // TRANS: Client exception. %s is a feed URL.
+ throw new ClientException(sprintt(_m('Invalid hub.topic "%s". User does not exist.'),$feed));
} else {
return true;
}
if ($feed == $groupFeed) {
$user = User_group::staticGet('id', $id);
if (!$user) {
- // TRANS: Client exception.
- throw new ClientException(sprintf(_m('Invalid hub.topic "%s". Group doesn\'t exist.'),$feed));
+ // TRANS: Client exception. %s is a feed URL.
+ throw new ClientException(sprintf(_m('Invalid hub.topic "%s". Group does not exist.'),$feed));
} else {
return true;
}
$list = Profile_list::staticGet('id', $id);
$user = User::staticGet('id', $user);
if (!$list || !$user || $list->tagger != $user->id) {
- throw new ClientException("Invalid hub.topic $feed; people tag doesn't exist.");
+ // TRANS: Client exception. %s is a feed URL.
+ throw new ClientException(sprintf(_m('Invalid hub.topic %s; people tag does not exist.'),$feed));
} else {
return true;
}