Skip to content

Commit

Permalink
* Added channel sync event handling to replace who on join
Browse files Browse the repository at this point in the history
    * Removed hide_who option (no longer needed)
    * Thanks to Wouter Coekaerts for the suggestion!
  • Loading branch information
symkat committed Oct 9, 2010
1 parent 33468f1 commit 7c55798
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
@@ -1,3 +1,7 @@
2010-10-09
* Added channel sync event handling to replace who on join
* Removed hide_who option (no longer needed)
* Thanks to Wouter Coekaerts for the suggestion!
2010-10-06
* Added patch by Mantas Mikulėnas "Make the default paths relative
to Irssi home directory" to correct issue with paths when starting
Expand Down
21 changes: 10 additions & 11 deletions stalker.pl
Expand Up @@ -8,7 +8,7 @@
# DBI
# DBD::SQLite3

$VERSION = '0.31';
$VERSION = '0.40';
%IRSSI = (
authors => 'SymKat',
contact => 'symkat@symkat.com',
Expand All @@ -26,6 +26,7 @@
Irssi::signal_add( 'nicklist changed', \&nick_changed_channel );
Irssi::signal_add( 'event 352', \&who_list );
Irssi::signal_add( 'channel joined', \&me_join );
Irssi::signal_add( 'channel sync', \&channel_sync );

Irssi::command_bind( 'host_lookup', \&host_request );
Irssi::command_bind( 'nick_lookup', \&nick_request );
Expand All @@ -43,8 +44,6 @@
Irssi::settings_add_bool( 'Stalker', $IRSSI{name} . "_recursive_search", 1 );
Irssi::settings_add_bool( 'Stalker', $IRSSI{name} . "_search_this_network_only", 0 );
Irssi::settings_add_bool( 'Stalker', $IRSSI{name} . "_ignore_guest_nicks", 1 );
Irssi::settings_add_bool( 'Stalker', $IRSSI{name} . "_who_on_join", 1 );
Irssi::settings_add_bool( 'Stalker', $IRSSI{name} . "_hide_who", 0 );
Irssi::settings_add_bool( 'Stalker', $IRSSI{name} . "_debug_log", 0 );
my $count;
my %data;
Expand Down Expand Up @@ -95,16 +94,16 @@ sub nick_changed_channel {
add_record( $_[1]->{nick}, (split( '@', $_[1]->{host} )), $_[0]->{server}->{address} );
}


sub who_list {
add_record( (split(" ", $_[1]))[5,2,3], $_[0]->{address} );
Irssi::signal_stop() if Irssi::settings_get_bool( $IRSSI{name} . "_hide_who" );
sub channel_sync {
my ( $channel ) = @_;

my $serv = $channel->{server}->{address};

for my $nick ( $channel->nicks() ) {
add_record( $nick->{nick}, ( split( '@', $nick->{host} ) ), $serv );
}
}

sub me_join {
$_[0]->{server}->send_raw( "WHO " . $_[0]->{name} )
if Irssi::settings_get_bool( $IRSSI{name} . "_who_on_join" );
}

# Automatic Database Creation And Checking
sub stat_database {
Expand Down

0 comments on commit 7c55798

Please sign in to comment.