diff options
| author | ailin-nemui | 2016-02-14 22:02:19 +0100 |
|---|---|---|
| committer | ailin-nemui | 2016-02-14 22:02:19 +0100 |
| commit | d8eacb40ba88ddbb6cab8838428c8b59cd99308c (patch) | |
| tree | 592f00370bf8877662c0ecc45734f78778cacad8 | |
| parent | 21bf1cb42ee9204c403acb766112f42b0bd8b235 (diff) | |
| parent | 1f185b6b5d377c724039b694cf4170e8f574fb4d (diff) | |
| download | scripts.irssi.org-d8eacb40ba88ddbb6cab8838428c8b59cd99308c.tar.bz2 | |
Merge pull request #240 from mh-source/gh-pages
mh_sbsplitmode.pl v1.07
| -rw-r--r-- | scripts/mh_sbsplitmode.pl | 59 |
1 files changed, 31 insertions, 28 deletions
diff --git a/scripts/mh_sbsplitmode.pl b/scripts/mh_sbsplitmode.pl index e3b15e2..79ebb6d 100644 --- a/scripts/mh_sbsplitmode.pl +++ b/scripts/mh_sbsplitmode.pl @@ -1,8 +1,8 @@ ############################################################################## # -# 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 @@ -59,6 +59,10 @@ # 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 @@ -95,7 +99,7 @@ use strict; use Irssi 20100403; use Irssi::TextUI; -our $VERSION = '1.06'; +our $VERSION = '1.07'; our %IRSSI = ( 'name' => 'mh_sbsplitmode', @@ -104,7 +108,7 @@ our %IRSSI = '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', ); ############################################################################## @@ -123,19 +127,19 @@ our $state; 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); } ############################################################################## @@ -281,8 +285,8 @@ sub signal_redir_event_248 { $format_data = 'is in'; - } else { - + } else + { $details = 0; $format_data = 'is no longer in'; } @@ -365,8 +369,8 @@ sub command_splitmode { $format_data = 'Splitmode unavailable'; - } else { - + } else + { if ($state->{$servertag}->{'s'}) { $format_data = 'In splitmode'; @@ -376,8 +380,8 @@ sub command_splitmode $format_data = $format_data . ' since ' . localtime($state->{$servertag}->{'s'}); } - } else { - + } else + { $format_data = 'Not in splitmode'; } @@ -386,19 +390,18 @@ sub command_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'); } } |
