]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Allow modules to prevent a message from updating the idle time.
authorSadie Powell <sadie@witchery.services>
Mon, 24 Feb 2020 02:10:36 +0000 (02:10 +0000)
committerSadie Powell <sadie@witchery.services>
Thu, 5 Mar 2020 20:47:18 +0000 (20:47 +0000)
include/message.h
include/modules/ctctags.h
src/coremods/core_message.cpp
src/modules/m_ircv3_ctctags.cpp

index 3a7c7018e7a772d97c5099a3f0f1c7bacda015bb..eae27ff94c0332d73222e2ae47d046145ea31547 100644 (file)
@@ -39,6 +39,9 @@ class CoreExport MessageDetails
        /* Whether to send the original message back to clients with echo-message support. */
        bool echo_original;
 
+       /** Whether to update the source user's idle time. */
+       bool update_idle;
+
         /** The users who are exempted from receiving this message. */
        CUList exemptions;
 
@@ -78,6 +81,7 @@ class CoreExport MessageDetails
        MessageDetails(MessageType mt, const std::string& msg, const ClientProtocol::TagMap& tags)
                : echo(true)
                , echo_original(false)
+               , update_idle(true)
                , original_text(msg)
                , tags_in(tags)
                , text(msg)
index f1af43c09ab99132ec10db9aa3a3d43244d0a8d8..ad45d12b1a4f31b5b61e344d3badc94525df796a 100644 (file)
@@ -85,6 +85,9 @@ class CTCTags::TagMessageDetails
        /* Whether to send the original tags back to clients with echo-message support. */
        bool echo_original;
 
+       /** Whether to update the source user's idle time. */
+       bool update_idle;
+
        /** The users who are exempted from receiving this message. */
        CUList exemptions;
 
@@ -97,6 +100,7 @@ class CTCTags::TagMessageDetails
        TagMessageDetails(const ClientProtocol::TagMap& tags)
                : echo(true)
                , echo_original(false)
+               , update_idle(true)
                , tags_in(tags)
        {
        }
index 648172b576e0febbc9d6008731072c51119be160..1093aad678fa06c77b97117aaba3f7c7673a3a06 100644 (file)
@@ -128,7 +128,7 @@ namespace
        {
                // If the source is local and was not sending a CTCP reply then update their idle time.
                LocalUser* lsource = IS_LOCAL(source);
-               if (lsource && (msgdetails.type != MSG_NOTICE || !msgdetails.IsCTCP()))
+               if (lsource && msgdetails.update_idle && (msgdetails.type != MSG_NOTICE || !msgdetails.IsCTCP()))
                        lsource->idle_lastmsg = ServerInstance->Time();
 
                // Inform modules that a message was sent.
index 421bf89c385dac9cfecb90ccf3406a8e738e7008..1bb803bc29c2a6a3b36ee7bc926dae93c88923ac 100644 (file)
@@ -57,7 +57,7 @@ class CommandTagMsg : public Command
        {
                // If the source is local then update its idle time.
                LocalUser* lsource = IS_LOCAL(source);
-               if (lsource)
+               if (lsource && msgdetails.update_idle)
                        lsource->idle_lastmsg = ServerInstance->Time();
 
                // Inform modules that a TAGMSG was sent.