Mercurial > pidgin.yaz
comparison libpurple/protocols/jabber/caps.c @ 25750:30a686c079d5
Remove JabberCapsIdentity and just use JabberIdentity everywhere
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Fri, 21 Nov 2008 18:24:31 +0000 |
parents | b5dbf1d9930b |
children | 27a9672371f1 |
comparison
equal
deleted
inserted
replaced
25749:b5dbf1d9930b | 25750:30a686c079d5 |
---|---|
68 } | 68 } |
69 | 69 |
70 static void jabber_caps_destroy_value(gpointer value) { | 70 static void jabber_caps_destroy_value(gpointer value) { |
71 JabberCapsValue *valuestruct = value; | 71 JabberCapsValue *valuestruct = value; |
72 while(valuestruct->identities) { | 72 while(valuestruct->identities) { |
73 JabberCapsIdentity *id = valuestruct->identities->data; | 73 JabberIdentity *id = valuestruct->identities->data; |
74 g_free(id->category); | 74 g_free(id->category); |
75 g_free(id->type); | 75 g_free(id->type); |
76 g_free(id->name); | 76 g_free(id->name); |
77 g_free(id); | 77 g_free(id); |
78 | 78 |
151 } else if(!strcmp(child->name,"identity")) { | 151 } else if(!strcmp(child->name,"identity")) { |
152 const char *category = xmlnode_get_attrib(child, "category"); | 152 const char *category = xmlnode_get_attrib(child, "category"); |
153 const char *type = xmlnode_get_attrib(child, "type"); | 153 const char *type = xmlnode_get_attrib(child, "type"); |
154 const char *name = xmlnode_get_attrib(child, "name"); | 154 const char *name = xmlnode_get_attrib(child, "name"); |
155 | 155 |
156 JabberCapsIdentity *id = g_new0(JabberCapsIdentity, 1); | 156 JabberIdentity *id = g_new0(JabberIdentity, 1); |
157 id->category = g_strdup(category); | 157 id->category = g_strdup(category); |
158 id->type = g_strdup(type); | 158 id->type = g_strdup(type); |
159 id->name = g_strdup(name); | 159 id->name = g_strdup(name); |
160 | 160 |
161 value->identities = g_list_append(value->identities,id); | 161 value->identities = g_list_append(value->identities,id); |
205 | 205 |
206 xmlnode_set_attrib(client, "node", clientinfo->node); | 206 xmlnode_set_attrib(client, "node", clientinfo->node); |
207 xmlnode_set_attrib(client, "ver", clientinfo->ver); | 207 xmlnode_set_attrib(client, "ver", clientinfo->ver); |
208 xmlnode_set_attrib(client, "hash", clientinfo->hash); | 208 xmlnode_set_attrib(client, "hash", clientinfo->hash); |
209 for(iter = props->identities; iter; iter = g_list_next(iter)) { | 209 for(iter = props->identities; iter; iter = g_list_next(iter)) { |
210 JabberCapsIdentity *id = iter->data; | 210 JabberIdentity *id = iter->data; |
211 xmlnode *identity = xmlnode_new_child(client, "identity"); | 211 xmlnode *identity = xmlnode_new_child(client, "identity"); |
212 xmlnode_set_attrib(identity, "category", id->category); | 212 xmlnode_set_attrib(identity, "category", id->category); |
213 xmlnode_set_attrib(identity, "type", id->type); | 213 xmlnode_set_attrib(identity, "type", id->type); |
214 if (id->name) | 214 if (id->name) |
215 xmlnode_set_attrib(identity, "name", id->name); | 215 xmlnode_set_attrib(identity, "name", id->name); |
305 | 305 |
306 void jabber_caps_free_clientinfo(JabberCapsClientInfo *clientinfo) { | 306 void jabber_caps_free_clientinfo(JabberCapsClientInfo *clientinfo) { |
307 if(!clientinfo) | 307 if(!clientinfo) |
308 return; | 308 return; |
309 while(clientinfo->identities) { | 309 while(clientinfo->identities) { |
310 JabberCapsIdentity *id = clientinfo->identities->data; | 310 JabberIdentity *id = clientinfo->identities->data; |
311 g_free(id->category); | 311 g_free(id->category); |
312 g_free(id->type); | 312 g_free(id->type); |
313 g_free(id->name); | 313 g_free(id->name); |
314 g_free(id); | 314 g_free(id); |
315 | 315 |
491 } else if(!strcmp(child->name,"identity")) { | 491 } else if(!strcmp(child->name,"identity")) { |
492 const char *category = xmlnode_get_attrib(child, "category"); | 492 const char *category = xmlnode_get_attrib(child, "category"); |
493 const char *type = xmlnode_get_attrib(child, "type"); | 493 const char *type = xmlnode_get_attrib(child, "type"); |
494 const char *name = xmlnode_get_attrib(child, "name"); | 494 const char *name = xmlnode_get_attrib(child, "name"); |
495 | 495 |
496 JabberCapsIdentity *id = g_new0(JabberCapsIdentity, 1); | 496 JabberIdentity *id = g_new0(JabberIdentity, 1); |
497 id->category = g_strdup(category); | 497 id->category = g_strdup(category); |
498 id->type = g_strdup(type); | 498 id->type = g_strdup(type); |
499 id->name = g_strdup(name); | 499 id->name = g_strdup(name); |
500 | 500 |
501 value->identities = g_list_append(value->identities,id); | 501 value->identities = g_list_append(value->identities,id); |
676 /* parse identity */ | 676 /* parse identity */ |
677 const char *category = xmlnode_get_attrib(child, "category"); | 677 const char *category = xmlnode_get_attrib(child, "category"); |
678 const char *type = xmlnode_get_attrib(child, "type"); | 678 const char *type = xmlnode_get_attrib(child, "type"); |
679 const char *name = xmlnode_get_attrib(child, "name"); | 679 const char *name = xmlnode_get_attrib(child, "name"); |
680 | 680 |
681 JabberCapsIdentity *id = g_new0(JabberCapsIdentity, 1); | 681 JabberIdentity *id = g_new0(JabberIdentity, 1); |
682 id->category = g_strdup(category); | 682 id->category = g_strdup(category); |
683 id->type = g_strdup(type); | 683 id->type = g_strdup(type); |
684 id->name = g_strdup(name); | 684 id->name = g_strdup(name); |
685 | 685 |
686 info->identities = g_list_append(info->identities, id); | 686 info->identities = g_list_append(info->identities, id); |