]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Introduce ModeProcessFlags, can be passed to ModeParser::Process() to indicate local...
authorattilamolnar <attilamolnar@hush.com>
Thu, 13 Jun 2013 16:15:34 +0000 (18:15 +0200)
committerattilamolnar <attilamolnar@hush.com>
Thu, 13 Jun 2013 16:15:34 +0000 (18:15 +0200)
Change ProtocolInterface::SendMode() to take source and destination parameters, and call it from the mode parser whenever the mode change is global

This deprecates the ambiguous InspIRCd::SendMode() and InspIRCd::SendGlobalMode() interface (the latter sent mode changes originating from local users twice, etc.)

25 files changed:
include/inspircd.h
include/mode.h
include/protocol.h
src/commands/cmd_mode.cpp
src/mode.cpp
src/modules.cpp
src/modules/m_autoop.cpp
src/modules/m_banredirect.cpp
src/modules/m_channames.cpp
src/modules/m_devoice.cpp
src/modules/m_messageflood.cpp
src/modules/m_namedmodes.cpp
src/modules/m_ojoin.cpp
src/modules/m_opermodes.cpp
src/modules/m_operprefix.cpp
src/modules/m_repeat.cpp
src/modules/m_rmode.cpp
src/modules/m_services_account.cpp
src/modules/m_spanningtree/fjoin.cpp
src/modules/m_spanningtree/fmode.cpp
src/modules/m_spanningtree/main.cpp
src/modules/m_spanningtree/main.h
src/modules/m_spanningtree/protocolinterface.cpp
src/modules/m_spanningtree/protocolinterface.h
src/modules/m_timedbans.cpp

index 22a0bfaa55ab62f4ca9c8abf79f204e85baaf889..aa6be2deeb3c3cd25f60137603999828ed89fc90 100644 (file)
@@ -554,22 +554,6 @@ class CoreExport InspIRCd
                Modules->AddService(*f);
        }
 
-       /** Send a modechange.
-        * The parameters provided are identical to that sent to the
-        * handler for class cmd_mode.
-        * @param parameters The mode parameters
-        * @param user The user to send error messages to
-        */
-       void SendMode(const std::vector<std::string>& parameters, User *user);
-
-       /** Send a modechange and route it to the network.
-        * The parameters provided are identical to that sent to the
-        * handler for class cmd_mode.
-        * @param parameters The mode parameters
-        * @param user The user to send error messages to
-        */
-       void SendGlobalMode(const std::vector<std::string>& parameters, User *user);
-
        /** Match two strings using pattern matching, optionally, with a map
         * to check case against (may be NULL). If map is null, match will be case insensitive.
         * @param str The literal string to match against
@@ -763,8 +747,3 @@ class CommandModule : public Module
                return Version(cmd.name, VF_VENDOR|VF_CORE);
        }
 };
-
-inline void InspIRCd::SendMode(const std::vector<std::string>& parameters, User* user)
-{
-       this->Modes->Process(parameters, user);
-}
index 3805b174bc3c56120b87db33e6c8fbacd69c1e08..9b8d07877d2a98bbe55ac016cadf737f71e86aa1 100644 (file)
@@ -471,6 +471,29 @@ class CoreExport ModeParser
        std::string Cached004ModeList;
 
  public:
+       typedef unsigned int ModeProcessFlag;
+       enum ModeProcessFlags
+       {
+               /** If only this flag is specified, the mode change will be global
+                * and parameter modes will have their parameters explicitly set
+                * (not merged). This is the default.
+                */
+               MODE_NONE = 0,
+
+               /** If this flag is set then the parameters of non-listmodes will be
+                * merged according to their conflict resolution rules.
+                * Does not affect user modes, channel modes without a parameter and
+                * listmodes.
+                */
+               MODE_MERGE = 1,
+
+               /** If this flag is set then the mode change won't be handed over to
+                * the linking module to be sent to other servers, but will be processed
+                * locally and sent to local user(s) as usual.
+                */
+               MODE_LOCALONLY = 2
+       };
+
        ModeParser();
        ~ModeParser();
 
