Skip to content

Commit 4e80d9c

Browse files
committed
Merge the remainder of the new groupchats implementation
Commit history: https://github.com/jfreegman/toxcore/tree/ngc_jf Spec: https://toktok.ltd/spec.html#dht-group-chats
1 parent 32ed67c commit 4e80d9c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+19847
-120
lines changed

.cirrus.yml

+1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ bazel-tsan_task:
9292
-//c-toxcore/auto_tests:conference_av_test
9393
-//c-toxcore/auto_tests:conference_test
9494
-//c-toxcore/auto_tests:file_transfer_test
95+
-//c-toxcore/auto_tests:group_tcp_test
9596
-//c-toxcore/auto_tests:onion_test
9697
-//c-toxcore/auto_tests:tcp_relay_test
9798
-//c-toxcore/auto_tests:tox_many_test

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ libtool
6565
.libs
6666
.dirstamp
6767
build/
68+
*.nvim*
69+
*.vim*
6870

6971
#kdevelop
7072
.kdev/
@@ -88,3 +90,5 @@ cscope.files
8890

8991
# rpm
9092
tox.spec
93+
94+
.idea/

CMakeLists.txt

+14
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ if(NOT USE_IPV6)
113113
add_definitions(-DUSE_IPV6=0)
114114
endif()
115115

116+
option(USE_TEST_NETWORK "Use a separate test network with different packet IDs" OFF)
117+
if(USE_TEST_NETWORK)
118+
add_definitions(-DUSE_TEST_NETWORK=1)
119+
endif()
120+
116121
option(BUILD_MISC_TESTS "Build additional tests and utilities" OFF)
117122
option(BUILD_FUN_UTILS "Build additional just for fun utilities" OFF)
118123

@@ -241,11 +246,20 @@ set(toxcore_SOURCES
241246
toxcore/friend_requests.c
242247
toxcore/friend_requests.h
243248
toxcore/group.c
249+
toxcore/group_chats.c
250+
toxcore/group_chats.h
251+
toxcore/group_common.h
252+
toxcore/group_connection.c
253+
toxcore/group_connection.h
244254
toxcore/group.h
245255
toxcore/group_announce.c
246256
toxcore/group_announce.h
247257
toxcore/group_moderation.c
248258
toxcore/group_moderation.h
259+
toxcore/group_onion_announce.c
260+
toxcore/group_onion_announce.h
261+
toxcore/group_pack.c
262+
toxcore/group_pack.h
249263
toxcore/LAN_discovery.c
250264
toxcore/LAN_discovery.h
251265
toxcore/list.c

auto_tests/BUILD.bazel

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ flaky_tests = {
4444
":check_compat",
4545
"//c-toxcore/testing:misc_tools",
4646
"//c-toxcore/toxav",
47+
"//c-toxcore/toxcore:Messenger",
4748
"//c-toxcore/toxcore:TCP_client",
4849
"//c-toxcore/toxcore:TCP_common",
4950
"//c-toxcore/toxcore:TCP_connection",

auto_tests/CMakeLists.txt

+9
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ auto_test(forwarding)
3636
auto_test(friend_connection)
3737
auto_test(friend_request)
3838
auto_test(friend_request_spam)
39+
auto_test(group_general)
40+
auto_test(group_invite)
41+
auto_test(group_message)
42+
auto_test(group_moderation)
43+
auto_test(group_save)
44+
auto_test(group_state)
45+
auto_test(group_sync)
46+
auto_test(group_tcp)
47+
auto_test(group_topic)
3948
auto_test(invalid_tcp_proxy)
4049
auto_test(invalid_udp_proxy)
4150
auto_test(lan_discovery)

auto_tests/Makefile.inc

+5
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ TESTS = \
1717
forwarding_test \
1818
friend_connection_test \
1919
friend_request_test \
20+
group_state_test \
2021
invalid_tcp_proxy_test \
2122
invalid_udp_proxy_test \
2223
lan_discovery_test \
@@ -126,6 +127,10 @@ friend_request_test_SOURCES = ../auto_tests/friend_request_test.c
126127
friend_request_test_CFLAGS = $(AUTOTEST_CFLAGS)
127128
friend_request_test_LDADD = $(AUTOTEST_LDADD)
128129

130+
group_state_test_SOURCES = ../auto_tests/group_state_test.c
131+
group_state_test_CFLAGS = $(AUTOTEST_CFLAGS)
132+
group_state_test_LDADD = $(AUTOTEST_LDADD)
133+
129134
invalid_tcp_proxy_test_SOURCES = ../auto_tests/invalid_tcp_proxy_test.c
130135
invalid_tcp_proxy_test_CFLAGS = $(AUTOTEST_CFLAGS)
131136
invalid_tcp_proxy_test_LDADD = $(AUTOTEST_LDADD)

auto_tests/auto_test_support.c

+7
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,13 @@ static const struct BootstrapNodes {
6565
0x65, 0x4A, 0x37, 0x58, 0xC5, 0x3E, 0x02, 0x73,
6666
0xEC, 0xFC, 0x4D, 0x12, 0xC2, 0x1D, 0xCA, 0x48,
6767
},
68+
{
69+
"tox.plastiras.org", 38445,
70+
0x5E, 0x47, 0xBA, 0x1D, 0xC3, 0x91, 0x3E, 0xB2,
71+
0xCB, 0xF2, 0xD6, 0x4C, 0xE4, 0xF2, 0x3D, 0x8B,
72+
0xFE, 0x53, 0x91, 0xBF, 0xAB, 0xE5, 0xC4, 0x3C,
73+
0x5B, 0xAD, 0x13, 0xF0, 0xA4, 0x14, 0xCD, 0x77,
74+
},
6875
#endif // USE_TEST_NETWORK
6976
{ nullptr, 0, 0 },
7077
};

0 commit comments

Comments
 (0)