From 66bbb64a70a06360059101d7aba3dc3d710e23e7 Mon Sep 17 00:00:00 2001 From: Qais Patankar Date: Sun, 14 Apr 2019 01:25:45 +0100 Subject: [PATCH] Add remotenickformat-zerowidth.tengo to contrib --- contrib/remotenickformat-zerowidth.tengo | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 contrib/remotenickformat-zerowidth.tengo diff --git a/contrib/remotenickformat-zerowidth.tengo b/contrib/remotenickformat-zerowidth.tengo new file mode 100644 index 0000000000..8d1d0656b5 --- /dev/null +++ b/contrib/remotenickformat-zerowidth.tengo @@ -0,0 +1,16 @@ +/* +This script will return the nick except with multi-character usernames +containing a zero-width space between the first and second character letter. + +Single character usernames will be left untouched. + +This is useful to prevent remote users from nickalerting +IRC users of the same name when the remote user speaks. + +This result can be used in {TENGO} in RemoteNickFormat. +*/ + +result = nick +if len(nick) > 1 { + result = string(nick[0]) + "​" + nick[1:] +}