diff options
Diffstat (limited to 'toxcore/Messenger.c')
-rw-r--r-- | toxcore/Messenger.c | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index a78b06b6..d99b0027 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c | |||
@@ -2839,36 +2839,3 @@ uint32_t copy_friendlist(Messenger const *m, int32_t *out_list, uint32_t list_si | |||
2839 | 2839 | ||
2840 | return ret; | 2840 | return ret; |
2841 | } | 2841 | } |
2842 | |||
2843 | /* Allocate and return a list of valid friend id's. List must be freed by the | ||
2844 | * caller. | ||
2845 | * | ||
2846 | * retun 0 if success. | ||
2847 | * return -1 if failure. | ||
2848 | */ | ||
2849 | int get_friendlist(const Messenger *m, int32_t **out_list, uint32_t *out_list_length) | ||
2850 | { | ||
2851 | uint32_t i; | ||
2852 | |||
2853 | *out_list_length = 0; | ||
2854 | |||
2855 | if (m->numfriends == 0) { | ||
2856 | *out_list = NULL; | ||
2857 | return 0; | ||
2858 | } | ||
2859 | |||
2860 | *out_list = malloc(m->numfriends * sizeof(int32_t)); | ||
2861 | |||
2862 | if (*out_list == NULL) { | ||
2863 | return -1; | ||
2864 | } | ||
2865 | |||
2866 | for (i = 0; i < m->numfriends; i++) { | ||
2867 | if (m->friendlist[i].status > 0) { | ||
2868 | (*out_list)[i] = i; | ||
2869 | (*out_list_length)++; | ||
2870 | } | ||
2871 | } | ||
2872 | |||
2873 | return 0; | ||
2874 | } | ||