git: 9front

Download patch

ref: 1293fdbcf959daf51533afa672115f0403185584
parent: c2b8859ca615fa3bb16bc7689df698a935528133
author: noodle <noodle@pastanoggin.com>
date: Thu Dec 11 15:18:22 EST 2025

ircrc: revert 78e2f69c0d7e4c17227e1ec0545cbb2a0ae1e96e and introduce a -u flag for username

ZNC completely ignores NICK when choosing the network to connect to,
so we don't need to allow / in nicknames (besides that rfc 1459 and
2812 disallow it).  This diff instead changes -u to take a username
and makes -U the flag for disabling encryption.  The user can then
specify their bouncer account password in PASS, and pass their bouncer
account username/network in USER.  This is compatible with ZNC, soju,
and pounce and works with factotum too as the same keyspec can be used
for all the networks that the user configured on their bouncer as long
as they pass the same nickname to ircrc for each network connection.

--- a/rc/bin/ircrc
+++ b/rc/bin/ircrc
@@ -8,6 +8,7 @@
 target=''
 netdir=()
 nick=$user
+username=$user
 pass=()
 tls=1
 serverpass=()
@@ -33,7 +34,7 @@
 fn work {
 	if(~ $#serverpass 1)
 		echo PASS $serverpass
-	echo USER $user foo bar :$realname
+	echo USER $username foo bar :$realname
 	echo NICK $nick
 	if (~ $#pass 1)
 		echo PRIVMSG NickServ :IDENTIFY $pass
@@ -147,7 +148,7 @@
 
 fn numeric {
 	sed 's/^:[a-zA-Z0-9_@\-|.!=#]+ //
-		s, '^$nick^' ,,
+		s/ '^$nick^' //
 		s/^353= /***	Users on /
 		s/^[0-9][0-9][0-9] ?:?/***	/'
 }
@@ -210,12 +211,15 @@
 	case -t
 		target=$2
 		shift
-	case -T
 	case -u
+		username=$2
+		shift
+	case -T
+	case -U
 		tls=0
 	case -*
-		echo 'usage: ircrc  [-p port] [-r realname] [-t target] [-n nick] [-u] [server]' >[1=2]
-		exit 'usage'	
+		echo 'usage: ircrc  [-p port] [-r realname] [-t target] [-n nick] [-u username] [-U] [server]' >[1=2]
+		exit 'usage'
 	}
 	shift
 }
--- a/sys/man/1/ircrc
+++ b/sys/man/1/ircrc
@@ -21,7 +21,12 @@
 ]
 [
 .B -u
-] [
+.I user
+]
+[
+.B -U
+]
+[
 .I server
 ]
 .SH DESCRIPTION
@@ -79,7 +84,11 @@
 Change the default nickname
 .RB ( $user ).
 .TP
-.BI -u
+.BI -u " user
+Change the default username
+.RB ( $user ).
+.TP
+.BI -U
 .br
 Disable TLS.
 .SS Commands
--