aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_chanhistory.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2024-09-22 14:01:37 +0100
committerGravatar Sadie Powell2024-09-22 14:01:37 +0100
commit70a92b4daee9f2fb91c9b5831c1e17d523c34e09 (patch)
treeb27926782eb357462dec96f91d0c1b629f10fcfb /src/modules/m_chanhistory.cpp
parentRename <chanhistory:bots> to <chanhistory:sendtobots>. (diff)
Allow opting-out of saving bot messages in the channel history.
Closes #2107.
Diffstat (limited to 'src/modules/m_chanhistory.cpp')
-rw-r--r--src/modules/m_chanhistory.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/modules/m_chanhistory.cpp b/src/modules/m_chanhistory.cpp
index 080e202f3..290a8b2de 100644
--- a/src/modules/m_chanhistory.cpp
+++ b/src/modules/m_chanhistory.cpp
@@ -173,6 +173,7 @@ private:
IRCv3::ServerTime::API servertimemanager;
ClientProtocol::MessageTagEvent tagevent;
bool prefixmsg;
+ bool savefrombots;
bool sendtobots;
void AddTag(ClientProtocol::Message& msg, const std::string& tagkey, std::string& tagval)
@@ -232,6 +233,7 @@ public:
historymode.maxduration = tag->getDuration("maxduration", 60*60*24*28);
historymode.maxlines = tag->getNum<unsigned long>("maxlines", 50);
prefixmsg = tag->getBool("prefixmsg", true);
+ savefrombots = tag->getBool("savefrombots", true);
sendtobots = tag->getBool("sendtobots", tag->getBool("bots", true));
}
@@ -245,6 +247,9 @@ public:
if (target.type != MessageTarget::TYPE_CHANNEL || target.status)
return;
+ if (user->IsModeSet(botmode) && !savefrombots)
+ return;
+
std::string_view ctcpname;
if (details.IsCTCP(ctcpname) && !irc::equals(ctcpname, "ACTION"))
return;