#
# Topicsed edits channel topics by perl regexps via the command /topicsed.
#
# Thanks to Mikael Magnusson for the idea and patch to implement a
# preview functionality. ;]
#
use strict;
use Irssi;
use vars qw/%IRSSI $VERSION/;
$VERSION="0.1";
%IRSSI = (
authors => "Gabor Nyeki",
contact => "bigmac\@vim.hu",
name => "topicsed",
description => "editing channel topics by regexps",
license => "public domain",
changed => "2017-03-18"
);
sub topicsed {
my ($regexp, $server, $winit) = @_;
my $preview = 0;
if ($regexp =~ m/^-p(review|) ?/) {
$preview = 1;
$regexp =~ s/^-p\w* ?//;
}
unless ($regexp) {
Irssi::print("Usage: /topicsed [-p[review]]