]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/main.cpp
m_check: Fix showing oper permissions (privileges). (#1556)
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / main.cpp
index c7e55c66cf3259e784969b03c4b4e956f74675db..985762872cc88c17fe16db33ef8adbf721299189 100644 (file)
@@ -37,7 +37,8 @@
 #include "translate.h"
 
 ModuleSpanningTree::ModuleSpanningTree()
-       : Stats::EventListener(this)
+       : Away::EventListener(this)
+       , Stats::EventListener(this)
        , rconnect(this)
        , rsquit(this)
        , map(this)
@@ -45,6 +46,7 @@ ModuleSpanningTree::ModuleSpanningTree()
        , currmembid(0)
        , eventprov(this, "event/server")
        , DNS(this, "DNS")
+       , tagevprov(this, "event/messagetag")
        , loopCall(false)
 {
 }
@@ -409,6 +411,7 @@ void ModuleSpanningTree::OnUserPostMessage(User* user, const MessageTarget& targ
                if (!IS_LOCAL(d))
                {
                        CmdBuilder params(user, message_type);
+                       params.push_tags(details.tags_out);
                        params.push_back(d->uuid);
                        params.push_last(details.text);
                        params.Unicast(d);
@@ -416,12 +419,13 @@ void ModuleSpanningTree::OnUserPostMessage(User* user, const MessageTarget& targ
        }
        else if (target.type == MessageTarget::TYPE_CHANNEL)
        {
-               Utils->SendChannelMessage(user->uuid, target.Get<Channel>(), details.text, target.status, details.exemptions, message_type);
+               Utils->SendChannelMessage(user->uuid, target.Get<Channel>(), details.text, target.status, details.tags_out, details.exemptions, message_type);
        }
        else if (target.type == MessageTarget::TYPE_SERVER)
        {
                const std::string* serverglob = target.Get<std::string>();
                CmdBuilder par(user, message_type);
+               par.push_tags(details.tags_out);
                par.push_back(*serverglob);
                par.push_last(details.text);
                par.Broadcast();
@@ -581,9 +585,6 @@ void ModuleSpanningTree::OnUserKick(User* source, Membership* memb, const std::s
 
 void ModuleSpanningTree::OnPreRehash(User* user, const std::string &parameter)
 {
-       if (loopCall)
-               return; // Don't generate a REHASH here if we're in the middle of processing a message that generated this one
-
        ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "OnPreRehash called with param %s", parameter.c_str());
 
        // Send out to other servers
@@ -718,15 +719,19 @@ void ModuleSpanningTree::OnDelLine(User* user, XLine *x)
        params.Broadcast();
 }
 
-ModResult ModuleSpanningTree::OnSetAway(User* user, const std::string &awaymsg)
+void ModuleSpanningTree::OnUserAway(User* user)
 {
        if (IS_LOCAL(user))
-               CommandAway::Builder(user, awaymsg).Broadcast();
+               CommandAway::Builder(user).Broadcast();
+}
 
-       return MOD_RES_PASSTHRU;
+void ModuleSpanningTree::OnUserBack(User* user)
+{
+       if (IS_LOCAL(user))
+               CommandAway::Builder(user).Broadcast();
 }
 
-void ModuleSpanningTree::OnMode(User* source, User* u, Channel* c, const Modes::ChangeList& modes, ModeParser::ModeProcessFlag processflags, const std::string& output_mode)
+void ModuleSpanningTree::OnMode(User* source, User* u, Channel* c, const Modes::ChangeList& modes, ModeParser::ModeProcessFlag processflags)
 {
        if (processflags & ModeParser::MODE_LOCALONLY)
                return;
@@ -738,7 +743,7 @@ void ModuleSpanningTree::OnMode(User* source, User* u, Channel* c, const Modes::
 
                CmdBuilder params(source, "MODE");
                params.push(u->uuid);
-               params.push(output_mode);
+               params.push(ClientProtocol::Messages::Mode::ToModeLetters(modes));
                params.push_raw(Translate::ModeChangeListToParams(modes.getlist()));
                params.Broadcast();
        }
@@ -747,7 +752,7 @@ void ModuleSpanningTree::OnMode(User* source, User* u, Channel* c, const Modes::
                CmdBuilder params(source, "FMODE");
                params.push(c->name);
                params.push_int(c->age);
-               params.push(output_mode);
+               params.push(ClientProtocol::Messages::Mode::ToModeLetters(modes));
                params.push_raw(Translate::ModeChangeListToParams(modes.getlist()));
                params.Broadcast();
        }