@@ -533,12 +556,11 @@ class CoreExport ModeParser
        /** Process a set of mode changes from a server or user.
         * @param parameters The parameters of the mode change, in the format
         * they would be from a MODE command.
-        * @param user The user setting or removing the modes. When the modes are set
-        * by a server, an 'uninitialized' User is used, where *user\::nick == NULL
-        * and *user->server == NULL.
-        * @param merge Should the mode parameters be merged?
+        * @param user The source of the mode change, can be a server user.
+        * @param flags Optional flags controlling how the mode change is processed,
+        * defaults to MODE_NONE.
         */
-       void Process(const std::vector<std::string>& parameters, User *user, bool merge = false);
+       void Process(const std::vector<std::string>& parameters, User* user, ModeProcessFlag flags = MODE_NONE);
 
        /** Find the mode handler for a given mode and type.
         * @param modeletter mode letter to search for
index 4488fcea43cd80be6923f3a9133d32dc42a9b8a1..eedca50ecc228bc0d8574d1fad72190b1fefd09b 100644 (file)
@@ -68,27 +68,13 @@ class ProtocolInterface
        virtual void SendTopic(Channel* channel, std::string &topic) { }
 
        /** Send mode changes for an object.
-        * @param target The channel name or user to send mode changes for.
+        * @param source The source of the mode change
+        * @param usertarget The target user, NULL if the target is a channel
+        * @param chantarget The target channel, NULL if the target is a user
         * @param modedata The mode changes to send.
         * @param translate A list of translation types
         */
-       virtual void SendMode(const std::string &target, const parameterlist &modedata, const std::vector<TranslateType> &translate) { }
-
-       /** Convenience function, string wrapper around the above.
-         */
-       virtual void SendModeStr(const std::string &target, const std::string &modeline)
-       {
-               irc::spacesepstream x(modeline);
-               parameterlist n;
-               std::vector<TranslateType> types;
-               std::string v;
-               while (x.GetToken(v))
-               {
-                       n.push_back(v);
-                       types.push_back(TR_TEXT);
-               }
-               SendMode(target, n, types);
-       }
+       virtual void SendMode(User* source, User* usertarget, Channel* chantarget, const parameterlist& modedata, const std::vector<TranslateType>& translate) { }
 
        /** Send a notice to users with a given snomask.
         * @param snomask The snomask required for the message to be sent.
index 746128a6beb7742c6489d57a1fec04ce5206af95..adb1d483baf4d9348201a94b85ce4487d31e4447 100644 (file)
@@ -49,7 +49,7 @@ class CommandMode : public Command
  */
 CmdResult CommandMode::Handle (const std::vector<std::string>& parameters, User *user)
 {
-       ServerInstance->Modes->Process(parameters, user, false);
+       ServerInstance->Modes->Process(parameters, user);
        return CMD_SUCCESS;
 }
 
index 2f56c332789c06ad3dba4e0dee316e7ba4c313d6..63008f45c8ffe69bd7b20a6cf72bbb0c322b674c 100644 (file)
@@ -331,7 +331,7 @@ ModeAction ModeParser::TryMode(User* user, User* targetuser, Channel* chan, bool
        return MODEACTION_ALLOW;
 }
 
