]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/irc-op.c
array_free(): enable debug code only when DEBUG_ARRAY is #define'd.
[ngircd-alex.git] / src / ngircd / irc-op.c
index e90d07458932ea42bec7f1343581e9cc08c436f5..ac477793c0ef1aad708607dce89dde74b3a93e47 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2003 by Alexander Barton (alex@barton.de)
+ * Copyright (c)2001-2005 by Alexander Barton (alex@barton.de)
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: irc-op.c,v 1.13 2004/04/09 21:41:52 alex Exp $";
+static char UNUSED id[] = "$Id: irc-op.c,v 1.17 2006/12/07 17:57:20 fw Exp $";
 
 #include "imp.h"
 #include <assert.h>
 #include <string.h>
 #include <stdio.h>
 
+#include "defines.h"
 #include "conn.h"
 #include "client.h"
 #include "channel.h"
-#include "defines.h"
 #include "irc-write.h"
 #include "lists.h"
 #include "log.h"
@@ -35,7 +35,7 @@ static char UNUSED id[] = "$Id: irc-op.c,v 1.13 2004/04/09 21:41:52 alex Exp $";
 #include "irc-op.h"
 
 
-GLOBAL BOOLEAN
+GLOBAL bool
 IRC_KICK( CLIENT *Client, REQUEST *Req )
 {
        CLIENT *target, *from;
@@ -59,12 +59,12 @@ IRC_KICK( CLIENT *Client, REQUEST *Req )
 } /* IRC_KICK */       
 
 
-GLOBAL BOOLEAN
+GLOBAL bool
 IRC_INVITE( CLIENT *Client, REQUEST *Req )
 {
        CHANNEL *chan;
        CLIENT *target, *from;
-       BOOLEAN remember = FALSE;
+       bool remember = false;
 
        assert( Client != NULL );
        assert( Req != NULL );
@@ -92,24 +92,24 @@ IRC_INVITE( CLIENT *Client, REQUEST *Req )
                {
                        /* Yes. The user must be channel operator! */
                        if( ! strchr( Channel_UserModes( chan, from ), 'o' )) return IRC_WriteStrClient( from, ERR_CHANOPRIVSNEEDED_MSG, Client_ID( from ), Channel_Name( chan ));
-                       remember = TRUE;
+                       remember = true;
                }
 
                /* Is the target user already member of the channel? */
                if( Channel_IsMemberOf( chan, target )) return IRC_WriteStrClient( from, ERR_USERONCHANNEL_MSG, Client_ID( from ), Req->argv[0], Req->argv[1] );
 
                /* If the target user is banned on that channel: remember invite */
-               if( Lists_CheckBanned( target, chan )) remember = TRUE;
+               if( Lists_Check(Channel_GetListBans(chan), target )) remember = true;
 
-               if( remember )
-               {
-                       /* We must memember this invite */
-                       if( ! Lists_AddInvited( Client_Mask( target ), chan, TRUE )) return CONNECTED;
+               if (remember) {
+                       /* We must remember this invite */
+                       if( ! Channel_AddInvite(chan, Client_Mask( target ), true))
+                               return CONNECTED;
                }
        }
 
-       Log( LOG_DEBUG, "User \"%s\" invites \"%s\" to \"%s\" ...", Client_Mask( from ), Req->argv[0], Req->argv[1] );
-       
+       LogDebug("User \"%s\" invites \"%s\" to \"%s\" ...", Client_Mask(from), Req->argv[0], Req->argv[1]);
+
        /* Inform target client */
        IRC_WriteStrClientPrefix( target, from, "INVITE %s %s", Req->argv[0], Req->argv[1] );