From 37a5904a81468b21f1175075caff432e4e71a803 Mon Sep 17 00:00:00 2001 From: Tobias Girstmair Date: Sat, 27 Apr 2024 14:18:17 +0200 Subject: [PATCH] switch to RFC2812 style USER command we don't (yet?) allow setting user mode, though. --- ircpipe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ircpipe.c b/ircpipe.c index 61a0ea3..370db4e 100644 --- a/ircpipe.c +++ b/ircpipe.c @@ -152,7 +152,7 @@ int irc_base64(char *buf, int n) { int irc_setup(const sock_t sock, const int outfd, const char *nick, const char *pass, int pass_type, const char *chan) { char buf[BUFSIZ]; - int n; + int n, mode = 0; /* mode: 1<<3=invisible | 1<<2=wallops */ struct pollfd fds[1]; fds[0].fd = sock.fd; fds[0].events = POLLIN; @@ -167,7 +167,7 @@ int irc_setup(const sock_t sock, const int outfd, const char *nick, const char * n = snprintf(buf, BUFSIZ, "NICK %s\r\n", nick); WRITE(sock, buf, n); - n = snprintf(buf, BUFSIZ, "USER %s 0.0.0.0 %s :%s\r\n", nick, nick, nick); + n = snprintf(buf, BUFSIZ, "USER %s %d * :%s\r\n", nick, mode, nick); WRITE(sock, buf, n); if (pass_type == SASL_PLAIN_PASSWD) { -- 2.39.3