summaryrefslogtreecommitdiff
path: root/src/xmpp
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2018-08-23 15:21:12 +0200
committerlouiz’ <louiz@louiz.org>2018-08-23 22:18:49 +0200
commit7d0df9b6ddee8db69ea0a511f031f32a4537a749 (patch)
tree86b1105169b6bf7ea5eea88fac3ec75597231d38 /src/xmpp
parent6c431b64d050a13853ebf3715fb6bf7986c0cff1 (diff)
downloadbiboumi-7d0df9b6ddee8db69ea0a511f031f32a4537a749.tar.gz
biboumi-7d0df9b6ddee8db69ea0a511f031f32a4537a749.tar.bz2
biboumi-7d0df9b6ddee8db69ea0a511f031f32a4537a749.tar.xz
biboumi-7d0df9b6ddee8db69ea0a511f031f32a4537a749.zip
Disable the throttle limit if negative
Also, invalid values result in -1 being set
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/biboumi_adhoc_commands.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/xmpp/biboumi_adhoc_commands.cpp b/src/xmpp/biboumi_adhoc_commands.cpp
index 45557aa..7c31f36 100644
--- a/src/xmpp/biboumi_adhoc_commands.cpp
+++ b/src/xmpp/biboumi_adhoc_commands.cpp
@@ -494,7 +494,11 @@ void ConfigureIrcServerStep2(XmppComponent& xmpp_component, AdhocSession& sessio
else if (field->get_tag("var") == "throttle_limit" && value)
{
- options.col<Database::ThrottleLimit>() = std::stoul(value->get_inner());
+ try {
+ options.col<Database::ThrottleLimit>() = std::stol(value->get_inner());
+ } catch (const std::logic_error&) {
+ options.col<Database::ThrottleLimit>() = -1;
+ }
Bridge* bridge = biboumi_component.find_user_bridge(session.get_owner_jid());
if (bridge)
{