]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fix a bug (snotices repeating constantly), and add a flush timer (1x5 seconds)
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 5 Jan 2008 16:57:42 +0000 (16:57 +0000)
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 5 Jan 2008 16:57:42 +0000 (16:57 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8639 e03df62e-2008-0410-955e-edbf42e46eb7

include/snomasks.h
src/snomasks.cpp

index 2f53443f07f9e07870206c837f66443c4413243b..a6a1f2d82a5e52b8c90453673239e7aa094537be 100644 (file)
@@ -25,9 +25,6 @@ class Snomask
  private:
        InspIRCd *ServerInstance;
 
-       /** Sends out a pending message
-        */
-       void Flush();
  public:
        char MySnomask;
        std::string Description;
@@ -46,6 +43,10 @@ class Snomask
        /** Sends a message to all opers with this snomask.
         */
        void SendMessage(const std::string &message);
+
+       /** Sends out a pending message
+        */
+       void Flush();
 };
 
 /** A list of snomasks which are valid, and their descriptive texts
index 2af5fc8014451ac341ddf2788abb78349d6418f3..97de1ebf521b80d030ce1635bdf105a20f42482a 100644 (file)
@@ -30,6 +30,10 @@ SnomaskManager::~SnomaskManager()
 void SnomaskManager::FlushSnotices()
 {
        // stub.. not yet written XXX
+       for (std::map<char, Snomask *>::iterator i = SnoMasks.begin(); i != SnoMasks.end(); i++)
+       {
+               i->second->Flush();
+       }
 }
 
 bool SnomaskManager::EnableSnomask(char letter, const std::string &type)
@@ -106,7 +110,6 @@ void Snomask::SendMessage(const std::string &message)
        {
                this->Flush();
                LastMessage = message;
-               Count = 1;
        }
        else
        {
@@ -134,4 +137,7 @@ void Snomask::Flush()
                        }
                }
        }
+
+       LastMessage = "";
+       Count = 1;
 }