summaryrefslogtreecommitdiff
path: root/include
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 /include
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 'include')
-rw-r--r--include/account.h14
-rw-r--r--include/bots.h2
-rw-r--r--include/channels.h11
-rw-r--r--include/config.h3
-rw-r--r--include/modes.h28
-rw-r--r--include/module.h8
-rw-r--r--include/modules.h33
-rw-r--r--include/modules/pseudoclients/chanserv.h (renamed from include/modules/chanserv.h)0
-rw-r--r--include/modules/pseudoclients/global.h (renamed from include/modules/global.h)0
-rw-r--r--include/modules/pseudoclients/memoserv.h (renamed from include/modules/memoserv.h)0
-rw-r--r--include/modules/pseudoclients/nickserv.h (renamed from include/modules/nickserv.h)3
-rw-r--r--include/regchannel.h11
-rw-r--r--include/users.h6
13 files changed, 37 insertions, 82 deletions
diff --git a/include/account.h b/include/account.h
index b5edd7ec2..4d6bd714f 100644
--- a/include/account.h
+++ b/include/account.h
@@ -65,18 +65,6 @@ class CoreExport NickAlias : public Serializable, public Extensible
void Serialize(Serialize::Data &data) const anope_override;
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
- /** Release a nick
- * See the comment in users.cpp
- */
- void Release();
-
- /** This function is called when a user on this nick either disconnects or changes nick.
- * Note that the user isnt necessarially identified to this nick
- * See the comment in users.cpp
- * @param u The user
- */
- void OnCancel(User *u);
-
/** Set a vhost for the user
* @param ident The ident
* @param host The host
@@ -306,7 +294,7 @@ class CoreExport NickCore : public Serializable, public Extensible
};
/* A request to check if an account/password is valid. These can exist for
- * extended periods of time due to some authentication modules take.
+ * extended periods due to the time some authentication modules take.
*/
class CoreExport IdentifyRequest
{
diff --git a/include/bots.h b/include/bots.h
index 42345d8ea..ef05c11e0 100644
--- a/include/bots.h
+++ b/include/bots.h
@@ -131,6 +131,4 @@ class CoreExport BotInfo : public User, public Serializable
static BotInfo* Find(const Anope::string &nick, bool nick_only = false);
};
-extern CoreExport BotInfo *BotServ, *ChanServ, *Global, *HostServ, *MemoServ, *NickServ, *OperServ;
-
#endif // BOTS_H
diff --git a/include/channels.h b/include/channels.h
index 7d1918f08..25bd95097 100644
--- a/include/channels.h
+++ b/include/channels.h
@@ -30,12 +30,6 @@ struct ChanUserContainer : public Extensible
ChanUserContainer(User *u, Channel *c) : user(u), chan(c) { }
};
-/* Possible flags:
- *
- * INHABIT - ChanServ is currently holding the channel
- * PERSIST - Channel still exists when emptied (IRCd enforced)
- * SYNCING - Channel is syncing users (channel was just created) and it should not be deleted
- */
class CoreExport Channel : public Base, public Extensible
{
public:
@@ -52,6 +46,8 @@ class CoreExport Channel : public Base, public Extensible
Serialize::Reference<ChannelInfo> ci;
/* When the channel was created */
time_t creation_time;
+ /* If the channel has just been created in a netjoin */
+ bool syncing;
/* Users in the channel */
typedef std::map<User *, ChanUserContainer *> ChanUserList;
@@ -272,9 +268,8 @@ class CoreExport Channel : public Base, public Extensible
* for the specified user.
* @param user The user to give/remove modes to/from
* @param give_modes if true modes may be given to the user
- * @param check_noop if true, CI_NOAUTOOP is checked before giving modes
*/
- void SetCorrectModes(User *u, bool give_mode, bool check_noop);
+ void SetCorrectModes(User *u, bool give_modes);
/** Unbans a user from this channel.
* @param u The user to unban
diff --git a/include/config.h b/include/config.h
index bd76ca8a5..0ea30e5f6 100644
--- a/include/config.h
+++ b/include/config.h
@@ -124,6 +124,7 @@ namespace Configuration
/* module configuration blocks */
std::map<Anope::string, Block *> modules;
+ Anope::map<Anope::string> bots;
Conf();
@@ -131,6 +132,8 @@ namespace Configuration
Block *GetModule(Module *);
Block *GetModule(const Anope::string &name);
+
+ BotInfo *GetClient(const Anope::string &name);
};
struct Uplink
diff --git a/include/modes.h b/include/modes.h
index 2d9755817..1e5d7f7c1 100644
--- a/include/modes.h
+++ b/include/modes.h
@@ -262,24 +262,6 @@ class CoreExport ChannelModeRegistered : public ChannelMode
bool CanSet(User *u) const anope_override;
};
-class StackerInfo
-{
- public:
- /* 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;
-
- /** 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);
-};
-
/** This is the mode manager
* It contains functions for adding modes to Anope so Anope can track them
* and do things such as MLOCK.
@@ -289,16 +271,6 @@ class StackerInfo
class CoreExport ModeManager
{
protected:
- /* List of pairs of user/channels and their stacker info */
- static std::map<User *, StackerInfo *> UserStackerObjects;
- static std::map<Channel *, StackerInfo *> ChannelStackerObjects;
-
- /** 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);
-
/* Array of all modes Anope knows about. Modes are in this array at position
* modechar. Additionally, status modes are in this array (again) at statuschar.
*/
diff --git a/include/module.h b/include/module.h
index d2b365bd7..39ef3403f 100644
--- a/include/module.h
+++ b/include/module.h
@@ -46,9 +46,9 @@
#include "users.h"
#include "xline.h"
-#include "modules/chanserv.h"
-#include "modules/global.h"
-#include "modules/memoserv.h"
-#include "modules/nickserv.h"
+#include "modules/pseudoclients/chanserv.h"
+#include "modules/pseudoclients/global.h"
+#include "modules/pseudoclients/memoserv.h"
+#include "modules/pseudoclients/nickserv.h"
#endif // MODULE_H
diff --git a/include/modules.h b/include/modules.h
index 641f6f80e..3f99a9114 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -363,9 +363,8 @@ class CoreExport Module : public Extensible
virtual void OnPostCommand(CommandSource &source, Command *command, const std::vector<Anope::string> &params) { }
/** Called when the databases are saved
- * @return EVENT_CONTINUE to let other modules continue saving, EVENT_STOP to stop
*/
- virtual EventReturn OnSaveDatabase() { return EVENT_CONTINUE; }
+ virtual void OnSaveDatabase() { }
/** Called when the databases are loaded
* @return EVENT_CONTINUE to let other modules continue loading, EVENT_STOP to stop
@@ -714,11 +713,16 @@ class CoreExport Module : public Extensible
*/
virtual void OnNickGroup(User *u, NickAlias *target) { }
- /** Called when a user identifies
+ /** Called when a user identifies to a nick
* @param u The user
*/
virtual void OnNickIdentify(User *u) { }
+ /** Called when a user is logged into an account
+ * @param u The user
+ */
+ virtual void OnUserLogin(User *u) { }
+
/** Called when a nick logs out
* @param u The nick
*/
@@ -985,8 +989,9 @@ class CoreExport Module : public Extensible
* @param chan The channel
* @param access The user's access on the channel
* @param give_modes If giving modes is desired
+ * @param take_modes If taking modes is desired
*/
- virtual void OnSetCorrectModes(User *user, Channel *chan, AccessGroup &access, bool give_modes) { }
+ virtual void OnSetCorrectModes(User *user, Channel *chan, AccessGroup &access, bool &give_modes, bool &take_modes) { }
virtual void OnSerializeCheck(Serialize::Type *) { }
virtual void OnSerializableConstruct(Serializable *) { }
@@ -1025,6 +1030,13 @@ class CoreExport Module : public Extensible
* @param cm The mode
*/
virtual EventReturn OnCanSet(User *u, const ChannelMode *cm) { return EVENT_CONTINUE; }
+
+ virtual EventReturn OnCheckDelete(Channel *) { return EVENT_CONTINUE; }
+
+ /** Called every options:expiretimeout seconds. Should be used to expire nicks,
+ * channels, etc.
+ */
+ virtual void OnExpireTick() { }
};
/** Implementation-specific flags which may be set in ModuleManager::Attach()
@@ -1036,13 +1048,13 @@ enum Implementation
I_OnPreNickExpire, I_OnNickExpire, I_OnNickForbidden, I_OnNickGroup, I_OnNickLogout, I_OnNickIdentify, I_OnNickDrop,
I_OnNickRegister, I_OnNickSuspended, I_OnNickUnsuspended, I_OnDelNick, I_OnNickCoreCreate, I_OnDelCore, I_OnChangeCoreDisplay,
I_OnNickClearAccess, I_OnNickAddAccess, I_OnNickEraseAccess, I_OnNickClearCert, I_OnNickAddCert, I_OnNickEraseCert,
- I_OnNickInfo, I_OnCheckAuthentication, I_OnNickUpdate, I_OnSetNickOption,
+ I_OnNickInfo, I_OnCheckAuthentication, I_OnNickUpdate, I_OnSetNickOption, I_OnUserLogin,
/* ChanServ */
I_OnChanSuspend, I_OnChanDrop, I_OnPreChanExpire, I_OnChanExpire, I_OnAccessAdd,
I_OnAccessDel, I_OnAccessClear, I_OnLevelChange, I_OnChanRegistered, I_OnChanUnsuspend, I_OnCreateChan, I_OnDelChan, I_OnChannelCreate,
- I_OnChannelDelete, I_OnAkickAdd, I_OnAkickDel, I_OnCheckKick, I_OnCheckModes,
- I_OnChanInfo, I_OnCheckPriv, I_OnGroupCheckPriv, I_OnSetChannelOption, I_OnChannelSync, I_OnSetCorrectModes,
+ I_OnAkickAdd, I_OnAkickDel, I_OnCheckKick, I_OnCheckModes,
+ I_OnChanInfo, I_OnCheckPriv, I_OnGroupCheckPriv, I_OnSetChannelOption, I_OnSetCorrectModes,
/* BotServ */
I_OnCreateBot, I_OnDelBot,
@@ -1055,6 +1067,9 @@ enum Implementation
/* MemoServ */
I_OnMemoSend, I_OnMemoDel,
+ /* Channels */
+ I_OnChannelModeSet, I_OnChannelModeUnset, I_OnChannelDelete, I_OnChannelSync, I_OnCheckDelete,
+
/* Users */
I_OnUserConnect, I_OnUserNickChange, I_OnUserQuit, I_OnPreUserLogoff, I_OnPostUserLogoff,
I_OnJoinChannel, I_OnPrePartChannel, I_OnPartChannel, I_OnLeaveChannel, I_OnFingerprint, I_OnUserAway, I_OnInvite,
@@ -1074,9 +1089,9 @@ enum Implementation
I_OnPreHelp, I_OnPostHelp, I_OnPreCommand, I_OnPostCommand, I_OnRestart, I_OnShutdown,
I_OnServerQuit, I_OnTopicUpdated,
I_OnEncrypt, I_OnDecrypt,
- I_OnChannelModeSet, I_OnChannelModeUnset, I_OnUserModeSet, I_OnUserModeUnset, I_OnChannelModeAdd, I_OnUserModeAdd,
+ I_OnUserModeSet, I_OnUserModeUnset, I_OnChannelModeAdd, I_OnUserModeAdd,
I_OnMLock, I_OnUnMLock, I_OnServerSync, I_OnUplinkSync, I_OnBotPrivmsg, I_OnPrivmsg, I_OnLog, I_OnDnsRequest,
- I_OnMessage, I_OnCanSet,
+ I_OnMessage, I_OnCanSet, I_OnExpireTick,
I_OnSerializeCheck, I_OnSerializableConstruct, I_OnSerializableDestruct, I_OnSerializableUpdate, I_OnSerializeTypeCreate,
I_END
diff --git a/include/modules/chanserv.h b/include/modules/pseudoclients/chanserv.h
index e1c3849fd..e1c3849fd 100644
--- a/include/modules/chanserv.h
+++ b/include/modules/pseudoclients/chanserv.h
diff --git a/include/modules/global.h b/include/modules/pseudoclients/global.h
index 52afc4a23..52afc4a23 100644
--- a/include/modules/global.h
+++ b/include/modules/pseudoclients/global.h
diff --git a/include/modules/memoserv.h b/include/modules/pseudoclients/memoserv.h
index d35d3f8a0..d35d3f8a0 100644
--- a/include/modules/memoserv.h
+++ b/include/modules/pseudoclients/memoserv.h
diff --git a/include/modules/nickserv.h b/include/modules/pseudoclients/nickserv.h
index b20d6ebd1..c0238ecfc 100644
--- a/include/modules/nickserv.h
+++ b/include/modules/pseudoclients/nickserv.h
@@ -9,7 +9,8 @@ class NickServService : public Service
}
virtual void Validate(User *u) = 0;
- virtual void Login(User *u, NickAlias *na) = 0;
+ virtual void Collide(User *u, NickAlias *na) = 0;
+ virtual void Release(NickAlias *na) = 0;
};
#endif // NICKSERV_H
diff --git a/include/regchannel.h b/include/regchannel.h
index 91cc90ffa..08fae12b3 100644
--- a/include/regchannel.h
+++ b/include/regchannel.h
@@ -399,17 +399,6 @@ class CoreExport ChannelInfo : public Serializable, public Extensible
*/
bool CheckKick(User *user);
- /** Check the channel topic
- * If topic lock is enabled will change the topic back, else it records
- * the new topic in the ChannelInfo
- */
- void CheckTopic();
-
- /** Restore the channel topic, used on channel creation when not syncing with the uplink
- * and after uplink sync
- */
- void RestoreTopic();
-
/** Get the level for a privilege
* @param priv The privilege name
* @return the level
diff --git a/include/users.h b/include/users.h
index 00ff5e410..768b6dfa1 100644
--- a/include/users.h
+++ b/include/users.h
@@ -187,12 +187,6 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe
void SendMessage(const BotInfo *source, const char *fmt, ...);
void SendMessage(const BotInfo *source, const Anope::string &msg) anope_override;
- /** Collide a nick
- * See the comment in users.cpp
- * @param na The nick
- */
- void Collide(NickAlias *na);
-
/** Identify the user to the Nick
* updates last_seen, logs the user in,
* send messages, checks for mails, set vhost and more