]> git.99rst.org Git - irssi-scripts.irssi.org.git/commitdiff
mh_sbuserinfo.pl v1.02
authormh <redacted>
Fri, 27 Nov 2015 19:31:05 +0000 (20:31 +0100)
committermh <redacted>
Fri, 27 Nov 2015 19:31:05 +0000 (20:31 +0100)
statusbar item that shows users and limit info in channels

changes:
only show item when channel is synced
cleaned out redundant code

scripts/mh_sbuserinfo.pl

index 75089da5b50ef68a9c9c3b95128a13fba99781f0..f1561bb0f419536bb427fedc26d1fe3f8c30af5c 100644 (file)
@@ -1,6 +1,6 @@
 ##############################################################################
 #
-# mh_sbuserinfo.pl v1.01 (20151127)
+# mh_sbuserinfo.pl v1.02 (20151127)
 #
 # Copyright (c) 2015  Michael Hansen
 #
@@ -55,6 +55,9 @@
 # see '/help statusbar' for more details and do not forget to '/save'
 #
 # history:
+#      v1.02 (20151127)
+#              only show item when channel is synced
+#              cleaned out redundant code
 #      v1.01 (20151127)
 #              call statusbar_redraw directly in signals
 #              now using elsif
@@ -76,7 +79,7 @@ use strict;
 use Irssi 20100403;
 use Irssi::TextUI;
 
-our $VERSION = '1.01';
+our $VERSION = '1.02';
 our %IRSSI   =
 (
        'name'        => 'mh_sbuserinfo',
@@ -248,21 +251,10 @@ sub statusbar_userinfo
 
                                $format = $format . $limit . '%n';
                        }
-
-               } else {
-
-                       $format = '?'
                }
        }
 
-       if ($format ne '')
-       {
-               $statusbaritem->default_handler($get_size_only, '{sb ' . $format . '}', '', 0);
-
-       } else {
-
-               $statusbaritem->default_handler($get_size_only, '{sb }', '', 0);
-       }
+       $statusbaritem->default_handler($get_size_only, '{sb ' . $format . '}', '', 0);
 }
 
 ##############################################################################
git clone https://git.99rst.org/PROJECT