| 2941 |
2941 |
| 2942 FbApiThread * |
2942 FbApiThread * |
| 2943 fb_api_thread_dup(const FbApiThread *thrd, gboolean deep) |
2943 fb_api_thread_dup(const FbApiThread *thrd, gboolean deep) |
| 2944 { |
2944 { |
| 2945 FbApiThread *ret; |
2945 FbApiThread *ret; |
| |
2946 FbApiUser *user; |
| |
2947 GSList *l; |
| 2946 |
2948 |
| 2947 if (thrd == NULL) { |
2949 if (thrd == NULL) { |
| 2948 return g_new0(FbApiThread, 1); |
2950 return g_new0(FbApiThread, 1); |
| 2949 } |
2951 } |
| 2950 |
2952 |
| 2951 ret = g_memdup(thrd, sizeof *thrd); |
2953 ret = g_memdup(thrd, sizeof *thrd); |
| 2952 |
2954 |
| 2953 if (deep) { |
2955 if (deep) { |
| |
2956 ret->users = NULL; |
| |
2957 |
| |
2958 for (l = thrd->users; l != NULL; l = l->next) { |
| |
2959 user = fb_api_user_dup(l->data, TRUE); |
| |
2960 ret->users = g_slist_prepend(ret->users, user); |
| |
2961 } |
| |
2962 |
| 2954 ret->topic = g_strdup(thrd->topic); |
2963 ret->topic = g_strdup(thrd->topic); |
| 2955 ret->users = g_slist_copy_deep(thrd->users, |
2964 ret->users = g_slist_reverse(ret->users); |
| 2956 (GCopyFunc) fb_api_user_dup, |
|
| 2957 GINT_TO_POINTER(deep)); |
|
| 2958 } |
2965 } |
| 2959 |
2966 |
| 2960 return ret; |
2967 return ret; |
| 2961 } |
2968 } |
| 2962 |
2969 |