diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-05-02 23:21:56 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-05-02 23:21:56 +0000 |
commit | 1eefcc4331fb40b0232c81e8fabbc8c8a0e97e6d (patch) | |
tree | 27acd42a14459e846a0c08397829b2918b58389f /src/mode.cpp | |
parent | 8f9a7390f83dc60cdaac42bf0108313b2d39f1df (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.cpp | 30 |
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) { |