summaryrefslogtreecommitdiff
path: root/protocols/Tox/libtox/src/toxcore/tox.h
diff options
context:
space:
mode:
authoraunsane <aunsane@gmail.com>2018-03-03 16:35:09 +0300
committeraunsane <aunsane@gmail.com>2018-03-03 16:35:33 +0300
commitfa58f69fe117640e29cefb1b699bede4d045bc2f (patch)
treea1bf8406d63e2b246bebdc572ceccfaabcffa359 /protocols/Tox/libtox/src/toxcore/tox.h
parent0e8f5a3aa5f5e73b413c5646444751783e367f2b (diff)
Tox:
- updated toxcore due to release v0.2 - removed message correction - reworked nodes update
Diffstat (limited to 'protocols/Tox/libtox/src/toxcore/tox.h')
-rw-r--r--protocols/Tox/libtox/src/toxcore/tox.h91
1 files changed, 51 insertions, 40 deletions
diff --git a/protocols/Tox/libtox/src/toxcore/tox.h b/protocols/Tox/libtox/src/toxcore/tox.h
index f4f3d06639..41a0994ed6 100644
--- a/protocols/Tox/libtox/src/toxcore/tox.h
+++ b/protocols/Tox/libtox/src/toxcore/tox.h
@@ -191,19 +191,19 @@ uint32_t tox_version_patch(void);
* features, but can't break the API.
*/
#define TOX_VERSION_IS_API_COMPATIBLE(MAJOR, MINOR, PATCH) \
- (TOX_VERSION_MAJOR > 0 && TOX_VERSION_MAJOR == MAJOR) && ( \
+ ((TOX_VERSION_MAJOR > 0 && TOX_VERSION_MAJOR == MAJOR) && ( \
/* 1.x.x, 2.x.x, etc. with matching major version. */ \
TOX_VERSION_MINOR > MINOR || \
- TOX_VERSION_MINOR == MINOR && TOX_VERSION_PATCH >= PATCH \
- ) || (TOX_VERSION_MAJOR == 0 && MAJOR == 0) && ( \
+ (TOX_VERSION_MINOR == MINOR && TOX_VERSION_PATCH >= PATCH) \
+ )) || ((TOX_VERSION_MAJOR == 0 && MAJOR == 0) && ( \
/* 0.x.x makes minor behave like major above. */ \
- (TOX_VERSION_MINOR > 0 && TOX_VERSION_MINOR == MINOR) && ( \
+ ((TOX_VERSION_MINOR > 0 && TOX_VERSION_MINOR == MINOR) && ( \
TOX_VERSION_PATCH >= PATCH \
- ) || (TOX_VERSION_MINOR == 0 && MINOR == 0) && ( \
+ )) || ((TOX_VERSION_MINOR == 0 && MINOR == 0) && ( \
/* 0.0.x and 0.0.y are only compatible if x == y. */ \
TOX_VERSION_PATCH == PATCH \
- ) \
- )
+ )) \
+ ))
/**
* Return whether the compiled library version is compatible with the passed
@@ -266,6 +266,8 @@ uint32_t tox_address_size(void);
/**
* Maximum length of a nickname in bytes.
+ *
+ * @deprecated The macro will be removed in 0.3.0. Use the function instead.
*/
#define TOX_MAX_NAME_LENGTH 128
@@ -273,6 +275,8 @@ uint32_t tox_max_name_length(void);
/**
* Maximum length of a status message in bytes.
+ *
+ * @deprecated The macro will be removed in 0.3.0. Use the function instead.
*/
#define TOX_MAX_STATUS_MESSAGE_LENGTH 1007
@@ -280,6 +284,8 @@ uint32_t tox_max_status_message_length(void);
/**
* Maximum length of a friend request message in bytes.
+ *
+ * @deprecated The macro will be removed in 0.3.0. Use the function instead.
*/
#define TOX_MAX_FRIEND_REQUEST_LENGTH 1016
@@ -287,6 +293,8 @@ uint32_t tox_max_friend_request_length(void);
/**
* Maximum length of a single message after which it should be split.
+ *
+ * @deprecated The macro will be removed in 0.3.0. Use the function instead.
*/
#define TOX_MAX_MESSAGE_LENGTH 1372
@@ -294,6 +302,8 @@ uint32_t tox_max_message_length(void);
/**
* Maximum size of custom packets. TODO(iphydf): should be LENGTH?
+ *
+ * @deprecated The macro will be removed in 0.3.0. Use the function instead.
*/
#define TOX_MAX_CUSTOM_PACKET_SIZE 1373
@@ -315,6 +325,8 @@ uint32_t tox_file_id_length(void);
/**
* Maximum file name length for file transfers.
+ *
+ * @deprecated The macro will be removed in 0.3.0. Use the function instead.
*/
#define TOX_MAX_FILENAME_LENGTH 255
@@ -371,12 +383,6 @@ typedef enum TOX_MESSAGE_TYPE {
*/
TOX_MESSAGE_TYPE_ACTION,
- /**
- * Correction of the last message. With empty message body can be used to mark
- * last message as deleted.
- */
- TOX_MESSAGE_TYPE_CORRECTION,
-
} TOX_MESSAGE_TYPE;
@@ -500,7 +506,7 @@ typedef void tox_log_cb(Tox *tox, TOX_LOG_LEVEL level, const char *file, uint32_
* @deprecated The memory layout of this struct (size, alignment, and field
* order) is not part of the ABI. To remain compatible, prefer to use tox_options_new to
* allocate the object and accessor functions to set the members. The struct
- * will become opaque (i.e. the definition will become private) in v0.2.0.
+ * will become opaque (i.e. the definition will become private) in v0.3.0.
*/
struct Tox_Options {
@@ -962,6 +968,9 @@ typedef enum TOX_CONNECTION {
/**
* Return whether we are connected to the DHT. The return value is equal to the
* last value received through the `self_connection_status` callback.
+ *
+ * @deprecated This getter is deprecated. Use the event and store the status
+ * in the client state.
*/
TOX_CONNECTION tox_self_get_connection_status(const Tox *tox);
@@ -1531,6 +1540,9 @@ void tox_callback_friend_status_message(Tox *tox, tox_friend_status_message_cb *
*
* The status returned is equal to the last status received through the
* `friend_status` callback.
+ *
+ * @deprecated This getter is deprecated. Use the event and store the status
+ * in the client state.
*/
TOX_USER_STATUS tox_friend_get_status(const Tox *tox, uint32_t friend_number, TOX_ERR_FRIEND_QUERY *error);
@@ -1560,6 +1572,9 @@ void tox_callback_friend_status(Tox *tox, tox_friend_status_cb *callback);
*
* @return the friend's connection status as it was received through the
* `friend_connection_status` event.
+ *
+ * @deprecated This getter is deprecated. Use the event and store the status
+ * in the client state.
*/
TOX_CONNECTION tox_friend_get_connection_status(const Tox *tox, uint32_t friend_number, TOX_ERR_FRIEND_QUERY *error);
@@ -1592,6 +1607,9 @@ void tox_callback_friend_connection_status(Tox *tox, tox_friend_connection_statu
* @return true if the friend is typing.
* @return false if the friend is not typing, or the friend number was
* invalid. Inspect the error code to determine which case it is.
+ *
+ * @deprecated This getter is deprecated. Use the event and store the status
+ * in the client state.
*/
bool tox_friend_get_typing(const Tox *tox, uint32_t friend_number, TOX_ERR_FRIEND_QUERY *error);
@@ -2394,43 +2412,36 @@ typedef void tox_conference_title_cb(Tox *tox, uint32_t conference_number, uint3
void tox_callback_conference_title(Tox *tox, tox_conference_title_cb *callback);
/**
- * Peer list state change types.
+ * @param conference_number The conference number of the conference the
+ * peer is in.
+ * @param peer_number The ID of the peer who changed their nickname.
+ * @param name A byte array containing the new nickname.
+ * @param length The size of the name byte array.
*/
-typedef enum TOX_CONFERENCE_STATE_CHANGE {
+typedef void tox_conference_peer_name_cb(Tox *tox, uint32_t conference_number, uint32_t peer_number,
+ const uint8_t *name, size_t length, void *user_data);
- /**
- * A peer has joined the conference.
- */
- TOX_CONFERENCE_STATE_CHANGE_PEER_JOIN,
-
- /**
- * A peer has exited the conference.
- */
- TOX_CONFERENCE_STATE_CHANGE_PEER_EXIT,
-
- /**
- * A peer has changed their name.
- */
- TOX_CONFERENCE_STATE_CHANGE_PEER_NAME_CHANGE,
-
-} TOX_CONFERENCE_STATE_CHANGE;
+/**
+ * Set the callback for the `conference_peer_name` event. Pass NULL to unset.
+ *
+ * This event is triggered when a peer changes their name.
+ */
+void tox_callback_conference_peer_name(Tox *tox, tox_conference_peer_name_cb *callback);
/**
- * @param conference_number The conference number of the conference the title change is intended for.
- * @param peer_number The ID of the peer who changed the title.
- * @param change The type of change (one of TOX_CONFERENCE_STATE_CHANGE).
+ * @param conference_number The conference number of the conference the
+ * peer is in.
*/
-typedef void tox_conference_namelist_change_cb(Tox *tox, uint32_t conference_number, uint32_t peer_number,
- TOX_CONFERENCE_STATE_CHANGE change, void *user_data);
+typedef void tox_conference_peer_list_changed_cb(Tox *tox, uint32_t conference_number, void *user_data);
/**
- * Set the callback for the `conference_namelist_change` event. Pass NULL to unset.
+ * Set the callback for the `conference_peer_list_changed` event. Pass NULL to unset.
*
- * This event is triggered when the peer list changes (name change, peer join, peer exit).
+ * This event is triggered when a peer joins or leaves the conference.
*/
-void tox_callback_conference_namelist_change(Tox *tox, tox_conference_namelist_change_cb *callback);
+void tox_callback_conference_peer_list_changed(Tox *tox, tox_conference_peer_list_changed_cb *callback);
typedef enum TOX_ERR_CONFERENCE_NEW {