From b10b14c8e9700feb720fe2f6092d05fd60b97f67 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Sun, 30 Jun 2019 13:23:28 +0200 Subject: [PATCH] Update url in Client.removeFriend --- fbchat/_client.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/fbchat/_client.py b/fbchat/_client.py index 9c99d81..f38ffa8 100644 --- a/fbchat/_client.py +++ b/fbchat/_client.py @@ -2054,17 +2054,17 @@ class Client(object): Removes a specifed friend from your friend list :param friend_id: The ID of the friend that you want to remove - :return: Returns error if the removing was unsuccessful, returns True when successful. + :return: True + :raises: FBchatException if request failed """ - payload = {"friend_id": friend_id, "unref": "none", "confirm": "Confirm"} - r = self._post("https://m.facebook.com/a/removefriend.php", payload) - query = parse_qs(urlparse(r.url).query) - if "err" not in query: - log.debug("Remove was successful!") - return True - else: - log.warning("Error while removing friend") - return False + data = {"uid": friend_id} + j = self._post( + "/ajax/profile/removefriendconfirm.php", + data, + fix_request=True, + as_json=True, + ) + return True def blockUser(self, user_id): """