irctk

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

commit ff32e1a6b810a740c77a22801a2644101490ce0c
parent 462b59b6d988cdd37b1808684da6f834867267f7
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Fri,  7 Sep 2012 13:09:24 +0200

Fix /join without password

Handle correctly the absence of password to make sure that the trailing '\n'
does not lead to garbled commands being sent to the server.

Diffstat:
irctk.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/irctk.c b/irctk.c @@ -1046,7 +1046,7 @@ int do_cmd_msg(irc_session_t *s, char *chan, char* line) if (args.join) { // now, get the right index int pw_pos2 = get_password(to_join); - rsl = irc_cmd_join(s, to_join, to_join + pw_pos2 + 1); + rsl = irc_cmd_join(s, to_join, pw_pos2 >= 0 ? to_join + pw_pos2 + 1 : NULL); // and revert revert_password(to_join, pw_pos); } else { @@ -1256,6 +1256,7 @@ void manage_event (irc_session_t *session, const char *event, const char *origin } if (!strcmp(event, "ERROR")) { + //if (((irc_ctx_t *) irc_get_ctx(session))->ready) { if (count == 1) { die(E_SERVER_ERROR, "Error from server: %s\n", params[0]); } else {