From 70a92b4daee9f2fb91c9b5831c1e17d523c34e09 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 22 Sep 2024 14:01:37 +0100 Subject: Allow opting-out of saving bot messages in the channel history. Closes #2107. --- src/modules/m_chanhistory.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/modules/m_chanhistory.cpp') 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("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; -- cgit v1.3.1-10-gc9f91