From db0e78c5d2e0998591b274c027fef26e1ac6ce6a Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Wed, 5 Feb 2014 13:49:16 +0000 Subject: 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. --- src/modules/m_cap.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/modules/m_cap.cpp') 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 { -- cgit v1.3.1-10-gc9f91