summaryrefslogtreecommitdiff
path: root/include/channels.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/channels.h')
-rw-r--r--include/channels.h46
1 files changed, 28 insertions, 18 deletions
diff --git a/include/channels.h b/include/channels.h
index 547db9f20..664f06a0a 100644
--- a/include/channels.h
+++ b/include/channels.h
@@ -1,20 +1,30 @@
-/* Channel support
+/*
+ * Anope IRC Services
*
- * (C) 2008-2016 Anope Team
- * Contact us at team@anope.org
+ * Copyright (C) 2010-2016 Anope Team <team@anope.org>
*
- * Please read COPYING and README for further details.
+ * This file is part of Anope. Anope is free software; you can
+ * redistribute it and/or modify it under the terms of the GNU
+ * General Public License as published by the Free Software
+ * Foundation, version 2.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see see <http://www.gnu.org/licenses/>.
*/
-#ifndef CHANNELS_H
-#define CHANNELS_H
+#pragma once
#include "anope.h"
#include "extensible.h"
#include "modes.h"
#include "serialize.h"
-typedef Anope::hash_map<Channel *> channel_map;
+using channel_map = Anope::locale_hash_map<Channel *>;
extern CoreExport channel_map ChannelList;
@@ -44,7 +54,7 @@ class CoreExport Channel : public Base, public Extensible
/* Channel name */
Anope::string name;
/* Set if this channel is registered. ci->c == this. Contains information relevant to the registered channel */
- Serialize::Reference<ChannelInfo> ci;
+ Serialize::Reference<ChanServ::Channel> ci;
/* When the channel was created */
time_t creation_time;
/* If the channel has just been created in a netjoin */
@@ -149,7 +159,7 @@ class CoreExport Channel : public Base, public Extensible
* @param param The param
* @param enforce_mlock true if mlocks should be enforced, false to override mlock
*/
- void SetModeInternal(MessageSource &source, ChannelMode *cm, const Anope::string &param = "", bool enforce_mlock = true);
+ void SetModeInternal(const MessageSource &source, ChannelMode *cm, const Anope::string &param = "", bool enforce_mlock = true);
/** Remove a mode internally on a channel, this is not sent out to the IRCd
* @param setter The Setter
@@ -157,7 +167,7 @@ class CoreExport Channel : public Base, public Extensible
* @param param The param
* @param enforce_mlock true if mlocks should be enforced, false to override mlock
*/
- void RemoveModeInternal(MessageSource &source, ChannelMode *cm, const Anope::string &param = "", bool enforce_mlock = true);
+ void RemoveModeInternal(const MessageSource &source, ChannelMode *cm, const Anope::string &param = "", bool enforce_mlock = true);
/** Set a mode on a channel
* @param bi The client setting the modes
@@ -165,7 +175,7 @@ class CoreExport Channel : public Base, public Extensible
* @param param Optional param arg for the mode
* @param enforce_mlock true if mlocks should be enforced, false to override mlock
*/
- void SetMode(BotInfo *bi, ChannelMode *cm, const Anope::string &param = "", bool enforce_mlock = true);
+ void SetMode(User *bi, ChannelMode *cm, const Anope::string &param = "", bool enforce_mlock = true);
/**
* Set a mode on a channel
@@ -174,7 +184,7 @@ class CoreExport Channel : public Base, public Extensible
* @param param Optional param arg for the mode
* @param enforce_mlock true if mlocks should be enforced, false to override mlock
*/
- void SetMode(BotInfo *bi, const Anope::string &name, const Anope::string &param = "", bool enforce_mlock = true);
+ void SetMode(User *bi, const Anope::string &name, const Anope::string &param = "", bool enforce_mlock = true);
/** Remove a mode from a channel
* @param bi The client setting the modes
@@ -182,7 +192,7 @@ class CoreExport Channel : public Base, public Extensible
* @param param Optional param arg for the mode
* @param enforce_mlock true if mlocks should be enforced, false to override mlock
*/
- void RemoveMode(BotInfo *bi, ChannelMode *cm, const Anope::string &param = "", bool enforce_mlock = true);
+ void RemoveMode(User *bi, ChannelMode *cm, const Anope::string &param = "", bool enforce_mlock = true);
/**
* Remove a mode from a channel
@@ -191,7 +201,7 @@ class CoreExport Channel : public Base, public Extensible
* @param param Optional param arg for the mode
* @param enforce_mlock true if mlocks should be enforced, false to override mlock
*/
- void RemoveMode(BotInfo *bi, const Anope::string &name, const Anope::string &param = "", bool enforce_mlock = true);
+ void RemoveMode(User *bi, const Anope::string &name, const Anope::string &param = "", bool enforce_mlock = true);
/** Get a modes parameter for the channel
* @param name The mode
@@ -205,7 +215,7 @@ class CoreExport Channel : public Base, public Extensible
* @param enforce_mlock Should mlock be enforced on this mode change
* @param cmodes The modes to set
*/
- void SetModes(BotInfo *bi, bool enforce_mlock, const char *cmodes, ...);
+ void SetModes(User *bi, bool enforce_mlock, const char *cmodes, ...);
/** Set a string of modes internally on a channel
* @param source The setter
@@ -225,8 +235,9 @@ class CoreExport Channel : public Base, public Extensible
* @param source The sender of the kick
* @param nick The nick being kicked
* @param reason The reason for the kick
+ * @return true if the kick was scucessful, false if a module blocked the kick or was otherwise unsuccessful
*/
- void KickInternal(const MessageSource &source, const Anope::string &nick, const Anope::string &reason);
+ bool KickInternal(const MessageSource &source, const Anope::string &nick, const Anope::string &reason);
/** Kick a user from the channel
* @param bi The sender, can be NULL for the service bot for this channel
@@ -234,7 +245,7 @@ class CoreExport Channel : public Base, public Extensible
* @param reason The reason for the kick
* @return true if the kick was scucessful, false if a module blocked the kick
*/
- bool Kick(BotInfo *bi, User *u, const char *reason = NULL, ...);
+ bool Kick(User *bi, User *u, const char *reason = NULL, ...);
/** Get all modes set on this channel, excluding status modes.
* @return a map of modes and their optional parameters.
@@ -307,4 +318,3 @@ class CoreExport Channel : public Base, public Extensible
static void DeleteChannels();
};
-#endif // CHANNELS_H