irctk

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

commit 895e3f5f6b5c8197bcf5a5768f955f47c826181d
parent 8cff9ecfd85b9e4c205b3001f8f91d4be21a6303
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Thu,  6 Aug 2015 23:31:48 +0200

fix bug: -J no longer obeyed

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

diff --git a/irctk.c b/irctk.c @@ -1958,13 +1958,16 @@ int start (int max_wait) debug("[main] Starting loop\n"); - for (i = 0; i < fifos.n ; i++) { - if( fifos.chans[i][0] == '#') { - debug("[reboot] rejoigning %s\n",fifos.chans[i]); - int pw_pos = get_password(fifos.chans[i]); - rsl = irc_cmd_join(s, fifos.chans[i], pw_pos >= 0 ? fifos.chans[i] + pw_pos + 1 : NULL); - revert_password(fifos.chans[i], pw_pos); - } + irc_ctx_t * ctx = (irc_ctx_t *) irc_get_ctx (s); + for (i = 0; i < (args.join ? fifos.n : ctx->n_channels); i++) { + char *chan = args.join ? fifos.chans[i] : ctx->channels[i]; + if (chan[0] != '#') + continue; // not a regular channel + debug("[reboot] rejoining %s\n",chan); + int pw_pos = get_password(chan); + irc_cmd_join (s, chan, chan + pw_pos + 1); + rsl = irc_cmd_join(s, chan, pw_pos >= 0 ? chan + pw_pos + 1 : NULL); + revert_password(chan, pw_pos); } while (cont) {