File: q_username.pl

package info (click to toggle)
irssi-scripts 20201016
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 4,068 kB
  • sloc: perl: 71,842; sh: 193; makefile: 6
file content (26 lines) | stat: -rw-r--r-- 689 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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');