X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcmd_invite.cpp;h=0eaafe2117fbed9addb1643900c5b74f9cc78e5a;hb=db07867e945deb72ce103f796e20104a27c5f68a;hp=07559a08236c9f22957308775abbeb994da975e3;hpb=aaf5226111f515f4baa68e95ea6a1db740828ac3;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/cmd_invite.cpp b/src/cmd_invite.cpp index 07559a082..0eaafe211 100644 --- a/src/cmd_invite.cpp +++ b/src/cmd_invite.cpp @@ -14,27 +14,14 @@ * --------------------------------------------------- */ -using namespace std; - -#include "inspircd_config.h" -#include "inspircd.h" -#include "inspircd_io.h" -#include #include -#include +#include "configreader.h" #include "users.h" -#include "ctables.h" -#include "globals.h" #include "modules.h" -#include "dynamic.h" -#include "message.h" #include "commands.h" -#include "inspstring.h" #include "helperfuncs.h" -#include "hashcomp.h" -#include "typedefs.h" -#include "command_parse.h" -#include "cmd_invite.h" +#include "message.h" +#include "commands/cmd_invite.h" extern ServerConfig* Config; extern int MODCOUNT; @@ -43,6 +30,8 @@ extern std::vector factory; void cmd_invite::Handle (char **parameters, int pcnt, userrec *user) { + int MOD_RESULT = 0; + if (pcnt == 2) { userrec* u = Find(parameters[0]); @@ -62,7 +51,7 @@ void cmd_invite::Handle (char **parameters, int pcnt, userrec *user) return; } - if ((c->binarymodes & CM_INVITEONLY) && (IS_LOCAL(user))) + if ((c->modes[CM_INVITEONLY]) && (IS_LOCAL(user))) { if (cstatus(user,c) < STATUS_HOP) { @@ -70,20 +59,23 @@ void cmd_invite::Handle (char **parameters, int pcnt, userrec *user) return; } } + if (c->HasUser(u)) { WriteServ(user->fd,"443 %s %s %s :Is already on channel %s",user->nick,u->nick,c->name,c->name); return; } + if ((IS_LOCAL(user)) && (!c->HasUser(user))) { WriteServ(user->fd,"442 %s %s :You're not on that channel!",user->nick, c->name); return; } - int MOD_RESULT = 0; FOREACH_RESULT(I_OnUserPreInvite,OnUserPreInvite(user,u,c)); - if (MOD_RESULT == 1) { + + if (MOD_RESULT == 1) + { return; } @@ -105,5 +97,3 @@ void cmd_invite::Handle (char **parameters, int pcnt, userrec *user) WriteServ(user->fd,"347 %s :End of INVITE list",user->nick); } } - -