]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/privmsg.cpp
Same here
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / privmsg.cpp
index 1752c54f63df1e8d1b0d9a9b252c3cad3667c567..316ad2e5cd996997d5560876b9521f95f009476f 100644 (file)
@@ -32,7 +32,7 @@ bool TreeSocket::ServerMessage(const std::string &messagetype, const std::string
                const char* target = params[0].c_str();
                std::string text = params[1].c_str();
 
-               if ((*target == '@') || (*target == '%') || (*target == '+'))
+               if (Instance->Modes->FindPrefix(*target))
                {
                        status = *target;
                        target++;
@@ -40,7 +40,7 @@ bool TreeSocket::ServerMessage(const std::string &messagetype, const std::string
 
                Channel* channel = Instance->FindChan(target);
                
-               if (target)
+               if (channel)
                {
                        if (messagetype == "PRIVMSG")
                        {
@@ -82,7 +82,7 @@ bool TreeSocket::ServerMessage(const std::string &messagetype, const std::string
                }
 
                /* Propogate as channel privmsg */
-               return Utils->DoOneToAllButSenderRaw(":" + prefix + " " + messagetype + " " + channel->name + " :" + text, sourceserv, prefix, assign(messagetype), params);
+               return Utils->DoOneToAllButSenderRaw(":" + prefix + " " + messagetype + " " + target + " :" + text, sourceserv, prefix, assign(messagetype), params);
        }
        return true;
 }