]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
no you can't just go from a std::ostringstream to a std::string, Om. *thwap*
authornenolod <nenolod@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 2 Oct 2006 13:01:14 +0000 (13:01 +0000)
committernenolod <nenolod@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 2 Oct 2006 13:01:14 +0000 (13:01 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5396 e03df62e-2008-0410-955e-edbf42e46eb7

src/modules/m_remove.cpp

index 2b237c08e3a1a4d13c67254ed951820f18759b6a..9966fbfb3ac0fc559cb21e5ae1c5a16e6aeae90e 100644 (file)
@@ -87,7 +87,7 @@ class RemoveBase
                chanrec* channel;
                ModeLevel tlevel;
                ModeLevel ulevel;
-               std::ostringstream reason;
+               std::string reason;
                std::string protectkey;
                std::string founderkey;
                bool hasnokicks;
@@ -179,6 +179,8 @@ class RemoveBase
                         */
                        if ((ulevel > PEON) && (ulevel >= tlevel) && (tlevel != OWNER))
                        {
+                               // no you can't just go from a std::ostringstream to a std::string, Om. -nenolod
+                               std::ostringstream reason_stream;
                                std::string reasonparam;
                                
                                /* If a reason is given, use it */
@@ -187,15 +189,15 @@ class RemoveBase
                                        /* Use all the remaining parameters as the reason */
                                        for(int i = 2; i < pcnt; i++)
                                        {
-                                               reason << " " << parameters[i];
+                                               reason_stream << " " << parameters[i];
                                        }
                                        
-                                       reasonparam = reason.str();
-                                       reason.clear();
+                                       reasonparam = reason_stream.str();
+                                       reason_stream.clear();
                                }
 
                                /* Build up the part reason string. */
-                               reason << "Removed by " << user->nick << reasonparam;
+                               reason = "Removed by " + user->nick + ": " + reasonparam;
 
                                channel->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :%s removed %s from the channel", channel->name, user->nick, target->nick);
                                target->WriteServ("NOTICE %s :*** %s removed you from %s with the message: %s", target->nick, user->nick, channel->name, reasonparam.c_str());