From 22a080c8f00ce9df421d77a9e0e5011470bf1276 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 24 Dec 2006 23:25:43 +0000 Subject: Fix ISON with multiple lines of ISON response, canonize the responses to weed out dupes, because trillian's irc support blows donkeys git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6110 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/cmd_ison.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/cmd_ison.cpp b/src/cmd_ison.cpp index 851f8e171..f89b549ca 100644 --- a/src/cmd_ison.cpp +++ b/src/cmd_ison.cpp @@ -24,23 +24,30 @@ extern "C" command_t* init_command(InspIRCd* Instance) */ CmdResult cmd_ison::Handle (const char** parameters, int pcnt, userrec *user) { - char retbuf[MAXBUF]; + std::map ison_already; userrec *u; - - snprintf(retbuf, MAXBUF, "303 %s :", user->nick); + std::string reply = std::string("303 ") + user->nick + " :"; for (int i = 0; i < pcnt; i++) { u = ServerInstance->FindNick(parameters[i]); + if (ison_already.find(u) != ison_already.end()) + continue; if (u) { - strlcat(retbuf, u->nick, MAXBUF); - charlcat(retbuf, ' ', MAXBUF); + reply.append(u->nick).append(" "); + if (reply.length() > 450) + { + user->WriteServ(reply); + reply = std::string("303 ") + user->nick + " :"; + } + ison_already[u] = u; } } - user->WriteServ(retbuf); + if (!reply.empty()) + user->WriteServ(reply); return CMD_SUCCESS; } -- cgit v1.2.3