def callback_friend_connection_status(self, callback, user_data):
"""
Set the callback for the `friend_connection_status` event. Pass NULL to unset.
This event is triggered when a friend goes offline after having been online, or when a friend goes online.
This callback is not called when adding friends. It is assumed that when adding friends, their connection status
is initially offline.
:param callback: Python function. Should take pointer (c_void_p) to Tox object,
The friend number (c_uint32) of the friend whose connection status changed,
The result of calling tox_friend_get_connection_status (TOX_CONNECTION) on the passed friend_number,
pointer (c_void_p) to user_data
:param user_data: pointer (c_void_p) to user data
"""
c_callback = CFUNCTYPE(None, c_void_p, c_uint32, c_int, c_void_p)
self.friend_connection_status_cb = c_callback(callback)
Tox.libtoxcore.tox_callback_friend_connection_status(self._tox_pointer,
self.friend_connection_status_cb, c_void_p(user_data))
评论列表
文章目录