X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_chanhistory.cpp;h=24c6237b3812b6d7e9a18426d2563381ef6c4944;hb=357d190074ee58809b31ea0c08543566168bddf6;hp=bace497c20dfb2a111b49bd8a11f2428740e6256;hpb=d24619c012b34d5a3d4cfb93e7bea3ff3d5721e7;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_chanhistory.cpp b/src/modules/m_chanhistory.cpp index bace497c2..24c6237b3 100644 --- a/src/modules/m_chanhistory.cpp +++ b/src/modules/m_chanhistory.cpp @@ -107,24 +107,19 @@ class ModuleChanHistory : public Module { HistoryMode m; bool sendnotice; + UserModeReference botmode; + bool dobots; public: - ModuleChanHistory() : m(this) + ModuleChanHistory() : m(this), botmode(this, "bot") { } - void init() CXX11_OVERRIDE - { - ServerInstance->Modules->AddService(m); - ServerInstance->Modules->AddService(m.ext); - - OnRehash(NULL); - } - - void OnRehash(User*) CXX11_OVERRIDE + void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE { ConfigTag* tag = ServerInstance->Config->ConfValue("chanhistory"); m.maxlines = tag->getInt("maxlines", 50); sendnotice = tag->getBool("notice", true); + dobots = tag->getBool("bots", true); } void OnUserMessage(User* user, void* dest, int target_type, const std::string &text, char status, const CUList&, MessageType msgtype) CXX11_OVERRIDE @@ -148,6 +143,9 @@ class ModuleChanHistory : public Module if (IS_REMOTE(memb->user)) return; + if (memb->user->IsModeSet(botmode) && !dobots) + return; + HistoryList* list = m.ext.get(memb->chan); if (!list) return;