git://git.camperquake.de
/
xmlrtorrent.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
58be7bb
)
- Handle autosave on module unload/irssi exit
master
author
Ralf Ertzinger
<sun@lain.camperquake.de>
Thu, 12 Feb 2009 16:01:31 +0000
(17:01 +0100)
committer
Ralf Ertzinger
<sun@lain.camperquake.de>
Thu, 12 Feb 2009 16:01:31 +0000
(17:01 +0100)
xmlrtorrent.pl
patch
|
blob
|
history
diff --git
a/xmlrtorrent.pl
b/xmlrtorrent.pl
index
397d72c
..
fae32f7
100644
(file)
--- a/
xmlrtorrent.pl
+++ b/
xmlrtorrent.pl
@@
-25,8
+25,16
@@
my @outputstack = (undef);
my $PARAMS = {
'_QUEUE' => {},
my $PARAMS = {
'_QUEUE' => {},
+ '_AUTOSAVE' => 1,
};
};
+# Handle module unload/irssi shutdown
+sub UNLOAD {
+ if ($conf->{'xmlrtorrent'}->{'_AUTOSAVE'}) {
+ cmd_save();
+ }
+}
+
# activate debug here
my $debug = 0;
# activate debug here
my $debug = 0;
@@
-86,6
+94,16
@@
my $xmlrtorrent_commands = {
$debug = 0;
write_irssi('Disabled debugging');
},
$debug = 0;
write_irssi('Disabled debugging');
},
+
+ 'autosave' => sub {
+ $conf->{'xmlrtorrent'}->{'_AUTOSAVE'} = 1;
+ write_irssi('Autosave enabled');
+ },
+
+ 'noautosave' => sub {
+ $conf->{'xmlrtorrent'}->{'_AUTOSAVE'} = 0;
+ write_irssi('Autosave disabled');
+ },
};
# This is shamelessly stolen from pythons urlgrabber
};
# This is shamelessly stolen from pythons urlgrabber