]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_uninvite.cpp
cmode(), cflags(), cstatus() -> chanrec::GetStatusChar(), chanrec::GetStatusFlags...
[user/henk/code/inspircd.git] / src / modules / m_uninvite.cpp
index 3e9c37a3ae8190d4d48020f5fda25bf38aeb024e..70e73cfad501e69ef045b4a93d435e62f71441fd 100644 (file)
@@ -24,8 +24,10 @@ using namespace std;
 #include "modules.h"
 #include "helperfuncs.h"
 #include "message.h"
+#include "inspircd.h"
 
 static Server *Srv;
+extern InspIRCd* ServerInstance;
         
 class cmd_uninvite : public command_t
 {
@@ -38,18 +40,18 @@ class cmd_uninvite : public command_t
 
        void Handle (const char** parameters, int pcnt, userrec *user)
        {
-               userrec* u = Find(parameters[0]);
-               chanrec* c = FindChan(parameters[1]);
+               userrec* u = ServerInstance->FindNick(parameters[0]);
+               chanrec* c = ServerInstance->FindChan(parameters[1]);
                         
                if ((!c) || (!u))
                {       
                        if (!c)
                        {
-                               WriteServ(user->fd,"401 %s %s :No such nick/channel",user->nick, parameters[1]);
+                               user->WriteServ("401 %s %s :No such nick/channel",user->nick, parameters[1]);
                        }
                        else
                        {
-                               WriteServ(user->fd,"401 %s %s :No such nick/channel",user->nick, parameters[0]);
+                               user->WriteServ("401 %s %s :No such nick/channel",user->nick, parameters[0]);
                        }
                                
                        return; 
@@ -57,9 +59,9 @@ class cmd_uninvite : public command_t
 
                if (c->modes[CM_INVITEONLY])
                {
-                       if (cstatus(user,c) < STATUS_HOP)
+                       if (c->GetStatus(user) < STATUS_HOP)
                        {
-                               WriteServ(user->fd,"482 %s %s :You must be at least a half-operator to change modes on this channel",user->nick, c->name);
+                               user->WriteServ("482 %s %s :You must be at least a half-operator to change modes on this channel",user->nick, c->name);
                                return;
                        }
                }
@@ -68,18 +70,18 @@ class cmd_uninvite : public command_t
 
                if (!u->IsInvited(xname))
                {
-                       WriteServ(user->fd,"491 %s %s %s :Is not invited to channel %s",user->nick,u->nick,c->name,c->name);
+                       user->WriteServ("491 %s %s %s :Is not invited to channel %s",user->nick,u->nick,c->name,c->name);
                        return;
                }
                if (!c->HasUser(user))
                {
-                       WriteServ(user->fd,"492 %s %s :You're not on that channel!",user->nick, c->name);
+                       user->WriteServ("492 %s %s :You're not on that channel!",user->nick, c->name);
                        return;
                }
 
                u->RemoveInvite(xname);
-               WriteServ(user->fd,"494 %s %s %s :Uninvited",user->nick,c->name,u->nick);
-               WriteServ(u->fd,"493 %s :You were uninvited from %s by %s",u->nick,c->name,user->nick);
+               user->WriteServ("494 %s %s %s :Uninvited",user->nick,c->name,u->nick);
+               u->WriteServ("493 %s :You were uninvited from %s by %s",u->nick,c->name,user->nick);
                c->WriteChannelWithServ(Srv->GetServerName().c_str(), "NOTICE %s :*** %s uninvited %s.", c->name, user->nick, u->nick);
        }
 };