Mercurial > pidgin
comparison libpurple/protocols/msn/object.c @ 32672:3828a61c44da
A boring and large patch so I can merge heads.
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Fri, 23 Dec 2011 08:21:58 +0000 |
parents | 2de522fa534a |
children |
comparison
equal
deleted
inserted
replaced
32671:0e69949b3e61 | 32672:3828a61c44da |
---|---|
101 | 101 |
102 /* If we are missing any of the required elements then discard the object */ | 102 /* If we are missing any of the required elements then discard the object */ |
103 if (obj->creator == NULL || obj->size == 0 || obj->type == 0 | 103 if (obj->creator == NULL || obj->size == 0 || obj->type == 0 |
104 || obj->sha1d == NULL) { | 104 || obj->sha1d == NULL) { |
105 purple_debug_error("msn", "Discarding invalid msnobj: '%s'\n", str); | 105 purple_debug_error("msn", "Discarding invalid msnobj: '%s'\n", str); |
106 msn_object_destroy(obj); | 106 msn_object_destroy(obj, FALSE); |
107 return NULL; | 107 return NULL; |
108 } | 108 } |
109 | 109 |
110 if (obj->location == NULL || obj->friendly == NULL) { | 110 if (obj->location == NULL || obj->friendly == NULL) { |
111 /* Location/friendly are required for non-buddyicon objects */ | 111 /* Location/friendly are required for non-buddyicon objects */ |
112 if (obj->type != MSN_OBJECT_USERTILE) { | 112 if (obj->type != MSN_OBJECT_USERTILE) { |
113 purple_debug_error("msn", "Discarding invalid msnobj: '%s'\n", str); | 113 purple_debug_error("msn", "Discarding invalid msnobj: '%s'\n", str); |
114 msn_object_destroy(obj); | 114 msn_object_destroy(obj, FALSE); |
115 return NULL; | 115 return NULL; |
116 /* Buddy icon object can contain Url/Url1 instead */ | 116 /* Buddy icon object can contain Url/Url1 instead */ |
117 } else if (obj->url == NULL || obj->url1 == NULL) { | 117 } else if (obj->url == NULL || obj->url1 == NULL) { |
118 purple_debug_error("msn", "Discarding invalid msnobj: '%s'\n", str); | 118 purple_debug_error("msn", "Discarding invalid msnobj: '%s'\n", str); |
119 msn_object_destroy(obj); | 119 msn_object_destroy(obj, FALSE); |
120 return NULL; | 120 return NULL; |
121 } | 121 } |
122 } | 122 } |
123 | 123 |
124 return obj; | 124 return obj; |
191 | 191 |
192 return msnobj; | 192 return msnobj; |
193 } | 193 } |
194 | 194 |
195 void | 195 void |
196 msn_object_destroy(MsnObject *obj) | 196 msn_object_destroy(MsnObject *obj, gboolean only_remote) |
197 { | 197 { |
198 g_return_if_fail(obj != NULL); | 198 g_return_if_fail(obj != NULL); |
199 | |
200 if (only_remote && obj->local) | |
201 return; | |
199 | 202 |
200 g_free(obj->creator); | 203 g_free(obj->creator); |
201 g_free(obj->location); | 204 g_free(obj->location); |
202 g_free(obj->friendly); | 205 g_free(obj->friendly); |
203 g_free(obj->sha1d); | 206 g_free(obj->sha1d); |