aboutsummaryrefslogtreecommitdiffstats
path: root/feature-tests/text_intercept.pl
diff options
context:
space:
mode:
authorTom Feist <shabble@metavore.org>2010-10-08 00:44:42 +0000
committerTom Feist <shabble@metavore.org>2010-10-08 00:44:42 +0000
commit7c447b8328be2e404fa3d34780da3c0e954082d0 (patch)
tree57d5304bbfb44916310be5b8b76293aa4c5cc520 /feature-tests/text_intercept.pl
parentadded prompt_replace to dev branch (diff)
parentvim_mode: Fix :registers' display of "+ and "*. (diff)
downloadirssi-scripts-7c447b8328be2e404fa3d34780da3c0e954082d0.tar.gz
irssi-scripts-7c447b8328be2e404fa3d34780da3c0e954082d0.zip
Merge remote branch 'origin/dev' into dev
Conflicts: prompt_info/prompt_replace.pl test/irssi/config
Diffstat (limited to 'feature-tests/text_intercept.pl')
-rw-r--r--feature-tests/text_intercept.pl33
1 files changed, 33 insertions, 0 deletions
diff --git a/feature-tests/text_intercept.pl b/feature-tests/text_intercept.pl
new file mode 100644
index 0000000..932703e
--- /dev/null
+++ b/feature-tests/text_intercept.pl
@@ -0,0 +1,33 @@
+use strict;
+use Irssi;
+use Irssi::TextUI; # for sbar_items_redraw
+
+use vars qw($VERSION %IRSSI);
+$VERSION = "1.0.1";
+%IRSSI = (
+ authors => "shabble",
+ contact => 'shabble+irssi@metavore.org, shabble@#irssi/Freenode',
+ name => "",
+ description => "",
+ license => "Public Domain",
+ changed => ""
+);
+
+my $ignore_flag = 0;
+
+Irssi::signal_add 'print text' => \&handle_text;
+
+
+sub handle_text {
+ my ($dest, $text, $stripped) = @_;
+
+ return if $ignore_flag;
+
+ Irssi::signal_stop();
+
+ $text =~ s/a/b/g;
+
+ $ignore_flag = 1;
+ $dest->print($text);
+ $ignore_flag = 0;
+}