aboutsummaryrefslogtreecommitdiffstats
path: root/feature-tests/sig_unbind.pl
diff options
context:
space:
mode:
authorricho <richo@psych0tik.net>2011-07-18 03:36:40 +0000
committerricho <richo@psych0tik.net>2011-07-18 03:36:40 +0000
commite4b9ea15d7abdae8211d18737fa54933f3faf57b (patch)
treefda4cc23faebfd1f130578b39fe161fe4c0ba1f8 /feature-tests/sig_unbind.pl
parentAdded goodnicks from richoH/richos-irssi (diff)
parentOnly attempt join if channel exists (diff)
downloadirssi-scripts-e4b9ea15d7abdae8211d18737fa54933f3faf57b.tar.gz
irssi-scripts-e4b9ea15d7abdae8211d18737fa54933f3faf57b.zip
Merge branch 'master' into richoH-dev
Diffstat (limited to 'feature-tests/sig_unbind.pl')
-rw-r--r--feature-tests/sig_unbind.pl58
1 files changed, 58 insertions, 0 deletions
diff --git a/feature-tests/sig_unbind.pl b/feature-tests/sig_unbind.pl
new file mode 100644
index 0000000..3123182
--- /dev/null
+++ b/feature-tests/sig_unbind.pl
@@ -0,0 +1,58 @@
+use strict;
+use warnings;
+
+
+use Irssi (@Irssi::EXPORT_OK);
+use Irssi::Irc;
+use Irssi::TextUI;
+
+use Data::Dumper;
+
+
+our $VERSION = '0.1';
+our %IRSSI = (
+ authors => 'shabble',
+ contact => 'shabble+irssi@metavore.org',
+ name => '',
+ description => '',
+ license => 'Public Domain',
+ );
+
+command_bind("dosig_r",
+ sub {
+ my $ref = \&cmd_oink;
+ _print("binding oink to $ref");
+ signal_add("command oink", $ref);
+ });
+
+command_bind("undosig_r",
+ sub {
+ my $ref = \&cmd_oink;
+
+ _print("unbinding oink from $ref");
+
+ signal_remove("command oink", $ref);
+ });
+
+command_bind("dosig_s",
+ sub {
+ signal_add("command oink", 'cmd_oink');
+ });
+
+command_bind("undosig_s",
+ sub {
+ signal_remove("command oink", 'cmd_oink');
+ });
+
+sub cmd_oink {
+ Irssi::active_win()->print("Oink:");
+}
+
+sub _print {
+ Irssi::active_win()->print($_[0]);
+}
+
+command("dosig_r");
+command("oink");
+command("undosig_r");
+command("oink");