mirror of
https://github.com/moparisthebest/hexchat
synced 2024-11-25 18:52:22 -05:00
update xchat to r1492
This commit is contained in:
parent
d3330fbe6f
commit
58c03db835
@ -212,19 +212,26 @@ sub hook_print {
|
|||||||
my $cb = $callback;
|
my $cb = $callback;
|
||||||
$callback = sub {
|
$callback = sub {
|
||||||
my @args = @{$_[0]};
|
my @args = @{$_[0]};
|
||||||
|
my $event_data = $_[1];
|
||||||
|
my $event_name = $event;
|
||||||
my $last_arg = @args - 1;
|
my $last_arg = @args - 1;
|
||||||
|
|
||||||
my @new = $cb->( \@args, $_[1], $event );
|
my @new = $cb->( \@args, $event_data, $event_name );
|
||||||
|
|
||||||
|
# allow changing event by returning the new value
|
||||||
|
if( @new > @args ) {
|
||||||
|
$event_name = pop @new;
|
||||||
|
}
|
||||||
|
|
||||||
# a filter can either return the new results or it can modify
|
# a filter can either return the new results or it can modify
|
||||||
# @_ in place.
|
# @_ in place.
|
||||||
if( @new ) {
|
if( @new == @args ) {
|
||||||
emit_print( $event, @new[ 0 .. $last_arg ] );
|
emit_print( $event_name, @new[ 0 .. $last_arg ] );
|
||||||
return EAT_ALL;
|
return EAT_ALL;
|
||||||
} elsif(
|
} elsif(
|
||||||
join( "\0", @{$_[0]} ) ne join( "\0", @args[ 0 .. $last_arg ] )
|
join( "\0", @{$_[0]} ) ne join( "\0", @args[ 0 .. $last_arg ] )
|
||||||
) {
|
) {
|
||||||
emit_print( $event, @args[ 0 .. $last_arg ] );
|
emit_print( $event_name, @args[ 0 .. $last_arg ] );
|
||||||
return EAT_ALL;
|
return EAT_ALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ sub get {
|
|||||||
(!defined $last_modified || $last_modified != -M $server_file ) ) {
|
(!defined $last_modified || $last_modified != -M $server_file ) ) {
|
||||||
$last_modified = -M _;
|
$last_modified = -M _;
|
||||||
|
|
||||||
|
@servers = ();
|
||||||
if( open my $fh, "<", $server_file ) {
|
if( open my $fh, "<", $server_file ) {
|
||||||
local $/ = "\n\n";
|
local $/ = "\n\n";
|
||||||
while( my $record = <$fh> ) {
|
while( my $record = <$fh> ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user