]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Wrap notice-saving code in a transaction
authorEvan Prodromou <evan@zhora.(none)>
Tue, 20 Jan 2009 13:19:32 +0000 (08:19 -0500)
committerEvan Prodromou <evan@zhora.(none)>
Tue, 20 Jan 2009 13:19:32 +0000 (08:19 -0500)
classes/Notice.php

index d614ceebab23285f0ac136896ea9f8c919c54a62..2816966321b2b7251a746dd1224ddb2c7bb98081 100644 (file)
@@ -125,6 +125,8 @@ class Notice extends Memcached_DataObject
                        $notice->is_local = $is_local;
                }
 
+               $notice->query('BEGIN');
+               
                $notice->reply_to = $reply_to;
                $notice->created = common_sql_now();
                $notice->content = common_shorten_links($content);
@@ -158,6 +160,8 @@ class Notice extends Memcached_DataObject
                // Add to notice inboxes
                
                $notice->addToInboxes();
+
+               $notice->query('COMMIT');
                
                # Clear the cache for subscribed users, so they'll update at next request
                # XXX: someone clever could prepend instead of clearing the cache