-void ModeParser::Process(const std::vector<std::string>& parameters, User *user, bool merge)
+void ModeParser::Process(const std::vector<std::string>& parameters, User* user, ModeProcessFlag flags)
 {
        std::string target = parameters[0];
        Channel* targetchannel = ServerInstance->FindChan(target);
@@ -411,7 +411,7 @@ void ModeParser::Process(const std::vector<std::string>& parameters, User *user,
                        /* Make sure the user isn't trying to slip in an invalid parameter */
                        if ((parameter.find(':') == 0) || (parameter.rfind(' ') != std::string::npos))
                                continue;
-                       if (merge && targetchannel && targetchannel->IsModeSet(modechar) && !mh->IsListMode())
+                       if ((flags & MODE_MERGE) && targetchannel && targetchannel->IsModeSet(modechar) && !mh->IsListMode())
                        {
                                std::string ours = targetchannel->GetModeParameter(modechar);
                                if (!mh->ResolveModeConflict(parameter, ours, targetchannel))
@@ -465,6 +465,9 @@ void ModeParser::Process(const std::vector<std::string>& parameters, User *user,
                LastParse.append(output_mode);
                LastParse.append(output_parameters.str());
 
+               if (!(flags & MODE_LOCALONLY))
+                       ServerInstance->PI->SendMode(user, targetuser, targetchannel, LastParseParams, LastParseTranslate);
+
                if (targetchannel)
                {
                        targetchannel->WriteChannel(user, "MODE %s", LastParse.c_str());
@@ -656,7 +659,7 @@ bool ModeParser::DelMode(ModeHandler* mh)
                                stackresult.push_back(chan->name);
                                while (stack.GetStackedLine(stackresult))
                                {
-                                       ServerInstance->SendMode(stackresult, ServerInstance->FakeClient);
+                                       this->Process(stackresult, ServerInstance->FakeClient, MODE_LOCALONLY);
                                        stackresult.erase(stackresult.begin() + 1, stackresult.end());
                                }
                        }
index 8bd44ff686691fe1b3a6060fead37b12a6bd1ea3..039e0142139e3d1840839d1d3558a6a79976d216 100644 (file)
@@ -533,13 +533,6 @@ void dynamic_reference_base::resolve()
                value = NULL;
 }
 
-void InspIRCd::SendGlobalMode(const std::vector<std::string>& parameters, User *user)
-{
-       Modes->Process(parameters, user);
-       if (!Modes->GetLastParse().empty())
-               this->PI->SendMode(parameters[0], Modes->GetLastParseParams(), Modes->GetLastParseTranslate());
-}
-
 Module* ModuleManager::Find(const std::string &name)
 {
        std::map<std::string, Module*>::iterator modfind = Modules.find(name);
index 85b14ba7ad6dfdfb1dac8782f292635b316911ae..9620a3a063f0ffbb04f2700cc2fe1b98eed8c0e8 100644 (file)
@@ -123,7 +123,7 @@ class ModuleAutoOp : public Module
                        for(std::string::size_type i = modeline.length(); i > 1; --i) // we use "i > 1" instead of "i" so we skip the +
                                modechange.push_back(memb->user->nick);
                        if(modechange.size() >= 3)
-                               ServerInstance->SendGlobalMode(modechange, ServerInstance->FakeClient);
+                               ServerInstance->Modes->Process(modechange, ServerInstance->FakeClient);
                }
        }
 
index 08b2244d4c6ec5e2b03be4fa5e9da6d929b8e118..a88324fe2cc9dac19548248e7e25038c1ff63feb 100644 (file)
@@ -260,7 +260,7 @@ class ModuleBanRedirect : public Module
                                stackresult.push_back(chan->name);
                                while (modestack.GetStackedLine(stackresult))
                                {
-                                       ServerInstance->Modes->Process(stackresult, ServerInstance->FakeClient);
+                                       ServerInstance->Modes->Process(stackresult, ServerInstance->FakeClient, ModeParser::MODE_LOCALONLY);
                                        stackresult.erase(stackresult.begin() + 1, stackresult.end());
                                }
                        }
index 52f781ae130548ec11f1387f1839750e5fb3dd67..f1a4981c8c95d74404c4859275bebc293c57fdf5 100644 (file)
@@ -84,7 +84,7 @@ class ModuleChannelNames : public Module
                                modes.push_back(c->name);
                                modes.push_back("-P");
 
-                               ServerInstance->SendGlobalMode(modes, ServerInstance->FakeClient);
+                               ServerInstance->Modes->Process(modes, ServerInstance->FakeClient);
                        }
                        const UserMembList* users = c->GetUsers();
                        for(UserMembCIter j = users->begin(); j != users->end(); )
