madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r22838: LJSUP-10503: duplication of delay posts

Committer: sbelyaev
LJSUP-10503: duplication of delay posts
U   trunk/cgi-bin/LJ/DelayedEntry.pm
Modified: trunk/cgi-bin/LJ/DelayedEntry.pm
===================================================================
--- trunk/cgi-bin/LJ/DelayedEntry.pm	2012-09-07 12:37:51 UTC (rev 22837)
+++ trunk/cgi-bin/LJ/DelayedEntry.pm	2012-09-07 13:03:12 UTC (rev 22838)
@@ -254,16 +254,27 @@
     my ($self) = @_;
 
     my $time = time();
-    return $self->journal->do( "UPDATE delayedlog2 SET ".
-                               "lastposttry=? " .
-                               "WHERE delayedid = ? AND " .
-                               "journalid = ? AND " .
-                               "lastposttry = ?" ,
-                               undef,
-                               $time,
-                               $self->delayedid,
-                               $self->journalid,
-                               $self->{lastposttry}, );
+    if (!$self->{lastposttry}) {
+         return $self->journal->do( "UPDATE delayedlog2 SET ".
+                                    "lastposttry=? " .
+                                    "WHERE delayedid = ? AND " .
+                                    "journalid = ?" .
+                                    undef,
+                                    $time,
+                                    $self->delayedid,
+                                    $self->journalid, );
+    } else {
+        return $self->journal->do( "UPDATE delayedlog2 SET ".
+                                   "lastposttry=? " .
+                                   "WHERE delayedid = ? AND " .
+                                   "journalid = ? AND " .
+                                   "lastposttry = ?" ,
+                                   undef,
+                                   $time,
+                                   $self->delayedid,
+                                   $self->journalid,
+                                   $self->{lastposttry}, );
+    }
 }
 
 sub convert_from_data {

Tags: livejournal, madeon, pm, sbelyaev
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments