]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Server origin PRIVMSG and NOTICE now supported by protocol. Will add interface after...
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Fri, 4 Apr 2008 14:05:07 +0000 (14:05 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Fri, 4 Apr 2008 14:05:07 +0000 (14:05 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9307 e03df62e-2008-0410-955e-edbf42e46eb7

src/modules/m_spanningtree/main.cpp
src/modules/m_spanningtree/privmsg.cpp

index 426cf114a89d9f09d87433f124b75f78d9907799..afc05bdbc4ea6c8f4082ea769ae951fdcf305dca 100644 (file)
@@ -453,6 +453,10 @@ void ModuleSpanningTree::OnWallops(User* user, const std::string &text)
 
 void ModuleSpanningTree::OnUserNotice(User* user, void* dest, int target_type, const std::string &text, char status, const CUList &exempt_list)
 {
+       /* Server origin */
+       if (user == NULL)
+               return;
+
        if (target_type == TYPE_USER)
        {
                User* d = (User*)dest;
@@ -501,6 +505,10 @@ void ModuleSpanningTree::OnUserNotice(User* user, void* dest, int target_type, c
 
 void ModuleSpanningTree::OnUserMessage(User* user, void* dest, int target_type, const std::string &text, char status, const CUList &exempt_list)
 {
+       /* Server origin */
+       if (user == NULL)
+               return;
+
        if (target_type == TYPE_USER)
        {
                // route private messages which are targetted at clients only to the server
index b73ba15fbf08cb45ffa92ec100bea8d556c2afd8..6c4c8935ee1b7baa490a9791526157d6572a9dcc 100644 (file)
@@ -50,7 +50,8 @@ bool TreeSocket::ServerMessage(const std::string &messagetype, const std::string
                        {
                                FOREACH_MOD_I(Instance, I_OnUserNotice, OnUserNotice(NULL, channel, TYPE_SERVER, text, status, except_list));
                        }
-                       channel->WriteChannelWithServ(prefix.c_str(), "%s %s :%s", messagetype.c_str(), channel->name, text.c_str());
+                       TreeServer* s = Utils->FindServer(prefix);
+                       channel->WriteChannelWithServ(s->GetName().c_str(), "%s %s :%s", messagetype.c_str(), channel->name, text.c_str());
                }
 
                /* Propogate as channel privmsg */