summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-05-27 01:24:54 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-05-27 01:24:54 +0000
commit55a959dbc797fcc74661c57ce4753809cf392e9e (patch)
tree44104f1bc0729ef39371718f4bf2d1763d64468a
parent5ad374391aa4b1ff7202cc7b08d6d320eb02e37d (diff)
Added 557 numeric (from MS Exchange chat server) to indicate too many results from /WHO
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1534 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/commands.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/commands.cpp b/src/commands.cpp
index 58597c2a0..7e3a7f09b 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -528,7 +528,7 @@ void handle_topic(char **parameters, int pcnt, userrec *user)
strlcpy(topic,parameters[1],MAXBUF);
if (strlen(topic)>MAXTOPIC)
{
- topic[MAXTOPIC-1] = '\0';
+ topic[MAXTOPIC] = '\0';
}
if (!strcasecmp(user->server,ServerName))
@@ -990,7 +990,10 @@ void handle_who(char **parameters, int pcnt, userrec *user)
WriteServ(user->fd,"352 %s %s %s %s %s %s %s :0 %s",user->nick, Ptr ? Ptr->name : "*", i->second->ident, i->second->dhost, i->second->server, i->second->nick, tmp, i->second->fullname);
n_list++;
if (n_list > MaxWhoResults)
+ {
+ WriteServ(user->fd,"557 %s WHO :Command aborted: More results than configured limit",user->nick);
break;
+ }
}
}
}
@@ -1009,6 +1012,7 @@ void handle_who(char **parameters, int pcnt, userrec *user)
Ptr = FindChan(parameters[0]);
if (Ptr)
{
+ int n_list = 0;
for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++)
{
if ((has_channel(i->second,Ptr)) && (isnick(i->second->nick)))
@@ -1023,6 +1027,13 @@ void handle_who(char **parameters, int pcnt, userrec *user)
if (strchr(i->second->modes,'o')) { strlcat(tmp, "*", 9); }
strlcat(tmp, cmode(i->second, Ptr),5);
WriteServ(user->fd,"352 %s %s %s %s %s %s %s :0 %s",user->nick, Ptr->name, i->second->ident, i->second->dhost, i->second->server, i->second->nick, tmp, i->second->fullname);
+ n_list++;
+ if (n_list > MaxWhoResults)
+ {
+ WriteServ(user->fd,"557 %s WHO :Command aborted: More results than configured limit",user->nick);
+ break;
+ }
+
}
}
WriteServ(user->fd,"315 %s %s :End of /WHO list.",user->nick, parameters[0]);