summaryrefslogtreecommitdiff
path: root/src/misc.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2016-07-28 21:29:35 -0400
committerAdam <Adam@anope.org>2016-07-28 21:29:35 -0400
commit0e758a2ac23dc4a001e8e126cec14588da9a9769 (patch)
tree45df813323e023c5c89db7279426c4ad0943b4a9 /src/misc.cpp
parenta3c8afae00c54d5b95c620248b51f90679d7d53f (diff)
Allow serializable fields to use storage in the respective objects.
Split service management code nito a proper servicemanager. Make service references managed instead of lazy lookup. Also made events and serializable use service manager instead of their respective systems for management
Diffstat (limited to 'src/misc.cpp')
-rw-r--r--src/misc.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/misc.cpp b/src/misc.cpp
index 436ac2261..323b66b13 100644
--- a/src/misc.cpp
+++ b/src/misc.cpp
@@ -140,14 +140,15 @@ void ListFormatter::Process(std::vector<Anope::string> &buffer)
unsigned length = 0;
for (std::map<Anope::string, size_t>::iterator it = lenghts.begin(), it_end = lenghts.end(); it != it_end; ++it)
{
- /* Break lines at 80 chars */
- if (length > 80)
+ if (length > Config->LineWrap)
{
breaks.insert(it->first);
length = 0;
}
else
+ {
length += it->second;
+ }
}
/* Only put a list header if more than 1 column */
@@ -480,8 +481,7 @@ bool Anope::Match(const Anope::string &str, const Anope::string &mask, bool case
void Anope::Encrypt(const Anope::string &src, Anope::string &dest)
{
- EventReturn MOD_RESULT;
- MOD_RESULT = Event::OnEncrypt(&Event::Encrypt::OnEncrypt, src, dest);
+ EventReturn MOD_RESULT = EventManager::Get()->Dispatch(&Event::Encrypt::OnEncrypt, src, dest);
static_cast<void>(MOD_RESULT);
}
@@ -495,8 +495,7 @@ bool Anope::Decrypt(const Anope::string &src, Anope::string &dest)
}
Anope::string hashm(src.begin(), src.begin() + pos);
- EventReturn MOD_RESULT;
- MOD_RESULT = Event::OnDecrypt(&Event::Decrypt::OnDecrypt, hashm, src, dest);
+ EventReturn MOD_RESULT = EventManager::Get()->Dispatch(&Event::Decrypt::OnDecrypt, hashm, src, dest);
if (MOD_RESULT == EVENT_ALLOW)
return true;