summaryrefslogtreecommitdiff
path: root/auto_tests/conference_test.c
diff options
context:
space:
mode:
authorzugz (tox) <mbays+tox@sdf.org>2018-08-02 19:23:34 +0100
committerzugz (tox) <mbays+tox@sdf.org>2018-08-12 22:46:06 +0200
commitd56ab5aaff5fab7ac707a5c914d3701f43eb2ba3 (patch)
tree161278ec297d281d1c39f1f337fe67eb52865c4c /auto_tests/conference_test.c
parent4ed6e5999226f9061f546108c5be72fe6f21a775 (diff)
add callback for successful connection to a conference
Diffstat (limited to 'auto_tests/conference_test.c')
-rw-r--r--auto_tests/conference_test.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/auto_tests/conference_test.c b/auto_tests/conference_test.c
index fd4f41b4..8f8f9357 100644
--- a/auto_tests/conference_test.c
+++ b/auto_tests/conference_test.c
@@ -70,7 +70,7 @@ static void handle_conference_invite(
70 "tox #%u: joining groupchat twice should be impossible.", state->id); 70 "tox #%u: joining groupchat twice should be impossible.", state->id);
71} 71}
72 72
73static void handle_conference_peer_list_changed( 73static void handle_conference_connected(
74 Tox *tox, uint32_t conference_number, void *user_data) 74 Tox *tox, uint32_t conference_number, void *user_data)
75{ 75{
76 State *state = (State *)user_data; 76 State *state = (State *)user_data;
@@ -79,15 +79,6 @@ static void handle_conference_peer_list_changed(
79 return; 79 return;
80 } 80 }
81 81
82 // TODO(zugz): neater way to determine whether we are connected, and when
83 // we become so
84 TOX_ERR_CONFERENCE_PEER_QUERY peer_err;
85 tox_conference_peer_number_is_ours(tox, 0, 0, &peer_err);
86
87 if (peer_err != TOX_ERR_CONFERENCE_PEER_QUERY_OK) {
88 return;
89 }
90
91 TOX_ERR_CONFERENCE_INVITE err; 82 TOX_ERR_CONFERENCE_INVITE err;
92 tox_conference_invite(tox, 1, 0, &err); 83 tox_conference_invite(tox, 1, 0, &err);
93 ck_assert_msg(err == TOX_ERR_CONFERENCE_INVITE_OK, "tox #%u failed to invite next friend: err = %d", state->id, err); 84 ck_assert_msg(err == TOX_ERR_CONFERENCE_INVITE_OK, "tox #%u failed to invite next friend: err = %d", state->id, err);
@@ -190,7 +181,7 @@ static void test_many_group(void)
190 tox_callback_self_connection_status(toxes[i], &handle_self_connection_status); 181 tox_callback_self_connection_status(toxes[i], &handle_self_connection_status);
191 tox_callback_friend_connection_status(toxes[i], &handle_friend_connection_status); 182 tox_callback_friend_connection_status(toxes[i], &handle_friend_connection_status);
192 tox_callback_conference_invite(toxes[i], &handle_conference_invite); 183 tox_callback_conference_invite(toxes[i], &handle_conference_invite);
193 tox_callback_conference_peer_list_changed(toxes[i], &handle_conference_peer_list_changed); 184 tox_callback_conference_connected(toxes[i], &handle_conference_connected);
194 185
195 char name[NAMELEN + 1]; 186 char name[NAMELEN + 1];
196 snprintf(name, NAMELEN + 1, NAME_FORMAT_STR, state[i].id); 187 snprintf(name, NAMELEN + 1, NAME_FORMAT_STR, state[i].id);