circo

claudio's IRC oasis
git clone git://git.bitsmanent.org/circo
Log | Files | Refs | README | LICENSE

commit e03b5a34fe761e341714bb3bb4ae293562c4bf57
parent c948e93649745ca7e8d1ee02cc3ac084a0adb962
Author: Claudio Alessi <smoppy@gmail.com>
Date:   Sat, 21 Apr 2018 15:45:52 +0200

Handle KICK messages.

Diffstat:
Mcirco.c | 18+++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/circo.c b/circo.c @@ -138,6 +138,7 @@ void privmsg(char *to, char *txt); void quit(char *msg); void recv_busynick(char *u, char *u2, char *u3); void recv_join(char *who, char *chan, char *txt); +void recv_kick(char *who, char *chan, char *txt); void recv_mode(char *u, char *val, char *u2); void recv_motd(char *u, char *u2, char *txt); void recv_nick(char *who, char *u, char *txt); @@ -171,6 +172,7 @@ int rows, cols; Message messages[] = { { "JOIN", recv_join }, + { "KICK", recv_kick }, { "MODE", recv_mode }, { "NICK", recv_nick }, { "NOTICE", recv_notice }, @@ -277,7 +279,7 @@ cmd_close(char *cmd, char *s) { return; } if(srv && ISCHAN(b)) - sout("PART :%s", b->name); + sout("PART :%s", b->name); /* Note: you may be not in that channel */ if(b == sel) { sel = sel->next ? sel->next : buffers; sel->need_redraw |= REDRAW_ALL; @@ -877,6 +879,20 @@ recv_join(char *who, char *chan, char *txt) { } void +recv_kick(char *who, char *chan, char *txt) { + Buffer *b; + + txt = skip(chan, ' '); + b = getbuf(chan); + if(!b) + return; + if(strcmp(txt, nick)) + bprintf(b, "KICK %s %s\n", who, txt); + else + bprintf(b, "Kicked.\n"); +} + +void recv_mode(char *u, char *val, char *u2) { if(*nick) return;