summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-24 23:25:43 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-24 23:25:43 +0000
commit22a080c8f00ce9df421d77a9e0e5011470bf1276 (patch)
treeaa784aaf9fc8f20c82a9257f47bf26c841cdd407
parent7fa29d1e2f23083c0949586ae0a369b264dc72e2 (diff)
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
-rw-r--r--src/cmd_ison.cpp19
1 files 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<userrec*,userrec*> 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;
}