index 64604e90c95b245ddf59b737d7610a70237e1074..889658d2000b838dbd3b78e6f37d4ddb486dbd2a 100644 (file)
@@ -46,7 +46,7 @@ class CommandDevoice : public Command
                modes.push_back("-v");
                modes.push_back(user->nick);
 
-               ServerInstance->SendGlobalMode(modes, ServerInstance->FakeClient);
+               ServerInstance->Modes->Process(modes, ServerInstance->FakeClient);
                return CMD_SUCCESS;
        }
 };
index 65c3354a9212b5ec624639995bf0d738bdcbd96d..86296094b3151af2c81828a5b32c4bbaa6018747 100644 (file)
@@ -156,7 +156,7 @@ class ModuleMsgFlood : public Module
                                        parameters.push_back(dest->name);
                                        parameters.push_back("+b");
                                        parameters.push_back("*!*@" + user->dhost);
-                                       ServerInstance->SendGlobalMode(parameters, ServerInstance->FakeClient);
+                                       ServerInstance->Modes->Process(parameters, ServerInstance->FakeClient);
                                }
 
                                const std::string kickMessage = "Channel flood triggered (limit is " + ConvToStr(f->lines) +
index 3e27092a7fbb1ec1e329fe5eb9117cd3859b9baf..26b6339a3aa1415d9c98c0137dcc361438b5da0c 100644 (file)
@@ -82,7 +82,7 @@ class CommandProp : public Command
                                }
                        }
                }
-               ServerInstance->SendGlobalMode(modes, src);
+               ServerInstance->Modes->Process(modes, src);
                return CMD_SUCCESS;
        }
 };
@@ -196,7 +196,7 @@ class ModuleNamedModes : public Module
                        }
                }
                newparms[1] = modelist;
-               ServerInstance->Modes->Process(newparms, source, false);
+               ServerInstance->Modes->Process(newparms, source);
                return MOD_RES_DENY;
        }
 };
index 999cd5b6486a72bd0311fa9eaa02f81b7dafbd0a..4aec2933a40eaf399c74a02c2eb29428cd580b6d 100644 (file)
@@ -93,7 +93,7 @@ class CommandOjoin : public SplitCommand
                        modes.push_back(user->nick);
                        if (op)
                                modes.push_back(user->nick);
-                       ServerInstance->SendGlobalMode(modes, ServerInstance->FakeClient);
+                       ServerInstance->Modes->Process(modes, ServerInstance->FakeClient);
                }
                return CMD_SUCCESS;
        }
index 5752ff48d07f9a360de9267627842e1d4916cc7e..4d4fcd998b7c42677e20b8c3fad851bfa4c8613b 100644 (file)
@@ -67,7 +67,7 @@ class ModuleModesOnOper : public Module
                while (ss >> buf)
                        modes.push_back(buf);
 
-               ServerInstance->SendMode(modes, u);
+               ServerInstance->Modes->Process(modes, u);
        }
 };
 
index 9c15cf5b2aa0d2ac7fe90fd5ffc77ebc460b0a4f..0f4cdbea1d34596cdec1e59d3d6ba2aaf73ac34c 100644 (file)
@@ -108,7 +108,7 @@ class ModuleOperPrefixMode : public Module
                for (UCListIter v = user->chans.begin(); v != user->chans.end(); v++)
                {
                        modechange[0] = (*v)->name;
-                       ServerInstance->SendGlobalMode(modechange, ServerInstance->FakeClient);
+                       ServerInstance->Modes->Process(modechange, ServerInstance->FakeClient);
                }
        }
 
index 5be0fd6227e37f04067255de8c29a1dd393433d6..86f26016d9cdb6adc488478e06a67b6685356628 100644 (file)
@@ -401,7 +401,7 @@ class RepeatModule : public Module
                                parameters.push_back(memb->chan->name);
                                parameters.push_back("+b");
                                parameters.push_back("*!*@" + user->dhost);
