Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add missing ngc constants getter declarations and definitions #2383

Merged
merged 1 commit into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion other/bootstrap_daemon/docker/tox-bootstrapd.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
57f46dbb45034232c62e29ad31fd433ad298591fd9d3ea06b92040d33b8d8660 /usr/local/bin/tox-bootstrapd
93c9c4ba12e450afd01aabd31ae1da970c841e13984b68969d183b11e6266e1a /usr/local/bin/tox-bootstrapd
6 changes: 6 additions & 0 deletions toxcore/tox.h
Original file line number Diff line number Diff line change
Expand Up @@ -3303,16 +3303,22 @@ uint32_t tox_group_max_part_length(void);
*/
#define TOX_GROUP_MAX_MESSAGE_LENGTH 1372

uint32_t tox_group_max_message_length(void);

/**
* Maximum length of a group custom lossy packet.
*/
#define TOX_GROUP_MAX_CUSTOM_LOSSY_PACKET_LENGTH 500

uint32_t tox_group_max_custom_lossy_packet_length(void);

/**
* Maximum length of a group custom lossless packet.
*/
#define TOX_GROUP_MAX_CUSTOM_LOSSLESS_PACKET_LENGTH 1373

uint32_t tox_group_max_custom_lossless_packet_length(void);

/**
* Maximum length of a group name.
*/
Expand Down
36 changes: 36 additions & 0 deletions toxcore/tox_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,42 @@ uint32_t tox_max_hostname_length(void)
{
return TOX_MAX_HOSTNAME_LENGTH;
}
uint32_t tox_group_max_topic_length(void)
{
return TOX_GROUP_MAX_TOPIC_LENGTH;
}
uint32_t tox_group_max_part_length(void)
{
return TOX_GROUP_MAX_PART_LENGTH;
}
uint32_t tox_group_max_message_length(void)
{
return TOX_GROUP_MAX_MESSAGE_LENGTH;
}
uint32_t tox_group_max_custom_lossy_packet_length(void)
{
return TOX_GROUP_MAX_CUSTOM_LOSSY_PACKET_LENGTH;
}
uint32_t tox_group_max_custom_lossless_packet_length(void)
{
return TOX_GROUP_MAX_CUSTOM_LOSSLESS_PACKET_LENGTH;
}
uint32_t tox_group_max_group_name_length(void)
{
return TOX_GROUP_MAX_GROUP_NAME_LENGTH;
}
uint32_t tox_group_max_password_size(void)
{
return TOX_GROUP_MAX_PASSWORD_SIZE;
}
uint32_t tox_group_chat_id_size(void)
{
return TOX_GROUP_CHAT_ID_SIZE;
}
uint32_t tox_group_peer_public_key_size(void)
{
return TOX_GROUP_PEER_PUBLIC_KEY_SIZE;
}
uint32_t tox_dht_node_ip_string_size(void)
{
return TOX_DHT_NODE_IP_STRING_SIZE;
Expand Down
9 changes: 9 additions & 0 deletions toxcore/tox_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ TEST(Tox, ConstantsAreNonZero)
EXPECT_GT(tox_file_id_length(), 0);
EXPECT_GT(tox_max_filename_length(), 0);
EXPECT_GT(tox_max_hostname_length(), 0);
EXPECT_GT(tox_group_max_topic_length(), 0);
EXPECT_GT(tox_group_max_part_length(), 0);
EXPECT_GT(tox_group_max_message_length(), 0);
EXPECT_GT(tox_group_max_custom_lossy_packet_length(), 0);
EXPECT_GT(tox_group_max_custom_lossless_packet_length(), 0);
EXPECT_GT(tox_group_max_group_name_length(), 0);
EXPECT_GT(tox_group_max_password_size(), 0);
EXPECT_GT(tox_group_chat_id_size(), 0);
EXPECT_GT(tox_group_peer_public_key_size(), 0);
EXPECT_GT(tox_dht_node_ip_string_size(), 0);
EXPECT_GT(tox_dht_node_public_key_size(), 0);
}
Expand Down