ignore /me messages

Discussion about XChat on Linux and other unix like systems.

ignore /me messages

Postby Mamonetti » 28 Dec 2006 22:53

Hi

is there any "easy" way to ignore /me or /ame messages from someone? many people use them for sending away (or similar) messages, so it would be interesting (imho) to have an extra option for the ignore command (chan, priv, ..., me, ame). well i think this would be the best, in order to join all ignore features in a single command instead of having for example a different script for this concrete situation

what do you think?

regards :D
User avatar
Mamonetti
 
Posts: 76
Joined: 03 Aug 2004 19:46
Location: Murcia - Spain

Postby eNTi » 08 Jan 2007 07:05

i'd just set those annoying fuckers on my ignore list. i hate those ppl.
eNTi
 
Posts: 8
Joined: 07 Nov 2005 18:11

Postby Khisanth » 09 Jan 2007 05:10

/ignore mask CTCP should ignore all the /me's as well.
Khisanth
 
Posts: 1724
Joined: 10 Jun 2004 05:23

Postby Mamonetti » 10 Jan 2007 22:24

hmm i have *!*@* ignored with invite and CTCP, but i still can see /me messages.. is this the correct behaviour?

regards
User avatar
Mamonetti
 
Posts: 76
Joined: 03 Aug 2004 19:46
Location: Murcia - Spain

Postby GatoLoko » 15 Jan 2007 20:59

Khisanth wrote:/ignore mask CTCP should ignore all the /me's as well.


/me isn't a ctcp command, so ignoring ctcp's does NOT ignore /me's

An example to show the diferencie from de x-chat raw log

<< PRIVMSG GatoLoko^ :PING
<--- that's a ctcp ping

<< PRIVMSG #channel :ACTION testing /me command <--- that's an action
User avatar
GatoLoko
 
Posts: 10
Joined: 10 May 2006 13:22

Postby Khisanth » 16 Jan 2007 14:11

GatoLoko wrote:
Khisanth wrote:/ignore mask CTCP should ignore all the /me's as well.


/me isn't a ctcp command, so ignoring ctcp's does NOT ignore /me's

An example to show the diferencie from de x-chat raw log

<< PRIVMSG GatoLoko^ :PING
<--- that's a ctcp ping

<< PRIVMSG #channel :ACTION testing /me command <--- that's an action


Your examples show that they ARE the same thing. :)
Open a dialog to yourself and do a /me.

It is also handled by the code in ctcp.c. DCC's are also CTCP. Looking at the code it is obvious that xchat is purposely treating them differently. That makes perfect sense but it doesn't mean they aren't the same type of message.
Khisanth
 
Posts: 1724
Joined: 10 Jun 2004 05:23

Postby Mamonetti » 16 Jan 2007 22:05

so why can i still see /me messages even when i'm ignoring "all" ctcp messages?

regards :D
User avatar
Mamonetti
 
Posts: 76
Joined: 03 Aug 2004 19:46
Location: Murcia - Spain

Postby Mamonetti » 28 Apr 2007 22:20

Code: Select all
#!/usr/bin/perl -w

sub ignoremes_print {
    my $str = shift;

    IRC::print "\0034$str\n";
}

IRC::register("Ignore /me Script", "1.0", "", "");
&ignoremes_print("Loading Ignore /me Script");
IRC::add_command_handler("ignoremes", "ignoremes_handler");
IRC::add_message_handler("PRIVMSG", "ignoremes_privmsg_handler");

my $ficheroIgnores = IRC::get_info(4)."/ignore-mes.list";
my %listaIgnores;

sub ignoremes_save {
    my $mask;
   
    unless(open FILE, ">$ficheroIgnores") {
   &ignoremes_print("Imposible guardar el fichero: $!");
   
   return Xchat::EAT_NONE;
    }
   
    foreach $mask (keys %listaIgnores) {
   print FILE "$mask\n"
    }
   
    close FILE;
   
    return Xchat::EAT_NONE;
}

sub ignoremes_handler {
    my $params = shift;
    my $cmd;
    my $mask;
    my $backup = $/;
    my @mascaras;
   
    ($cmd,$mask) = split(" ",$params);
   
    if (uc $cmd eq "ADD") {
   if (!exists $listaIgnores{$mask}) {
       $listaIgnores{$mask} = $mask;
      
       &ignoremes_print("ADD / mask -> $mask");
      
       &ignoremes_save();
   }
   else {
       &ignoremes_print("NO-ADD / mask -> $mask");
   }
    }
    elsif (uc $cmd eq "REMOVE") {
   if (exists $listaIgnores{$mask}) {
       delete($listaIgnores{$mask});
      
       &ignoremes_print("REMOVE / mask -> $mask");
      
       &ignoremes_save();
   }
   else {
       &ignoremes_print("NO-REMOVE / mask -> $mask");
   }
    }
    elsif (uc $cmd eq "LIST") {
   my $key;
   
   &ignoremes_print("Lista ignore /me:");
   
   foreach $key (keys %listaIgnores) {
       &ignoremes_print("    $key");
   }
    }
    elsif (uc $cmd eq "LOAD") {
   $/ = "\n";
   unless(open CHANS, "<$ficheroIgnores") {
       &ignoremes_print("Imposible cargar el fichero: $!");
      
       $/ = $backup;
            return Xchat::EAT_NONE;
   }
   
   @mascaras = <CHANS>;
        close CHANS;
   
   # borramos la lista actual
   delete @listaIgnores{keys %listaIgnores};
   
   foreach $mask (@mascaras) {
            chomp $mask;
      
       if (!exists $listaIgnores{$mask}) {
                $listaIgnores{$mask} = $mask;
      
           &ignoremes_print("LOAD / mask -> $mask");
       }
   }
   
   $/ = $backup;
    }
    else {
   &ignoremes_print("Opciones: /ignoremes ADD|REMOVE mask");
   &ignoremes_print("Opciones: /ignoremes LIST|LOAD");
    }
   
    return Xchat::EAT_NONE;
}

sub ignoremes_privmsg_handler {
    my $mensaje = shift;
    my $channel = Xchat::get_info("channel");
    my $mask;
   
    foreach $mask (keys %listaIgnores) {
   if (index uc $mensaje,"$mask PRIVMSG $channel :ACTION") {
       return Xchat::EAT_ALL;
   }
    }
   
    return Xchat::EAT_NONE;
}


Finally i decided to write a small script, reusing some code from older ones. I'm sure it's not the best, but seems to work :P

Simply touch $HOME/.xchat2/ignore-mes.list

Regards :D
User avatar
Mamonetti
 
Posts: 76
Joined: 03 Aug 2004 19:46
Location: Murcia - Spain

Postby fired0g » 30 Apr 2007 23:52

the /me syntax is not a ctcp or dcc. It is an action. I don't believe you can ignore an action.
fired0g
 
Posts: 9
Joined: 30 Apr 2007 23:35

Postby jlh » 01 May 2007 21:56

fired0g wrote:the /me syntax is not a ctcp or dcc. It is an action. I don't believe you can ignore an action.

Actions are implemented over CTCP.
jlh
 
Posts: 248
Joined: 14 Jul 2004 19:38
Location: Switzerland


Return to XChat

Who is online

Users browsing this forum: No registered users and 0 guests