##############################################################################
#
-# mh_sbsplitmode.pl v1.06 (20151227)
+# mh_sbsplitmode.pl v1.07 (20160213)
#
-# Copyright (c) 2015 Michael Hansen
+# Copyright (c) 2015, 2016 Michael Hansen
#
# Permission to use, copy, modify, and distribute this software
# for any purpose with or without fee is hereby granted, provided
# see '/help statusbar' for more details and do not forget to '/save'
#
# history:
+#
+# v1.07 (20160213)
+# added namespace to MSGLEVEL
+# code cleanup
# v1.06 (20151227)
# added _print/_print_details and supporting code
# /splitmode now prints stats d unavailable in a bit nicer way
use Irssi 20100403;
use Irssi::TextUI;
-our $VERSION = '1.06';
+our $VERSION = '1.07';
our %IRSSI =
(
'name' => 'mh_sbsplitmode',
'authors' => 'Michael Hansen',
'contact' => 'mh on IRCnet #help',
'url' => 'http://scripts.irssi.org / https://github.com/mh-source/irssi-scripts',
- 'changed' => 'Sun Dec 27 11:50:52 CET 2015',
+ 'changed' => 'Sat Feb 13 14:18:00 CET 2016',
);
##############################################################################
sub trim_space
{
- my ($string) = @_;
-
- if (defined($string))
- {
- $string =~ s/^\s+//g;
- $string =~ s/\s+$//g;
+ my ($string) = @_;
- } else {
+ if (defined($string))
+ {
+ $string =~ s/^\s+//g;
+ $string =~ s/\s+$//g;
- $string = '';
- }
+ } else
+ {
+ $string = '';
+ }
- return($string);
+ return($string);
}
##############################################################################
{
$format_data = 'is in';
- } else {
-
+ } else
+ {
$details = 0;
$format_data = 'is no longer in';
}
{
$format_data = 'Splitmode unavailable';
- } else {
-
+ } else
+ {
if ($state->{$servertag}->{'s'})
{
$format_data = 'In splitmode';
$format_data = $format_data . ' since ' . localtime($state->{$servertag}->{'s'});
}
- } else {
-
+ } else
+ {
$format_data = 'Not in splitmode';
}
if ($format_detail ne '')
{
- Irssi::active_win->printformat(MSGLEVEL_CRAP, 'mh_sbsplitmode_line', $format_server, $format_data, $format_detail);
-
- } else {
+ Irssi::active_win->printformat(Irssi::MSGLEVEL_CRAP, 'mh_sbsplitmode_line', $format_server, $format_data, $format_detail);
- Irssi::active_win->printformat(MSGLEVEL_CRAP, 'mh_sbsplitmode_line_no_detail', $format_server, $format_data);
+ } else
+ {
+ Irssi::active_win->printformat(Irssi::MSGLEVEL_CRAP, 'mh_sbsplitmode_line_no_detail', $format_server, $format_data);
}
}
}
- } else {
-
- Irssi::active_win->printformat(MSGLEVEL_CRAP, 'mh_sbsplitmode_error', 'No servers');
-
+ } else
+ {
+ Irssi::active_win->printformat(Irssi::MSGLEVEL_CRAP, 'mh_sbsplitmode_error', 'No servers');
}
}