diff options
| author | Adam <Adam@anope.org> | 2011-10-14 12:53:28 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2011-10-14 12:53:28 -0400 |
| commit | 2504af7d0f14ee72eac20dc6d6a12a08389ec0a9 (patch) | |
| tree | dda30bb16c21c74a87ff550bdafadb55de2af916 /modules | |
| parent | ddc3c2f38cf6ddc0c1f8ad82489a281e01ef50fc (diff) | |
Fixed os_forbid adds reason if no expiry is given
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/commands/os_forbid.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/modules/commands/os_forbid.cpp b/modules/commands/os_forbid.cpp index 00731f703..83b9829fa 100644 --- a/modules/commands/os_forbid.cpp +++ b/modules/commands/os_forbid.cpp @@ -101,11 +101,16 @@ class CommandOSForbid : public Command else if (subcommand.equals_ci("EMAIL")) type = FT_EMAIL; - if (command.equals_ci("ADD") && params.size() > 2 && type != FT_NONE) + if (command.equals_ci("ADD") && params.size() > 3 && type != FT_NONE) { const Anope::string &expiry = params[2][0] == '+' ? params[2] : ""; - const Anope::string &entry = params.size() > 3 && !expiry.empty() ? params[3] : params[2]; - Anope::string reason = !expiry.empty() && params.size() > 4 ? params[4] : (params.size() > 3 ? params[3] : ""); + const Anope::string &entry = !expiry.empty() ? params[3] : params[2]; + Anope::string reason; + if (expiry.empty()) + reason = params[3] + " "; + if (params.size() > 4) + reason += params[4]; + reason.trim(); time_t expiryt = 0; |
