]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
More funky stuff, SNONOTICE, MODENOTICE to go with OPERNOTICE
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 12 Nov 2006 16:14:44 +0000 (16:14 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 12 Nov 2006 16:14:44 +0000 (16:14 +0000)
(OPERNOTICE can be considered to be "MODENOTICE os", but it saves bandwidth and cpu to send OPERNOTICE where possible)

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5713 e03df62e-2008-0410-955e-edbf42e46eb7

src/modules/m_spanningtree.cpp

index e2543c05eabb7a66d43077e199b2c2831fec7e65..3a04c4af695231978832c5604919f85e88967137 100644 (file)
@@ -3414,6 +3414,30 @@ class TreeSocket : public InspSocket
 
                                        return Utils->DoOneToAllButSenderRaw(line, sourceserv, prefix, command, params);
                                }
+                               else if (command == "MODENOTICE")
+                               {
+                                       std::string sourceserv = this->myhost;
+                                       if (this->InboundServerName != "")
+                                               sourceserv = this->InboundServerName;
+                                       if (params.size() >= 2)
+                                       {
+                                               Instance->WriteMode(params[0].c_str(), WM_AND, "*** From %s: %s", sourceserv.c_str(), params[1].c_str());
+                                       }
+
+                                       return Utils->DoOneToAllButSenderRaw(line, sourceserv, prefix, command, params);
+                               }
+                               else if (command == "SNONOTICE")
+                               {
+                                       std::string sourceserv = this->myhost;
+                                       if (this->InboundServerName != "")
+                                               sourceserv = this->InboundServerName;
+                                       if (params.size() >= 2)
+                                       {
+                                               Instance->SNO->WriteToSnoMask(*(params[0].c_str()), "From " + sourceserv + ": "+ params[1]);
+                                       }
+
+                                       return Utils->DoOneToAllButSenderRaw(line, sourceserv, prefix, command, params);
+                               }
                                else if (command == "ENDBURST")
                                {
                                        this->bursting = false;
@@ -5182,6 +5206,20 @@ class ModuleSpanningTree : public Module
                        (*params)[0] = ":" + (*params)[0];
                        Utils->DoOneToMany(ServerInstance->Config->ServerName,"OPERNOTICE",*params);
                }
+               else if (event->GetEventID() == "send_modeset")
+               {
+                       if (params->size() < 2)
+                               return;
+                       (*params)[1] = ":" + (*params)[1];
+                       Utils->DoOneToMany(ServerInstance->Config->ServerName,"MODENOTICE",*params);
+               }
+               else if (event->GetEventID() == "send_snoset")
+               {
+                       if (params->size() < 2)
+                               return;
+                       (*params)[1] = ":" + (*params)[1];
+                       Utils->DoOneToMany(ServerInstance->Config->ServerName,"SNONOTICE",*params);
+               }
                else if (event->GetEventID() == "send_push")
                {
                        if (params->size() < 2)