# Copyright 2002 by Marco d'Itri <md@linux.it>
# You can use this software under the terms of the GNU General Public License.
# strip hostmask from services notices

use Irssi;
use strict;

my $Services_Hostmask = qr/\@services\.$/;

Irssi::theme_register([
	notice_private_service	=> '{notice $0}$1',
]);

Irssi::signal_add('event notice' => 'event_nickserv_notice');

sub event_nickserv_notice {
	my ($server, $data, $source, $source_hostmask) = @_;

	return unless $source_hostmask and $source_hostmask =~ $Services_Hostmask;

	my ($target, $msg) = $data =~ /^(\S*)\s:(.*)/;
	Irssi::active_win->printformat(MSGLEVEL_NOTICES, 'notice_private_service',
		$source, $msg);
	Irssi::signal_stop();
}
