Rename <chanhistory:bots> to <chanhistory:sendtobots>.

This commit is contained in:
Sadie Powell 2024-09-22 13:48:56 +01:00
parent fbbc362ebb
commit 2b10b8fc2a
2 changed files with 12 additions and 11 deletions

View File

@ -312,22 +312,23 @@
# #
#-#-#-#-#-#-#-#-#-#-#- CHANHISTORY CONFIGURATION -#-#-#-#-#-#-#-#-#-#-# #-#-#-#-#-#-#-#-#-#-#- 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 # # maxlines - The maximum number of lines of chat history to send to a #
# joining users. Defaults to 50. # # 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 # # prefixmsg - Whether to send an explanatory message to clients that #
# don't support the chathistory batch type. Defaults to # # don't support the chathistory batch type. Defaults to #
# yes. # # yes. #
# # # #
#<chanhistory bots="yes" # sendtobots - Whether to send channel history to users with user #
# mode +B (bot) enabled. Defaults to yes. #
#
#<chanhistory maxlines="50"
# maxduration="4w" # maxduration="4w"
# maxlines="50" # prefixmsg="yes"
# prefixmsg="yes"> # sendtobots="yes">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# Channel logging module: Used to send snotice output to channels, to # Channel logging module: Used to send snotice output to channels, to

View File

@ -166,14 +166,14 @@ class ModuleChanHistory final
private: private:
HistoryMode historymode; HistoryMode historymode;
SimpleUserMode nohistorymode; SimpleUserMode nohistorymode;
bool prefixmsg;
UserModeReference botmode; UserModeReference botmode;
bool dobots;
IRCv3::Batch::CapReference batchcap; IRCv3::Batch::CapReference batchcap;
IRCv3::Batch::API batchmanager; IRCv3::Batch::API batchmanager;
IRCv3::Batch::Batch batch; IRCv3::Batch::Batch batch;
IRCv3::ServerTime::API servertimemanager; IRCv3::ServerTime::API servertimemanager;
ClientProtocol::MessageTagEvent tagevent; ClientProtocol::MessageTagEvent tagevent;
bool prefixmsg;
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,7 +232,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);
dobots = tag->getBool("bots", true); sendtobots = tag->getBool("sendtobots", tag->getBool("bots", true));
} }
ModResult OnRouteMessage(const Channel* channel, const Server* server) override ModResult OnRouteMessage(const Channel* channel, const Server* server) override
@ -264,7 +264,7 @@ public:
if (!localuser) if (!localuser)
return; return;
if (memb->user->IsModeSet(botmode) && !dobots) if (memb->user->IsModeSet(botmode) && !sendtobots)
return; return;
if (memb->user->IsModeSet(nohistorymode)) if (memb->user->IsModeSet(nohistorymode))