diff options
author | attilamolnar <attilamolnar@hush.com> | 2012-11-29 20:12:33 +0100 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2012-11-29 21:12:13 +0100 |
commit | 83db3dc06a44b50d8e25828e201a51edb4030d92 (patch) | |
tree | 6a1439fb8bcb0a034e53ff35b84f38696c330dae /src/modules/m_cgiirc.cpp | |
parent | d53f0956ab7ff6b63430bb62ba7dbcfd2fde8e41 (diff) |
m_cgiirc Fix wrong announcement when the host in WEBIRC is too long
Diffstat (limited to 'src/modules/m_cgiirc.cpp')
-rw-r--r-- | src/modules/m_cgiirc.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index f6ad5992a..08b8d3f1c 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -89,11 +89,15 @@ class CommandWebirc : public Command { realhost.set(user, user->host); realip.set(user, user->GetIPString()); + + bool host_ok = (parameters[2].length() < 64); + const std::string& newhost = (host_ok ? parameters[2] : parameters[3]); + if (notify) - ServerInstance->SNO->WriteGlobalSno('a', "Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from %s", user->nick.c_str(), user->host.c_str(), parameters[2].c_str(), user->host.c_str()); + ServerInstance->SNO->WriteGlobalSno('a', "Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from %s", user->nick.c_str(), user->host.c_str(), newhost.c_str(), user->host.c_str()); // Check if we're happy with the provided hostname. If it's problematic then make sure we won't set a host later, just the IP - if (parameters[2].length() < 64) + if (host_ok) webirc_hostname.set(user, parameters[2]); else webirc_hostname.unset(user); |