irctk

libircclient binding for scripts
git clone https://a3nm.net/git/irctk/
Log | Files | Refs | README

commit 6189d76c30e0114e5ee19ae26add92658a55a46a
parent 837d2fb62748650db87abb4d5febb7e2a2f5a805
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Sat, 21 Jul 2012 02:02:47 +0200

simpler handling of /quit

Diffstat:
irctk.c | 16++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/irctk.c b/irctk.c @@ -1096,17 +1096,13 @@ int do_cmd_msg(irc_session_t *s, char *chan, char* line) debug("topic %s", arg); rsl = irc_cmd_topic(s, chan, arg); } else if ((arg = MATCH_CMD0(line, "quit"))) { - if (IS_END(*arg)) { - rsl = irc_cmd_quit(s, NULL); - if (!rsl) - rsl = -1; - } else if (*arg == ' ') { - rsl = irc_cmd_quit(s, arg); - if (!rsl) - rsl = -1; - } else { - info("Unrecognized command: %s", line); + char *rquit = NULL; + if (*arg == ' ') { + rquit = arg; } + rsl = irc_cmd_quit(s, rquit); + if (!rsl) + rsl = -1; } else if ((arg = MATCH_CMD(line, "invite"))) { char *inick = consume_word(&arg); if (!IS_END(*arg)) {