Commit e44ddb3fbfec42b4c617a1c2862939d41ad8e6de

Authored by Caesar Ahlenhed
1 parent 697dc2ba

Added ignore user function

Showing 1 changed file with 8 additions and 4 deletions   Show diff stats
pushover.pl
... ... @@ -18,6 +18,9 @@ use warnings;
18 18 # comma separated list of
19 19 # network tags that should
20 20 # be ignored.
  21 +# /set pushover_ignore_nick NICK1, NICK2 # Nicks to ignore and not
  22 +# push notifications for.
  23 +# Comma seperated list.
21 24 # /set pushover_debug ON/OFF # Debug mode.
22 25 #
23 26 # "General hilight" basically referrs to ALL the hilights you have
... ... @@ -54,7 +57,7 @@ $VERSION = "0.1";
54 57 description => "Sends notifonotifications when away",
55 58 license => "GPLv2",
56 59 url => "http://sniker.codebase.nu",
57   - changed => "Sun Jan 25 16:44:25 CET 2015",
  60 + changed => "Tue Sep 08 13:49:25 CEST 2015",
58 61 );
59 62  
60 63 # Configuration settings and default values.
... ... @@ -66,6 +69,7 @@ Irssi::settings_add_str("PushoverIrssi", "pushover_priority_channel", 0);
66 69 Irssi::settings_add_str("PushoverIrssi", "pushover_priority_pm", 0);
67 70 Irssi::settings_add_str("PushoverIrssi", "pushover_priority_general", 0);
68 71 Irssi::settings_add_str("PushoverIrssi", "pushover_ignore_nettag", "");
  72 +Irssi::settings_add_str("PushoverIrssi", "pushover_ignore_nick", "");
69 73 Irssi::settings_add_bool("PushoverIrssi", "pushover_debug", 0);
70 74  
71 75 sub send_noti {
... ... @@ -120,7 +124,7 @@ sub pubmsg {
120 124 my ($server, $data, $nick, $nick_addr, $target) = @_;
121 125  
122 126 if(!Irssi::settings_get_bool("pushover_general_hilight")){
123   - if($server->{usermode_away} == 1 && $data =~ /$server->{nick}/i && index(Irssi::settings_get_str("pushover_ignore_nettag"), $server->{tag}) == -1){
  127 + if($server->{usermode_away} == 1 && $data =~ /$server->{nick}/i && index(Irssi::settings_get_str("pushover_ignore_nettag"), $server->{tag}) == -1 && index(Irssi::settings_get_str("pushover_ignore_nick"), $nick) == -1){
124 128 send_noti("Hilighted " . $server->{tag} . "/" . $target, $nick . ': ' . $data, Irssi::settings_get_str("pushover_priority_channel"));
125 129 }
126 130 }
... ... @@ -128,7 +132,7 @@ sub pubmsg {
128 132  
129 133 sub privmsg {
130 134 my ($server, $data, $nick) = @_;
131   - if($server->{usermode_away} == 1 && index(Irssi::settings_get_str("pushover_ignore_nettag"), $server->{tag}) == -1){
  135 + if($server->{usermode_away} == 1 && index(Irssi::settings_get_str("pushover_ignore_nettag"), $server->{tag}) == -1) && index(Irssi::settings_get_str("pushover_ignore_nick"), $nick) == -1){
132 136 send_noti("PM @ " . $server->{tag}, $nick . ': ' . $data, Irssi::settings_get_str("pushover_priority_pm"));
133 137 }
134 138 }
... ... @@ -138,7 +142,7 @@ sub genhilight {
138 142 my $server = $dest->{server};
139 143  
140 144 if($dest->{level} & MSGLEVEL_HILIGHT) {
141   - if($server->{usermode_away} == 1 && index(Irssi::settings_get_str("pushover_ignore_nettag"), $server->{tag}) == -1){
  145 + if($server->{usermode_away} == 1 && index(Irssi::settings_get_str("pushover_ignore_nettag"), $server->{tag}) == -1) && index(Irssi::settings_get_str("pushover_ignore_nick"), $nick) == -1){
142 146 if(Irssi::settings_get_bool("pushover_general_hilight")){
143 147 send_noti("General Hilight " . $server->{tag} . "/" . $dest->{target}, $stripped, Irssi::settings_get_str("pushover_priority_general"));
144 148 }
... ...