diff options
author | Peter Powell <petpow@saberuk.com> | 2014-02-05 13:49:16 +0000 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-02-06 23:10:01 +0100 |
commit | db0e78c5d2e0998591b274c027fef26e1ac6ce6a (patch) | |
tree | f87b58008e0b3ccb44c4c4088e913de95cf1dcb3 /src/modules | |
parent | 13edc2e8eb1404e51131468451ed64ef4d25cdaf (diff) |
Fix various cases of UUID exposure.
- Introduce WriteCommand which sends * when the user has not registered.
- Switch a ton of code to use WriteCommand instead of WriteServ.
- Convert WriteNotice to be a wrapper around WriteCommand.
- Only send * when NICK has not been sent instead of before registration.
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_cap.cpp | 8 | ||||
-rw-r--r-- | src/modules/m_cloaking.cpp | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/modules/m_cap.cpp b/src/modules/m_cap.cpp index 968c304ab..9e074b219 100644 --- a/src/modules/m_cap.cpp +++ b/src/modules/m_cap.cpp @@ -75,13 +75,13 @@ class CommandCAP : public Command if (Data.ack.size() > 0) { std::string AckResult = irc::stringjoiner(Data.ack).GetJoined(); - user->WriteServ("CAP %s ACK :%s", user->nick.c_str(), AckResult.c_str()); + user->WriteCommand("CAP", "ACK :" + AckResult); } if (Data.wanted.size() > 0) { std::string NakResult = irc::stringjoiner(Data.wanted).GetJoined(); - user->WriteServ("CAP %s NAK :%s", user->nick.c_str(), NakResult.c_str()); + user->WriteCommand("CAP", "NAK :" + NakResult); } } else if (subcommand == "END") @@ -96,7 +96,7 @@ class CommandCAP : public Command Data.Send(); std::string Result = irc::stringjoiner(Data.wanted).GetJoined(); - user->WriteServ("CAP %s %s :%s", user->nick.c_str(), subcommand.c_str(), Result.c_str()); + user->WriteCommand("CAP", subcommand + " :" + Result); } else if (subcommand == "CLEAR") { @@ -106,7 +106,7 @@ class CommandCAP : public Command Data.Send(); std::string Result = irc::stringjoiner(Data.ack).GetJoined(); - user->WriteServ("CAP %s ACK :%s", user->nick.c_str(), Result.c_str()); + user->WriteCommand("CAP", "ACK :" + Result); } else { diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp index d83786a20..5d62c9cf6 100644 --- a/src/modules/m_cloaking.cpp +++ b/src/modules/m_cloaking.cpp @@ -301,7 +301,7 @@ class ModuleCloaking : public Module if (u->IsModeSet(cu)) { u->SetMode(cu, false); - u->WriteServ("MODE %s -%c", u->nick.c_str(), cu.GetModeChar()); + u->WriteCommand("MODE", "-" + ConvToStr(cu.GetModeChar())); } } |