]> git.vpit.fr Git - perl/scripts/xchat.git/blobdiff - clones.pl
Also undef %fetched when clones.pl is unloaded
[perl/scripts/xchat.git] / clones.pl
index fded636bd38c8aee60a92426d5ddb911972026ab..c1e0dd950ebc47c5a3666179c6906cbc7a72d2ec 100755 (executable)
--- a/clones.pl
+++ b/clones.pl
@@ -188,15 +188,13 @@ hook_server 'JOIN', sub {
  my $clones = add $nick, host($userhost), $serv, $chan;
  return EAT_NONE unless $clones > 0;
 
local_context $chan, $serv => sub {
my $printer = sub {
   print $ph clone_enter_str $userhost, $nick, $clones;
   1
- } or do {
-  delay JOIN_DELAY, sub {
-   local_context $chan, $serv => sub {
-    print $ph clone_enter_str $userhost, $nick, $clones;
-   }
-  }
+ };
+
+ local_context $chan, $serv, $printer or delay JOIN_DELAY, sub {
+  local_context $chan, $serv, $printer;
  };
 
  return EAT_NONE;
@@ -316,7 +314,10 @@ $ph = Xchat::XPI->new(
  author => 'Vincent Pit (VPIT)',
  email  => 'perl@profvince.com',
  url    => 'http://www.profvince.com',
- unload => sub { undef %users },
+ unload => sub {
+  undef %users;
+  undef %fetched;
+ },
 );
 
 1;