summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/account.cpp14
-rw-r--r--src/bots.cpp2
-rw-r--r--src/channels.cpp19
-rw-r--r--src/extensible.cpp7
-rw-r--r--src/init.cpp2
-rw-r--r--src/language.cpp2
-rw-r--r--src/modes.cpp4
-rw-r--r--src/module.cpp2
-rw-r--r--src/modulemanager.cpp4
-rw-r--r--src/nickalias.cpp2
-rw-r--r--src/nickcore.cpp2
-rw-r--r--src/regchannel.cpp2
-rw-r--r--src/tools/CMakeLists.txt2
-rw-r--r--src/tools/geoipupdate.sh2
-rw-r--r--src/users.cpp2
-rw-r--r--src/win32/socket.cpp2
-rw-r--r--src/win32/windows.cpp2
17 files changed, 52 insertions, 20 deletions
diff --git a/src/account.cpp b/src/account.cpp
index e58ee1646..89c9c7909 100644
--- a/src/account.cpp
+++ b/src/account.cpp
@@ -73,8 +73,20 @@ void IdentifyRequest::ModuleUnload(Module *m)
IdentifyRequest *ir = *it;
++it;
- ir->Release(m);
+ ir->holds.erase(m);
+ if (ir->holds.empty() && ir->dispatched)
+ {
+ if (!ir->success)
+ ir->OnFail();
+ delete ir;
+ continue;
+ }
+
if (ir->owner == m)
+ {
+ if (!ir->success)
+ ir->OnFail();
delete ir;
+ }
}
}
diff --git a/src/bots.cpp b/src/bots.cpp
index 85e605f21..c6a726855 100644
--- a/src/bots.cpp
+++ b/src/bots.cpp
@@ -49,6 +49,8 @@ BotInfo::BotInfo(const Anope::string &nnick, const Anope::string &nuser, const A
BotInfo::~BotInfo()
{
+ UnsetExtensibles();
+
FOREACH_MOD(OnDelBot, (this));
// If we're synchronised with the uplink already, send the bot.
diff --git a/src/channels.cpp b/src/channels.cpp
index 7e7702d7e..a794f5126 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -52,6 +52,8 @@ Channel::Channel(const Anope::string &nname, time_t ts)
Channel::~Channel()
{
+ UnsetExtensibles();
+
FOREACH_MOD(OnChannelDelete, (this));
ModeManager::StackerDel(this);
@@ -121,7 +123,7 @@ void Channel::CheckModes()
bool Channel::CheckDelete()
{
- /* Channel is syncing from a netburst, don't destroy it as more users are probably wanting to join immediatly
+ /* Channel is syncing from a netburst, don't destroy it as more users are probably wanting to join immediately
* We also don't part the bot here either, if necessary we will part it after the sync
*/
if (this->syncing)
@@ -160,10 +162,10 @@ void Channel::DeleteUser(User *user)
ChanUserContainer *cu = user->FindChannel(this);
if (!this->users.erase(user))
- Log(LOG_DEBUG) << "Channel::DeleteUser() tried to delete nonexistant user " << user->nick << " from channel " << this->name;
+ Log(LOG_DEBUG) << "Channel::DeleteUser() tried to delete non-existent user " << user->nick << " from channel " << this->name;
if (!user->chans.erase(this))
- Log(LOG_DEBUG) << "Channel::DeleteUser() tried to delete nonexistant channel " << this->name << " from " << user->nick << "'s channel list";
+ Log(LOG_DEBUG) << "Channel::DeleteUser() tried to delete non-existent channel " << this->name << " from " << user->nick << "'s channel list";
delete cu;
if (this->CheckDelete())
@@ -279,7 +281,7 @@ void Channel::SetModeInternal(MessageSource &setter, ChannelMode *ocm, const Ano
if (!u)
{
- Log() << "MODE " << this->name << " +" << cm->mchar << " for nonexistant user " << param;
+ Log() << "MODE " << this->name << " +" << cm->mchar << " for non-existent user " << param;
return;
}
@@ -350,7 +352,7 @@ void Channel::RemoveModeInternal(MessageSource &setter, ChannelMode *ocm, const
if (!u)
{
- Log() << "Channel::RemoveModeInternal() MODE " << this->name << "-" << cm->mchar << " for nonexistant user " << param;
+ Log() << "Channel::RemoveModeInternal() MODE " << this->name << "-" << cm->mchar << " for non-existent user " << param;
return;
}
@@ -656,7 +658,7 @@ void Channel::SetModesInternal(MessageSource &source, const Anope::string &mode,
if (cm->type == MODE_REGULAR)
{
- /* something changed if we are adding a mode we dont have, or removing one we have */
+ /* something changed if we are adding a mode we don't have, or removing one we have */
changed |= !!add != this->HasMode(cm->name);
if (add)
this->SetModeInternal(source, cm, "", false);
@@ -691,7 +693,7 @@ void Channel::SetModesInternal(MessageSource &source, const Anope::string &mode,
this->RemoveModeInternal(source, cm, token, enforce_mlock);
}
else
- Log() << "warning: Channel::SetModesInternal() recieved more modes requiring params than params, modes: " << mode;
+ Log() << "warning: Channel::SetModesInternal() received more modes requiring params than params, modes: " << mode;
}
if (!this_reference)
@@ -856,7 +858,8 @@ void Channel::SetCorrectModes(User *user, bool give_modes)
given = true;
}
}
- else if (take_modes && !has_priv && !u_access.HasPriv(cm->name + "ME"))
+ /* modes that have no privileges assigned shouldn't be removed (like operprefix, ojoin) */
+ else if (take_modes && !has_priv && ci->GetLevel(cm->name + "ME") != ACCESS_INVALID && !u_access.HasPriv(cm->name + "ME"))
{
/* Only remove modes if they are > voice */
if (cm->name == "VOICE")
diff --git a/src/extensible.cpp b/src/extensible.cpp
index 37206f7c1..8f0aab544 100644
--- a/src/extensible.cpp
+++ b/src/extensible.cpp
@@ -24,6 +24,11 @@ ExtensibleBase::~ExtensibleBase()
Extensible::~Extensible()
{
+ UnsetExtensibles();
+}
+
+void Extensible::UnsetExtensibles()
+{
while (!extension_items.empty())
(*extension_items.begin())->Unset(this);
}
@@ -63,7 +68,7 @@ bool* Extensible::Extend(const Anope::string &name, const bool &what)
if (ref)
return ref->Set(this);
- Log(LOG_DEBUG) << "Extend for nonexistant type " << name << " on " << static_cast<void *>(this);
+ Log(LOG_DEBUG) << "Extend for non-existent type " << name << " on " << static_cast<void *>(this);
return NULL;
}
diff --git a/src/init.cpp b/src/init.cpp
index e6bc8e150..6d903ac8f 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -1,4 +1,4 @@
-/* Initalization and related routines.
+/* Initialization and related routines.
*
* (C) 2003-2014 Anope Team
* Contact us at team@anope.org
diff --git a/src/language.cpp b/src/language.cpp
index 5ff344281..c2643f438 100644
--- a/src/language.cpp
+++ b/src/language.cpp
@@ -88,7 +88,7 @@ const char *Language::Translate(const char *lang, const char *string)
SetThreadLocale(MAKELCID(MAKELANGID(WindowsGetLanguage(lang), SUBLANG_DEFAULT), SORT_DEFAULT));
#else
/* First, set LANG and LANGUAGE env variables.
- * Some systems (Debian) don't care about this, so we must setlocale LC_ALL aswell.
+ * Some systems (Debian) don't care about this, so we must setlocale LC_ALL as well.
* BUT if this call fails because the LANGUAGE env variable is set, setlocale resets
* the locale to "C", which short circuits gettext and causes it to fail on systems that
* use the LANGUAGE env variable. We must reset the locale to en_US (or, anything not
diff --git a/src/modes.cpp b/src/modes.cpp
index 38266f95f..51b31bb7b 100644
--- a/src/modes.cpp
+++ b/src/modes.cpp
@@ -290,7 +290,7 @@ void StackerInfo::AddMode(Mode *mode, bool set, const Anope::string &param)
break;
}
}
- /* If the mode is on the other list, remove it from there (eg, we dont want +o-o Adam Adam) */
+ /* If the mode is on the other list, remove it from there (eg, we don't want +o-o Adam Adam) */
for (it = otherlist->begin(), it_end = otherlist->end(); it != it_end; ++it)
{
/* The param must match too (can have multiple status or list modes), but
@@ -320,7 +320,7 @@ static class ModePipe : public Pipe
}
} *modePipe;
-/** Get the stacker info for an item, if one doesnt exist it is created
+/** Get the stacker info for an item, if one doesn't exist it is created
* @param Item The user/channel etc
* @return The stacker info
*/
diff --git a/src/module.cpp b/src/module.cpp
index 3266c955f..5c02e4e49 100644
--- a/src/module.cpp
+++ b/src/module.cpp
@@ -64,6 +64,8 @@ Module::Module(const Anope::string &modname, const Anope::string &, ModType modt
Module::~Module()
{
+ UnsetExtensibles();
+
/* Detach all event hooks for this module */
ModuleManager::DetachAll(this);
IdentifyRequest::ModuleUnload(this);
diff --git a/src/modulemanager.cpp b/src/modulemanager.cpp
index b6df3578a..06a3c2181 100644
--- a/src/modulemanager.cpp
+++ b/src/modulemanager.cpp
@@ -435,8 +435,8 @@ bool ModuleManager::SetPriority(Module *mod, Implementation i, Priority s, Modul
break;
}
- /* Eh? this module doesnt exist, probably trying to set priority on an event
- * theyre not attached to.
+ /* Eh? this module doesn't exist, probably trying to set priority on an event
+ * they're not attached to.
*/
if (!found)
return false;
diff --git a/src/nickalias.cpp b/src/nickalias.cpp
index 9f3651c12..fbf3411fc 100644
--- a/src/nickalias.cpp
+++ b/src/nickalias.cpp
@@ -51,6 +51,8 @@ NickAlias::NickAlias(const Anope::string &nickname, NickCore* nickcore) : Serial
NickAlias::~NickAlias()
{
+ UnsetExtensibles();
+
FOREACH_MOD(OnDelNick, (this));
/* Accept nicks that have no core, because of database load functions */
diff --git a/src/nickcore.cpp b/src/nickcore.cpp
index 9c0e25f32..f669a9181 100644
--- a/src/nickcore.cpp
+++ b/src/nickcore.cpp
@@ -38,6 +38,8 @@ NickCore::NickCore(const Anope::string &coredisplay) : Serializable("NickCore"),
NickCore::~NickCore()
{
+ UnsetExtensibles();
+
FOREACH_MOD(OnDelCore, (this));
if (!this->chanaccess->empty())
diff --git a/src/regchannel.cpp b/src/regchannel.cpp
index 397a6f28b..2b17c72ca 100644
--- a/src/regchannel.cpp
+++ b/src/regchannel.cpp
@@ -142,6 +142,8 @@ ChannelInfo::ChannelInfo(const ChannelInfo &ci) : Serializable("ChannelInfo"),
ChannelInfo::~ChannelInfo()
{
+ UnsetExtensibles();
+
FOREACH_MOD(OnDelChan, (this));
Log(LOG_DEBUG) << "Deleting channel " << this->name;
diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt
index e547a2e9a..ef2f3b15b 100644
--- a/src/tools/CMakeLists.txt
+++ b/src/tools/CMakeLists.txt
@@ -48,5 +48,5 @@ endif(NOT WIN32)
# On non-Windows platforms, if RUNGROUP is set, change the permissions of the tools directory
if(NOT WIN32 AND RUNGROUP)
- install(CODE "execute_process(COMMAND ${CHMOD} 2770 \"\$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/bin\")")
+ install(CODE "execute_process(COMMAND ${CHMOD} 2770 \"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin\")")
endif(NOT WIN32 AND RUNGROUP)
diff --git a/src/tools/geoipupdate.sh b/src/tools/geoipupdate.sh
index 0b02dae36..641ac3259 100644
--- a/src/tools/geoipupdate.sh
+++ b/src/tools/geoipupdate.sh
@@ -5,7 +5,7 @@
# them into existing mysql tables. The tables are created
# by the irc2sql module on the first load.
-# Dont forget to rename this file or your changes
+# Don't forget to rename this file or your changes
# will be overwritte on the next 'make install'
############################
diff --git a/src/users.cpp b/src/users.cpp
index 8ec13d8c0..73d1d4368 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -292,6 +292,8 @@ void User::SetRealname(const Anope::string &srealname)
User::~User()
{
+ UnsetExtensibles();
+
if (this->server != NULL)
{
if (this->server->IsSynced())
diff --git a/src/win32/socket.cpp b/src/win32/socket.cpp
index d481515d3..211999f9a 100644
--- a/src/win32/socket.cpp
+++ b/src/win32/socket.cpp
@@ -51,7 +51,7 @@ int windows_accept(int fd, struct sockaddr *addr, int *addrlen)
* @param af The protocol type, AF_INET or AF_INET6
* @param src The address
* @param dst Struct to put results in
- * @return 1 on sucess, -1 on error
+ * @return 1 on success, -1 on error
*/
int windows_inet_pton(int af, const char *src, void *dst)
{
diff --git a/src/win32/windows.cpp b/src/win32/windows.cpp
index 3ef1bcfa9..997260581 100644
--- a/src/win32/windows.cpp
+++ b/src/win32/windows.cpp
@@ -194,7 +194,7 @@ Anope::string GetWindowsVersion()
buf = "Microsoft Windows 98" + extra;
}
if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 90)
- buf = "Microsoft Windows Millenium Edition";
+ buf = "Microsoft Windows Millennium Edition";
}
return buf;
}