From 5d2b5cd51e64c3e49a536ef431c97dc1d0b78dfd Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Tue, 7 Aug 2018 14:58:32 -0400 Subject: Populate tab-complete list --- handle.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'handle.c') diff --git a/handle.c b/handle.c index 8073758..015960d 100644 --- a/handle.c +++ b/handle.c @@ -81,6 +81,7 @@ static void handleJoin(char *prefix, char *params) { free(chat.user); chat.user = strdup(user); } + tabTouch(nick); uiFmt( "\3%d%s\3 arrives in \3%d%s\3", color(user), nick, color(chan), chan @@ -91,6 +92,7 @@ static void handlePart(char *prefix, char *params) { char *nick = prift(&prefix); char *user = prift(&prefix); char *chan = shift(¶ms); + tabRemove(nick); if (params) { char *mesg = shift(¶ms); uiFmt( @@ -108,6 +110,7 @@ static void handlePart(char *prefix, char *params) { static void handleQuit(char *prefix, char *params) { char *nick = prift(&prefix); char *user = prift(&prefix); + tabRemove(nick); if (params) { char *mesg = shift(¶ms); char *quot = (mesg[0] == '"') ? "" : "\""; @@ -126,6 +129,7 @@ static void handleKick(char *prefix, char *params) { char *chan = shift(¶ms); char *kick = shift(¶ms); char *mesg = shift(¶ms); + tabRemove(nick); uiFmt( "\3%d%s\3 kicks \3%d%s\3 out of \3%d%s\3, \"%s\"", color(user), nick, color(kick), kick, color(chan), chan, mesg @@ -176,6 +180,7 @@ static void handle352(char *prefix, char *params) { shift(¶ms); shift(¶ms); char *nick = shift(¶ms); + tabTouch(nick); size_t cap = sizeof(who.buf) - who.len; int len = snprintf( &who.buf[who.len], cap, @@ -204,6 +209,7 @@ static void handleNick(char *prefix, char *params) { free(chat.nick); chat.nick = strdup(next); } + tabReplace(prev, next); uiFmt( "\3%d%s\3 is now known as \3%d%s\3", color(user), prev, color(user), next @@ -215,6 +221,7 @@ static void handlePrivmsg(char *prefix, char *params) { char *user = prift(&prefix); shift(¶ms); char *mesg = shift(¶ms); + tabTouch(nick); if (mesg[0] == '\1') { strsep(&mesg, " "); char *action = strsep(&mesg, "\1"); @@ -230,6 +237,7 @@ static void handleNotice(char *prefix, char *params) { char *chan = shift(¶ms); char *mesg = shift(¶ms); if (strcmp(chat.chan, chan)) return; + tabTouch(nick); uiFmt("-\3%d%s\3- %s", color(user), nick, mesg); } -- cgit 1.4.1-2-gfad0