From c06e64a6556f1703f9455ad91299c521ad8b3ed8 Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Wed, 5 Oct 2016 11:06:16 +0200 Subject: weechat: I give up MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Johannes Löthberg --- weechat/aspell.conf | 2 +- weechat/irc.conf | 231 ++- weechat/logger.conf | 4 +- weechat/perl/recoverop.pl | 176 ++ weechat/plugins.conf | 49 +- weechat/python/autojoin_on_invite.py | 102 ++ weechat/python/chanop.py | 3236 ---------------------------------- weechat/python/colorize_nicks.py | 14 +- weechat/python/go.py | 10 +- weechat/python/infolist.py | 195 ++ weechat/python/listbuffer.py | 467 +++++ weechat/python/nsb.py | 113 ++ weechat/relay.conf | 2 + weechat/script.conf | 1 + weechat/trigger.conf | 5 + weechat/weechat.conf | 96 +- weechat/xfer.conf | 2 +- 17 files changed, 1411 insertions(+), 3294 deletions(-) create mode 100644 weechat/perl/recoverop.pl create mode 100644 weechat/python/autojoin_on_invite.py delete mode 100644 weechat/python/chanop.py create mode 100644 weechat/python/infolist.py create mode 100644 weechat/python/listbuffer.py create mode 100644 weechat/python/nsb.py diff --git a/weechat/aspell.conf b/weechat/aspell.conf index a408f98..3e021f7 100644 --- a/weechat/aspell.conf +++ b/weechat/aspell.conf @@ -7,7 +7,7 @@ misspelled = lightred suggestions = default [check] -commands = "ame,amsg,away,command,cycle,kick,kickban,me,msg,notice,part,query,quit,topic" +commands = "ame,amsg,away,command,cycle,kick,kickban,me,msg,notice,part,query,quit,topic,ns,cs" default_dict = "en" during_search = on enabled = on diff --git a/weechat/irc.conf b/weechat/irc.conf index 811b43b..4b66c0c 100644 --- a/weechat/irc.conf +++ b/weechat/irc.conf @@ -23,11 +23,10 @@ display_join_message = "329,332,333" display_old_topic = on display_pv_away_once = on display_pv_back = on -highlight_channel = "$nick,demize,demi,remi,remize,kyrias" +highlight_channel = "$nick,demize,demi,remize,kyrias,remmy,remmy*" highlight_pv = "" highlight_server = "$nick" highlight_tags_restrict = "irc_privmsg,irc_notice" -item_away_message = on item_channel_modes_hide_args = "k" item_display_server = buffer_plugin item_nick_modes = on @@ -36,14 +35,11 @@ join_auto_add_chantype = off msgbuffer_fallback = current new_channel_position = none new_pv_position = none -nick_color_force = "tigr:lightblue;tigrmesh:lightblue;Earnestly:green;Earnestea:green" -nick_color_hash = djb2 -nick_color_stop_chars = "_|[" nick_completion_smart = speakers nick_mode = both nick_mode_empty = off nicks_hide_password = "nickserv" -notice_as_pv = always +notice_as_pv = auto notice_welcome_redirect = on notice_welcome_tags = "" notify_tags_ison = "notify_message" @@ -57,7 +53,7 @@ smart_filter = on smart_filter_delay = 5 smart_filter_join = on smart_filter_join_unmask = 30 -smart_filter_mode = "v" +smart_filter_mode = "" smart_filter_nick = on smart_filter_quit = on temporary_servers = on @@ -65,7 +61,6 @@ topic_strip_colors = off [color] input_nick = lightcyan -item_away = yellow item_channel_modes = default item_lag_counting = default item_lag_finished = yellow @@ -76,14 +71,15 @@ mirc_remap = "1,-1:darkgray" nick_prefixes = "q:lightred;a:lightcyan;o:lightgreen;h:lightmagenta;v:yellow;*:lightblue" notice = blue reason_quit = default +topic_current = default topic_new = white topic_old = darkgray [network] -alternate_nick = on autoreconnect_delay_growing = 2 autoreconnect_delay_max = 1800 ban_mask_default = "*!$user@$host" +channel_encode = off colors_receive = on colors_send = on lag_check = 30 @@ -93,6 +89,7 @@ lag_reconnect = 0 lag_refresh_interval = 1 notify_check_ison = 1 notify_check_whois = 5 +sasl_fail_unavailable = on send_unknown_commands = off whois_double_nick = off @@ -115,16 +112,17 @@ autorejoin = off autorejoin_delay = 30 away_check = 0 away_check_max_nicks = 0 -capabilities = "account-notify,away-notify,extended-join,multi-prefix,userhost-in-names,server-time,znc.in/server-time-iso" +capabilities = "account-notify,away-notify,cap-notify,extended-join,multi-prefix,userhost-in-names,server-time" command = "" command_delay = 0 connection_timeout = 60 -default_msg_kick = "" -default_msg_part = "" -default_msg_quit = "" ipv6 = on local_hostname = "" -nicks = "demize,remize,dem,kyrias" +msg_kick = "" +msg_part = "WeeChat ${info:version}" +msg_quit = "WeeChat ${info:version}" +nicks = "demize,remize,kyrias" +nicks_alternate = on notify = "" password = "" proxy = "" @@ -141,7 +139,7 @@ ssl_dhkey_size = 512 ssl_fingerprint = "" ssl_priorities = "NORMAL" ssl_verify = off -username = "dem" +username = "kyrias" [server] Freenode.addresses @@ -153,7 +151,7 @@ Freenode.ssl_priorities Freenode.ssl_dhkey_size Freenode.ssl_fingerprint Freenode.ssl_verify -Freenode.password = "kyrias/Freenode:" +Freenode.password = "kyrias/freenode:" Freenode.capabilities Freenode.sasl_mechanism Freenode.sasl_username @@ -165,6 +163,7 @@ Freenode.autoconnect = on Freenode.autoreconnect Freenode.autoreconnect_delay Freenode.nicks +Freenode.nicks_alternate Freenode.username Freenode.realname Freenode.local_hostname @@ -178,9 +177,9 @@ Freenode.anti_flood_prio_high Freenode.anti_flood_prio_low Freenode.away_check Freenode.away_check_max_nicks -Freenode.default_msg_kick -Freenode.default_msg_part -Freenode.default_msg_quit +Freenode.msg_kick +Freenode.msg_part +Freenode.msg_quit Freenode.notify Furnet.addresses Furnet.proxy @@ -191,7 +190,7 @@ Furnet.ssl_priorities Furnet.ssl_dhkey_size Furnet.ssl_fingerprint Furnet.ssl_verify -Furnet.password = "kyrias/Furnet:" +Furnet.password = "kyrias/furnet:" Furnet.capabilities Furnet.sasl_mechanism Furnet.sasl_username @@ -203,6 +202,7 @@ Furnet.autoconnect = on Furnet.autoreconnect Furnet.autoreconnect_delay Furnet.nicks +Furnet.nicks_alternate Furnet.username Furnet.realname Furnet.local_hostname @@ -216,9 +216,9 @@ Furnet.anti_flood_prio_high Furnet.anti_flood_prio_low Furnet.away_check Furnet.away_check_max_nicks -Furnet.default_msg_kick -Furnet.default_msg_part -Furnet.default_msg_quit +Furnet.msg_kick +Furnet.msg_part +Furnet.msg_quit Furnet.notify Foonetic.addresses Foonetic.proxy @@ -229,7 +229,7 @@ Foonetic.ssl_priorities Foonetic.ssl_dhkey_size Foonetic.ssl_fingerprint Foonetic.ssl_verify -Foonetic.password = "kyrias/Foonetic:" +Foonetic.password = "kyrias/foonetic:" Foonetic.capabilities Foonetic.sasl_mechanism Foonetic.sasl_username @@ -241,6 +241,7 @@ Foonetic.autoconnect = on Foonetic.autoreconnect Foonetic.autoreconnect_delay Foonetic.nicks +Foonetic.nicks_alternate Foonetic.username Foonetic.realname Foonetic.local_hostname @@ -254,9 +255,9 @@ Foonetic.anti_flood_prio_high Foonetic.anti_flood_prio_low Foonetic.away_check Foonetic.away_check_max_nicks -Foonetic.default_msg_kick -Foonetic.default_msg_part -Foonetic.default_msg_quit +Foonetic.msg_kick +Foonetic.msg_part +Foonetic.msg_quit Foonetic.notify Therian.addresses Therian.proxy @@ -267,7 +268,7 @@ Therian.ssl_priorities Therian.ssl_dhkey_size Therian.ssl_fingerprint Therian.ssl_verify -Therian.password = "kyrias/Therian:" +Therian.password = "kyrias/therian:" Therian.capabilities Therian.sasl_mechanism Therian.sasl_username @@ -279,6 +280,7 @@ Therian.autoconnect = on Therian.autoreconnect Therian.autoreconnect_delay Therian.nicks +Therian.nicks_alternate Therian.username Therian.realname Therian.local_hostname @@ -292,11 +294,11 @@ Therian.anti_flood_prio_high Therian.anti_flood_prio_low Therian.away_check Therian.away_check_max_nicks -Therian.default_msg_kick -Therian.default_msg_part -Therian.default_msg_quit +Therian.msg_kick +Therian.msg_part +Therian.msg_quit Therian.notify -HypeIRC.addresses = "theos.kyriasis.com/6697" +HypeIRC.addresses HypeIRC.proxy HypeIRC.ipv6 HypeIRC.ssl @@ -305,7 +307,7 @@ HypeIRC.ssl_priorities HypeIRC.ssl_dhkey_size HypeIRC.ssl_fingerprint HypeIRC.ssl_verify -HypeIRC.password = "kyrias/HypeIRC:" +HypeIRC.password = "kyrias/hypeirc:" HypeIRC.capabilities HypeIRC.sasl_mechanism HypeIRC.sasl_username @@ -317,6 +319,7 @@ HypeIRC.autoconnect = on HypeIRC.autoreconnect HypeIRC.autoreconnect_delay HypeIRC.nicks +HypeIRC.nicks_alternate HypeIRC.username HypeIRC.realname HypeIRC.local_hostname @@ -330,7 +333,163 @@ HypeIRC.anti_flood_prio_high HypeIRC.anti_flood_prio_low HypeIRC.away_check HypeIRC.away_check_max_nicks -HypeIRC.default_msg_kick -HypeIRC.default_msg_part -HypeIRC.default_msg_quit +HypeIRC.msg_kick +HypeIRC.msg_part +HypeIRC.msg_quit HypeIRC.notify +twitch.addresses = "irc.twitch.tv/6667" +twitch.proxy +twitch.ipv6 +twitch.ssl = off +twitch.ssl_cert +twitch.ssl_priorities +twitch.ssl_dhkey_size +twitch.ssl_fingerprint +twitch.ssl_verify +twitch.password = "oauth:c1hb7pr458gm8t6puvs3dn6fav3ev0" +twitch.capabilities = "twitch.tv/membership,twitch.tv/commands,account-notify,away-notify,cap-notify,extended-join,multi-prefix,server-time,userhost-in-names" +twitch.sasl_mechanism +twitch.sasl_username +twitch.sasl_password +twitch.sasl_key +twitch.sasl_timeout +twitch.sasl_fail +twitch.autoconnect +twitch.autoreconnect +twitch.autoreconnect_delay +twitch.nicks = "kyriasis" +twitch.nicks_alternate +twitch.username +twitch.realname +twitch.local_hostname +twitch.command +twitch.command_delay +twitch.autojoin +twitch.autorejoin +twitch.autorejoin_delay +twitch.connection_timeout +twitch.anti_flood_prio_high +twitch.anti_flood_prio_low +twitch.away_check +twitch.away_check_max_nicks +twitch.msg_kick +twitch.msg_part +twitch.msg_quit +twitch.notify +fc00.addresses +fc00.proxy +fc00.ipv6 +fc00.ssl +fc00.ssl_cert +fc00.ssl_priorities +fc00.ssl_dhkey_size +fc00.ssl_fingerprint +fc00.ssl_verify +fc00.password = "kyrias/fc00:" +fc00.capabilities +fc00.sasl_mechanism +fc00.sasl_username +fc00.sasl_password +fc00.sasl_key +fc00.sasl_timeout +fc00.sasl_fail +fc00.autoconnect = on +fc00.autoreconnect +fc00.autoreconnect_delay +fc00.nicks +fc00.nicks_alternate +fc00.username +fc00.realname +fc00.local_hostname +fc00.command +fc00.command_delay +fc00.autojoin +fc00.autorejoin +fc00.autorejoin_delay +fc00.connection_timeout +fc00.anti_flood_prio_high +fc00.anti_flood_prio_low +fc00.away_check +fc00.away_check_max_nicks +fc00.msg_kick +fc00.msg_part +fc00.msg_quit +fc00.notify +EFnet.addresses = "irc.efnet.org/6697" +EFnet.proxy +EFnet.ipv6 +EFnet.ssl = on +EFnet.ssl_cert +EFnet.ssl_priorities +EFnet.ssl_dhkey_size +EFnet.ssl_fingerprint +EFnet.ssl_verify +EFnet.password +EFnet.capabilities +EFnet.sasl_mechanism +EFnet.sasl_username +EFnet.sasl_password +EFnet.sasl_key +EFnet.sasl_timeout +EFnet.sasl_fail +EFnet.autoconnect +EFnet.autoreconnect +EFnet.autoreconnect_delay +EFnet.nicks +EFnet.nicks_alternate +EFnet.username +EFnet.realname +EFnet.local_hostname +EFnet.command +EFnet.command_delay +EFnet.autojoin +EFnet.autorejoin +EFnet.autorejoin_delay +EFnet.connection_timeout +EFnet.anti_flood_prio_high +EFnet.anti_flood_prio_low +EFnet.away_check +EFnet.away_check_max_nicks +EFnet.msg_kick +EFnet.msg_part +EFnet.msg_quit +EFnet.notify +mozilla.addresses = "theos.kyriasis.com/6697" +mozilla.proxy +mozilla.ipv6 +mozilla.ssl +mozilla.ssl_cert +mozilla.ssl_priorities +mozilla.ssl_dhkey_size +mozilla.ssl_fingerprint +mozilla.ssl_verify +mozilla.password = "kyrias/mozilla:" +mozilla.capabilities +mozilla.sasl_mechanism +mozilla.sasl_username +mozilla.sasl_password +mozilla.sasl_key +mozilla.sasl_timeout +mozilla.sasl_fail +mozilla.autoconnect = on +mozilla.autoreconnect +mozilla.autoreconnect_delay +mozilla.nicks +mozilla.nicks_alternate +mozilla.username +mozilla.realname +mozilla.local_hostname +mozilla.command +mozilla.command_delay +mozilla.autojoin +mozilla.autorejoin +mozilla.autorejoin_delay +mozilla.connection_timeout +mozilla.anti_flood_prio_high +mozilla.anti_flood_prio_low +mozilla.away_check +mozilla.away_check_max_nicks +mozilla.msg_kick +mozilla.msg_part +mozilla.msg_quit +mozilla.notify diff --git a/weechat/logger.conf b/weechat/logger.conf index 7c88758..33b2df4 100644 --- a/weechat/logger.conf +++ b/weechat/logger.conf @@ -13,11 +13,11 @@ backlog_line = green auto_log = on flush_delay = 120 info_lines = on -mask = "$plugin.$name/%F.weechatlog" +mask = "$plugin.$name/%F" name_lower_case = on nick_prefix = "" nick_suffix = "" -path = "%h/logs/" +path = "/home/kyrias/.local/share/weechat/logs/" replacement_char = "_" time_format = "%Y-%m-%d %H:%M:%S" diff --git a/weechat/perl/recoverop.pl b/weechat/perl/recoverop.pl new file mode 100644 index 0000000..e7b8791 --- /dev/null +++ b/weechat/perl/recoverop.pl @@ -0,0 +1,176 @@ +# +# recoverop.pl - WeeChat script to recover channel operator in empty channel +# +# Copyright (C) 2012 "AYANOKOUZI, Ryuunosuke" +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# Description: +# recoverop.pl tries to take a channel operator privilege by part and join +# after last user leave a channel. After loading the script, by default, it +# is unavailable for all channels. You can specify server and channel in +# which the script is available by perl regular expression. +# +# Vars: +# plugins.var.perl.recoverop.regex +# perl regular expression (format: "server.channel") make recoverop.pl +# available. +# plugins.var.perl.recoverop.modes +# modes for channel (format: "+sn"), empty string or not set == do not change modes +# +# Examples: +# /set plugins.var.perl.recoverop.regex "\A(freenode\.#weechat)|(oftc\.#debian.*)\Z" +# try to recover channel operator privilege in #weechat on freenode and +# in all channels starting from "#debian" on oftc. +# /set plugins.var.perl.recoverop.regex ".*" +# recoverop is available for all channels. +# /set plugins.var.perl.recoverop.regex "" +# recoverop is unavailable for all channels. +# /unset plugins.var.perl.recoverop.regex +# recoverop is unavailable for all channels (default). +# /set plugins.var.perl.recoverop.modes "+sn" +# set modes +sn after join. +# + +use strict; +use warnings; + +weechat::register( + "recoverop", "AYANOKOUZI, Ryuunosuke", + "0.1.1", "GPL3", "recover channel operator in empty channel", + "", "" +); +my $script_name = "recoverop"; + +weechat::hook_signal( "*,irc_raw_in_PART", "my_signal_irc_in_PART_cb", "" ); +weechat::hook_signal( "*,irc_raw_in_QUIT", "my_signal_irc_in_QUIT_cb", "" ); +weechat::hook_config( "plugins.var.perl.$script_name.*", "config_cb", "" ); + +my $conf = &configure(); + +sub config_cb { + my $data = shift; + my $option = shift; + my $value = shift; + $conf = &configure(); + return weechat::WEECHAT_RC_OK; +} + +sub configure { + my $val = weechat::config_get_plugin('regex'); + $conf->{regex} = qr/$val/; + $conf->{mode} = weechat::config_get_plugin('modes'); + return $conf; +} + +sub part_join { + my $server = shift; + my $channel = shift; + my $nick = shift; + if ( "$server.$channel" !~ m/$conf->{regex}/ ) { + return weechat::WEECHAT_RC_OK; + } + my $nicks_count = get_nicks_count( $server, $channel ); + if ( defined $nicks_count && $nicks_count == 2 ) { + my $myname = get_myname($server); + if ( defined $myname && $myname ne '' ) { + my $prefix = get_prefix( $server, $channel, $myname ); + if ( defined $prefix && $prefix ne '@' ) { + my $buffer = + weechat::buffer_search( "irc", "$server.$channel" ); + if ($buffer) + { + my $sec = int rand 10; + weechat::command( $buffer, "/wait ${sec}s /cycle" ); + if ($conf->{mode}) + { + $sec += 5; + weechat::command( $buffer, "/wait ${sec}s /mode ".$conf->{mode}); + } + } + } + } + } + return weechat::WEECHAT_RC_OK; +} + +sub my_signal_irc_in_PART_cb { + my $data = shift; + my $signal = shift; + my $type_data = shift; + my $signal_data = shift; + my $server = ( split ',', $signal )[0]; + my ( $user, $channel ) = ( split ' ', $type_data, 4 )[ 0, 2 ]; + my ( $nick, $username, $address ) = ( $user =~ m/:(.*)!(.*)@(.*)/ ); + part_join( $server, $channel, $nick ); + return weechat::WEECHAT_RC_OK; +} + +sub my_signal_irc_in_QUIT_cb { + my $data = shift; + my $signal = shift; + my $type_data = shift; + my $signal_data = shift; + my $server = ( split ',', $signal )[0]; + my $user = ( split ' ', $type_data, 3 )[0]; + my ( $nick, $username, $address ) = ( $user =~ m/:(.*)!(.*)@(.*)/ ); + my $infolist = weechat::infolist_get( "irc_channel", "", "$server" ); + + while ( weechat::infolist_next($infolist) ) { + my $name = weechat::infolist_string( $infolist, "name" ); + my $infolist2 = + weechat::infolist_get( "irc_nick", "", "$server,$name,$nick" ); + if ( defined $infolist2 && $infolist2 eq '' ) { + weechat::infolist_free($infolist2); + next; + } + weechat::infolist_free($infolist2); + + part_join( $server, $name, $nick ); + } + weechat::infolist_free($infolist); + return weechat::WEECHAT_RC_OK; +} + +sub get_myname { + my $server = shift; + my $infolist = weechat::infolist_get( "irc_server", "", "$server" ); + weechat::infolist_next($infolist); + my $myname = weechat::infolist_string( $infolist, "nick" ); + weechat::infolist_free($infolist); + return $myname; +} + +sub get_nicks_count { + my $server = shift; + my $channel = shift; + my $infolist = + weechat::infolist_get( "irc_channel", "", "$server,$channel" ); + weechat::infolist_next($infolist); + my $nicks_count = weechat::infolist_integer( $infolist, "nicks_count" ); + weechat::infolist_free($infolist); + return $nicks_count; +} + +sub get_prefix { + my $server = shift; + my $channel = shift; + my $nick = shift; + my $infolist = + weechat::infolist_get( "irc_nick", "", "$server,$channel,$nick" ); + weechat::infolist_next($infolist); + my $prefix = weechat::infolist_string( $infolist, "prefix" ); + weechat::infolist_free($infolist); + return $prefix; +} diff --git a/weechat/plugins.conf b/weechat/plugins.conf index 7bad995..f2c5e61 100644 --- a/weechat/plugins.conf +++ b/weechat/plugins.conf @@ -6,6 +6,23 @@ fifo.fifo = "on" guile.check_license = "off" lua.check_license = "on" +perl.beep.beep_command_dcc = "play -q /usr/share/sounds/gnome/default/alerts/drip.ogg" +perl.beep.beep_command_highlight = "play -q /usr/share/sounds/gnome/default/alerts/drip.ogg" +perl.beep.beep_command_pv = "play -q /usr/share/sounds/gnome/default/alerts/drip.ogg" +perl.beep.beep_command_timeout = "30000" +perl.beep.beep_dcc = "on" +perl.beep.beep_highlight = "on" +perl.beep.beep_highlight_blacklist = "off" +perl.beep.beep_highlight_whitelist = "on" +perl.beep.beep_pv = "on" +perl.beep.beep_pv_blacklist = "off" +perl.beep.beep_pv_whitelist = "on" +perl.beep.beep_trigger_highlight = "" +perl.beep.beep_trigger_pv = "" +perl.beep.bell_always = "" +perl.beep.blacklist_nicks = "" +perl.beep.whitelist_channels = "" +perl.beep.whitelist_nicks = "furnet.Xanadu,furnet.Xanamaus" perl.buddylist.buddy.on.server = "on" perl.buddylist.buddy.on.server.color = "green" perl.buddylist.buddylist = "/home/kyrias/.weechat/buddylist.txt" @@ -52,8 +69,6 @@ perl.highmon.nick_prefix = "<" perl.highmon.nick_suffix = ">" perl.highmon.output = "bar" perl.highmon.short_names = "on" -perl.isgd.auto = "on" -perl.isgd.auto_min_length = "90" perl.isgd.color = "white" perl.listsort.max_size = "100" perl.mplex.away_msg = "Detached head" @@ -129,15 +144,17 @@ python.announce_url_title.buffers = "freenode.#testing," python.announce_url_title.buffers_notice = "freenode.#testing," python.announce_url_title.global = "on" python.announce_url_title.global_prefix = "url" -python.announce_url_title.ignore_buffers = "freenode.#archlinux,freenode.#archlinux-offtopic,freenode.#archers,freenode.#archlinux-mordor,freenode.#archlinux-bugs,freenode.#archlinux-women,freenode.#archlinux-women-dev,freenode.#kyriasis,freenode.#archlinux-tu,freenode.#archlinux-pacman,freenode.#lojban,freenode.#systemd" +python.announce_url_title.ignore_buffers = "freenode.#archlinux,freenode.#archlinux-offtopic,freenode.#archers,freenode.#archlinux-mordor,freenode.#archlinux-bugs,freenode.#archlinux-women,freenode.#archlinux-women-dev,freenode.#kyriasis,freenode.#archlinux-tu,freenode.#archlinux-pacman,freenode.#lojban,freenode.#systemd,freenode.#lobsters,furnet.#spork,hypeirc.#radar" python.announce_url_title.prefix = "" python.announce_url_title.reannounce_wait = "5" python.announce_url_title.suffix = "" python.announce_url_title.title_max_length = "80" python.announce_url_title.url_ignore = "http://git.io/" python.announce_url_title.user_agent = "WeeChat/%(version)s (http://www.weechat.org)" -python.autosavekey.mute = "off" -python.autosavekey.secure = "off" +python.autojoin_on_invite.ignore_channels = "" +python.autojoin_on_invite.ignore_nicks = "" +python.autojoin_on_invite.whitelist_channels = "" +python.autojoin_on_invite.whitelist_nicks = "" python.chanop.autodeop = "on" python.chanop.autodeop_delay = "60" python.chanop.default_banmask = "host" @@ -147,9 +164,8 @@ python.chanop.enable_multi_kick = "off" python.chanop.enable_remove = "off" python.chanop.kick_reason = "" python.chanop.op_command = "/msg chanserv op $channel $nick" -python.chanop.watchlist.freenode = "#archlinux-classroom,#archlinux-botabuse,#archlinux,#archlinux-unregistered,#archlinux-offtopic,#kyriasis" +python.chanop.watchlist.freenode = "#kyriasis,#archlinux-mordor,#archlinux-botabuse,#archlinux,#archlinux-unregistered,#archlinux-offtopic,#archlinux-classroom" python.check_license = "on" -python.clone_scanner.autofocus = "on" python.clone_scanner.clone_onjoin_alert_key = "mask" python.clone_scanner.clone_report_key = "mask" python.clone_scanner.colors.clone_report.clone.match = "chat" @@ -231,6 +247,23 @@ ruby.check_license = "on" tcl.check_license = "on" [desc] +perl.beep.beep_command_dcc = "command for beep on dcc, special value "$bell" is allowed, as well as "$bell;command" (default: "$bell")" +perl.beep.beep_command_highlight = "command for beep on highlight, special value "$bell" is allowed, as well as "$bell;command" (default: "$bell")" +perl.beep.beep_command_pv = "command for beep on private message, special value "$bell" is allowed, as well as "$bell;command" (default: "$bell")" +perl.beep.beep_command_timeout = "timeout for command run (in milliseconds, 0 = never kill (not recommended)) (default: "30000")" +perl.beep.beep_dcc = "beep on dcc (default: "on")" +perl.beep.beep_highlight = "beep on highlight (default: "on")" +perl.beep.beep_highlight_blacklist = "turn blacklist for highlights on or off (default: "off")" +perl.beep.beep_highlight_whitelist = "turn whitelist for highlights on or off (default: "off")" +perl.beep.beep_pv = "beep on private message (default: "on")" +perl.beep.beep_pv_blacklist = "turn blacklist for private messages on or off (default: "off")" +perl.beep.beep_pv_whitelist = "turn whitelist for private messages on or off (default: "off")" +perl.beep.beep_trigger_highlight = "word that will trigger execution of beep_command_highlight (if empty, anything will trigger) (default: "")" +perl.beep.beep_trigger_pv = "word that will trigger execution of beep_command_pv (it empty, anything will trigger) (default: "")" +perl.beep.bell_always = "use $bell on private messages and/or highlights regardless of trigger and whitelist settings (example: "pv,highlight") (default: "")" +perl.beep.blacklist_nicks = "comma-separated list of "server.nick": if not empty, these nicks will not be able to trigger execution of commands. Cannot be used in conjuction with whitelist (example: "freenode.nick1,freenode.nick2") (default: "")" +perl.beep.whitelist_channels = "comma-separated list of "server.#channel": if not empty, only these channels will trigger execution of commands (example: "freenode.#weechat,freenode.#channel2") (default: "")" +perl.beep.whitelist_nicks = "comma-separated list of "server.nick": if not empty, only these nicks will trigger execution of commands (example: "freenode.nick1,freenode.nick2") (default: "")" perl.buddylist.buddy.on.server = "show buddy who is connected to a server, but not visiting the same channel(s) (default: on)" perl.buddylist.buddy.on.server.color = "color for online buddy but not visiting the same channel(s) (default: lightgreen)" perl.buddylist.buddylist = "path/file-name to store your buddies" @@ -263,8 +296,6 @@ perl.colorize_lines.highlight = "apply highlight color to the highlighted lines perl.colorize_lines.lines = "apply nickname color to the lines (off/on/nicks). the latter will limit highlighting to nicknames in option 'nicks'" perl.colorize_lines.nicks = "comma-separater list of nicks (e.g. freenode.cat,*.dog) OR file name starting with '/' (e.g. /file.txt). in the latter case, nicknames will get loaded from that file inside weechat folder (e.g. from ~/.weechat/file.txt). nicknames in file are newline-separated (e.g. freenode.dog\n*.cat)" perl.colorize_lines.own_lines = "apply nickname color to own lines (off/on/only). the latter turns off all other kinds of coloring altogether" -perl.isgd.auto = "Shorten all incoming URLs automatically (default: "off")" -perl.isgd.auto_min_length = "Only shorten incoming URLs automatically which have this minimum length (default: "1")" perl.isgd.color = "Color used for printing shortened URLs (default: "white")" perl.listsort.max_size = "maximum size of /list output in kilobytes to be handled" perl.multiline.char = "character(s) which should be displayed to indicate end of line" diff --git a/weechat/python/autojoin_on_invite.py b/weechat/python/autojoin_on_invite.py new file mode 100644 index 0000000..cdaeaf0 --- /dev/null +++ b/weechat/python/autojoin_on_invite.py @@ -0,0 +1,102 @@ +# -*- coding: utf-8 -*- +# +# Copyright (c) 2009 by xt +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +# +# (this script requires WeeChat 0.3.0 or newer) +# +# History: +# 2013-12-21, Sebastien Helleu +# version 0.5: fix parsing of INVITE message +# 2013-11-28, sakkemo +# version 0.4: add whitelist for nicks/channels +# 2009-11-09, xt +# version 0.3: add ignore option for channels +# 2009-10-29, xt +# version 0.2: add ignore option +# 2009-10-28, xt +# version 0.1: initial release + +import weechat as w +import re + +SCRIPT_NAME = "autojoin_on_invite" +SCRIPT_AUTHOR = "xt " +SCRIPT_VERSION = "0.5" +SCRIPT_LICENSE = "GPL3" +SCRIPT_DESC = "Auto joins channels when invited" + +# script options +settings = { + 'whitelist_nicks': '', # comma separated list of nicks, + # overrides ignore_nicks + 'whitelist_channels': '', # comma separated list of channels, + # overrides ignore_channels + 'ignore_nicks': '', # comma separated list of nicks + #that we will not accept auto invite from + 'ignore_channels': '', # comma separated list of channels to not join +} + +if w.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE, + SCRIPT_DESC, "", ""): + for option, default_value in settings.iteritems(): + if not w.config_is_set_plugin(option): + w.config_set_plugin(option, default_value) + + w.hook_signal('*,irc_in2_invite', 'invite_cb', '') + + +def invite_cb(data, signal, signal_data): + server = signal.split(',')[0] # EFNet,irc_in_INVITE + channel = signal_data.split()[-1].lstrip(':') # :nick!ident@host.name INVITE yournick :#channel + from_nick = re.match(':(?P.+)!', signal_data).groups()[0] + + if len(w.config_get_plugin('whitelist_nicks')) > 0 and len(w.config_get_plugin('whitelist_channels')) > 0: # if there's two whitelists, accept both + if from_nick in w.config_get_plugin('whitelist_nicks').split(',') or channel in w.config_get_plugin('whitelist_channels').split(','): + w.prnt('', 'Automatically joining %s on server %s, invitation from %s (whitelist).' \ + %(channel, server, from_nick)) + w.command('', '/quote -server %s JOIN %s' % (server, channel)) + else: + w.prnt('', 'Ignoring invite from %s to channel %s. Neither inviter nor channel in whitelist.' %(from_nick, channel)) + + elif len(w.config_get_plugin('whitelist_nicks')) > 0: # if there's a whitelist, accept nicks in it + if from_nick in w.config_get_plugin('whitelist_nicks').split(','): + w.prnt('', 'Automatically joining %s on server %s, invitation from %s (whitelist).' \ + %(channel, server, from_nick)) + w.command('', '/quote -server %s JOIN %s' % (server, channel)) + else: + w.prnt('', 'Ignoring invite from %s to channel %s. Inviter not in whitelist.' %(from_nick, channel)) + + elif len(w.config_get_plugin('whitelist_channels')) > 0: # if there's a whitelist, accept channels in it + if channel in w.config_get_plugin('whitelist_channels').split(','): + w.prnt('', 'Automatically joining %s on server %s, invitation from %s (whitelist).' \ + %(channel, server, from_nick)) + w.command('', '/quote -server %s JOIN %s' % (server, channel)) + else: + w.prnt('', 'Ignoring invite from %s to channel %s. Channel not in whitelist.' %(from_nick, channel)) + + else: # use the ignore lists to make the decision + if from_nick in w.config_get_plugin('ignore_nicks').split(','): + w.prnt('', 'Ignoring invite from %s to channel %s. Invite from ignored inviter.' %(from_nick, channel)) + elif channel in w.config_get_plugin('ignore_channels').split(','): + w.prnt('', 'Ignoring invite from %s to channel %s. Invite to ignored channel.' %(from_nick, channel)) + else: + w.prnt('', 'Automatically joining %s on server %s, invitation from %s.' \ + %(channel, server, from_nick)) + w.command('', '/quote -server %s JOIN %s' % (server, channel)) + + return w.WEECHAT_RC_OK diff --git a/weechat/python/chanop.py b/weechat/python/chanop.py deleted file mode 100644 index 848837e..0000000 --- a/weechat/python/chanop.py +++ /dev/null @@ -1,3236 +0,0 @@ -# -*- coding: utf-8 -*- -### -# Copyright (c) 2009-2013 by Elián Hanisch -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -### - -### -# Helper script for IRC Channel Operators -# -# Inspired by auto_bleh.pl (irssi) and chanserv.py (xchat) scripts. -# -# Networks like Freenode and some channels encourage operators to not stay -# permanently with +o privileges and only use it when needed. This script -# works along those lines, requesting op, kick/ban/etc and deop -# automatically with a single command. -# Still this script is very configurable and its behaviour can be configured -# in a per server or per channel basis so it can fit most needs without -# changing its code. -# -# Features several completions for ban/quiet masks and a memory for channel -# masks and users (so users that parted are still bannable by nick). -# -# -# Commands (see detailed help with /help in WeeChat): -# * /oop: Request or give op. -# * /odeop: Drop or remove op. -# * /okick: Kick user (or users). -# * /oban: Apply ban mask. -# * /ounban: Remove ban mask. -# * /oquiet: Apply quiet mask. -# * /ounquiet: Remove quiet mask. -# * /obankick: Ban and kick user (or users) -# * /otopic: Change channel topic -# * /omode: Change channel modes -# * /olist: List cached masks (bans or quiets) -# * /ovoice: Give voice to user -# * /odevoice: Remove voice from user -# -# -# Settings: -# Most configs (unless noted otherwise) can be defined for a server or a -# channel in particular, so it is possible to request op in different -# networks, stay always op'ed in one channel while -# auto-deop in another. -# -# For define an option for a specific server use: -# /set plugins.var.python.chanop.