- Refine /nosave handling
[videosite.git] / videosite.pl
index ee1fa26..35c0809 100644 (file)
@@ -4,6 +4,8 @@
 # licensed under GNU GPL v2
 #
 # Based on youtube.pl by Christian Garbs <mitch@cgarbs.de>
+# which in turn is
+# based on trigger.pl by Wouter Coekaerts <wouter@coekaerts.be>
 
 use strict;
 use Irssi 20020324 qw (command_bind command_runsub signal_add_first signal_add_last);
@@ -76,10 +78,15 @@ sub check_for_link {
         $witem = Irssi::window_item_find($target);
     }
 
+    # Look if we should ignore this line
+    if ($message =~ m,(?:\s|^)/nosave,) {
+        return;
+    }
+
     # Offer the message to all Grabbers in turn
     foreach $g (@grabbers) {
         if (defined($m = $g->get($message))) {
-            write_irssi($witem, '%%R>>> %%NSaving %%Y%s%%N %%G%s', $m->{'TYPE'}, $m->{'TITLE'});
+            write_irssi($witem, '%%R>>> %%NSaving %%Y%s%%N %%G%s', $m->{'SOURCE'}, $m->{'TITLE'});
             unless($getter->get($m)) {
                 write_irssi($witem, '%%R>>> FAILED');
             }