mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-09 10:39:02 -04:00
Allow opting-out of saving bot messages in the channel history.
Closes #2107.
This commit is contained in:
parent
2b10b8fc2a
commit
70a92b4dae
@ -322,12 +322,16 @@
|
|||||||
# don't support the chathistory batch type. Defaults to #
|
# don't support the chathistory batch type. Defaults to #
|
||||||
# yes. #
|
# yes. #
|
||||||
# #
|
# #
|
||||||
|
# savefrombots - Whether to save messages from users with user mode #
|
||||||
|
# +B (bot) in the channel history. Defaults to yes. #
|
||||||
|
# #
|
||||||
# sendtobots - Whether to send channel history to users with user #
|
# sendtobots - Whether to send channel history to users with user #
|
||||||
# mode +B (bot) enabled. Defaults to yes. #
|
# mode +B (bot) enabled. Defaults to yes. #
|
||||||
#
|
#
|
||||||
#<chanhistory maxlines="50"
|
#<chanhistory maxlines="50"
|
||||||
# maxduration="4w"
|
# maxduration="4w"
|
||||||
# prefixmsg="yes"
|
# prefixmsg="yes"
|
||||||
|
# savefrombots="yes"
|
||||||
# sendtobots="yes">
|
# sendtobots="yes">
|
||||||
|
|
||||||
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
|
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
|
||||||
|
@ -173,6 +173,7 @@ private:
|
|||||||
IRCv3::ServerTime::API servertimemanager;
|
IRCv3::ServerTime::API servertimemanager;
|
||||||
ClientProtocol::MessageTagEvent tagevent;
|
ClientProtocol::MessageTagEvent tagevent;
|
||||||
bool prefixmsg;
|
bool prefixmsg;
|
||||||
|
bool savefrombots;
|
||||||
bool sendtobots;
|
bool sendtobots;
|
||||||
|
|
||||||
void AddTag(ClientProtocol::Message& msg, const std::string& tagkey, std::string& tagval)
|
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.maxduration = tag->getDuration("maxduration", 60*60*24*28);
|
||||||
historymode.maxlines = tag->getNum<unsigned long>("maxlines", 50);
|
historymode.maxlines = tag->getNum<unsigned long>("maxlines", 50);
|
||||||
prefixmsg = tag->getBool("prefixmsg", true);
|
prefixmsg = tag->getBool("prefixmsg", true);
|
||||||
|
savefrombots = tag->getBool("savefrombots", true);
|
||||||
sendtobots = tag->getBool("sendtobots", tag->getBool("bots", true));
|
sendtobots = tag->getBool("sendtobots", tag->getBool("bots", true));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -245,6 +247,9 @@ public:
|
|||||||
if (target.type != MessageTarget::TYPE_CHANNEL || target.status)
|
if (target.type != MessageTarget::TYPE_CHANNEL || target.status)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (user->IsModeSet(botmode) && !savefrombots)
|
||||||
|
return;
|
||||||
|
|
||||||
std::string_view ctcpname;
|
std::string_view ctcpname;
|
||||||
if (details.IsCTCP(ctcpname) && !irc::equals(ctcpname, "ACTION"))
|
if (details.IsCTCP(ctcpname) && !irc::equals(ctcpname, "ACTION"))
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user