From 98aa10b7e0357a71f16a1331132a9b5b1408ff75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=D0=92=D0=BB=D0=B0?= =?UTF-8?q?=D0=B4=D0=B8=D0=BC=D0=B8=D1=80=D0=BE=D0=B2=D0=B8=D1=87?= Date: Thu, 25 Feb 2016 15:08:34 +0300 Subject: [PATCH] friend list improvements --- src/tox.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/tox.py b/src/tox.py index 87dff7e..ff95f3f 100644 --- a/src/tox.py +++ b/src/tox.py @@ -593,13 +593,14 @@ class Tox(object): :param friend_list: pointer (c_char_p) to a memory region with enough space to hold the friend list. If this parameter is None, this function allocates memory for the friend list. - :return: pointer (c_char_p) to a memory region with the friend list + :return: friend list """ + friend_list_size = self.self_get_friend_list_size() if friend_list is None: - friend_list = create_string_buffer(sizeof(c_uint32) * self.self_get_friend_list_size()) + friend_list = create_string_buffer(sizeof(c_uint32) * friend_list_size) friend_list = POINTER(c_uint32)(friend_list) Tox.libtoxcore.tox_self_get_friend_list(self._tox_pointer, friend_list) - return friend_list + return friend_list[0:friend_list_size] def friend_get_public_key(self, friend_number, public_key): """