-                               ServerInstance->SendGlobalMode(parameters, ServerInstance->FakeClient);
+                               ServerInstance->Modes->Process(parameters, ServerInstance->FakeClient);
                        }
 
                        memb->chan->KickUser(ServerInstance->FakeClient, user, "Repeat flood");
index 8259d406cbc9e7cda1147675eebaa3aea69a0439..f5e6433bfb02043d781bad3dea37e083f8d0bac0 100644 (file)
@@ -100,7 +100,7 @@ class CommandRMode : public Command
                stackresult.push_back(chan->name);
                while (modestack.GetStackedLine(stackresult))
                {
-                       ServerInstance->SendMode(stackresult, user);
+                       ServerInstance->Modes->Process(stackresult, user);
                        stackresult.erase(stackresult.begin() + 1, stackresult.end());
                }
 
index e42c02ff2b63a523049450cf6fadc5784bdcc737..123132ca988e23663bdd4f20957dce697f5c935b 100644 (file)
@@ -159,7 +159,7 @@ class ModuleServicesAccount : public Module
                        std::vector<std::string> modechange;
                        modechange.push_back(user->nick);
                        modechange.push_back("-r");
-                       ServerInstance->SendMode(modechange, ServerInstance->FakeClient);
+                       ServerInstance->Modes->Process(modechange, ServerInstance->FakeClient, ModeParser::MODE_LOCALONLY);
                }
        }
 
index b25444cdacc657878566c602c4f607e602311eda..faf5345427a6e2828a27e34c4d91e62fef015f89 100644 (file)
@@ -130,7 +130,7 @@ CmdResult CommandFJoin::Handle(const std::vector<std::string>& params, User *src
 
                /* Remember, params[params.size() - 1] is userlist, and we don't want to apply *that* */
                modelist.insert(modelist.end(), params.begin()+2, params.end()-1);
-               ServerInstance->SendMode(modelist, srcuser);
+               ServerInstance->Modes->Process(modelist, srcuser, ModeParser::MODE_LOCALONLY | ModeParser::MODE_MERGE);
        }
 
        irc::modestacker modestack(true);
@@ -222,7 +222,7 @@ void CommandFJoin::ApplyModeStack(User* srcuser, Channel* c, irc::modestacker& s
 
        while (stack.GetStackedLine(stackresult))
        {
-               ServerInstance->SendMode(stackresult, srcuser);
+               ServerInstance->Modes->Process(stackresult, srcuser, ModeParser::MODE_LOCALONLY);
                stackresult.erase(stackresult.begin() + 1, stackresult.end());
        }
 }
index 7be904faf7552bb10b2185cc25989f507f2c2b9f..9a72c5f05016ea453221f75ada2ca95d5a903b7f 100644 (file)
@@ -55,23 +55,25 @@ CmdResult CommandFMode::Handle(const std::vector<std::string>& params, User *who
                ourTS = user->age;
        }
 
-       /* TS is equal or less: Merge the mode changes into ours and pass on.
+       /* If the TS is greater than ours, we drop the mode and don't pass it anywhere.
         */
-       if (TS <= ourTS)
-       {
-               std::vector<std::string> modelist;
-               modelist.reserve(params.size()-1);
-               /* Insert everything into modelist except the TS (params[1]) */
-               modelist.push_back(params[0]);
-               modelist.insert(modelist.end(), params.begin()+2, params.end());
+       if (TS > ourTS)
+               return CMD_FAILURE;
 
-               bool merge = (TS == ourTS) && IS_SERVER(who);
-               ServerInstance->Modes->Process(modelist, who, merge);
-               return CMD_SUCCESS;
-       }
-       /* If the TS is greater than ours, we drop the mode and dont pass it anywhere.
+       /* TS is equal or less: Merge the mode changes into ours and pass on.
         */
