rev 1524 - in trunk/siesta/lib/Siesta: . Plugin

[prev] [thread] [next] [lurker] [Date index for 2004/06/02]

From: richardc
Subject: rev 1524 - in trunk/siesta/lib/Siesta: . Plugin
Date: 16:42 on 02 Jun 2004
Author: richardc
Date: 2004-06-02 16:42:13 +0100 (Wed, 02 Jun 2004)
New Revision: 1524

Modified:
   trunk/siesta/lib/Siesta/DBI.pm
   trunk/siesta/lib/Siesta/Deferred.pm
   trunk/siesta/lib/Siesta/Plugin/Resume.pm
Log:
fix Challenge/Resume by recreating the Deferred->hash method

Modified: trunk/siesta/lib/Siesta/DBI.pm
===================================================================
--- trunk/siesta/lib/Siesta/DBI.pm	2004-06-02 13:04:54 UTC (rev 1523)
+++ trunk/siesta/lib/Siesta/DBI.pm	2004-06-02 15:42:13 UTC (rev 1524)
@@ -73,7 +73,14 @@
     return 1;
 }
 
+sub delete {
+    my $self = shift;
+    $self->remove_from_object_index;
+    return $self->SUPER::delete( @_ );
+}
 
+
+
 1;
 __DATA__
 

Modified: trunk/siesta/lib/Siesta/Deferred.pm
===================================================================
--- trunk/siesta/lib/Siesta/Deferred.pm	2004-06-02 13:04:54 UTC (rev 1523)
+++ trunk/siesta/lib/Siesta/Deferred.pm	2004-06-02 15:42:13 UTC (rev 1524)
@@ -1,7 +1,7 @@
 use strict;
 package Siesta::Deferred;
 use base qw( Siesta::DBI );
-
+use Digest::MD5 qw(md5_hex);
 __PACKAGE__->set_up_table('deferred');
 __PACKAGE__->has_a(who     => 'Siesta::Member' );
 __PACKAGE__->has_a(message => 'Siesta::Message',
@@ -44,12 +44,24 @@
     my $self = shift;
 
     # yuck
-    my $plugins = [ map { Siesta::Plugin->retrieve( $_ )->promote } 
-                    split /,/, $self->plugins 
+    my $plugins = [ map { Siesta::Plugin->retrieve( $_ )->promote }
+                    split /,/, $self->plugins
                   ];
 
     # even yuckier
     return $plugins->[0]->list;
 }
 
+=head2 hash
+
+a hash of the deferred message, used for Challenge/Resume
+
+=cut
+
+
+sub hash {
+    my $self = shift;
+    return md5_hex( $self->message->as_string );
+}
+
 1;

Modified: trunk/siesta/lib/Siesta/Plugin/Resume.pm
===================================================================
--- trunk/siesta/lib/Siesta/Plugin/Resume.pm	2004-06-02 13:04:54 UTC (rev 1523)
+++ trunk/siesta/lib/Siesta/Plugin/Resume.pm	2004-06-02 15:42:13 UTC (rev 1524)
@@ -1,7 +1,6 @@
 use strict;
 package Siesta::Plugin::Resume;
 use base 'Siesta::Plugin';
-use Digest::MD5 qw(md5_hex);
 sub description { "set a deferred message on its way" }
 
 sub process {

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