diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-03-24 19:05:43 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-03-24 19:05:43 +0000 |
commit | 0825e274f6e047c3e948334b8fdbc0189dba3e32 (patch) | |
tree | b40bf524a416cc09680eb00f7724fd1c2c9292fc /src | |
parent | ca049db71a518655e7c3bfe0f0d8a057ec88c8bb (diff) |
Finally fixed a load of umode change stuff!
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@897 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/mode.cpp | 13 | ||||
-rw-r--r-- | src/modules/m_services.cpp | 13 |
2 files changed, 14 insertions, 12 deletions
diff --git a/src/mode.cpp b/src/mode.cpp index 9b7d29e94..082a0fadb 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -1691,8 +1691,13 @@ void merge_mode2(char **parameters, int pcnt, userrec* user) strcpy(outpars,"+"); direction = 1; + if ((parameters[1][0] == ':') && (strlen(parameters[1])>1)) + { + // some stupid 3rd party things (such as services packages) put a colon on the mode list... + log(DEBUG,"Some muppet put a colon on the modelist! changed to '%s'",++parameters[1]); + } if ((parameters[1][0] != '+') && (parameters[1][0] != '-')) - return; + return; for (int i = 0; i < strlen(parameters[1]); i++) { @@ -1746,6 +1751,7 @@ void merge_mode2(char **parameters, int pcnt, userrec* user) dmodes[strlen(dmodes)] = parameters[1][i]; outpars[strlen(outpars)+1]='\0'; outpars[strlen(outpars)] = parameters[1][i]; + log(DEBUG,"OUTPARS='%s', DMODES='%s'",outpars,dmodes); } } } @@ -1783,6 +1789,7 @@ void merge_mode2(char **parameters, int pcnt, userrec* user) } } } + log(DEBUG,"DONE! OUTPARS='%s', DMODES='%s'",outpars,dmodes); if (strlen(outpars)) { char b[MAXBUF]; @@ -1818,7 +1825,9 @@ void merge_mode2(char **parameters, int pcnt, userrec* user) if ((!strcmp(b,"+")) || (!strcmp(b,"-"))) return; - WriteTo(user,dest,"MODE :%s",b); + // was sending 'b' + WriteTo(user,dest,"MODE %s :%s",dest->nick,b); + log(DEBUG,"Sent: :%s MODE %s",user->nick,b); if (strlen(dmodes)>MAXMODES) { diff --git a/src/modules/m_services.cpp b/src/modules/m_services.cpp index 878724168..dd1506717 100644 --- a/src/modules/m_services.cpp +++ b/src/modules/m_services.cpp @@ -48,14 +48,7 @@ class ModuleServices : public Module // only a u-lined server may add or remove the +r mode. if ((Srv->IsUlined(user->nick)) || (Srv->IsUlined(user->server))) { - // FCS - BugFix for #27 :) - if ((!strchr(user->modes,'r')) && (mode_on == false)) { - return 1; - } else if ((strchr(user->modes,'r')) && (mode_on == true)) { - return 1; - } else { - return 0; - } + return 1; } else { @@ -64,13 +57,13 @@ class ModuleServices : public Module } else { - if (!strcmp(user->server,"")) + if ((Srv->IsUlined(user->nick)) || (Srv->IsUlined(user->server)) || (!strcmp(user->server,""))) { return 1; } else { - Srv->SendServ(user->fd,"500 "+std::string(user->nick)+" :Only a server may modify the +r user mode"); + Srv->SendServ(user->fd,"500 "+std::string(user->nick)+" :Only a U-Lined server may modify the +r user mode"); } } } |