This function returns a list of users in the current channel, in one string, separated by spaces, terminated by a null (Spaces aren't allowed as part of a nickname)
| 381 | // string, separated by spaces, terminated by a null |
| 382 | // (Spaces aren't allowed as part of a nickname) |
| 383 | char *GetChatUserList() { |
| 384 | int iuser_list_length = 0; |
| 385 | ; |
| 386 | if (User_list) { |
| 387 | DLLmem_free(User_list); |
| 388 | User_list = nullptr; |
| 389 | } |
| 390 | if (!Socket_connected) |
| 391 | return nullptr; |
| 392 | |
| 393 | Curruser = Firstuser; |
| 394 | while (Curruser) { |
| 395 | iuser_list_length += strlen(Curruser->nick_name) + 1; |
| 396 | Curruser = Curruser->next; |
| 397 | } |
| 398 | Curruser = Firstuser; |
| 399 | User_list = (char *)DLLmem_malloc(iuser_list_length + 1); |
| 400 | User_list[0] = '\0'; |
| 401 | while (Curruser) { |
| 402 | strcat(User_list, Curruser->nick_name); |
| 403 | strcat(User_list, " "); |
| 404 | Curruser = Curruser->next; |
| 405 | } |
| 406 | |
| 407 | return User_list; |
| 408 | } |
| 409 | |
| 410 | // Call this to set/join a channel. Since we can't be sure that we will be |
| 411 | // able to join that channel, check it for completion |
no outgoing calls
no test coverage detected