changelog_bot (changelog_bot) wrote in changelog,
changelog_bot
changelog_bot
changelog

[livejournal] r21654: LJSV-1257: Calendar does not immediately...

Committer: nnikulochkina
LJSV-1257: Calendar does not immediately update to reflect edited dates

Now user's timeupdate changes on edit/delete event.
U   trunk/cgi-bin/ljprotocol.pl
Modified: trunk/cgi-bin/ljprotocol.pl
===================================================================
--- trunk/cgi-bin/ljprotocol.pl	2012-04-05 11:54:07 UTC (rev 21653)
+++ trunk/cgi-bin/ljprotocol.pl	2012-04-05 13:02:44 UTC (rev 21654)
@@ -2898,8 +2898,9 @@
     # can't edit in deleted/suspended community
     return fail($err,307) unless $uowner->{'statusvis'} eq "V" || $uowner->is_readonly;
 
+    my $dbh = LJ::get_db_writer();
     my $dbcm = LJ::get_cluster_master($uowner);
-    return fail($err,306) unless $dbcm;
+    return fail($err,306) unless $dbcm && $dbh;
 
     # can't specify both a custom security and 'friends-only'
     return fail($err, 203, "Invalid friends group security set.")
@@ -3074,6 +3075,10 @@
         if ( $itemid == $uowner->get_sticky_entry_id() ) {
             $uowner->remove_sticky_entry_id();
         }
+	
+	$dbh->do("UPDATE userusage SET timeupdate=NOW() ".
+	         "WHERE userid=$ownerid");
+	LJ::MemCache::set([$ownerid, "tu:$ownerid"], pack("N", time()), 30*60);
 
         return $res;
     }
@@ -3329,6 +3334,10 @@
         $res->{'url'} = LJ::item_link($uowner, $itemid, $oldevent->{'anum'});
         $res->{'ditemid'} = $itemid * 256 + $oldevent->{'anum'};
     }
+    
+    $dbh->do("UPDATE userusage SET timeupdate=NOW() ".
+             "WHERE userid=$ownerid");
+    LJ::MemCache::set([$ownerid, "tu:$ownerid"], pack("N", time()), 30*60);
 
     my $entry = LJ::Entry->new($ownerid, jitemid => $itemid);
     LJ::EventLogRecord::EditEntry->new($entry)->fire;

Tags: changelog_bot, livejournal, nnikulochkina, pl
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