aboutsummaryrefslogblamecommitdiffstats
path: root/feature-tests/format-test.pl
blob: 7a38d9f4734c30cc64529a11c7e3076c91d9127d (plain) (tree)
1
2
3
4
5
6




             
                 









                                             

                                                    
                 



                                                      
 


                                                                    

 



                                  



                                                                                     
 
 
use strict;
use warnings;


use Irssi;
use Data::Dumper;

our $VERSION = '0.1';
our %IRSSI = (
              authors     => '',
              contact     => '',
              name        => '',
              description => '',
              license     => 'Public Domain',
             );

sub actually_printformat {
    my ($win, $level, $module, $format, @args) = @_;
    my $ret = '';
    {
        # deeeeeeep black magic.
        local *CORE::GLOBAL::caller = sub { $module };
        $win->printformat($level, $format, @args);

        $ret = Irssi::current_theme()->get_format($module, $format);
    }
    return $ret;
}

init();

sub init {
    my $win = Irssi::active_win();
    my $moo = actually_printformat($win, Irssi::MSGLEVEL_CLIENTCRAP, 'fe-common/irc',
                                   "kill_server", "foo", "bar", "horse", "cake");

    print Dumper($moo);

}