diff options
Diffstat (limited to 'toxcore/group.c')
-rw-r--r-- | toxcore/group.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/toxcore/group.c b/toxcore/group.c index eb84703d..9fafd8fc 100644 --- a/toxcore/group.c +++ b/toxcore/group.c | |||
@@ -1670,25 +1670,24 @@ uint32_t count_chatlist(Group_Chats *g_c) | |||
1670 | * Otherwise, returns the number of elements copied. | 1670 | * Otherwise, returns the number of elements copied. |
1671 | * If the array was too small, the contents | 1671 | * If the array was too small, the contents |
1672 | * of out_list will be truncated to list_size. */ | 1672 | * of out_list will be truncated to list_size. */ |
1673 | /* | 1673 | uint32_t copy_chatlist(Group_Chats *g_c, int32_t *out_list, uint32_t list_size) |
1674 | uint32_t copy_chatlist(const Messenger *m, int *out_list, uint32_t list_size) | ||
1675 | { | 1674 | { |
1676 | if (!out_list) | 1675 | if (!out_list) { |
1677 | return 0; | 1676 | return 0; |
1677 | } | ||
1678 | 1678 | ||
1679 | if (m->numchats == 0) { | 1679 | if (g_c->num_chats == 0) { |
1680 | return 0; | 1680 | return 0; |
1681 | } | 1681 | } |
1682 | 1682 | ||
1683 | uint32_t i; | 1683 | uint32_t i, ret = 0; |
1684 | uint32_t ret = 0; | ||
1685 | 1684 | ||
1686 | for (i = 0; i < m->numchats; i++) { | 1685 | for (i = 0; i < g_c->num_chats; ++i) { |
1687 | if (ret >= list_size) { | 1686 | if (ret >= list_size) { |
1688 | break; *//* Abandon ship *//* | 1687 | break; /* Abandon ship */ |
1689 | } | 1688 | } |
1690 | 1689 | ||
1691 | if (m->chats[i]) { | 1690 | if (g_c->chats[i].status > GROUPCHAT_STATUS_NONE) { |
1692 | out_list[ret] = i; | 1691 | out_list[ret] = i; |
1693 | ret++; | 1692 | ret++; |
1694 | } | 1693 | } |
@@ -1696,4 +1695,3 @@ uint32_t copy_chatlist(const Messenger *m, int *out_list, uint32_t list_size) | |||
1696 | 1695 | ||
1697 | return ret; | 1696 | return ret; |
1698 | } | 1697 | } |
1699 | */ | ||