shithub: irc.myr

Download patch

ref: ed89b32da6ef6fcae739e05d7540082dc918db9d
parent: 73c2ff3cb1e81e8be61f378de1eecf461f4570dc
author: Ori Bernstein <ori@eigenstate.org>
date: Tue Jan 2 18:56:01 EST 2018

Ignore sigils in nick completion.

--- a/main.myr
+++ b/main.myr
@@ -946,7 +946,7 @@
 	pfx = getstr(irc.cmd[off:irc.off])
 	matches = [][:]
 	for var i = 0; i < chan.users.len; i++
-		if std.hasprefix(chan.users[i], pfx)
+		if matchcompletion(chan.users[i], pfx)
 			std.slpush(&matches, chan.users[i])
 		;;
 	;;
@@ -960,6 +960,14 @@
 		status(irc, chan, "completions: {j= }", matches)
 	;;
 	std.slfree(pfx)
+}
+
+const matchcompletion = {user, pfx
+	match (user[0] : char)
+	| '@':	-> std.hasprefix(user[1:], pfx)
+	| '+':	-> std.hasprefix(user[1:], pfx)
+	| _:	-> std.hasprefix(user, pfx)
+	;;
 }
 
 const scroll = {irc, chan, delta
--