summaryrefslogtreecommitdiff
path: root/testing/irc_syncbot.c
diff options
context:
space:
mode:
Diffstat (limited to 'testing/irc_syncbot.c')
-rw-r--r--testing/irc_syncbot.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/testing/irc_syncbot.c b/testing/irc_syncbot.c
index 83b86a19..329dfb85 100644
--- a/testing/irc_syncbot.c
+++ b/testing/irc_syncbot.c
@@ -94,7 +94,7 @@ static void callback_group_invite(Tox *tox, uint32_t fid, TOX_CONFERENCE_TYPE ty
94 void *userdata) 94 void *userdata)
95{ 95{
96 if (current_group == -1) { 96 if (current_group == -1) {
97 current_group = tox_conference_join(tox, fid, data, length, NULL); 97 current_group = tox_conference_join(tox, fid, data, length, nullptr);
98 } 98 }
99} 99}
100 100
@@ -103,13 +103,13 @@ static void callback_friend_message(Tox *tox, uint32_t fid, TOX_MESSAGE_TYPE typ
103 void *userdata) 103 void *userdata)
104{ 104{
105 if (length == 1 && *message == 'c') { 105 if (length == 1 && *message == 'c') {
106 if (tox_conference_delete(tox, current_group, NULL) == 0) { 106 if (tox_conference_delete(tox, current_group, nullptr) == 0) {
107 current_group = -1; 107 current_group = -1;
108 } 108 }
109 } 109 }
110 110
111 if (length == 1 && *message == 'i') { 111 if (length == 1 && *message == 'i') {
112 tox_conference_invite(tox, fid, current_group, NULL); 112 tox_conference_invite(tox, fid, current_group, nullptr);
113 } 113 }
114 114
115 if (length == 1 && *message == 'j' && sock >= 0) { 115 if (length == 1 && *message == 'j' && sock >= 0) {
@@ -121,14 +121,14 @@ static void copy_groupmessage(Tox *tox, uint32_t groupnumber, uint32_t friendgro
121 const uint8_t *message, size_t length, 121 const uint8_t *message, size_t length,
122 void *userdata) 122 void *userdata)
123{ 123{
124 if (tox_conference_peer_number_is_ours(tox, groupnumber, friendgroupnumber, NULL)) { 124 if (tox_conference_peer_number_is_ours(tox, groupnumber, friendgroupnumber, nullptr)) {
125 return; 125 return;
126 } 126 }
127 127
128 TOX_ERR_CONFERENCE_PEER_QUERY error; 128 TOX_ERR_CONFERENCE_PEER_QUERY error;
129 size_t namelen = tox_conference_peer_get_name_size(tox, groupnumber, friendgroupnumber, &error); 129 size_t namelen = tox_conference_peer_get_name_size(tox, groupnumber, friendgroupnumber, &error);
130 uint8_t name[TOX_MAX_NAME_LENGTH]; 130 uint8_t name[TOX_MAX_NAME_LENGTH];
131 tox_conference_peer_get_name(tox, groupnumber, friendgroupnumber, name, NULL); 131 tox_conference_peer_get_name(tox, groupnumber, friendgroupnumber, name, nullptr);
132 132
133 if (namelen == 0 || error != TOX_ERR_CONFERENCE_PEER_QUERY_OK) { 133 if (namelen == 0 || error != TOX_ERR_CONFERENCE_PEER_QUERY_OK) {
134 memcpy(name, "<unknown>", 9); 134 memcpy(name, "<unknown>", 9);
@@ -205,7 +205,7 @@ static void send_irc_group(Tox *tox, uint8_t *msg, uint16_t len)
205 205
206 uint8_t *pmsg = (uint8_t *)strstr((char *)req, " PRIVMSG"); 206 uint8_t *pmsg = (uint8_t *)strstr((char *)req, " PRIVMSG");
207 207
208 if (pmsg == NULL) { 208 if (pmsg == nullptr) {
209 return; 209 return;
210 } 210 }
211 211
@@ -227,7 +227,7 @@ static void send_irc_group(Tox *tox, uint8_t *msg, uint16_t len)
227 227
228 memcpy(message + length, msg + req_len + 2, len - (req_len + 2)); 228 memcpy(message + length, msg + req_len + 2, len - (req_len + 2));
229 length += len - (req_len + 2); 229 length += len - (req_len + 2);
230 tox_conference_send_message(tox, current_group, TOX_MESSAGE_TYPE_NORMAL, message, length, NULL); 230 tox_conference_send_message(tox, current_group, TOX_MESSAGE_TYPE_NORMAL, message, length, nullptr);
231} 231}
232 232
233static Tox *init_tox(int argc, char *argv[]) 233static Tox *init_tox(int argc, char *argv[])
@@ -377,7 +377,7 @@ int main(int argc, char *argv[])
377 } 377 }
378 } 378 }
379 379
380 tox_iterate(tox, NULL); 380 tox_iterate(tox, nullptr);
381 usleep(1000 * 50); 381 usleep(1000 * 50);
382 } 382 }
383} 383}