summaryrefslogtreecommitdiffstats
path: root/scripts/q_username.pl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 20:19:02 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 20:19:02 +0000
commit03929dac2a29664878d2c971648a4fe1fb698462 (patch)
tree02c5e2b3e006234aa29545f7a93a1ce01b291a8b /scripts/q_username.pl
parentInitial commit. (diff)
downloadirssi-scripts-03929dac2a29664878d2c971648a4fe1fb698462.tar.xz
irssi-scripts-03929dac2a29664878d2c971648a4fe1fb698462.zip
Adding upstream version 20231031.upstream/20231031upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'scripts/q_username.pl')
-rw-r--r--scripts/q_username.pl26
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/q_username.pl b/scripts/q_username.pl
new file mode 100644
index 0000000..6652ddf
--- /dev/null
+++ b/scripts/q_username.pl
@@ -0,0 +1,26 @@
+# Prints the Q username in right format
+
+use strict;
+use Irssi;
+use vars qw($VERSION %IRSSI);
+$VERSION = "0.1";
+%IRSSI = (
+ authors=> "Teemu \'jamov\' Koskinen",
+ contact=> "teemu.koskinen\@mbnet.fi",
+ name=> "q_username",
+ description=> "Prints the Q username in right format",
+ license=> "Public Domain",
+);
+
+Irssi::theme_register([whois_auth => ' authnick : $1']);
+
+sub event_whois_auth {
+ my ($server, $data) = @_;
+ my ($num, $nick, $auth_nick) = split(/ +/, $_[1], 3);
+ $auth_nick =~ s/\:is authed as //;
+
+ $server->printformat($nick, MSGLEVEL_CRAP, 'whois_auth', $nick, $auth_nick);
+ Irssi::signal_stop();
+}
+
+Irssi::signal_add('event 330', 'event_whois_auth');