comparison libpurple/protocols/jabber/jabber.c @ 31234:b678afdc2b8f

When a jabber identity is added or removed, the caps_hash that would be created changes; uncache it so that it is recalculated as appropriate. applied changes from 72a1ab897368e57934b7b5d2e58e897e679efabe through 4bb0587b181457c9971826f9a448bdbcdab4a9cf
author Evan Schoenberg <evan.s@dreskin.net>
date Mon, 21 Feb 2011 00:17:36 +0000
parents 05c45d8f2ce3
children 9d7b2a7709d5
comparison
equal deleted inserted replaced
31233:58d9bcd75866 31234:b678afdc2b8f
1982 1982
1983 /* try to remove just in case it already exists in the list */ 1983 /* try to remove just in case it already exists in the list */
1984 jabber_remove_feature(namespace); 1984 jabber_remove_feature(namespace);
1985 1985
1986 jabber_features = g_list_append(jabber_features, feat); 1986 jabber_features = g_list_append(jabber_features, feat);
1987
1988 /* Our cached caps_hash, if present, is now incorrect; force recalculation next time it is needed */
1989 g_free(js->caps_hash);
1990 js->caps_hash = NULL;
1987 } 1991 }
1988 1992
1989 void jabber_remove_feature(const char *namespace) { 1993 void jabber_remove_feature(const char *namespace) {
1990 GList *feature; 1994 GList *feature;
1991 for(feature = jabber_features; feature; feature = feature->next) { 1995 for(feature = jabber_features; feature; feature = feature->next) {
2063 ident->type = g_strdup(type); 2067 ident->type = g_strdup(type);
2064 ident->lang = g_strdup(lang); 2068 ident->lang = g_strdup(lang);
2065 ident->name = g_strdup(name); 2069 ident->name = g_strdup(name);
2066 jabber_identities = g_list_insert_sorted(jabber_identities, ident, 2070 jabber_identities = g_list_insert_sorted(jabber_identities, ident,
2067 jabber_identity_compare); 2071 jabber_identity_compare);
2072
2073 /* Our cached caps_hash, if present, is now incorrect; force recalculation next time it is needed */
2074 g_free(js->caps_hash);
2075 js->caps_hash = NULL;
2068 } 2076 }
2069 2077
2070 static void jabber_identities_destroy(void) 2078 static void jabber_identities_destroy(void)
2071 { 2079 {
2072 while (jabber_identities) { 2080 while (jabber_identities) {