irctk

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

commit e180c07caf16b063524b9a8d5c42572e84810537
parent 64925934febf7d6d2049e79e89ba5e58b3310a6e
Author: Antoine Amarilli <ant.amarilli@free.fr>
Date:   Sun, 16 Jan 2011 18:55:27 +0100

corrected last_in bug

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

diff --git a/irctk.c b/irctk.c @@ -602,12 +602,6 @@ void event_channel (irc_session_t * session, const char * event, const char * or //while(origin[i++] != '!') putchar(origin[i-1]); printf("%s", origin); printf("> %s\n", params[1] ); - if ( !origin ) - return; - if (strcmp(params[0], args.nick)) // if addressed in our private chan, reply on the sender's priv chan - strcpy(args.last_chan_in, params[0]); - else strcpy(args.last_chan_in, origin?origin:"someone"); - strcpy(args.last_nick_in, origin?origin:"someone"); } else { pruned = params[1]; ok2 = 1; @@ -627,6 +621,10 @@ void event_channel (irc_session_t * session, const char * event, const char * or printf("%s\n", pruned); } + if (strcmp(params[0], args.nick)) // if addressed in our private chan, reply on the sender's priv chan + strcpy(args.last_chan_in, params[0]); + else strcpy(args.last_chan_in, origin?origin:"someone"); + strcpy(args.last_nick_in, origin?origin:"someone"); fflush(stdout); }