summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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)
{