mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
tox_count_chatlist() now works.
This commit is contained in:
parent
cfa142f471
commit
b41eadf695
|
@ -1630,21 +1630,21 @@ void kill_groupchats(Group_Chats *g_c)
|
|||
|
||||
/* Return the number of chats in the instance m.
|
||||
* You should use this to determine how much memory to allocate
|
||||
* for copy_chatlist. */
|
||||
/*
|
||||
uint32_t count_chatlist(const Messenger *m)
|
||||
* for copy_chatlist.
|
||||
*/
|
||||
uint32_t count_chatlist(Group_Chats *g_c)
|
||||
{
|
||||
uint32_t ret = 0;
|
||||
uint32_t i;
|
||||
|
||||
for (i = 0; i < m->numchats; i++) {
|
||||
if (m->chats[i]) {
|
||||
for (i = 0; i < g_c->num_chats; i++) {
|
||||
if (g_c->chats[i].status != GROUPCHAT_STATUS_NONE) {
|
||||
ret++;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}*/
|
||||
}
|
||||
|
||||
/* Copy a list of valid chat IDs into the array out_list.
|
||||
* If out_list is NULL, returns 0.
|
||||
|
|
|
@ -203,6 +203,12 @@ int group_number_peers(const Group_Chats *g_c, int groupnumber);
|
|||
int group_names(const Group_Chats *g_c, int groupnumber, uint8_t names[][MAX_NAME_LENGTH], uint16_t lengths[],
|
||||
uint16_t length);
|
||||
|
||||
/* Return the number of chats in the instance m.
|
||||
* You should use this to determine how much memory to allocate
|
||||
* for copy_chatlist.
|
||||
*/
|
||||
uint32_t count_chatlist(Group_Chats *g_c);
|
||||
|
||||
/* Send current name (set in messenger) to all online groups.
|
||||
*/
|
||||
void send_name_all_groups(Group_Chats *g_c);
|
||||
|
|
|
@ -704,8 +704,7 @@ int tox_group_get_names(const Tox *tox, int groupnumber, uint8_t names[][TOX_MAX
|
|||
uint32_t tox_count_chatlist(const Tox *tox)
|
||||
{
|
||||
const Messenger *m = tox;
|
||||
//return count_chatlist(m);
|
||||
return 0;
|
||||
return count_chatlist(m->group_chat_object);
|
||||
}
|
||||
|
||||
/* Copy a list of valid chat IDs into the array out_list.
|
||||
|
|
Loading…
Reference in New Issue
Block a user