]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Rename <chanhistory:notice> to <chanhistory:prefixmsg>.
authorSadie Powell <sadie@witchery.services>
Fri, 3 Jan 2020 22:35:25 +0000 (22:35 +0000)
committerSadie Powell <sadie@witchery.services>
Fri, 3 Jan 2020 22:35:53 +0000 (22:35 +0000)
This name is a lot lessambiguous.

docs/conf/modules.conf.example
src/modules/m_chanhistory.cpp

index ae747e3a03680d1f5b7ad2841c6a48803fa115b5..215f661370d4b06bd189fcf6c8a97353ddfa6c93 100644 (file)
 #
 # Set the maximum number of lines allowed to be stored per channel below.
 # This is the hard limit for 'X'.
-# If notice is set to yes, joining users will get a NOTICE before playback
-# telling them about the following lines being the pre-join history.
+# If prefixmsg is set to yes, joining users without batch support will get
+# a NOTICE before playback telling them about the following lines being
+# the pre-join history.
 # If bots is set to yes, it will also send to users marked with +B
-#<chanhistory maxlines="50" notice="yes" bots="yes">
+#<chanhistory maxlines="50" prefixmsg="yes" bots="yes">
 
 #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
 # Channel logging module: Used to send snotice output to channels, to
index cfe2a6916b5e569320d5ad8df50bca211f049216..c9a4286ded1e99616d5367e61ebe4261668c4b26 100644 (file)
@@ -124,7 +124,7 @@ class ModuleChanHistory
 {
  private:
        HistoryMode m;
-       bool sendnotice;
+       bool prefixmsg;
        UserModeReference botmode;
        bool dobots;
        IRCv3::Batch::CapReference batchcap;
@@ -191,7 +191,7 @@ class ModuleChanHistory
        {
                ConfigTag* tag = ServerInstance->Config->ConfValue("chanhistory");
                m.maxlines = tag->getUInt("maxlines", 50, 1);
-               sendnotice = tag->getBool("notice", true);
+               prefixmsg = tag->getBool("prefixmsg", tag->getBool("notice", true));
                dobots = tag->getBool("bots", true);
        }
 
@@ -228,11 +228,11 @@ class ModuleChanHistory
                if (!list)
                        return;
 
-               if ((sendnotice) && (!batchcap.get(localuser)))
+               if ((prefixmsg) && (!batchcap.get(localuser)))
                {
                        std::string message("Replaying up to " + ConvToStr(list->maxlen) + " lines of pre-join history");
                        if (list->maxtime > 0)
-                               message.append(" spanning up to " + InspIRCd::DurationString(list->maxtime));
+                               message.append(" from the last " + InspIRCd::DurationString(list->maxtime));
                        memb->WriteNotice(message);
                }