Software /
code /
prosody-modules
Diff
mod_pubsub_hub/mod_pubsub_hub.lua @ 767:e5667f1da6bf
mod_pubsub_hub: Enforce minimal lease time
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 02 Aug 2012 00:28:33 +0200 |
parent | 766:1184fe8ebb21 |
child | 785:e781e63a49f4 |
line wrap: on
line diff
--- a/mod_pubsub_hub/mod_pubsub_hub.lua Thu Aug 02 00:25:24 2012 +0200 +++ b/mod_pubsub_hub/mod_pubsub_hub.lua Thu Aug 02 00:28:33 2012 +0200 @@ -50,7 +50,7 @@ local callback = body["hub.callback"]; local mode = body["hub.mode"]; local topic = body["hub.topic"]; - local lease_seconds = m_min(tonumber(body["hub.lease_seconds"]) or default_lease, max_lease); + local lease_seconds = m_max(min_lease, m_min(tonumber(body["hub.lease_seconds"]) or default_lease, max_lease)); local secret = body["hub.secret"]; local verify_token = body["hub.verify_token"];