/*
* ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors.
+ * Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors.
*
* 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
* Channel management
*/
-#include "imp.h"
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <stdio.h>
#include <strings.h>
+#include <time.h>
-#include "defines.h"
#include "conn-func.h"
-#include "exp.h"
#include "channel.h"
-#include "imp.h"
#include "irc-write.h"
#include "conf.h"
#include "hash.h"
-#include "lists.h"
#include "log.h"
#include "messages.h"
#include "match.h"
-#include "exp.h"
-
-
#define REMOVE_PART 0
#define REMOVE_QUIT 1
#define REMOVE_KICK 2
!Channel_UserHasMode(chan, Target, 'a') &&
!Channel_UserHasMode(chan, Target, 'o'))
can_kick = true;
+
+ /* IRC operators & IRCd with OperCanMode enabled
+ * can kick anyways regardless of privilege */
+ else if(Client_HasMode(Origin, 'o') && Conf_OperCanMode)
+ can_kick = true;
if(!can_kick) {
IRC_WriteErrClient(Origin, ERR_CHANOPPRIVTOOLOW_MSG,
GLOBAL bool
-Channel_AddBan(CHANNEL *c, const char *mask )
+Channel_AddBan(CHANNEL *c, const char *mask, const char *who )
{
struct list_head *h = Channel_GetListBans(c);
LogDebug("Adding \"%s\" to \"%s\" ban list", mask, Channel_Name(c));
- return Lists_Add(h, mask, false, NULL);
+ return Lists_Add(h, mask, time(NULL), who, false);
}
GLOBAL bool
-Channel_AddExcept(CHANNEL *c, const char *mask )
+Channel_AddExcept(CHANNEL *c, const char *mask, const char *who )
{
struct list_head *h = Channel_GetListExcepts(c);
LogDebug("Adding \"%s\" to \"%s\" exception list", mask, Channel_Name(c));
- return Lists_Add(h, mask, false, NULL);
+ return Lists_Add(h, mask, time(NULL), who, false);
}
GLOBAL bool
-Channel_AddInvite(CHANNEL *c, const char *mask, bool onlyonce)
+Channel_AddInvite(CHANNEL *c, const char *mask, bool onlyonce, const char *who )
{
struct list_head *h = Channel_GetListInvites(c);
LogDebug("Adding \"%s\" to \"%s\" invite list", mask, Channel_Name(c));
- return Lists_Add(h, mask, onlyonce, NULL);
+ return Lists_Add(h, mask, time(NULL), who, onlyonce);
}
while (e) {
if (!IRC_WriteStrClient(Client, msg, Client_ID(Client),
Channel_Name(Channel),
- Lists_GetMask(e)))
+ Lists_GetMask(e),
+ Lists_GetReason(e),
+ Lists_GetValidity(e)))
return DISCONNECTED;
e = Lists_GetNext(e);
}