rev 1498 - trunk/siesta/lib/Siesta/Plugin

[prev] [thread] [next] [lurker] [Date index for 2004/04/05]

From: richardc
Subject: rev 1498 - trunk/siesta/lib/Siesta/Plugin
Date: 21:08 on 05 Apr 2004
Author: richardc
Date: 2004-04-05 21:08:12 +0100 (Mon, 05 Apr 2004)
New Revision: 1498

Added:
   trunk/siesta/lib/Siesta/Plugin/NoMail.pm
Log:
simple NoMail plugin


Added: trunk/siesta/lib/Siesta/Plugin/NoMail.pm
===================================================================
--- trunk/siesta/lib/Siesta/Plugin/NoMail.pm	2004-04-05 18:09:00 UTC (rev 1497)
+++ trunk/siesta/lib/Siesta/Plugin/NoMail.pm	2004-04-05 20:08:12 UTC (rev 1498)
@@ -0,0 +1,25 @@
+use strict;
+package Siesta::Plugin::NoMail;
+use base 'Siesta::Plugin';
+
+sub description { "opt out of recieving mail" }
+sub personal { 1 }
+
+sub process {
+    my $self = shift;
+    # we're always personal, so don't do anything without a user
+    return unless $self->user;
+    return $self->pref( 'nomail' );
+}
+
+sub options {
+    return +{
+        nomail => {
+            description => "send me no mail",
+            type        => "boolean",
+            default     => 0, # not nomail, erm, mail!
+        },
+    };
+}
+
+1;

Generated at 13:57 on 01 Jul 2004 by mariachi 0.52