]> git.mxchange.org Git - friendica.git/commitdiff
fix response
authorJonny Tischbein <jonny_tischbein@systemli.org>
Sun, 16 Sep 2018 17:36:25 +0000 (19:36 +0200)
committerJonny Tischbein <jonny_tischbein@systemli.org>
Sun, 16 Sep 2018 17:36:25 +0000 (19:36 +0200)
include/api.php

index 242f4bc3bb698b5662f67fdd8a2084113f0730bb..8588b2cf897cdb17e4b0bc475ff67ba48f7f6ef6 100644 (file)
@@ -3696,8 +3696,14 @@ function api_friendships_destroy($type)
                DBA::update('contact', ['rel' => Contact::FOLLOWER], ['id' => $contact['id']]);
        }
 
-       $answer = ['result' => 'ok', 'user_id' => $contact_id, 'contact' => 'contact deleted'];
-       return api_format_data("friendships-destroy", $type, ['result' => $answer]);
+       // "uid" and "self" are only needed for some internal stuff, so remove it from here
+       unset($contact["uid"]);
+       unset($contact["self"]);
+
+       // Set screen_name since Twidere requests it
+       $contact["screen_name"] = $contact["nick"];
+
+       return api_format_data("friendships-destroy", $type, ['user' => $contact]);
 }
 api_register_func('api/friendships/destroy', 'api_friendships_destroy', true, API_METHOD_POST);