-       return CMD_FAILURE;
+       std::vector<std::string> modelist;
+       modelist.reserve(params.size()-1);
+       /* Insert everything into modelist except the TS (params[1]) */
+       modelist.push_back(params[0]);
+       modelist.insert(modelist.end(), params.begin()+2, params.end());
+
+       ModeParser::ModeProcessFlag flags = ModeParser::MODE_LOCALONLY;
+       if ((TS == ourTS) && IS_SERVER(who))
+               flags |= ModeParser::MODE_MERGE;
+
+       ServerInstance->Modes->Process(modelist, who, flags);
+       return CMD_SUCCESS;
 }
 
 
index 9af4bfd0cdfc3ec5f5c4a36f23032f85a96b15c2..8c5439fbb239314f480a7b7c40121e067fd491fd 100644 (file)
@@ -77,7 +77,7 @@ void ModuleSpanningTree::init()
                I_OnUserMessage, I_OnBackgroundTimer, I_OnUserJoin,
                I_OnChangeHost, I_OnChangeName, I_OnChangeIdent, I_OnUserPart, I_OnUnloadModule,
                I_OnUserQuit, I_OnUserPostNick, I_OnUserKick, I_OnRehash, I_OnPreRehash,
-               I_OnOper, I_OnAddLine, I_OnDelLine, I_OnMode, I_OnLoadModule, I_OnStats,
+               I_OnOper, I_OnAddLine, I_OnDelLine, I_OnLoadModule, I_OnStats,
                I_OnSetAway, I_OnPostCommand, I_OnUserConnect, I_OnAcceptConnection
        };
        ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
@@ -793,33 +793,6 @@ void ModuleSpanningTree::OnDelLine(User* user, XLine *x)
        }
 }
 
