summaryrefslogtreecommitdiff
path: root/src/modes.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-05-26 17:13:11 -0400
committerAdam <Adam@anope.org>2013-05-26 17:13:11 -0400
commit22658d63bdb1e52a66f4514af45fa55ca5891345 (patch)
tree673304ab19f7e077b489354248247867518331f8 /src/modes.cpp
parentf2dee1e1d642b07947f59f91dfba9af34ef84685 (diff)
Get rid of the remaining references in the core to specific services. Move more stuff out of the core to the proper modules.
Diffstat (limited to 'src/modes.cpp')
-rw-r--r--src/modes.cpp33
1 files changed, 28 insertions, 5 deletions
diff --git a/src/modes.cpp b/src/modes.cpp
index 651fbafd9..2e9a49f09 100644
--- a/src/modes.cpp
+++ b/src/modes.cpp
@@ -14,9 +14,11 @@
#include "protocol.h"
#include "channels.h"
+struct StackerInfo;
+
/* List of pairs of user/channels and their stacker info */
-std::map<User *, StackerInfo *> ModeManager::UserStackerObjects;
-std::map<Channel *, StackerInfo *> ModeManager::ChannelStackerObjects;
+static std::map<User *, StackerInfo *> UserStackerObjects;
+static std::map<Channel *, StackerInfo *> ChannelStackerObjects;
/* List of all modes Anope knows about */
std::vector<ChannelMode *> ModeManager::ChannelModes;
@@ -31,6 +33,25 @@ static std::vector<ChannelModeStatus *> ChannelModesByStatus;
/* Number of generic modes we support */
unsigned ModeManager::GenericChannelModes = 0, ModeManager::GenericUserModes = 0;
+struct StackerInfo
+{
+ /* Modes to be added */
+ std::list<std::pair<Mode *, Anope::string> > AddModes;
+ /* Modes to be deleted */
+ std::list<std::pair<Mode *, Anope::string> > DelModes;
+ /* Bot this is sent from */
+ const BotInfo *bi;
+
+ StackerInfo() : bi(NULL) { }
+
+ /** Add a mode to this object
+ * @param mode The mode
+ * @param set true if setting, false if unsetting
+ * @param param The param for the mode
+ */
+ void AddMode(Mode *mode, bool set, const Anope::string &param);
+};
+
ChannelStatus::ChannelStatus()
{
}
@@ -255,7 +276,11 @@ static StackerInfo *GetInfo(List &l, Object *o)
return s;
}
-std::list<Anope::string> ModeManager::BuildModeStrings(StackerInfo *info)
+/** Build a list of mode strings to send to the IRCd from the mode stacker
+ * @param info The stacker info for a channel or user
+ * @return a list of strings
+ */
+static std::list<Anope::string> BuildModeStrings(StackerInfo *info)
{
std::list<Anope::string> ret;
std::list<std::pair<Mode *, Anope::string> >::iterator it, it_end;
@@ -521,8 +546,6 @@ void ModeManager::StackerAdd(const BotInfo *bi, User *u, UserMode *um, bool Set,
s->AddMode(um, Set, Param);
if (bi)
s->bi = bi;
- else
- s->bi = NULL;
if (!modePipe)
modePipe = new ModePipe();