Don't always add a colon to custom commands
authorManuel Nickschas <sputnick@quassel-irc.org>
Fri, 14 Mar 2014 17:40:40 +0000 (18:40 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Fri, 14 Mar 2014 20:56:15 +0000 (21:56 +0100)
commit39322ca33d77a7378bbac92ec20698e3e9b6a18e
tree23311ec56195a1c9720244f66af9b12749503932
parent670743897bc3b96b17a7fdad3f672637b46ea302
Don't always add a colon to custom commands

The IRC spec mandates that spaces be used as separators between the
arguments for a command. However, the last parameter may itself contain
spaces, and to allow this, one can prefix that argument with a colon.

Instead of checking if the colon is needed, Quassel just always added
a colon to the last argument, which usually works fine. However, it broke
some uses of custom server commands.

This fix now checks if the last argument contains a space or starts with
a colon (which then needs to be escaped), and leaves it alone otherwise.

Fixes #1173 - thanks to Gunnar Beutner for providing the patch.
src/core/corenetwork.cpp