Created
February 3, 2011 13:42
-
-
Save jvolkman/809479 to your computer and use it in GitHub Desktop.
Adds private message support to chanmon.pl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- chanmon.pl.orig 2011-02-02 23:00:19.000000000 -0500 | |
+++ chanmon.pl 2011-02-02 23:00:22.000000000 -0500 | |
@@ -544,6 +544,11 @@ | |
weechat::config_set_plugin("nick_suffix", ""); | |
} | |
} | |
+ | |
+ if (!(weechat::config_is_set_plugin("private"))) | |
+ { | |
+ weechat::config_set_plugin("private", "off"); | |
+ } | |
} | |
# Get config updates | |
@@ -658,9 +663,9 @@ | |
# Only work on messages and topic notices | |
if ($cb_tags =~ /irc_privmsg/ || $cb_tags =~ /irc_topic/) | |
{ | |
- # Check buffer name is an IRC channel | |
+ # Check buffer name is an IRC channel or a private message | |
$bufname = weechat::buffer_get_string($cb_bufferp, 'name'); | |
- if ($bufname =~ /(.*)\.([#&\+!])(.*)/) | |
+ if ($bufname =~ /(.*)\.([#&\+!])(.*)/ || (weechat::config_get_plugin("private") eq "on" && $cb_tags =~ /notify_private/)) | |
{ | |
# Are we running on this channel | |
if (weechat::config_get_plugin($bufname) ne "off" && $cb_disp eq "1") | |
@@ -725,9 +730,9 @@ | |
# Special outgoing ACTION & away_info catcher | |
elsif ($cb_tags eq "" || $cb_tags =~ /away_info/ && weechat::config_get_plugin("show_aways") eq "on" ) | |
{ | |
- # Check buffer name is an IRC channel | |
+ # Check buffer name is an IRC channel or a private message | |
$bufname = weechat::buffer_get_string($cb_bufferp, 'name'); | |
- if ($bufname =~ /(.*)\.([#&\+!])(.*)/) | |
+ if ($bufname =~ /(.*)\.([#&\+!])(.*)/ || (weechat::config_get_plugin("private") eq "on" && $cb_tags =~ /notify_private/)) | |
{ | |
# Are we running dynamically | |
if (weechat::config_get_plugin("dynamic") eq "on") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In case it's not obvious, you need to set plugins.var.perl.chanmon.private = "on" for it to work.