diff --git a/docs/conf/modules.example.conf b/docs/conf/modules.example.conf index e6aff5dd2..c696550f0 100644 --- a/docs/conf/modules.example.conf +++ b/docs/conf/modules.example.conf @@ -312,22 +312,23 @@ # #-#-#-#-#-#-#-#-#-#-#- CHANHISTORY CONFIGURATION -#-#-#-#-#-#-#-#-#-#-# # # -# bots - Whether to send channel history to bots. Defaults to yes. # +# maxduration - The maximum period to keep chat history for. Defaults # +# to 4 weeks. # # # # maxlines - The maximum number of lines of chat history to send to a # # joining users. Defaults to 50. # # # -# maxduration - The maximum period to keep chat history for. Defaults # -# to 4 weeks. # -# # # prefixmsg - Whether to send an explanatory message to clients that # # don't support the chathistory batch type. Defaults to # # yes. # # # -# +# prefixmsg="yes" +# sendtobots="yes"> #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Channel logging module: Used to send snotice output to channels, to diff --git a/src/modules/m_chanhistory.cpp b/src/modules/m_chanhistory.cpp index 1d6833dd2..080e202f3 100644 --- a/src/modules/m_chanhistory.cpp +++ b/src/modules/m_chanhistory.cpp @@ -166,14 +166,14 @@ class ModuleChanHistory final private: HistoryMode historymode; SimpleUserMode nohistorymode; - bool prefixmsg; UserModeReference botmode; - bool dobots; IRCv3::Batch::CapReference batchcap; IRCv3::Batch::API batchmanager; IRCv3::Batch::Batch batch; IRCv3::ServerTime::API servertimemanager; ClientProtocol::MessageTagEvent tagevent; + bool prefixmsg; + bool sendtobots; void AddTag(ClientProtocol::Message& msg, const std::string& tagkey, std::string& tagval) { @@ -232,7 +232,7 @@ public: historymode.maxduration = tag->getDuration("maxduration", 60*60*24*28); historymode.maxlines = tag->getNum("maxlines", 50); prefixmsg = tag->getBool("prefixmsg", true); - dobots = tag->getBool("bots", true); + sendtobots = tag->getBool("sendtobots", tag->getBool("bots", true)); } ModResult OnRouteMessage(const Channel* channel, const Server* server) override @@ -264,7 +264,7 @@ public: if (!localuser) return; - if (memb->user->IsModeSet(botmode) && !dobots) + if (memb->user->IsModeSet(botmode) && !sendtobots) return; if (memb->user->IsModeSet(nohistorymode))