summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2014-10-02 08:31:14 -0400
committerirungentoo <irungentoo@gmail.com>2014-10-02 08:31:14 -0400
commit1ac1522c39a1bd49aeef0be3d339f1740fffb663 (patch)
tree2d391bff0ae6dfba637bc5aa74bc135655dfb606
parente6fcef495848097bf9de35bea627f1d545586aed (diff)
Removed useless code.
-rw-r--r--toxcore/Messenger.c33
-rw-r--r--toxcore/Messenger.h8
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 */
2849int 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. */
915uint32_t copy_friendlist(const Messenger *m, int32_t *out_list, uint32_t list_size); 915uint32_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 */
923int get_friendlist(const Messenger *m, int **out_list, uint32_t *out_list_length);
924
925#endif 917#endif