| 109 { |
109 { |
| 110 g_return_if_fail(obj != NULL); |
110 g_return_if_fail(obj != NULL); |
| 111 |
111 |
| 112 g_free(obj->creator); |
112 g_free(obj->creator); |
| 113 g_free(obj->location); |
113 g_free(obj->location); |
| 114 g_free(obj->real_location); |
|
| 115 g_free(obj->friendly); |
114 g_free(obj->friendly); |
| 116 g_free(obj->sha1d); |
115 g_free(obj->sha1d); |
| 117 g_free(obj->sha1c); |
116 g_free(obj->sha1c); |
| |
117 |
| |
118 purple_imgstore_unref(obj->img); |
| 118 |
119 |
| 119 if (obj->local) |
120 if (obj->local) |
| 120 local_objs = g_list_remove(local_objs, obj); |
121 local_objs = g_list_remove(local_objs, obj); |
| 121 |
122 |
| 122 g_free(obj); |
123 g_free(obj); |
| 315 |
316 |
| 316 local_objs = g_list_append(local_objs, obj); |
317 local_objs = g_list_append(local_objs, obj); |
| 317 } |
318 } |
| 318 |
319 |
| 319 void |
320 void |
| 320 msn_object_set_real_location(MsnObject *obj, const char *real_location) |
321 msn_object_set_image(MsnObject *obj, PurpleStoredImage *img) |
| 321 { |
322 { |
| 322 g_return_if_fail(obj != NULL); |
323 g_return_if_fail(obj != NULL); |
| |
324 g_return_if_fail(img != NULL); |
| 323 |
325 |
| 324 /* obj->local = TRUE; */ |
326 /* obj->local = TRUE; */ |
| 325 |
327 |
| 326 if (obj->real_location != NULL) |
328 purple_imgstore_unref(obj->img); |
| 327 g_free(obj->real_location); |
329 obj->img = purple_imgstore_ref(img); |
| 328 |
330 } |
| 329 obj->real_location = |
331 |
| 330 (real_location == NULL ? NULL : g_strdup(real_location)); |
332 PurpleStoredImage * |
| 331 } |
333 msn_object_get_image(const MsnObject *obj) |
| 332 |
|
| 333 const char * |
|
| 334 msn_object_get_real_location(const MsnObject *obj) |
|
| 335 { |
334 { |
| 336 MsnObject *local_obj; |
335 MsnObject *local_obj; |
| 337 |
336 |
| 338 g_return_val_if_fail(obj != NULL, NULL); |
337 g_return_val_if_fail(obj != NULL, NULL); |
| 339 |
338 |
| 340 local_obj = msn_object_find_local(msn_object_get_sha1(obj)); |
339 local_obj = msn_object_find_local(msn_object_get_sha1(obj)); |
| 341 |
340 |
| 342 if (local_obj != NULL) |
341 if (local_obj != NULL) |
| 343 return local_obj->real_location; |
342 return local_obj->img; |
| 344 |
343 |
| 345 return NULL; |
344 return NULL; |
| 346 } |
345 } |