]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Twitter bridge - Was using the wrong idiom to update foreign_link
authorZach Copley <zach@controlyourself.ca>
Wed, 24 Sep 2008 06:04:55 +0000 (02:04 -0400)
committerZach Copley <zach@controlyourself.ca>
Wed, 24 Sep 2008 06:04:55 +0000 (02:04 -0400)
objs, which was causing UI inconsistencies. Fixed.

darcs-hash:20080924060455-7b5ce-71ac4bb3a80ca44e6ae758d2287d50c918d1d908.gz

actions/twittersettings.php

index d8eb7aba0873e3a4483d2926106fdf0634ea6292..d37c042acf74d9300507aa34f98dd5c72be135a2 100644 (file)
@@ -238,6 +238,10 @@ class TwittersettingsAction extends SettingsAction {
                        return;
                }
 
+               $flink->query('BEGIN');
+
+               $original = clone($flink);
+
                if ($noticesync) {
                        if ($replysync) {
                                $flink->noticesync = 3;
@@ -250,14 +254,17 @@ class TwittersettingsAction extends SettingsAction {
 
                $flink->friendsync = ($friendsync) ? 2 : 0;
                // $flink->profilesync = 0; // XXX: leave as default?
-               $result = $flink->update();
 
-               if (!$result) {
+               $result = $flink->update($original);
+
+               if ($result === FALSE) {
                        common_log_db_error($flink, 'UPDATE', __FILE__);
                        $this->show_form(_('Couldn\'t save Twitter preferences.'));
                        return;
                }
 
+               $flink->query('COMMIT');
+
                $this->show_form(_('Twitter preferences saved.'));
 
                return;