- LogDebug("User \"%s\" invites \"%s\" to \"%s\" ...", Client_Mask(from), Req->argv[0], Req->argv[1]);
-
+ LogDebug("User \"%s\" invites \"%s\" to \"%s\" ...", Client_Mask(from),
+ Req->argv[0], Req->argv[1]);
+
+ /*
+ * RFC 2812 says:
+ * 'There is no requirement that the channel [..] must exist or be a valid channel'
+ * The problem with this is that this allows the "channel" to contain spaces,
+ * in which case we must prefix its name with a colon to make it clear that
+ * it is only a single argument.
+ */
+ colon_if_necessary = strchr(Req->argv[1], ' ') ? ":":"";