diff options
author | Attila Molnar <attilamolnar@hush.com> | 2012-10-08 07:42:31 -0700 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2012-10-08 07:42:31 -0700 |
commit | 9fc6f1eac580c9114e0f6ed83233683fb16a5e3f (patch) | |
tree | 7abc9696c69a3f93efddba34ab5666d4e4e6f5c6 /src | |
parent | bf002b8ee071b1a0bf570376a17ff7754061e994 (diff) | |
parent | 428a5e3d0f5060d43c56a8a8595c8102241ce7ea (diff) |
Merge pull request #321 from ballock/insp20
Allows to use user->ident string instead of user->nick for NickServ.
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_passforward.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/modules/m_passforward.cpp b/src/modules/m_passforward.cpp index bf09c1f6e..fb7bae234 100644 --- a/src/modules/m_passforward.cpp +++ b/src/modules/m_passforward.cpp @@ -47,7 +47,7 @@ class ModulePassForward : public Module forwardcmd = Conf.ReadValue("passforward", "cmd", "PRIVMSG $nickrequired :IDENTIFY $pass", 0); } - void FormatStr(std::string& result, const std::string& format, const std::string &nick, const std::string &pass) + void FormatStr(std::string& result, const std::string& format, const LocalUser* user) { for (unsigned int i = 0; i < format.length(); i++) { @@ -61,12 +61,17 @@ class ModulePassForward : public Module } else if (format.substr(i, 5) == "$nick") { - result.append(nick); + result.append(user->nick); + i += 4; + } + else if (format.substr(i, 5) == "$user") + { + result.append(user->ident); i += 4; } else if (format.substr(i,5) == "$pass") { - result.append(pass); + result.append(user->password); i += 4; } else @@ -92,11 +97,11 @@ class ModulePassForward : public Module } std::string tmp; - FormatStr(tmp,forwardmsg, user->nick, user->password); + FormatStr(tmp,forwardmsg, user); user->WriteServ(tmp); tmp.clear(); - FormatStr(tmp,forwardcmd, user->nick, user->password); + FormatStr(tmp,forwardcmd, user); ServerInstance->Parser->ProcessBuffer(tmp,user); } }; |