![]() |
![]() |
5 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
sub on_dcc {
my ($self, $event) = @_;
my $type = ($event->args)[1];
if (uc($type) eq 'SEND') {
open TEST, ">/tmp/net-irc.dcctest"
or do { warn "Can't open test file: $!"; return; };
$self->new_get($event, \*TEST);
print "Saving incoming DCC SEND to /tmp/net-irc.dcctest\n";
} elsif(uc($type) eq 'CHAT') {
$self->new_chat($event);
} else {
print STDERR ("Unknown DCC type: " . $type);
}
}
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
sub on_dcc {
my ($self, $event) = @_;
my $type = ($event->args)[0];
if($type =~ /(SEND)\s(.*)\s(\d+)\s(\d+)\s(\d+)/) {
$kind = $1;
$name = $2;
$size = $5;
}
elsif($type =~ /(CHAT)\schat\s(\d+)\s(\d+)/) {
$kind = $1;
}
if ($kind eq 'SEND') {
$o_file = ">" . $name;
open(TEST, $o_file)
or do { warn "[!!] can not create incoming/" . $o_file . "\n";
next;
};
$self->new_get($event, \*TEST);
print "[OK] saving incoming DCC SEND to incoming/" . $name . "\n";
}
elsif($kind eq 'CHAT') {
$self->new_chat($event);
}
else {
print STDERR ("[!!] unknown DCC type: " . $kind . "\n");
}
}
![]() |
![]() |
5 Einträge, 1 Seite |