summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2013-08-24 07:50:02 -0700
committerAttila Molnar <attilamolnar@hush.com>2013-08-24 07:50:02 -0700
commit9745333cd4c846ef04ad78c41f04a87af7e5b2d6 (patch)
treed8dca2dbb72649395c676e88d1bf451031aa43fe /src
parent7264a6a8d4360989ca2f64230da07c562d0f34f1 (diff)
parent71b9af776ef53c6902c020cf729c5277b824e0f9 (diff)
Merge pull request #616 from ShutterQuick/inspircd+chanhistbot
Option to select if chanhistory is on for bots
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_chanhistory.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/modules/m_chanhistory.cpp b/src/modules/m_chanhistory.cpp
index bace497c2..f1f9ed614 100644
--- a/src/modules/m_chanhistory.cpp
+++ b/src/modules/m_chanhistory.cpp
@@ -107,8 +107,10 @@ class ModuleChanHistory : public Module
{
HistoryMode m;
bool sendnotice;
+ UserModeReference botmode;
+ bool dobots;
public:
- ModuleChanHistory() : m(this)
+ ModuleChanHistory() : m(this), botmode(this, "bot")
{
}
@@ -125,6 +127,7 @@ class ModuleChanHistory : public Module
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 +151,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;