From 32007f81cf0bb475f3621d7637666b06ffa482b9 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 10 Jan 2015 15:17:16 -0500 Subject: Add networkinfo:nick_chars option to allow configuring additional characters allowed in nicknames --- include/config.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/config.h b/include/config.h index b132c5d2d..2ae6e3ced 100644 --- a/include/config.h +++ b/include/config.h @@ -103,6 +103,8 @@ namespace Configuration time_t TimeoutCheck; /* options:usestrictprivmsg */ bool UseStrictPrivmsg; + /* networkinfo:nickchars */ + Anope::string NickChars; /* either "/msg " or "/" */ Anope::string StrictPrivmsg; -- cgit From 2264a206d262f07f6c6d91df867383d6413e0c3f Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 26 Jan 2015 15:10:18 -0500 Subject: Check virtual mode bases better --- include/modes.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/modes.h b/include/modes.h index 9c5916c0f..729e979d4 100644 --- a/include/modes.h +++ b/include/modes.h @@ -107,6 +107,8 @@ class CoreExport ChannelMode : public Mode bool CanSet(User *u) const anope_override; + virtual void Check() { } + /** 'wrap' this channel mode and param to the underlying mode and param */ virtual ChannelMode *Wrap(Anope::string ¶m); @@ -215,6 +217,8 @@ class CoreExport ChannelModeVirtual : public T ~ChannelModeVirtual(); + void Check() anope_override; + ChannelMode *Wrap(Anope::string ¶m) anope_override; ChannelMode *Unwrap(ChannelMode *cm, Anope::string ¶m) = 0; -- cgit From 845ca576b4c5a94f0a3ec12a4dd524a7d017155e Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 28 Jan 2015 22:57:15 -0500 Subject: More properly track topic change sources and allow users with access to change topics through topiclock --- include/channels.h | 2 +- include/modules.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/channels.h b/include/channels.h index 9bc6c27c6..80459d357 100644 --- a/include/channels.h +++ b/include/channels.h @@ -258,7 +258,7 @@ class CoreExport Channel : public Base, public Extensible * @param newtopic The new topic * @param ts The time the new topic is being set */ - void ChangeTopicInternal(const Anope::string &user, const Anope::string &newtopic, time_t ts = Anope::CurTime); + void ChangeTopicInternal(User *u, const Anope::string &user, const Anope::string &newtopic, time_t ts = Anope::CurTime); /** Update the topic of the channel, and reset it if topiclock etc says to * @param user The user setting the topic diff --git a/include/modules.h b/include/modules.h index 0569fd33f..5ea35c888 100644 --- a/include/modules.h +++ b/include/modules.h @@ -474,11 +474,12 @@ class CoreExport Module : public Extensible virtual void OnJoinChannel(User *u, Channel *c) { throw NotImplementedException(); } /** Called when a new topic is set + * @param source The user changing the topic, if any * @param c The channel - * @param setter The user who set the new topic + * @param setter The user who set the new topic, if there is no source * @param topic The new topic */ - virtual void OnTopicUpdated(Channel *c, const Anope::string &user, const Anope::string &topic) { throw NotImplementedException(); } + virtual void OnTopicUpdated(User *source, Channel *c, const Anope::string &user, const Anope::string &topic) { throw NotImplementedException(); } /** Called before a channel expires * @param ci The channel -- cgit From 64ca357b136bc190e5fec32269b34b85bf9cf610 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 3 Feb 2015 19:38:23 -0500 Subject: Make module version system work --- include/CMakeLists.txt | 3 +- include/modules.h | 20 +++++--- include/version.cpp | 123 +++++++++++++++++++++++++++++++++++-------------- 3 files changed, 104 insertions(+), 42 deletions(-) (limited to 'include') diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 6170cde27..1a96d7111 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -7,7 +7,7 @@ get_target_property(version_BINARY version LOCATION) # Modify version.h from the above executable, with dependencies to version.cpp # and all of the source files in the main build add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version_build - COMMAND ${version_BINARY} ${Anope_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/version.h + COMMAND ${version_BINARY} ${Anope_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/version.h ${CMAKE_CURRENT_BINARY_DIR}/build.h DEPENDS version ${SRC_SRCS} ) # Add version to list of files for CPack to ignore @@ -15,6 +15,7 @@ get_filename_component(version_BINARY ${version_BINARY} NAME) add_to_cpack_ignored_files("${version_BINARY}$" TRUE) if(NOT WIN32) add_to_cpack_ignored_files("version.h$" TRUE) + add_to_cpack_ignored_files("build.h$" TRUE) endif(NOT WIN32) set(PCH_SOURCES_GCH "") diff --git a/include/modules.h b/include/modules.h index 5ea35c888..0c10caa7b 100644 --- a/include/modules.h +++ b/include/modules.h @@ -20,6 +20,7 @@ #include "timers.h" #include "logger.h" #include "extensible.h" +#include "version.h" /** This definition is used as shorthand for the various classes * and functions needed to make a module loadable by the OS. @@ -40,6 +41,10 @@ extern "C" void AnopeFini(x *m) \ { \ delete m; \ + } \ + extern "C" DllExport ModuleVersion AnopeVersion() \ + { \ + return ModuleVersion(VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH); \ } #else # define MODULE_INIT(x) \ @@ -50,6 +55,10 @@ extern "C" DllExport void AnopeFini(x *m) \ { \ delete m; \ + } \ + extern "C" DllExport ModuleVersion AnopeVersion() \ + { \ + return ModuleVersion(VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH); \ } #endif @@ -279,12 +288,6 @@ class CoreExport Module : public Extensible */ void SetAuthor(const Anope::string &author); - /** Get the version of Anope this module was - * compiled against - * @return The version - */ - ModuleVersion GetVersion() const; - virtual void Prioritize(); /* Everything below here are events. Modules must ModuleManager::Attach to these events @@ -1206,6 +1209,11 @@ class CoreExport ModuleManager * @return MOD_ERR_OK on success, anything else on fail */ static ModuleReturn DeleteModule(Module *m); + + /** Get the version of Anope the module was compiled against + * @return The version + */ + static ModuleVersion GetVersion(void *handle); }; #endif // MODULES_H diff --git a/include/version.cpp b/include/version.cpp index b0ea0423d..119403e13 100644 --- a/include/version.cpp +++ b/include/version.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include static std::string get_git_hash(const std::string &git_dir) { @@ -45,29 +45,16 @@ static std::string get_git_hash(const std::string &git_dir) return "g" + filebuf.substr(0, 7); } -int main(int argc, char *argv[]) +static bool read_version_sh(const std::string &version_sh, std::map &versions) { - if (argc < 3) - { - std::cerr << "Syntax: " << argv[0] << " " << std::endl; - return 1; - } - - std::string version_sh = std::string(argv[1]) + "/src/version.sh"; - std::string git_dir = std::string(argv[1]) + "/.git"; - - std::fstream fd; - - fd.clear(); - fd.open(version_sh.c_str(), std::ios::in); + std::fstream fd(version_sh.c_str(), std::ios::in); if (!fd.is_open()) { std::cerr << "Error: Unable to open src/version.sh for reading: " << version_sh << std::endl; - return 1; + return false; } std::string filebuf; - std::list > versions; while (getline(fd, filebuf)) { if (!filebuf.find("VERSION_")) @@ -75,24 +62,25 @@ int main(int argc, char *argv[]) size_t eq = filebuf.find('='); std::string type = filebuf.substr(0, eq); - std::string value = filebuf.substr(eq + 2, filebuf.length() - eq - 3); - versions.push_back(std::make_pair(type, value)); + std::string value = filebuf.substr(eq + 1); + + versions[type] = value; } } fd.close(); - std::string git_version = get_git_hash(git_dir); - if (!git_version.empty()) - versions.push_back(std::make_pair("VERSION_GIT", git_version)); + return true; +} - fd.clear(); - fd.open(argv[2], std::ios::in); +static bool write_build_h(const std::string &buildh) +{ + std::fstream fd(buildh.c_str(), std::ios::in); std::string build = "#define BUILD 1"; if (fd.is_open()) { - while (getline(fd, filebuf)) + for (std::string filebuf; getline(fd, filebuf);) { if (!filebuf.find("#define BUILD")) { @@ -110,27 +98,92 @@ int main(int argc, char *argv[]) } fd.clear(); - fd.open(argv[2], std::ios::out); - + fd.open(buildh.c_str(), std::ios::out); if (!fd.is_open()) { - std::cerr << "Error: Unable to include/version.h for writing: " << argv[2] << std::endl; - return 1; + std::cerr << "Error: Unable to open build.h for writing: " << buildh << std::endl; + return false; } fd << "/* This file is automatically generated by version.cpp - do not edit it! */" << std::endl; + fd << build << std::endl; + fd.close(); + + return true; +} - for (std::list >::iterator it = versions.begin(), it_end = versions.end(); it != it_end; ++it) +static void read_version_h(const std::string &versionh, std::map &versions) +{ + std::fstream fd(versionh.c_str(), std::ios::in); + + if (!fd.is_open()) + return; + + for (std::string filebuf; getline(fd, filebuf);) { - if (it->first == "VERSION_EXTRA" || it->first == "VERSION_GIT") - fd << "#define " << it->first << " \"" << it->second << "\"" << std::endl; - else - fd << "#define " << it->first << " " << it->second << std::endl; + if (!filebuf.find("#define VERSION_")) + { + size_t space = filebuf.substr(8).find(' '); + + std::string name = filebuf.substr(8).substr(0, space), + version = filebuf.substr(8).substr(space + 1); + + versions[name] = version; + } } - fd << build << std::endl; + fd.close(); +} + +static bool write_version_h(const std::string &versionh, const std::map &versions) +{ + std::fstream fd(versionh.c_str(), std::ios::out); + + if (!fd.is_open()) + return false; + + for (std::map::const_iterator it = versions.begin(); it != versions.end(); ++it) + { + fd << "#define " << it->first << " " << it->second << std::endl; + } fd.close(); + return true; +} + +int main(int argc, char *argv[]) +{ + if (argc < 4) + { + std::cerr << "Syntax: " << argv[0] << " " << std::endl; + return 1; + } + + std::string version_sh = std::string(argv[1]) + "/src/version.sh"; + std::string git_dir = std::string(argv[1]) + "/.git"; + std::string versionh = argv[2]; + std::string buildh = argv[3]; + + std::map versions, old_versions; + + if (!read_version_sh(version_sh, versions)) + return -1; + + std::string git_version = get_git_hash(git_dir); + if (!git_version.empty()) + versions["VERSION_GIT"] = '"' + git_version + '"'; + + if (!write_build_h(buildh)) + return -1; + + read_version_h(versionh, old_versions); + + if (versions == old_versions) + return 0; + + if (!write_version_h(versionh, versions)) + return -1; + return 0; } -- cgit From 7de4b86b7fb44f800db2e5b4e4c69e1ccc6fbda3 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 23 Feb 2015 15:47:08 -0500 Subject: Move GIT_VERSION define to build.h, otherwise version.h is bumped per commit which forces a rebuild --- include/version.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/version.cpp b/include/version.cpp index 119403e13..22921202b 100644 --- a/include/version.cpp +++ b/include/version.cpp @@ -73,7 +73,7 @@ static bool read_version_sh(const std::string &version_sh, std::map Date: Wed, 11 Mar 2015 08:48:08 -0400 Subject: Redesign m_ldap to no longer rely on undefined behavior Accessing the same LDAP* from multiple threads at once is always undefined, even if one thread is just polling ldap_result. Instead keep one thread per connection and issue blocking queries on the thread. --- include/modules/ldap.h | 42 ++++++++++++++++-------------------------- 1 file changed, 16 insertions(+), 26 deletions(-) (limited to 'include') diff --git a/include/modules/ldap.h b/include/modules/ldap.h index 65be27687..20ca71cf8 100644 --- a/include/modules/ldap.h +++ b/include/modules/ldap.h @@ -1,8 +1,6 @@ #ifndef ANOPE_LDAP_H #define ANOPE_LDAP_H -typedef int LDAPQuery; - class LDAPException : public ModuleException { public: @@ -59,28 +57,26 @@ struct LDAPAttributes : public std::map messages; Anope::string error; - enum QueryType - { - QUERY_UNKNOWN, - QUERY_BIND, - QUERY_SEARCH, - QUERY_ADD, - QUERY_DELETE, - QUERY_MODIFY - }; - QueryType type; - LDAPQuery id; LDAPResult() { this->type = QUERY_UNKNOWN; - this->id = -1; } size_t size() const @@ -126,48 +122,42 @@ class LDAPProvider : public Service /** Attempt to bind to the LDAP server as an admin * @param i The LDAPInterface the result is sent to - * @return The query ID */ - virtual LDAPQuery BindAsAdmin(LDAPInterface *i) = 0; + virtual void BindAsAdmin(LDAPInterface *i) = 0; /** Bind to LDAP * @param i The LDAPInterface the result is sent to * @param who The binddn * @param pass The password - * @return The query ID */ - virtual LDAPQuery Bind(LDAPInterface *i, const Anope::string &who, const Anope::string &pass) = 0; + virtual void Bind(LDAPInterface *i, const Anope::string &who, const Anope::string &pass) = 0; /** Search ldap for the specified filter * @param i The LDAPInterface the result is sent to * @param base The base DN to search * @param filter The filter to apply - * @return The query ID */ - virtual LDAPQuery Search(LDAPInterface *i, const Anope::string &base, const Anope::string &filter) = 0; + virtual void Search(LDAPInterface *i, const Anope::string &base, const Anope::string &filter) = 0; /** Add an entry to LDAP * @param i The LDAPInterface the result is sent to * @param dn The dn of the entry to add * @param attributes The attributes - * @return The query ID */ - virtual LDAPQuery Add(LDAPInterface *i, const Anope::string &dn, LDAPMods &attributes) = 0; + virtual void Add(LDAPInterface *i, const Anope::string &dn, LDAPMods &attributes) = 0; /** Delete an entry from LDAP * @param i The LDAPInterface the result is sent to * @param dn The dn of the entry to delete - * @return The query ID */ - virtual LDAPQuery Del(LDAPInterface *i, const Anope::string &dn) = 0; + virtual void Del(LDAPInterface *i, const Anope::string &dn) = 0; /** Modify an existing entry in LDAP * @param i The LDAPInterface the result is sent to * @param base The base DN to modify * @param attributes The attributes to modify - * @return The query ID */ - virtual LDAPQuery Modify(LDAPInterface *i, const Anope::string &base, LDAPMods &attributes) = 0; + virtual void Modify(LDAPInterface *i, const Anope::string &base, LDAPMods &attributes) = 0; }; #endif // ANOPE_LDAP_H -- cgit From 310e95a92e64a9546247fe57d4643328fa4ebe9b Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 11 Mar 2015 14:36:56 -0400 Subject: Allow cs clone to clone levels too --- include/regchannel.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/regchannel.h b/include/regchannel.h index 416b0280d..50e0ceed2 100644 --- a/include/regchannel.h +++ b/include/regchannel.h @@ -198,6 +198,11 @@ class CoreExport ChannelInfo : public Serializable, public Extensible */ void ClearAkick(); + /** Get the level entries for the channel. + * @return The levels for the channel. + */ + const Anope::map &GetLevelEntries(); + /** Get the level for a privilege * @param priv The privilege name * @return the level -- cgit From c5ff7c686837afbb854aa6546ade3aa8c86a1cd1 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 12 Mar 2015 08:00:12 -0400 Subject: Show passlen in PASSWORD_TOO_LONG --- include/language.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/language.h b/include/language.h index a1b5c347d..7832f4692 100644 --- a/include/language.h +++ b/include/language.h @@ -74,7 +74,7 @@ namespace Language #define MORE_OBSCURE_PASSWORD _("Please try again with a more obscure password. Passwords should be at least\n" \ "five characters long, should not be something easily guessed\n" \ "(e.g. your real name or your nick), and cannot contain the space or tab characters.") -#define PASSWORD_TOO_LONG _("Your password is too long. Please try again with a shorter password.") +#define PASSWORD_TOO_LONG _("Your password is too long. It must not exceed %u characters.") #define NICK_NOT_REGISTERED _("Your nick isn't registered.") #define NICK_X_NOT_REGISTERED _("Nick \002%s\002 isn't registered.") #define NICK_X_NOT_IN_USE _("Nick \002%s\002 isn't currently in use.") -- cgit From 4266d17e8c0bbcc5cb8422c2af142c4c8af9d768 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 12 Mar 2015 11:14:59 -0400 Subject: Update cmake version parsing code to deal with recent build version changes Update Config.cs to no longer hardcode VS generators, it seems no longer necessary. Fix new version system, cannot return C++ types from extern C functions --- include/modules.h | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/modules.h b/include/modules.h index 0c10caa7b..69e9e6d27 100644 --- a/include/modules.h +++ b/include/modules.h @@ -42,9 +42,13 @@ { \ delete m; \ } \ - extern "C" DllExport ModuleVersion AnopeVersion() \ + extern "C" DllExport ModuleVersionC AnopeVersion() \ { \ - return ModuleVersion(VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH); \ + ModuleVersionC ver; \ + ver.version_major = VERSION_MAJOR; \ + ver.version_minor = VERSION_MINOR; \ + ver.version_patch = VERSION_PATCH; \ + return ver; \ } #else # define MODULE_INIT(x) \ @@ -56,9 +60,13 @@ { \ delete m; \ } \ - extern "C" DllExport ModuleVersion AnopeVersion() \ + extern "C" DllExport ModuleVersionC AnopeVersion() \ { \ - return ModuleVersion(VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH); \ + ModuleVersionC ver; \ + ver.version_major = VERSION_MAJOR; \ + ver.version_minor = VERSION_MINOR; \ + ver.version_patch = VERSION_PATCH; \ + return ver; \ } #endif @@ -182,6 +190,11 @@ enum }; typedef unsigned short ModType; +struct ModuleVersionC +{ + int version_major, version_minor, version_patch; +}; + /** Returned by Module::GetVersion, used to see what version of Anope * a module is compiled against. */ @@ -193,12 +206,7 @@ class ModuleVersion int version_patch; public: - /** Constructor - * @param major The major version number - * @param minor The minor version number - * @param patch The patch version number - */ - ModuleVersion(int major, int minor, int patch); + ModuleVersion(const ModuleVersionC &); /** Get the major version of Anope this was built against * @return The major version -- cgit From 4c54a3939f9e36f47cd912275f4dbfdb4e64f8d9 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 22 Mar 2015 10:26:49 -0400 Subject: Change git version name back to what it was, which the core uses --- include/version.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/version.cpp b/include/version.cpp index 22921202b..f6feb3354 100644 --- a/include/version.cpp +++ b/include/version.cpp @@ -108,7 +108,7 @@ static bool write_build_h(const std::string &buildh, const std::string &git_vers fd << "/* This file is automatically generated by version.cpp - do not edit it! */" << std::endl; fd << build << std::endl; if (!git_version.empty()) - fd << "#define GIT_VERSION \"" << git_version << "\"" << std::endl; + fd << "#define VERSION_GIT \"" << git_version << "\"" << std::endl; fd.close(); return true; -- cgit From 1666b1a8d8d629fd4ea89b083863dc217154eee9 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Wed, 8 Jul 2015 10:55:44 +0100 Subject: Fix a ton of typos. --- include/anope.h | 6 +++--- include/hashcomp.h | 2 +- include/lists.h | 2 +- include/modules.h | 2 +- include/modules/cs_mode.h | 2 +- include/pstdint.h | 2 +- include/serialize.h | 4 ++-- include/sockets.h | 2 +- include/users.h | 4 ++-- 9 files changed, 13 insertions(+), 13 deletions(-) (limited to 'include') diff --git a/include/anope.h b/include/anope.h index 638661440..d27aa6546 100644 --- a/include/anope.h +++ b/include/anope.h @@ -543,7 +543,7 @@ namespace Anope extern CoreExport Anope::string Random(size_t len); } -/** sepstream allows for splitting token seperated lists. +/** sepstream allows for splitting token separated lists. * Each successive call to sepstream::GetToken() returns * the next token, until none remain, at which point the method returns * an empty string. @@ -615,7 +615,7 @@ class CoreExport sepstream bool StreamEnd(); }; -/** A derived form of sepstream, which seperates on commas +/** A derived form of sepstream, which separates on commas */ class commasepstream : public sepstream { @@ -625,7 +625,7 @@ class commasepstream : public sepstream commasepstream(const Anope::string &source, bool allowempty = false) : sepstream(source, ',', allowempty) { } }; -/** A derived form of sepstream, which seperates on spaces +/** A derived form of sepstream, which separates on spaces */ class spacesepstream : public sepstream { diff --git a/include/hashcomp.h b/include/hashcomp.h index 140131e72..1b225de7d 100644 --- a/include/hashcomp.h +++ b/include/hashcomp.h @@ -123,7 +123,7 @@ namespace ci * @param s1 String to find in * @param n Position to search up to * @param c Character to search for - * @return Pointer to the first occurance of c in s1 + * @return Pointer to the first occurrence of c in s1 */ static const char *find(const char *s1, int n, char c); }; diff --git a/include/lists.h b/include/lists.h index 980f8b533..cb8e0cb64 100644 --- a/include/lists.h +++ b/include/lists.h @@ -52,7 +52,7 @@ class CoreExport NumberList virtual void HandleNumber(unsigned number); /** Called when there is an error with the numbered list - * Return false to immediatly stop processing the list and return + * Return false to immediately stop processing the list and return * This is all done before we start calling HandleNumber, so no numbers will have been processed yet * @param list The list * @return false to stop processing diff --git a/include/modules.h b/include/modules.h index 69e9e6d27..7367e2986 100644 --- a/include/modules.h +++ b/include/modules.h @@ -1016,7 +1016,7 @@ class CoreExport Module : public Extensible */ virtual void OnLogMessage(LogInfo *li, const Log *l, const Anope::string &msg) { throw NotImplementedException(); } - /** Called when a DNS request (question) is recieved. + /** Called when a DNS request (question) is received. * @param req The dns request * @param reply The reply that will be sent */ diff --git a/include/modules/cs_mode.h b/include/modules/cs_mode.h index 44ffd5a7f..a4f0fe3f5 100644 --- a/include/modules/cs_mode.h +++ b/include/modules/cs_mode.h @@ -80,7 +80,7 @@ struct ModeLocks virtual const ModeLock *GetMLock(const Anope::string &mname, const Anope::string ¶m = "") = 0; /** Get the current mode locks as a string - * @param complete True to show mlock parameters aswell + * @param complete True to show mlock parameters as well * @return A string of mode locks, eg: +nrt */ virtual Anope::string GetMLockAsString(bool complete) const = 0; diff --git a/include/pstdint.h b/include/pstdint.h index fa64dbe70..a8de63fd7 100644 --- a/include/pstdint.h +++ b/include/pstdint.h @@ -73,7 +73,7 @@ * include stdint.h. The hope is that one or the other can be * used with no real difference. * - * 5) In the current verison, if your platform can't represent + * 5) In the current version, if your platform can't represent * int32_t, int16_t and int8_t, it just dumps out with a compiler * error. * diff --git a/include/serialize.h b/include/serialize.h index f83c9bfd3..52efb46aa 100644 --- a/include/serialize.h +++ b/include/serialize.h @@ -65,9 +65,9 @@ class CoreExport Serializable : public virtual Base Serialize::Type *s_type; /* Iterator into serializable_items */ std::list::iterator s_iter; - /* The hash of the last serialized form of this object commited to the database */ + /* The hash of the last serialized form of this object committed to the database */ size_t last_commit; - /* The last time this object was commited to the database */ + /* The last time this object was committed to the database */ time_t last_commit_time; protected: diff --git a/include/sockets.h b/include/sockets.h index ca61f7efc..129c27c8b 100644 --- a/include/sockets.h +++ b/include/sockets.h @@ -372,7 +372,7 @@ class CoreExport ListenSocket : public virtual Socket virtual ~ListenSocket(); /** Process what has come in from the connection - * @return false to destory this socket + * @return false to destroy this socket */ bool ProcessRead(); diff --git a/include/users.h b/include/users.h index 04d1606a4..ea47aaf04 100644 --- a/include/users.h +++ b/include/users.h @@ -44,7 +44,7 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe Anope::string vident; Anope::string ident; Anope::string uid; - /* If the user is on the access list of the nick theyre on */ + /* If the user is on the access list of the nick they're on */ bool on_access; /* Map of user modes and the params this user has (if any) */ ModeList modes; @@ -103,7 +103,7 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe * @param svhost The vhost of the user * @param sip The ip of the user * @param sserver The server of the user - * @param srealname The realname/gecos of teh user + * @param srealname The realname/gecos of the user * @param ts User's timestamp * @param smodes User's modes * @param suid The unique identifier of the user. -- cgit From ceddb8370c85f5c5319b497a9c4efb578338beed Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 13 Jul 2015 17:59:14 -0400 Subject: Unset extensibles on larger objects when they destruct Some complex extensibles require the full object to still be alive in their destructors to keep proper bookkeeping --- include/extensible.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/extensible.h b/include/extensible.h index 2a852ff47..c9787fd21 100644 --- a/include/extensible.h +++ b/include/extensible.h @@ -40,6 +40,8 @@ class CoreExport Extensible virtual ~Extensible(); + void UnsetExtensibles(); + template T* GetExt(const Anope::string &name) const; bool HasExt(const Anope::string &name) const; -- cgit From 2f5e880e57be3d4881c47da991334c516e76ffaf Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 14 Sep 2015 12:24:13 -0400 Subject: Don't update channel last used time from ns alist access check --- include/regchannel.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/regchannel.h b/include/regchannel.h index 50e0ceed2..7713db056 100644 --- a/include/regchannel.h +++ b/include/regchannel.h @@ -133,8 +133,8 @@ class CoreExport ChannelInfo : public Serializable, public Extensible /** Retrieve the access for a user or group in the form of a vector of access entries * (as multiple entries can affect a single user). */ - AccessGroup AccessFor(const User *u); - AccessGroup AccessFor(const NickCore *nc); + AccessGroup AccessFor(const User *u, bool updateLastUsed = true); + AccessGroup AccessFor(const NickCore *nc, bool updateLastUsed = true); /** Get the size of the accss vector for this channel * @return The access vector size -- cgit From 1ac4a1d9a56141d18b3e8a32fe165535031a4c67 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 17 Sep 2015 10:07:30 -0400 Subject: Defer channel deletion until after i/o. There are some edge cases with events kicking users mid-event that can delete them. --- include/channels.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/channels.h b/include/channels.h index 80459d357..23867c792 100644 --- a/include/channels.h +++ b/include/channels.h @@ -32,6 +32,8 @@ struct ChanUserContainer : public Extensible class CoreExport Channel : public Base, public Extensible { + static std::vector deleting; + public: typedef std::multimap ModeList; private: @@ -300,6 +302,8 @@ class CoreExport Channel : public Base, public Extensible * @param ts The time the channel was created */ static Channel *FindOrCreate(const Anope::string &name, bool &created, time_t ts = Anope::CurTime); + + static void DeleteChannels(); }; #endif // CHANNELS_H -- cgit