From 5369d9a4c85c7bf1136b2fdd61ca984412fa8d38 Mon Sep 17 00:00:00 2001 From: xfnw Date: Thu, 20 Jan 2022 10:40:22 -0500 Subject: [PATCH] send actions to default channel if none specified --- kirc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kirc.c b/kirc.c index 10b17d5..d69860a 100644 --- a/kirc.c +++ b/kirc.c @@ -893,8 +893,13 @@ static void handleUserInput(struct State *l) { case '@' : /* send private message to target channel or user */ strtok_r(l->buf, " ", &tok); if (l->buf[1] == '@') { - raw("privmsg %s :\001ACTION %s\001\r\n", l->buf + 2, tok); - printf("\x1b[35mprivmsg %s :ACTION %s\x1b[0m\r\n", l->buf + 2, tok); + if (l->buf[2] == '\0') { + raw("privmsg #%s :\001ACTION %s\001\r\n", cdef, tok); + printf("\x1b[35mprivmsg #%s :ACTION %s\x1b[0m\r\n", cdef, tok); + } else { + raw("privmsg %s :\001ACTION %s\001\r\n", l->buf + 2, tok); + printf("\x1b[35mprivmsg %s :ACTION %s\x1b[0m\r\n", l->buf + 2, tok); + } } else { raw("privmsg %s :%s\r\n", l->buf + 1, tok); printf("\x1b[35mprivmsg %s :%s\x1b[0m\r\n", l->buf + 1, tok);