-void ModuleSpanningTree::OnMode(User* user, void* dest, int target_type, const parameterlist &text, const std::vector<TranslateType> &translate)
-{
-       if ((IS_LOCAL(user)) && (user->registered == REG_ALL))
-       {
-               parameterlist params;
-               std::string output_text;
-
-               ServerInstance->Parser->TranslateUIDs(translate, text, output_text);
-
-               if (target_type == TYPE_USER)
-               {
-                       User* u = (User*)dest;
-                       params.push_back(u->uuid);
-                       params.push_back(output_text);
-                       Utils->DoOneToMany(user->uuid, "MODE", params);
-               }
-               else
-               {
-                       Channel* c = (Channel*)dest;
-                       params.push_back(c->name);
-                       params.push_back(ConvToStr(c->age));
-                       params.push_back(output_text);
-                       Utils->DoOneToMany(user->uuid, "FMODE", params);
-               }
-       }
-}
-
 ModResult ModuleSpanningTree::OnSetAway(User* user, const std::string &awaymsg)
 {
        if (IS_LOCAL(user))
index 22357aed434ef6a25aec211bebe3b22ef415e7e5..28ebbc37369133b67a68496c1262edff63694043 100644 (file)
@@ -163,7 +163,6 @@ class ModuleSpanningTree : public Module
        void OnLine(User* source, const std::string &host, bool adding, char linetype, long duration, const std::string &reason);
        void OnAddLine(User *u, XLine *x) CXX11_OVERRIDE;
        void OnDelLine(User *u, XLine *x) CXX11_OVERRIDE;
-       void OnMode(User* user, void* dest, int target_type, const std::vector<std::string> &text, const std::vector<TranslateType> &translate) CXX11_OVERRIDE;
        ModResult OnStats(char statschar, User* user, string_list &results) CXX11_OVERRIDE;
        ModResult OnSetAway(User* user, const std::string &awaymsg) CXX11_OVERRIDE;
        void ProtoSendMode(void* opaque, TargetTypeFlags target_type, void* target, const std::vector<std::string> &modeline, const std::vector<TranslateType> &translate);
index 93a1387580c909322bb2073df7d3fb74dbae9942..ce824fef85f25e3a0e3771d2d6c6205b60517897 100644 (file)
@@ -89,35 +89,28 @@ void SpanningTreeProtocolInterface::SendTopic(Channel* channel, std::string &top
        Utils->DoOneToMany(ServerInstance->Config->GetSID(),"FTOPIC", params);
 }
 
-void SpanningTreeProtocolInterface::SendMode(const std::string &target, const parameterlist &modedata, const std::vector<TranslateType> &translate)
+void SpanningTreeProtocolInterface::SendMode(User* source, User* u, Channel* c, const parameterlist& modedata, const std::vector<TranslateType>& translate)
 {
-       if (modedata.empty())
-               return;
-
-       std::string outdata;
-       ServerInstance->Parser->TranslateUIDs(translate, modedata, outdata);
-
-       std::string uidtarget;
-       ServerInstance->Parser->TranslateUIDs(TR_NICK, target, uidtarget);
-
-       parameterlist outlist;
-       outlist.push_back(uidtarget);
-       outlist.push_back(outdata);
+       parameterlist params;
 
-       User* a = ServerInstance->FindNick(uidtarget);
-       if (a)
+       if (u)
        {
-               Utils->DoOneToMany(ServerInstance->Config->GetSID(),"MODE",outlist);
-               return;
+               if (u->registered != REG_ALL)
+                       return;
+
+               params.push_back(u->uuid);
+               params.insert(params.end(), modedata.begin(), modedata.end());
+               Utils->DoOneToMany(source->uuid, "MODE", params);
        }
        else
        {
-               Channel* c = ServerInstance->FindChan(target);
-               if (c)
-               {
-                       outlist.insert(outlist.begin() + 1, ConvToStr(c->age));
-                       Utils->DoOneToMany(ServerInstance->Config->GetSID(),"FMODE",outlist);
-               }
+               std::string output_text;
+               ServerInstance->Parser->TranslateUIDs(translate, modedata, output_text);
+
+               params.push_back(c->name);
+               params.push_back(ConvToStr(c->age));
+               params.push_back(output_text);
+               Utils->DoOneToMany(source->uuid, "FMODE", params);
        }
 }
 
index 80a21c49b34c7a11631386ceb5b6fb55ea0c22c0..2b4c4371ff20b4f862b1470ea6358c0b1a167ccb 100644 (file)
@@ -25,14 +25,13 @@ class ModuleSpanningTree;
 class SpanningTreeProtocolInterface : public ProtocolInterface
 {
        SpanningTreeUtilities* Utils;
-       void SendChannel(Channel* target, char status, const std::string &text);
  public:
        SpanningTreeProtocolInterface(SpanningTreeUtilities* util) : Utils(util) { }
 
        bool SendEncapsulatedData(const parameterlist &encap);
        void SendMetaData(Extensible* target, const std::string &key, const std::string &data);
        void SendTopic(Channel* channel, std::string &topic);
-       void SendMode(const std::string &target, const parameterlist &modedata, const std::vector<TranslateType> &types);
+       void SendMode(User* source, User* usertarget, Channel* chantarget, const parameterlist& modedata, const std::vector<TranslateType>& types);
        void SendSNONotice(const std::string &snomask, const std::string &text);
        void PushToClient(User* target, const std::string &rawline);
        void SendChannelPrivmsg(Channel* target, char status, const std::string &text);
index a76d89c827d0efc5bf36cdad4001fb82162e8832..93245432d996332e374d5beaf1dab0ad592036dc 100644 (file)
@@ -195,7 +195,7 @@ class ModuleTimedBans : public Module
                                cr->WriteAllExcept(ServerInstance->FakeClient, true, '@', empty, "NOTICE %s :%s", cr->name.c_str(), expiry.c_str());
                                ServerInstance->PI->SendChannelNotice(cr, '@', expiry);
 
-                               ServerInstance->SendGlobalMode(setban, ServerInstance->FakeClient);
+                               ServerInstance->Modes->Process(setban, ServerInstance->FakeClient);
                        }
                }
        }