diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2012-08-23 08:03:04 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2012-08-23 08:03:04 +0200 |
commit | 2c0b860d62dc49325d64cfb7cb9dc62ccd2a9699 (patch) | |
tree | 9c5dd2f565ba1ca0123755f14c320506cec7479f | |
parent | 7f3d7e5f29eadd0e805131b768efe5faa656d903 (diff) | |
download | weechat-2c0b860d62dc49325d64cfb7cb9dc62ccd2a9699.zip |
irc: keep trailing spaces in IRC messages only for some commands (if message ends with text from user)
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 278 | ||||
-rw-r--r-- | src/plugins/irc/irc-protocol.h | 1 |
2 files changed, 142 insertions, 137 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 709ef9caf..63eb36f54 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -4372,7 +4372,8 @@ irc_protocol_recv_command (struct t_irc_server *server, const char *msg_command, const char *msg_channel) { - int i, cmd_found, return_code, argc, decode_color, message_ignored; + int i, cmd_found, return_code, argc, decode_color, keep_trailing_spaces; + int message_ignored; char *dup_irc_message, *pos_space; struct t_irc_channel *ptr_channel; t_irc_recv_func *cmd_recv_func; @@ -4381,143 +4382,143 @@ irc_protocol_recv_command (struct t_irc_server *server, char *nick, *address, *address_color, *host, *host_no_color, *host_color; char **argv, **argv_eol; struct t_irc_protocol_msg irc_protocol_messages[] = - { { "authenticate", /* authenticate */ 1, &irc_protocol_cb_authenticate }, - { "cap", /* client capability */ 1, &irc_protocol_cb_cap }, - { "error", /* error received from IRC server */ 1, &irc_protocol_cb_error }, - { "invite", /* invite a nick on a channel */ 1, &irc_protocol_cb_invite }, - { "join", /* join a channel */ 1, &irc_protocol_cb_join }, - { "kick", /* forcibly remove a user from a channel */ 1, &irc_protocol_cb_kick }, - { "kill", /* close client-server connection */ 1, &irc_protocol_cb_kill }, - { "mode", /* change channel or user mode */ 1, &irc_protocol_cb_mode }, - { "nick", /* change current nickname */ 1, &irc_protocol_cb_nick }, - { "notice", /* send notice message to user */ 1, &irc_protocol_cb_notice }, - { "part", /* leave a channel */ 1, &irc_protocol_cb_part }, - { "ping", /* ping server */ 1, &irc_protocol_cb_ping }, - { "pong", /* answer to a ping message */ 1, &irc_protocol_cb_pong }, - { "privmsg", /* message received */ 1, &irc_protocol_cb_privmsg }, - { "quit", /* close all connections and quit */ 1, &irc_protocol_cb_quit }, - { "topic", /* get/set channel topic */ 0, &irc_protocol_cb_topic }, + { { "authenticate", /* authenticate */ 1, 0, &irc_protocol_cb_authenticate }, + { "cap", /* client capability */ 1, 0, &irc_protocol_cb_cap }, + { "error", /* error received from IRC server */ 1, 0, &irc_protocol_cb_error }, + { "invite", /* invite a nick on a channel */ 1, 0, &irc_protocol_cb_invite }, + { "join", /* join a channel */ 1, 0, &irc_protocol_cb_join }, + { "kick", /* forcibly remove a user from a channel */ 1, 1, &irc_protocol_cb_kick }, + { "kill", /* close client-server connection */ 1, 1, &irc_protocol_cb_kill }, + { "mode", /* change channel or user mode */ 1, 0, &irc_protocol_cb_mode }, + { "nick", /* change current nickname */ 1, 0, &irc_protocol_cb_nick }, + { "notice", /* send notice message to user */ 1, 1, &irc_protocol_cb_notice }, + { "part", /* leave a channel */ 1, 1, &irc_protocol_cb_part }, + { "ping", /* ping server */ 1, 0, &irc_protocol_cb_ping }, + { "pong", /* answer to a ping message */ 1, 0, &irc_protocol_cb_pong }, + { "privmsg", /* message received */ 1, 1, &irc_protocol_cb_privmsg }, + { "quit", /* close all connections and quit */ 1, 1, &irc_protocol_cb_quit }, + { "topic", /* get/set channel topic */ 0, 1, &irc_protocol_cb_topic }, { "wallops", /* send a message to all currently connected users who have " "set the 'w' user mode " - "for themselves */ 1, &irc_protocol_cb_wallops }, - { "001", /* a server message */ 1, &irc_protocol_cb_001 }, - { "005", /* a server message */ 1, &irc_protocol_cb_005 }, - { "221", /* user mode string */ 1, &irc_protocol_cb_221 }, - { "223", /* whois (charset is) */ 1, &irc_protocol_cb_whois_nick_msg }, - { "264", /* whois (is using encrypted connection) */ 1, &irc_protocol_cb_whois_nick_msg }, - { "275", /* whois (secure connection) */ 1, &irc_protocol_cb_whois_nick_msg }, - { "276", /* whois (has client certificate fingerprint) */ 1, &irc_protocol_cb_whois_nick_msg }, - { "301", /* away message */ 1, &irc_protocol_cb_301 }, - { "303", /* ison */ 1, &irc_protocol_cb_303 }, - { "305", /* unaway */ 1, &irc_protocol_cb_305 }, - { "306", /* now away */ 1, &irc_protocol_cb_306 }, - { "307", /* whois (registered nick) */ 1, &irc_protocol_cb_whois_nick_msg }, - { "310", /* whois (help mode) */ 1, &irc_protocol_cb_whois_nick_msg }, - { "311", /* whois (user) */ 1, &irc_protocol_cb_311 }, - { "312", /* whois (server) */ 1, &irc_protocol_cb_312 }, - { "313", /* whois (operator) */ 1, &irc_protocol_cb_whois_nick_msg }, - { "314", /* whowas */ 1, &irc_protocol_cb_314 }, - { "315", /* end of /who list */ 1, &irc_protocol_cb_315 }, - { "317", /* whois (idle) */ 1, &irc_protocol_cb_317 }, - { "318", /* whois (end) */ 1, &irc_protocol_cb_whois_nick_msg }, - { "319", /* whois (channels) */ 1, &irc_protocol_cb_whois_nick_msg }, - { "320", /* whois (identified user) */ 1, &irc_protocol_cb_whois_nick_msg }, - { "321", /* /list start */ 1, &irc_protocol_cb_321 }, - { "322", /* channel (for /list) */ 1, &irc_protocol_cb_322 }, - { "323", /* end of /list */ 1, &irc_protocol_cb_323 }, - { "324", /* channel mode */ 1, &irc_protocol_cb_324 }, - { "326", /* whois (has oper privs) */ 1, &irc_protocol_cb_whois_nick_msg }, - { "327", /* whois (host) */ 1, &irc_protocol_cb_327 }, - { "328", /* channel url */ 1, &irc_protocol_cb_328 }, - { "329", /* channel creation date */ 1, &irc_protocol_cb_329 }, - { "330", /* is logged in as */ 1, &irc_protocol_cb_330_343 }, - { "331", /* no topic for channel */ 1, &irc_protocol_cb_331 }, - { "332", /* topic of channel */ 0, &irc_protocol_cb_332 }, - { "333", /* infos about topic (nick and date changed) */ 1, &irc_protocol_cb_333 }, - { "335", /* is a bot on */ 1, &irc_protocol_cb_whois_nick_msg }, - { "338", /* whois (host) */ 1, &irc_protocol_cb_338 }, - { "341", /* inviting */ 1, &irc_protocol_cb_341 }, - { "343", /* is opered as */ 1, &irc_protocol_cb_330_343 }, - { "344", /* channel reop */ 1, &irc_protocol_cb_344 }, - { "345", /* end of channel reop list */ 1, &irc_protocol_cb_345 }, - { "346", /* invite list */ 1, &irc_protocol_cb_346 }, - { "347", /* end of invite list */ 1, &irc_protocol_cb_347 }, - { "348", /* channel exception list */ 1, &irc_protocol_cb_348 }, - { "349", /* end of channel exception list */ 1, &irc_protocol_cb_349 }, - { "351", /* server version */ 1, &irc_protocol_cb_351 }, - { "352", /* who */ 1, &irc_protocol_cb_352 }, - { "353", /* list of nicks on channel */ 1, &irc_protocol_cb_353 }, - { "366", /* end of /names list */ 1, &irc_protocol_cb_366 }, - { "367", /* banlist */ 1, &irc_protocol_cb_367 }, - { "368", /* end of banlist */ 1, &irc_protocol_cb_368 }, - { "369", /* whowas (end) */ 1, &irc_protocol_cb_whowas_nick_msg }, - { "378", /* whois (connecting from) */ 1, &irc_protocol_cb_whois_nick_msg }, - { "379", /* whois (using modes) */ 1, &irc_protocol_cb_whois_nick_msg }, - { "401", /* no such nick/channel */ 1, &irc_protocol_cb_generic_error }, - { "402", /* no such server */ 1, &irc_protocol_cb_generic_error }, - { "403", /* no such channel */ 1, &irc_protocol_cb_generic_error }, - { "404", /* cannot send to channel */ 1, &irc_protocol_cb_generic_error }, - { "405", /* too many channels */ 1, &irc_protocol_cb_generic_error }, - { "406", /* was no such nick */ 1, &irc_protocol_cb_generic_error }, - { "407", /* was no such nick */ 1, &irc_protocol_cb_generic_error }, - { "409", /* no origin */ 1, &irc_protocol_cb_generic_error }, - { "410", /* no services */ 1, &irc_protocol_cb_generic_error }, - { "411", /* no recipient */ 1, &irc_protocol_cb_generic_error }, - { "412", /* no text to send */ 1, &irc_protocol_cb_generic_error }, - { "413", /* no toplevel */ 1, &irc_protocol_cb_generic_error }, - { "414", /* wilcard in toplevel domain */ 1, &irc_protocol_cb_generic_error }, - { "421", /* unknown command */ 1, &irc_protocol_cb_generic_error }, - { "422", /* MOTD is missing */ 1, &irc_protocol_cb_generic_error }, - { "423", /* no administrative info */ 1, &irc_protocol_cb_generic_error }, - { "424", /* file error */ 1, &irc_protocol_cb_generic_error }, - { "431", /* no nickname given */ 1, &irc_protocol_cb_generic_error }, - { "432", /* erroneous nickname */ 1, &irc_protocol_cb_432 }, - { "433", /* nickname already in use */ 1, &irc_protocol_cb_433 }, - { "436", /* nickname collision */ 1, &irc_protocol_cb_generic_error }, - { "437", /* nick/channel unavailable */ 1, &irc_protocol_cb_437 }, - { "438", /* not authorized to change nickname */ 1, &irc_protocol_cb_438 }, - { "441", /* user not in channel */ 1, &irc_protocol_cb_generic_error }, - { "442", /* not on channel */ 1, &irc_protocol_cb_generic_error }, - { "443", /* user already on channel */ 1, &irc_protocol_cb_generic_error }, - { "444", /* user not logged in */ 1, &irc_protocol_cb_generic_error }, - { "445", /* summon has been disabled */ 1, &irc_protocol_cb_generic_error }, - { "446", /* users has been disabled */ 1, &irc_protocol_cb_generic_error }, - { "451", /* you are not registered */ 1, &irc_protocol_cb_generic_error }, - { "461", /* not enough parameters */ 1, &irc_protocol_cb_generic_error }, - { "462", /* you may not register */ 1, &irc_protocol_cb_generic_error }, - { "463", /* your host isn't among the privileged */ 1, &irc_protocol_cb_generic_error }, - { "464", /* password incorrect */ 1, &irc_protocol_cb_generic_error }, - { "465", /* you are banned from this server */ 1, &irc_protocol_cb_generic_error }, - { "467", /* channel key already set */ 1, &irc_protocol_cb_generic_error }, - { "470", /* forwarding to another channel */ 1, &irc_protocol_cb_generic_error }, - { "471", /* channel is already full */ 1, &irc_protocol_cb_generic_error }, - { "472", /* unknown mode char to me */ 1, &irc_protocol_cb_generic_error }, - { "473", /* cannot join channel (invite only) */ 1, &irc_protocol_cb_generic_error }, - { "474", /* cannot join channel (banned from channel) */ 1, &irc_protocol_cb_generic_error }, - { "475", /* cannot join channel (bad channel key) */ 1, &irc_protocol_cb_generic_error }, - { "476", /* bad channel mask */ 1, &irc_protocol_cb_generic_error }, - { "477", /* channel doesn't support modes */ 1, &irc_protocol_cb_generic_error }, - { "481", /* you're not an IRC operator */ 1, &irc_protocol_cb_generic_error }, - { "482", /* you're not channel operator */ 1, &irc_protocol_cb_generic_error }, - { "483", /* you can't kill a server! */ 1, &irc_protocol_cb_generic_error }, - { "484", /* your connection is restricted! */ 1, &irc_protocol_cb_generic_error }, - { "485", /* user is immune from kick/deop */ 1, &irc_protocol_cb_generic_error }, - { "487", /* network split */ 1, &irc_protocol_cb_generic_error }, - { "491", /* no O-lines for your host */ 1, &irc_protocol_cb_generic_error }, - { "501", /* unknown mode flag */ 1, &irc_protocol_cb_generic_error }, - { "502", /* can't change mode for other users */ 1, &irc_protocol_cb_generic_error }, - { "671", /* whois (secure connection) */ 1, &irc_protocol_cb_whois_nick_msg }, - { "900", /* logged in as (SASL) */ 1, &irc_protocol_cb_900 }, - { "901", /* you are now logged in */ 1, &irc_protocol_cb_901 }, - { "903", /* SASL authentication successful */ 1, &irc_protocol_cb_sasl_end }, - { "904", /* SASL authentication failed */ 1, &irc_protocol_cb_sasl_end }, - { "905", /* SASL message too long */ 1, &irc_protocol_cb_sasl_end }, - { "906", /* SASL authentication aborted */ 1, &irc_protocol_cb_sasl_end }, - { "907", /* You have already completed SASL authentication */ 1, &irc_protocol_cb_sasl_end }, - { "973", /* whois (secure connection) */ 1, &irc_protocol_cb_server_mode_reason }, - { "974", /* whois (secure connection) */ 1, &irc_protocol_cb_server_mode_reason }, - { "975", /* whois (secure connection) */ 1, &irc_protocol_cb_server_mode_reason }, - { NULL, 0, NULL } + "for themselves */ 1, 1, &irc_protocol_cb_wallops }, + { "001", /* a server message */ 1, 0, &irc_protocol_cb_001 }, + { "005", /* a server message */ 1, 0, &irc_protocol_cb_005 }, + { "221", /* user mode string */ 1, 0, &irc_protocol_cb_221 }, + { "223", /* whois (charset is) */ 1, 0, &irc_protocol_cb_whois_nick_msg }, + { "264", /* whois (is using encrypted connection) */ 1, 0, &irc_protocol_cb_whois_nick_msg }, + { "275", /* whois (secure connection) */ 1, 0, &irc_protocol_cb_whois_nick_msg }, + { "276", /* whois (has client certificate fingerprint) */ 1, 0, &irc_protocol_cb_whois_nick_msg }, + { "301", /* away message */ 1, 1, &irc_protocol_cb_301 }, + { "303", /* ison */ 1, 0, &irc_protocol_cb_303 }, + { "305", /* unaway */ 1, 0, &irc_protocol_cb_305 }, + { "306", /* now away */ 1, 0, &irc_protocol_cb_306 }, + { "307", /* whois (registered nick) */ 1, 0, &irc_protocol_cb_whois_nick_msg }, + { "310", /* whois (help mode) */ 1, 0, &irc_protocol_cb_whois_nick_msg }, + { "311", /* whois (user) */ 1, 0, &irc_protocol_cb_311 }, + { "312", /* whois (server) */ 1, 0, &irc_protocol_cb_312 }, + { "313", /* whois (operator) */ 1, 0, &irc_protocol_cb_whois_nick_msg }, + { "314", /* whowas */ 1, 0, &irc_protocol_cb_314 }, + { "315", /* end of /who list */ 1, 0, &irc_protocol_cb_315 }, + { "317", /* whois (idle) */ 1, 0, &irc_protocol_cb_317 }, + { "318", /* whois (end) */ 1, 0, &irc_protocol_cb_whois_nick_msg }, + { "319", /* whois (channels) */ 1, 0, &irc_protocol_cb_whois_nick_msg }, + { "320", /* whois (identified user) */ 1, 0, &irc_protocol_cb_whois_nick_msg }, + { "321", /* /list start */ 1, 0, &irc_protocol_cb_321 }, + { "322", /* channel (for /list) */ 1, 0, &irc_protocol_cb_322 }, + { "323", /* end of /list */ 1, 0, &irc_protocol_cb_323 }, + { "324", /* channel mode */ 1, 0, &irc_protocol_cb_324 }, + { "326", /* whois (has oper privs) */ 1, 0, &irc_protocol_cb_whois_nick_msg }, + { "327", /* whois (host) */ 1, 0, &irc_protocol_cb_327 }, + { "328", /* channel url */ 1, 0, &irc_protocol_cb_328 }, + { "329", /* channel creation date */ 1, 0, &irc_protocol_cb_329 }, + { "330", /* is logged in as */ 1, 0, &irc_protocol_cb_330_343 }, + { "331", /* no topic for channel */ 1, 0, &irc_protocol_cb_331 }, + { "332", /* topic of channel */ 0, 1, &irc_protocol_cb_332 }, + { "333", /* infos about topic (nick and date changed) */ 1, 0, &irc_protocol_cb_333 }, + { "335", /* is a bot on */ 1, 0, &irc_protocol_cb_whois_nick_msg }, + { "338", /* whois (host) */ 1, 0, &irc_protocol_cb_338 }, + { "341", /* inviting */ 1, 0, &irc_protocol_cb_341 }, + { "343", /* is opered as */ 1, 0, &irc_protocol_cb_330_343 }, + { "344", /* channel reop */ 1, 0, &irc_protocol_cb_344 }, + { "345", /* end of channel reop list */ 1, 0, &irc_protocol_cb_345 }, + { "346", /* invite list */ 1, 0, &irc_protocol_cb_346 }, + { "347", /* end of invite list */ 1, 0, &irc_protocol_cb_347 }, + { "348", /* channel exception list */ 1, 0, &irc_protocol_cb_348 }, + { "349", /* end of channel exception list */ 1, 0, &irc_protocol_cb_349 }, + { "351", /* server version */ 1, 0, &irc_protocol_cb_351 }, + { "352", /* who */ 1, 0, &irc_protocol_cb_352 }, + { "353", /* list of nicks on channel */ 1, 0, &irc_protocol_cb_353 }, + { "366", /* end of /names list */ 1, 0, &irc_protocol_cb_366 }, + { "367", /* banlist */ 1, 0, &irc_protocol_cb_367 }, + { "368", /* end of banlist */ 1, 0, &irc_protocol_cb_368 }, + { "369", /* whowas (end) */ 1, 0, &irc_protocol_cb_whowas_nick_msg }, + { "378", /* whois (connecting from) */ 1, 0, &irc_protocol_cb_whois_nick_msg }, + { "379", /* whois (using modes) */ 1, 0, &irc_protocol_cb_whois_nick_msg }, + { "401", /* no such nick/channel */ 1, 0, &irc_protocol_cb_generic_error }, + { "402", /* no such server */ 1, 0, &irc_protocol_cb_generic_error }, + { "403", /* no such channel */ 1, 0, &irc_protocol_cb_generic_error }, + { "404", /* cannot send to channel */ 1, 0, &irc_protocol_cb_generic_error }, + { "405", /* too many channels */ 1, 0, &irc_protocol_cb_generic_error }, + { "406", /* was no such nick */ 1, 0, &irc_protocol_cb_generic_error }, + { "407", /* was no such nick */ 1, 0, &irc_protocol_cb_generic_error }, + { "409", /* no origin */ 1, 0, &irc_protocol_cb_generic_error }, + { "410", /* no services */ 1, 0, &irc_protocol_cb_generic_error }, + { "411", /* no recipient */ 1, 0, &irc_protocol_cb_generic_error }, + { "412", /* no text to send */ 1, 0, &irc_protocol_cb_generic_error }, + { "413", /* no toplevel */ 1, 0, &irc_protocol_cb_generic_error }, + { "414", /* wilcard in toplevel domain */ 1, 0, &irc_protocol_cb_generic_error }, + { "421", /* unknown command */ 1, 0, &irc_protocol_cb_generic_error }, + { "422", /* MOTD is missing */ 1, 0, &irc_protocol_cb_generic_error }, + { "423", /* no administrative info */ 1, 0, &irc_protocol_cb_generic_error }, + { "424", /* file error */ 1, 0, &irc_protocol_cb_generic_error }, + { "431", /* no nickname given */ 1, 0, &irc_protocol_cb_generic_error }, + { "432", /* erroneous nickname */ 1, 0, &irc_protocol_cb_432 }, + { "433", /* nickname already in use */ 1, 0, &irc_protocol_cb_433 }, + { "436", /* nickname collision */ 1, 0, &irc_protocol_cb_generic_error }, + { "437", /* nick/channel unavailable */ 1, 0, &irc_protocol_cb_437 }, + { "438", /* not authorized to change nickname */ 1, 0, &irc_protocol_cb_438 }, + { "441", /* user not in channel */ 1, 0, &irc_protocol_cb_generic_error }, + { "442", /* not on channel */ 1, 0, &irc_protocol_cb_generic_error }, + { "443", /* user already on channel */ 1, 0, &irc_protocol_cb_generic_error }, + { "444", /* user not logged in */ 1, 0, &irc_protocol_cb_generic_error }, + { "445", /* summon has been disabled */ 1, 0, &irc_protocol_cb_generic_error }, + { "446", /* users has been disabled */ 1, 0, &irc_protocol_cb_generic_error }, + { "451", /* you are not registered */ 1, 0, &irc_protocol_cb_generic_error }, + { "461", /* not enough parameters */ 1, 0, &irc_protocol_cb_generic_error }, + { "462", /* you may not register */ 1, 0, &irc_protocol_cb_generic_error }, + { "463", /* your host isn't among the privileged */ 1, 0, &irc_protocol_cb_generic_error }, + { "464", /* password incorrect */ 1, 0, &irc_protocol_cb_generic_error }, + { "465", /* you are banned from this server */ 1, 0, &irc_protocol_cb_generic_error }, + { "467", /* channel key already set */ 1, 0, &irc_protocol_cb_generic_error }, + { "470", /* forwarding to another channel */ 1, 0, &irc_protocol_cb_generic_error }, + { "471", /* channel is already full */ 1, 0, &irc_protocol_cb_generic_error }, + { "472", /* unknown mode char to me */ 1, 0, &irc_protocol_cb_generic_error }, + { "473", /* cannot join channel (invite only) */ 1, 0, &irc_protocol_cb_generic_error }, + { "474", /* cannot join channel (banned from channel) */ 1, 0, &irc_protocol_cb_generic_error }, + { "475", /* cannot join channel (bad channel key) */ 1, 0, &irc_protocol_cb_generic_error }, + { "476", /* bad channel mask */ 1, 0, &irc_protocol_cb_generic_error }, + { "477", /* channel doesn't support modes */ 1, 0, &irc_protocol_cb_generic_error }, + { "481", /* you're not an IRC operator */ 1, 0, &irc_protocol_cb_generic_error }, + { "482", /* you're not channel operator */ 1, 0, &irc_protocol_cb_generic_error }, + { "483", /* you can't kill a server! */ 1, 0, &irc_protocol_cb_generic_error }, + { "484", /* your connection is restricted! */ 1, 0, &irc_protocol_cb_generic_error }, + { "485", /* user is immune from kick/deop */ 1, 0, &irc_protocol_cb_generic_error }, + { "487", /* network split */ 1, 0, &irc_protocol_cb_generic_error }, + { "491", /* no O-lines for your host */ 1, 0, &irc_protocol_cb_generic_error }, + { "501", /* unknown mode flag */ 1, 0, &irc_protocol_cb_generic_error }, + { "502", /* can't change mode for other users */ 1, 0, &irc_protocol_cb_generic_error }, + { "671", /* whois (secure connection) */ 1, 0, &irc_protocol_cb_whois_nick_msg }, + { "900", /* logged in as (SASL) */ 1, 0, &irc_protocol_cb_900 }, + { "901", /* you are now logged in */ 1, 0, &irc_protocol_cb_901 }, + { "903", /* SASL authentication successful */ 1, 0, &irc_protocol_cb_sasl_end }, + { "904", /* SASL authentication failed */ 1, 0, &irc_protocol_cb_sasl_end }, + { "905", /* SASL message too long */ 1, 0, &irc_protocol_cb_sasl_end }, + { "906", /* SASL authentication aborted */ 1, 0, &irc_protocol_cb_sasl_end }, + { "907", /* You have already completed SASL authentication */ 1, 0, &irc_protocol_cb_sasl_end }, + { "973", /* whois (secure connection) */ 1, 0, &irc_protocol_cb_server_mode_reason }, + { "974", /* whois (secure connection) */ 1, 0, &irc_protocol_cb_server_mode_reason }, + { "975", /* whois (secure connection) */ 1, 0, &irc_protocol_cb_server_mode_reason }, + { NULL, 0, 0, NULL } }; if (!msg_command) @@ -4590,6 +4591,7 @@ irc_protocol_recv_command (struct t_irc_server *server, { cmd_name = msg_command; decode_color = 1; + keep_trailing_spaces = 0; cmd_recv_func = irc_protocol_cb_numeric; } else @@ -4608,6 +4610,7 @@ irc_protocol_recv_command (struct t_irc_server *server, { cmd_name = irc_protocol_messages[cmd_found].name; decode_color = irc_protocol_messages[cmd_found].decode_color; + keep_trailing_spaces = irc_protocol_messages[cmd_found].keep_trailing_spaces; cmd_recv_func = irc_protocol_messages[cmd_found].recv_function; } @@ -4624,7 +4627,8 @@ irc_protocol_recv_command (struct t_irc_server *server, else dup_irc_message = NULL; argv = weechat_string_split (dup_irc_message, " ", 0, 0, &argc); - argv_eol = weechat_string_split (dup_irc_message, " ", 2, 0, NULL); + argv_eol = weechat_string_split (dup_irc_message, " ", + 1 + keep_trailing_spaces, 0, NULL); return_code = (int) (cmd_recv_func) (server, nick, address_color, host_color, diff --git a/src/plugins/irc/irc-protocol.h b/src/plugins/irc/irc-protocol.h index 002c2e86f..f23dc3a4a 100644 --- a/src/plugins/irc/irc-protocol.h +++ b/src/plugins/irc/irc-protocol.h @@ -74,6 +74,7 @@ struct t_irc_protocol_msg { char *name; /* IRC message name */ int decode_color; /* decode color before calling function */ + int keep_trailing_spaces; /* keep trailing spaces in message */ t_irc_recv_func *recv_function; /* function called when msg is received */ }; |