improved ctcp handler method, fixes #1011
authorJohannes Huber <johu@gmx.de>
Wed, 11 Aug 2010 01:19:38 +0000 (03:19 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 11 Aug 2010 14:43:31 +0000 (16:43 +0200)
do not add space in ctcp handler method pack if message is empty

src/core/ctcphandler.cpp

index 158c39d..655f170 100644 (file)
@@ -162,6 +162,9 @@ void CtcpHandler::parse(Message::Type messageType, const QString &prefix, const
 }
 
 QByteArray CtcpHandler::pack(const QByteArray &ctcpTag, const QByteArray &message) {
+  if(message.isEmpty())
+    return XDELIM + ctcpTag + XDELIM;
+
   return XDELIM + ctcpTag + ' ' + xdelimQuote(message) + XDELIM;
 }