]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/disfavor.php
notice_inbox.id -> notice_inbox.notice_id
[quix0rs-gnu-social.git] / actions / disfavor.php
index 6f4a078862076c4f3b3c16a9293f1cb757c4479c..35cfd60707fc26d45f2c657043a19dcd1d00d1a1 100644 (file)
@@ -63,10 +63,21 @@ class DisfavorAction extends Action {
                        $this->server_error(_('Could not delete favorite.'));
                        return;
                }
-
-               # XXX: ajax response
-
-               common_redirect(common_local_url('showfavorites',
-                                                                                array('nickname' => $user->nickname)));
+               
+               $user->blowFavesCache();
+
+               if ($this->boolean('ajax')) {
+                       common_start_html('text/xml');
+                       common_element_start('head');
+                       common_element('title', _('Favor'));
+                       common_element_end('head');
+                       common_element_start('body');
+                       common_favor_form($notice);
+                       common_element_end('body');
+                       common_element_end('html');
+               } else {
+                       common_redirect(common_local_url('showfavorites',
+                                                                                        array('nickname' => $user->nickname)));
+               }
        }
 }
\ No newline at end of file