diff --git a/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 b/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 index 8c915217..6b2fd809 100644 --- a/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 +++ b/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 @@ -1 +1 @@ -12972fcd956654a18e367e03d6bcaab12fbe2ae166dfc937474a7bd123e0910f /usr/local/bin/tox-bootstrapd +2e1ae94d48eb1793ec3b42ed1516c53fb0b6b0e41bc89160e6037ee881a872b4 /usr/local/bin/tox-bootstrapd diff --git a/toxcore/group_chats.c b/toxcore/group_chats.c index adc425eb..3b6d6197 100644 --- a/toxcore/group_chats.c +++ b/toxcore/group_chats.c @@ -3510,8 +3510,8 @@ unsigned int gc_get_peer_connection_status(const GC_Chat *chat, uint32_t peer_id { const int peer_number = get_peer_number_of_peer_id(chat, peer_id); - if (peer_number_is_self(peer_number)) { // we cannot have a connection with ourselves - return 0; + if (peer_number_is_self(peer_number)) { + return chat->self_udp_status == SELF_UDP_STATUS_NONE ? 1 : 2; } const GC_Connection *gconn = get_gc_connection(chat, peer_number); diff --git a/toxcore/group_chats.h b/toxcore/group_chats.h index 821e629a..656dd471 100644 --- a/toxcore/group_chats.h +++ b/toxcore/group_chats.h @@ -391,10 +391,13 @@ non_null(1) nullable(3) int gc_get_peer_public_key_by_peer_id(const GC_Chat *chat, uint32_t peer_id, uint8_t *public_key); /** @brief Gets the connection status for peer associated with `peer_id`. + * + * If `peer_id` designates ourself, the return value indicates whether we're capable + * of making UDP connections with other peers, or are limited to TCP connections. * * Returns 2 if we have a direct (UDP) connection with a peer. * Returns 1 if we have an indirect (TCP) connection with a peer. - * Returns 0 if peer_id is invalid or corresponds to ourselves. + * Returns 0 if peer_id is invalid. * * Note: Return values must correspond to Tox_Connection enum in API. */ diff --git a/toxcore/tox.h b/toxcore/tox.h index 23dca42f..8d816618 100644 --- a/toxcore/tox.h +++ b/toxcore/tox.h @@ -3967,7 +3967,8 @@ Tox_Group_Role tox_group_peer_get_role(const Tox *tox, uint32_t group_number, ui /** * Return the type of connection we have established with a peer. * - * This function will return an error if called on ourselves. + * If `peer_id` designates ourself, the return value indicates whether we're capable + * of making UDP connections with other peers, or are limited to TCP connections. * * @param group_number The group number of the group we wish to query. * @param peer_id The ID of the peer whose connection status we wish to query.