X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_chanhistory.cpp;h=036fc1df6c4ba043a575dfa6297596c90048b772;hb=551d687ec6d7ce44be35fae0dd7345fe73c4f63a;hp=16eba953f544fb05323c2fd3f269c760497e9305;hpb=388e4ff40931dda5870ddef149e54bdcc6c5a711;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_chanhistory.cpp b/src/modules/m_chanhistory.cpp index 16eba953f..036fc1df6 100644 --- a/src/modules/m_chanhistory.cpp +++ b/src/modules/m_chanhistory.cpp @@ -37,12 +37,12 @@ struct HistoryList class HistoryMode : public ModeHandler { - bool IsValidDuration(const std::string duration) + bool IsValidDuration(const std::string& duration) { for (std::string::const_iterator i = duration.begin(); i != duration.end(); ++i) { unsigned char c = *i; - if (((c >= '0') && (c <= '9')) || (c == 's') || (c != 'S')) + if (((c >= '0') && (c <= '9')) || (c == 's') || (c == 'S')) continue; if (duration_multi[c] == 1) @@ -70,7 +70,7 @@ class HistoryMode : public ModeHandler return MODEACTION_DENY; unsigned int len = ConvToInt(parameter.substr(0, colon)); - int time = ServerInstance->Duration(duration); + int time = InspIRCd::Duration(duration); if (len == 0 || time < 0) return MODEACTION_DENY; if (len > maxlines && IS_LOCAL(source)) @@ -119,9 +119,10 @@ class ModuleChanHistory : public Module void init() { ServerInstance->Modules->AddService(m); + ServerInstance->Modules->AddService(m.ext); Implementation eventlist[] = { I_OnPostJoin, I_OnUserMessage, I_OnRehash }; - ServerInstance->Modules->Attach(eventlist, this, 3); + ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); OnRehash(NULL); }