Subject: | UpLevel hackery |
This diff allows POE::Session::Irssi to be used anywhere, not just in
Irssi::Scripts::<script_name>.
Any create()s will be called in the script's package that is in its call
stack. # Does that make sense?
Basically, call POE::Session::Irssi->create() in a package that is use()
or require() 'd from a script, and PSI will signal_bind or command_add
in that scripts package.
Subject: | Irssi.pm.diff |
--- Irssi.pm Sat Aug 25 23:49:28 2007
+++ Irssi.pm_ Sat Aug 25 23:49:13 2007
@@ -198,13 +198,12 @@
sub _connect_stuff {
my ($kernel, $session) = @_[KERNEL, SESSION];
- #my $foolvl = 0;
- #$foolvl++ while (caller($foolvl) ne 'Irssi::Script::test2');
- #print "ARRIVED AT $foolvl";
-
- my $lvl = 8;
+ my $lvl = 0;
+ $lvl++ while (caller($lvl) !~ /^Irssi::Script::/);
# if there's an existing _start, we're a level higher(lower?)
$lvl++ if (caller() eq 'POE::Session::Irssi');
+ #print "ARRIVED AT $lvl";
my $name_map = $session->[SE_DATA]->{$pkg}->{signal_name_map};
while (my ($irssi_name, $poe_name) = each %$name_map) {