diff options
Diffstat (limited to 'toxcore')
-rw-r--r-- | toxcore/Messenger.c | 33 | ||||
-rw-r--r-- | toxcore/Messenger.h | 8 |
2 files changed, 0 insertions, 41 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 | } | ||
diff --git a/toxcore/Messenger.h b/toxcore/Messenger.h index 42919a0d..6b7b5000 100644 --- a/toxcore/Messenger.h +++ b/toxcore/Messenger.h | |||
@@ -914,12 +914,4 @@ uint32_t get_num_online_friends(const Messenger *m); | |||
914 | * of out_list will be truncated to list_size. */ | 914 | * of out_list will be truncated to list_size. */ |
915 | uint32_t copy_friendlist(const Messenger *m, int32_t *out_list, uint32_t list_size); | 915 | uint32_t copy_friendlist(const Messenger *m, int32_t *out_list, uint32_t list_size); |
916 | 916 | ||
917 | /* Allocate and return a list of valid friend id's. List must be freed by the | ||
918 | * caller. | ||
919 | * | ||
920 | * retun 0 if success. | ||
921 | * return -1 if failure. | ||
922 | */ | ||
923 | int get_friendlist(const Messenger *m, int **out_list, uint32_t *out_list_length); | ||
924 | |||
925 | #endif | 917 | #endif |