-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwhoisToServer.pl
More file actions
55 lines (48 loc) · 1.17 KB
/
whoisToServer.pl
File metadata and controls
55 lines (48 loc) · 1.17 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# nightfrog
# Move whois to the server tab
use strict;
use warnings;
use Xchat qw( :all );
# No particular order
for my $event ( 'WhoIs Authenticated',
'WhoIs Away Line',
'WhoIs Channel/Oper Line',
'WhoIs End',
'WhoIs Identified',
'WhoIs Idle Line',
'WhoIs Idle Line with Signon',
'WhoIs Name Line',
'WhoIs Real Host',
'WhoIs Server Line',
'WhoIs Special' )
{
hook_print( $event, \&whoisToServer, { 'data' => $event } );
}
sub whoisToServer
{
my ( $data, $event ) = @_;
my $id = get_info 'id';
my $context = get_info 'context';
# Got to the server tab
switchToServer( $id );
emit_print( $event, @$data );
set_context $context;
return EAT_XCHAT;
}
sub switchToServer
{
my $connectionID = shift;
for my $tab ( get_list 'channels' )
{
if( $tab->{ id } == $connectionID && $tab->{ type } == 1 )
{
return set_context $tab->{ context };
}
}
return;
}
register(
'Whois to Server',
0x41569F,
'Move whois events to the server tab'
);