Updated Encode to not run additional times. 84/head
authortecknojock <tecknojock@gmail.com>
Wed, 17 Sep 2014 05:28:42 +0000 (00:28 -0500)
committertecknojock <tecknojock@gmail.com>
Wed, 17 Sep 2014 05:28:42 +0000 (00:28 -0500)
Fixed the issue of the message being encoded twice unnessesarily on
actions that did not require splitting.

src/core/ctcpparser.cpp

index 2afe993..db285a6 100644 (file)
@@ -329,9 +329,10 @@ void CtcpParser::query(CoreNetwork *net, const QString &bufname, const QString &
         }
         if (splitPos <= 0 || splitPos > maxSplitPos)
             splitPos = maxSplitPos;
+       newparams << net->serverEncode(bufname) << lowLevelQuote(pack(net->serverEncode(ctcpTag), net->userEncode(bufname, message.left(splitPos))));
+        params = newparams;
     }
-    newparams << net->serverEncode(bufname) << lowLevelQuote(pack(net->serverEncode(ctcpTag), net->userEncode(bufname, message.left(splitPos))));
-    net->putCmd("PRIVMSG", newparams);
+    net->putCmd("PRIVMSG", params);
 
     if (splitPos < message.count())
         query(net, bufname, ctcpTag, message.mid(splitPos));