From ff93355af851541e21218811eb46190a3eb070a3 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 23 Jun 2014 15:44:06 -0400 Subject: Hold a reference to the type in Serialize::Checker in the event it goes away, and invalidate the type pointer of objects when the type goes away --- include/serialize.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/serialize.h b/include/serialize.h index 496110fda..f83c9bfd3 100644 --- a/include/serialize.h +++ b/include/serialize.h @@ -60,9 +60,9 @@ class CoreExport Serializable : public virtual Base * constructed before other objects are if it isn't. */ static std::list *SerializableItems; + friend class Serialize::Type; /* The type of item this object is */ Serialize::Type *s_type; - private: /* Iterator into serializable_items */ std::list::iterator s_iter; /* The hash of the last serialized form of this object commited to the database */ @@ -109,7 +109,7 @@ class CoreExport Serializable : public virtual Base * of class that inherits from Serialiable. Used for unserializing objects * of this type, as it requires a function pointer to a static member function. */ -class CoreExport Serialize::Type +class CoreExport Serialize::Type : public Base { typedef Serializable* (*unserialize_func)(Serializable *obj, Serialize::Data &); @@ -188,7 +188,7 @@ class Serialize::Checker { Anope::string name; T obj; - mutable Serialize::Type *type; + mutable ::Reference type; inline void Check() const { -- cgit From bf8f62c32d6c66e38c167e6ca0ac59d29db52326 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 24 Aug 2014 16:39:04 -0400 Subject: Change Channel::GetModeList to return a copy of the mode list, not a pair of lower/upper bound iterators. Sometimes when iterating the list, like in cs_mode, we can modify the contents of it, which combined with mlock always agressively trying to readd modes to it can do bad things. --- include/channels.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/channels.h b/include/channels.h index cc30d2030..9bc6c27c6 100644 --- a/include/channels.h +++ b/include/channels.h @@ -242,9 +242,9 @@ class CoreExport Channel : public Base, public Extensible /** Get a list of modes on a channel * @param name A mode name to get the list of - * @return a pair of iterators for the beginning and end of the list + * @return a vector of the list mode entries */ - std::pair GetModeList(const Anope::string &name); + std::vector GetModeList(const Anope::string &name); /** Get a string of the modes set on this channel * @param complete Include mode parameters -- cgit From e46bcff32467deef0d83790a1587cc5d6d442337 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 12 Oct 2014 19:25:39 -0400 Subject: Move nick register event to make it easier for modules to determine if a newly registered nick is confirmed or not. Add confirm event. --- include/modules.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/modules.h b/include/modules.h index 6f7803cff..d3d0f64cc 100644 --- a/include/modules.h +++ b/include/modules.h @@ -747,6 +747,12 @@ class CoreExport Module : public Extensible */ virtual void OnNickRegister(User *user, NickAlias *na, const Anope::string &pass) { throw NotImplementedException(); } + /** Called when a nick is confirmed. This will never be called if registration confirmation is not enabled. + * @param user The user confirming the nick + * @param The account being confirmed + */ + virtual void OnNickConfirm(User *user, NickCore *) { throw NotImplementedException(); } + /** Called when a nick is suspended * @param na The nick alias */ @@ -1091,7 +1097,7 @@ enum Implementation I_OnAccessClear, I_OnLevelChange, I_OnChanDrop, I_OnChanRegistered, I_OnChanSuspend, I_OnChanUnsuspend, I_OnCreateChan, I_OnDelChan, I_OnChannelCreate, I_OnChannelDelete, I_OnAkickAdd, I_OnAkickDel, I_OnCheckKick, I_OnChanInfo, I_OnCheckPriv, I_OnGroupCheckPriv, I_OnNickDrop, I_OnNickGroup, I_OnNickIdentify, - I_OnUserLogin, I_OnNickLogout, I_OnNickRegister, I_OnNickSuspend, I_OnNickUnsuspended, I_OnDelNick, I_OnNickCoreCreate, + I_OnUserLogin, I_OnNickLogout, I_OnNickRegister, I_OnNickConfirm, I_OnNickSuspend, 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_OnBotInfo, I_OnCheckAuthentication, I_OnNickUpdate, I_OnFingerprint, I_OnUserAway, I_OnInvite, I_OnDeleteVhost, I_OnSetVhost, I_OnSetDisplayedHost, I_OnMemoSend, I_OnMemoDel, -- cgit From 0cd3bfa24fccea79a5055bcd12d6aa607ecc635e Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 14 Oct 2014 18:58:55 -0400 Subject: Fix module event prioritization which was broken with the newer auto-attach event stuff. Also remove logically dead code from os_defcon, and make os_defcon akill similar masks to os_session when enforcing session akills. Fixes #1618 which relies on os_session to be prioritized before os_defcon. --- include/modules.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/modules.h b/include/modules.h index d3d0f64cc..0569fd33f 100644 --- a/include/modules.h +++ b/include/modules.h @@ -285,6 +285,8 @@ class CoreExport Module : public Extensible */ ModuleVersion GetVersion() const; + virtual void Prioritize(); + /* Everything below here are events. Modules must ModuleManager::Attach to these events * before they will be called. */ -- cgit From e1f5e030bc8edac10da922e0402744b1e2f023c8 Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 5 Dec 2014 20:24:27 -0500 Subject: Change webpanel access add to just add via the commands, split Command::Run into two so I can do this as I need to run named commands for it --- include/commands.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/commands.h b/include/commands.h index f2b0592d4..2a1b34da2 100644 --- a/include/commands.h +++ b/include/commands.h @@ -170,6 +170,8 @@ class CoreExport Command : public Service */ static void Run(CommandSource &source, const Anope::string &message); + void Run(CommandSource &source, const Anope::string &, const CommandInfo &, std::vector ¶ms); + /** Looks up a command name from the service name. * Note that if the same command exists multiple places this will return the first one encountered * @param command_service The command service to lookup, eg, nickserv/register -- cgit