1 // Channel.H -*- C++ -*-
2 // Copyright (c) 1997, 1998 Etienne BERNARD
3 // Copyright (C) 2002,2008 Clinton Ebadi
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
39 class ServerConnection;
45 #define DEFAULT_KEEPMODES "iklmnpst"
47 // This struct is used to keep information about
48 // the channel we want to join, the modes we
49 // want to set/keep on these channels, and the
51 struct wantedChannel {
56 wantedChannel(String m, String kp, String ky)
57 : mode(m), keep(kp), key(ky) { }
75 std::map<String, User *, std::less<String> > channelMemory;
76 BanList channelBanlist;
77 ServerConnection * cnx;
84 INVITE_ONLY = 4, // +i
85 TOPIC_RESTRICTED = 8, // +t
86 EXTMSG_RESTRICTED = 16, // +n
88 HAS_KEY = 64, // +k <key>
89 IS_LIMITED = 128 // +l <limit>
92 Channel(ServerConnection *, String, String);
95 void addNick(String, String, int, UserList *, bool = false);
97 void changeNick(String, String);
99 User * getUser(String);
101 void addBan(const Mask&, std::time_t = -1);
102 void delBan(const Mask&);
103 void purge_expired_bans ();
104 template<typename T> void for_each_ban_entry (const T & fun)
105 { channelBanlist.foreach (fun); }
107 void parseMode(Person *, String);
112 friend class Commands;
113 friend class UserCommands;