#!/usr/bin/perl

use Irssi;
use Irssi::Irc;

use constant PI =>
"3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745";
sub sig_topic
{
	my ($chn) = @_;
	my ($topic_by, $userhost_by) = split('!', $chn->{topic_by});
	return if lc $topic_by eq lc $chn->{server}->{nick};

	my $topic = "";
	$topic = $chn->{topic} . " /" . $topic_by . "|" if $chn->{topic};

	$topic .= PI;
	$chn->command("TOPIC $topic");
}

Irssi::signal_add_last("channel topic changed", "sig_topic");
