]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/u_listmode.h
Add contents of LDFLAGS in addition to CXXFLAGS
[user/henk/code/inspircd.git] / include / u_listmode.h
index 666e851f74d5cf8bb9ba69cfea5651edbdc49eb3..eb3cf18b7e2694c4c9d3ecae59792a2735fad226 100644 (file)
@@ -3,7 +3,7 @@
  *       +------------------------------------+
  *
  *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
  *         the file COPYING for details.
@@ -19,7 +19,7 @@
 inline std::string stringtime(InspIRCd* Instance)
 {
        std::ostringstream TIME;
-       TIME << Instance->Time(); 
+       TIME << Instance->Time();
        return TIME.str();
 }
 
@@ -129,7 +129,7 @@ class ListModeBase : public ModeHandler
         * specified in ListModeBase::configtag
         */
        limitlist chanlimits;
+
  public:
        /** Constructor.
         * @param Instance The creator of this class
@@ -147,7 +147,7 @@ class ListModeBase : public ModeHandler
                infokey = "listbase_mode_" + std::string(1, mode) + "_list";
        }
 
-       /** See mode.h 
+       /** See mode.h
         */
        std::pair<bool,std::string> ModeSet(User*, User*, Channel* channel, const std::string &parameter)
        {
@@ -217,12 +217,9 @@ class ListModeBase : public ModeHandler
 
                        while (modestack.GetStackedLine(stackresult))
                        {
-                               for (size_t j = 0; j < stackresult.size(); j++)
-                               {
-                                       mode_junk.push_back(stackresult[j]);
-                               }
-
-                               ServerInstance->SendMode(mode_junk, ServerInstance->FakeClient);                
+                               mode_junk.insert(mode_junk.end(), stackresult.begin(), stackresult.end());
+                               ServerInstance->SendMode(mode_junk, ServerInstance->FakeClient);
+                               mode_junk.erase(mode_junk.begin() + 1, mode_junk.end());
                        }
                }
        }
@@ -299,7 +296,7 @@ class ListModeBase : public ModeHandler
                                {
                                        /* Give a subclass a chance to error about this */
                                        TellAlreadyOnList(source, channel, parameter);
-                                       
+
                                        // it does, deny the change
                                        return MODEACTION_DENY;
                                }
@@ -350,9 +347,9 @@ class ListModeBase : public ModeHandler
                        {
                                source->WriteNumeric(478, "%s %s %s :Channel ban/ignore list is full", source->nick.c_str(), channel->name.c_str(), parameter.c_str());
                        }
-                       
+
                        parameter = "";
-                       return MODEACTION_DENY; 
+                       return MODEACTION_DENY;
                }
                else
                {
@@ -423,6 +420,8 @@ class ListModeBase : public ModeHandler
                chan->GetExt(infokey, mlist);
                irc::modestacker modestack(ServerInstance, true);
                std::deque<std::string> stackresult;
+               std::deque<TranslateType> types;
+               types.push_back(TR_TEXT);
                if (mlist)
                {
                        for (modelist::iterator it = mlist->begin(); it != mlist->end(); it++)
@@ -432,9 +431,8 @@ class ListModeBase : public ModeHandler
                }
                while (modestack.GetStackedLine(stackresult))
                {
-                       irc::stringjoiner mode_join(" ", stackresult, 0, stackresult.size() - 1);
-                       std::string line = mode_join.GetJoined();
-                       proto->ProtoSendMode(opaque, TYPE_CHANNEL, chan, line);
+                       types.assign(stackresult.size(), this->GetTranslateType());
+                       proto->ProtoSendMode(opaque, TYPE_CHANNEL, chan, stackresult, types);
                }
        }
 
@@ -445,7 +443,7 @@ class ListModeBase : public ModeHandler
        virtual void DoCleanup(int, void*)
        {
        }
-       
+
        /** Validate parameters.
         * Overridden by implementing module.
         * @param source Source user adding the parameter
@@ -457,7 +455,7 @@ class ListModeBase : public ModeHandler
        {
                return true;
        }
-       
+
        /** Tell the user the list is too long.
         * Overridden by implementing module.
         * @param source Source user adding the parameter
@@ -469,7 +467,7 @@ class ListModeBase : public ModeHandler
        {
                return false;
        }
-       
+
        /** Tell the user an item is already on the list.
         * Overridden by implementing module.
         * @param source Source user adding the parameter
@@ -479,7 +477,7 @@ class ListModeBase : public ModeHandler
        virtual void TellAlreadyOnList(User*, Channel*, std::string&)
        {
        }
-       
+
        /** Tell the user that the parameter is not in the list.
         * Overridden by implementing module.
         * @param source Source user removing the parameter
@@ -519,7 +517,7 @@ class ListModeBase : public ModeHandler
                                {
                                        LM->literal = LM->user->nick + "!" + LM->user->ident + "@" + LM->user->GetIPString();
                                }
-                               
+
                                for (modelist::iterator it = mlist->begin(); it != mlist->end(); it++)
                                {
                                        if (LM->extban && it->mask.length() > 1 && it->mask[0] == LM->extban && it->mask[1] == ':')
@@ -560,4 +558,3 @@ class ListModeBase : public ModeHandler
 };
 
 #endif
-