Mercurial > pidgin
comparison libpurple/protocols/jabber/jabber.c @ 25167:860ebaf275ae
Add more jabber plugin unloading functions to clean up more data structures
In reality, probably not terribly useful since the entire program is about to quit.
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Sat, 22 Nov 2008 19:44:05 +0000 |
parents | 1b64942c5fb2 |
children | b1b1b75a922e |
comparison
equal
deleted
inserted
replaced
25166:18fdbe507fdd | 25167:860ebaf275ae |
---|---|
1516 break; | 1516 break; |
1517 } | 1517 } |
1518 } | 1518 } |
1519 } | 1519 } |
1520 | 1520 |
1521 static void jabber_features_destroy(void) | |
1522 { | |
1523 while (jabber_features) { | |
1524 JabberFeature *feature = jabber_features->data; | |
1525 g_free(feature->namespace); | |
1526 g_free(feature); | |
1527 jabber_features = g_list_remove_link(jabber_features, jabber_features); | |
1528 } | |
1529 } | |
1530 | |
1521 void jabber_add_identity(const gchar *category, const gchar *type, const gchar *lang, const gchar *name) { | 1531 void jabber_add_identity(const gchar *category, const gchar *type, const gchar *lang, const gchar *name) { |
1522 GList *identity; | 1532 GList *identity; |
1523 JabberIdentity *ident; | 1533 JabberIdentity *ident; |
1524 /* both required according to XEP-0030 */ | 1534 /* both required according to XEP-0030 */ |
1525 g_return_if_fail(category != NULL); | 1535 g_return_if_fail(category != NULL); |
1538 ident->category = g_strdup(category); | 1548 ident->category = g_strdup(category); |
1539 ident->type = g_strdup(type); | 1549 ident->type = g_strdup(type); |
1540 ident->lang = g_strdup(lang); | 1550 ident->lang = g_strdup(lang); |
1541 ident->name = g_strdup(name); | 1551 ident->name = g_strdup(name); |
1542 jabber_identities = g_list_append(jabber_identities, ident); | 1552 jabber_identities = g_list_append(jabber_identities, ident); |
1553 } | |
1554 | |
1555 static void jabber_identities_destroy(void) | |
1556 { | |
1557 while (jabber_identities) { | |
1558 JabberIdentity *id = jabber_identities->data; | |
1559 g_free(id->category); | |
1560 g_free(id->type); | |
1561 g_free(id->lang); | |
1562 g_free(id->name); | |
1563 g_free(id); | |
1564 jabber_identities = g_list_remove_link(jabber_identities, jabber_identities); | |
1565 } | |
1543 } | 1566 } |
1544 | 1567 |
1545 const char *jabber_list_icon(PurpleAccount *a, PurpleBuddy *b) | 1568 const char *jabber_list_icon(PurpleAccount *a, PurpleBuddy *b) |
1546 { | 1569 { |
1547 return "jabber"; | 1570 return "jabber"; |
2633 purple_plugin_ipc_register(plugin, "add_feature", PURPLE_CALLBACK(jabber_ipc_add_feature), | 2656 purple_plugin_ipc_register(plugin, "add_feature", PURPLE_CALLBACK(jabber_ipc_add_feature), |
2634 purple_marshal_VOID__POINTER, | 2657 purple_marshal_VOID__POINTER, |
2635 NULL, 1, | 2658 NULL, 1, |
2636 purple_value_new(PURPLE_TYPE_STRING)); | 2659 purple_value_new(PURPLE_TYPE_STRING)); |
2637 } | 2660 } |
2661 | |
2662 void | |
2663 jabber_uninit_plugin(void) | |
2664 { | |
2665 jabber_features_destroy(); | |
2666 jabber_identities_destroy(); | |
2667 } |