diff options
Diffstat (limited to 'src/modules/m_cap.cpp')
-rw-r--r-- | src/modules/m_cap.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/modules/m_cap.cpp b/src/modules/m_cap.cpp index 5673c7f62..86f79103c 100644 --- a/src/modules/m_cap.cpp +++ b/src/modules/m_cap.cpp @@ -98,8 +98,13 @@ class CommandCAP : public Command Event event((char*) &Data, (Module*)this->Creator, subcommand == "LS" ? "cap_ls" : "cap_list"); event.Send(this->ServerInstance); - std::string Result = irc::stringjoiner(" ", Data.wanted, 0, Data.wanted.size() - 1).GetJoined(); - user->WriteServ("CAP * LS :%s", Result.c_str()); + std::string Result; + if (Data.wanted.size() > 0) + Result = irc::stringjoiner(" ", Data.wanted, 0, Data.wanted.size() - 1).GetJoined(); + else + Result = ""; + + user->WriteServ("CAP * %s :%s", subcommand.c_str(), Result.c_str()); } else if (subcommand == "CLEAR") { |