// Channel.H -*- C++ -*-
// Copyright (c) 1997, 1998 Etienne BERNARD
-// Copyright (C) 2002 Clinton Ebadi
+// Copyright (C) 2002,2008 Clinton Ebadi
// 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
#ifndef CHANNEL_H
#define CHANNEL_H
-#include <ctime>
+#include <algorithm>
+#include <functional>
#include <map>
#include <vector>
+#include <ctime>
+
+#include "BanList.H"
#include "String.H"
class BanEntry;
class Bot;
class Commands;
+class Mask;
class Parser;
class Person;
class ServerConnection;
bool doMode;
bool gotWho;
std::map<String, User *, std::less<String> > channelMemory;
- std::vector<BanEntry *> channelBanlist;
+ BanList channelBanlist;
ServerConnection * cnx;
public:
bool hasNick(String);
User * getUser(String);
- void addBan(String, std::time_t = -1);
- void delBan(String);
+ void addBan(const Mask&, std::time_t = -1);
+ void delBan(const Mask&);
+ void purge_expired_bans ();
+ template<typename T> void for_each_ban_entry (const T & fun)
+ { channelBanlist.foreach (fun); }
void parseMode(Person *, String);
void resynchModes();