From 1ab34a631cb90fda60c625d1a99b608f1e71cae7 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: Fri, 19 Feb 2016 16:46:27 +0300 Subject: [PATCH] upd tox --- src/tox.py | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/tox.py b/src/tox.py index 18b5a49..d5979fc 100644 --- a/src/tox.py +++ b/src/tox.py @@ -269,7 +269,9 @@ class Tox(object): elif tox_err_friend_delete == TOX_ERR_FRIEND_DELETE['TOX_ERR_FRIEND_DELETE_FRIEND_NOT_FOUND']: raise ArgumentError('There was no friend with the given friend number. No friends were deleted.') - # TODO Friend list queries, Friend-specific state queries + # TODO Friend list queries + + # TODO Friend-specific state queries def self_set_typing(self, friend_number, typing): tox_err_set_typing = c_int() @@ -300,6 +302,35 @@ class Tox(object): elif tox_err_friend_send_message == TOX_ERR_FRIEND_SEND_MESSAGE['TOX_ERR_FRIEND_SEND_MESSAGE_EMPTY']: raise ArgumentError('Attempted to send a zero-length message.') + def callback_friend_read_receipt(self, callback, user_data): + tox_friend_read_receipt_cb = CFUNCTYPE(None, c_void_p, c_uint32, c_uint32, c_void_p) + c_callback = tox_friend_read_receipt_cb(callback) + self.libtoxcore.tox_callback_friend_read_receipt(self._tox_pointer, c_callback, c_void_p(user_data)) + + def callback_friend_request(self, callback, user_data): + tox_friend_request_cb = CFUNCTYPE(None, c_void_p, c_char_p, c_char_p, c_size_t, c_void_p) + c_callback = tox_friend_request_cb(callback) + self.libtoxcore.tox_callback_friend_request(self._tox_pointer, c_callback, c_void_p(user_data)) + + def callback_friend_message(self, callback, user_data): + tox_friend_message_cb = CFUNCTYPE(None, c_void_p, c_uint32, c_int, c_char_p, c_size_t, c_void_p) + c_callback = tox_friend_message_cb(callback) + self.libtoxcore.tox_callback_friend_message(self._tox_pointer, c_callback, c_void_p(user_data)) + + # TODO File transmission: common between sending and receiving + + # TODO File transmission: sending + + # TODO File transmission: receiving + + # TODO Group chat management + + # TODO Group chat message sending and receiving + + # TODO Low-level custom packet sending and receiving + + # TODO Low-level network information + def __del__(self): if hasattr(self, 'tox_options'): self.libtoxcore.tox_kill(self._tox_pointer)