summaryrefslogtreecommitdiff
path: root/src/mode.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-05-02 23:21:56 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-05-02 23:21:56 +0000
commit1eefcc4331fb40b0232c81e8fabbc8c8a0e97e6d (patch)
tree27acd42a14459e846a0c08397829b2918b58389f /src/mode.cpp
parent8f9a7390f83dc60cdaac42bf0108313b2d39f1df (diff)
Fix to prevent empty umodes
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1283 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/mode.cpp')
-rw-r--r--src/mode.cpp30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/mode.cpp b/src/mode.cpp
index 65e42e875..610ea21e4 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -1444,12 +1444,14 @@ void handle_mode(char **parameters, int pcnt, userrec *user)
if ((!b[0]) || (!strcmp(b,"+")) || (!strcmp(b,"-")))
return;
- WriteTo(user, dest, "MODE %s :%s", dest->nick, b);
-
- // M token for a usermode must go to all servers
- char buffer[MAXBUF];
- snprintf(buffer,MAXBUF,"m %s %s %s",user->nick, dest->nick, b);
- NetSendToAll(buffer);
+ if (strcmp(b,""))
+ {
+ WriteTo(user, dest, "MODE %s :%s", dest->nick, b);
+ // M token for a usermode must go to all servers
+ char buffer[MAXBUF];
+ snprintf(buffer,MAXBUF,"m %s %s %s",user->nick, dest->nick, b);
+ NetSendToAll(buffer);
+ }
if (strlen(dmodes)>MAXMODES)
{
@@ -1696,15 +1698,17 @@ void server_mode(char **parameters, int pcnt, userrec *user)
if ((b[z] == '-') || (b[z] == '+'))
b[z] = '\0';
- if ((!strcmp(b,"+")) || (!strcmp(b,"-")))
+ if ((!b[0]) || (!strcmp(b,"+")) || (!strcmp(b,"-")))
return;
- WriteTo(user, dest, "MODE %s :%s", dest->nick, b);
-
- // M token for a usermode must go to all servers
- char buffer[MAXBUF];
- snprintf(buffer,MAXBUF,"m %s %s %s",user->nick, dest->nick, b);
- NetSendToAll(buffer);
+ if (strcmp(b,""))
+ {
+ WriteTo(user, dest, "MODE %s :%s", dest->nick, b);
+ // M token for a usermode must go to all servers
+ char buffer[MAXBUF];
+ snprintf(buffer,MAXBUF,"m %s %s %s",user->nick, dest->nick, b);
+ NetSendToAll(buffer);
+ }
if (strlen(dmodes)>MAXMODES)
{