modtime_unix should use the revtime prop, and fall back onto 
logtime_unix if the entry has never been edited. Some refactoring to eliminate 
redundancy.

        Patch by fu. 

diffs (29 lines):

diff -r d157ea166cf2 -r 5c1c10d3fd31 cgi-bin/LJ/Entry.pm
--- a/cgi-bin/LJ/Entry.pm       Mon Feb 21 19:24:45 2011 +0800
+++ b/cgi-bin/LJ/Entry.pm       Mon Feb 21 21:21:31 2011 +0800
@@ -327,15 +327,7 @@ sub logtime_unix {
 
 sub modtime_unix {
     my $self = $_[0];
-    __PACKAGE__->preload_rows ([ $self ]) unless $self->{_loaded_row};
-    __PACKAGE__->preload_props([ $self ]) unless $self->{_loaded_props};
-
-    return LJ::mysqldate_to_time($self->{logtime}, 1);
-}
-
-sub revtime_unix {
-    my $self = $_[0];
-    return $self->prop( "revtime" );
+    return $self->prop( "revtime" ) || $self->logtime_unix;
 }
 
 sub security {
@@ -597,7 +589,7 @@ sub atom_entry {
     $atom_entry->title( $self->subject_text );
 
     $atom_entry->published( LJ::time_to_w3c( $self->logtime_unix, "Z" ) );
-    $atom_entry->updated( LJ::time_to_w3c( $self->revtime_unix || 
$self->logtime_unix, 'Z' ) );
+    $atom_entry->updated( LJ::time_to_w3c( $self->modtime_unix, 'Z' ) );
 
     my $author = XML::Atom::Person->new( Version => 1 );
     $author->name( $self->poster->name_orig );
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to