shithub: gridirc

Download patch

ref: 1636bc55b3a2c7c3c8ac33a35df4161e113b916f
parent: 7a65588484b6e122431b8c894def0abcf2b979f3
author: sirjofri <sirjofri@sirjofri.de>
date: Sat Dec 4 09:29:58 EST 2021

fixes single-word messages, removes unused code

--- a/gridirc.rc
+++ b/gridirc.rc
@@ -60,27 +60,16 @@
 	fflush
 }
 
-doprint && NF >= 2 {
-	if (length($2) == 1){
+doprint {
+	if (NF >= 2 && length($2) == 1){
 		sender=$1
 		$1=""
 		$2=""
 		sub(/^ +/, "")
 		sendMsg(sender, sprintf("#%s", chan), $0)
+	} else {
+		sendMsg(host, sprintf("#%s", chan), $0)
 	}
-	next
-	
-#	msg=""
-#	split($0, msg_a)
-#	for(i = 3; i <= length(msg_a); i++) {
-#		msg = sprintf("%s %s", msg, msg_a[i])
-#	}
-#	sendMsg($1, sprintf("#%s", chan), msg)
-#	next
-}
-
-doprint {
-	sendMsg(host, chan, $0)
 	next
 }
 ' /n/chat/$chan &