Mercurial > pidgin.yaz
diff libpurple/protocols/oscar/oscar.c @ 31368:29b4f2c52533
merged from im.pidgin.pidgin
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Fri, 19 Nov 2010 07:13:04 +0900 |
parents | 0462bec07414 f71745835d15 |
children | 193cbfcfc935 |
line wrap: on
line diff
--- a/libpurple/protocols/oscar/oscar.c Thu Nov 18 23:07:34 2010 +0900 +++ b/libpurple/protocols/oscar/oscar.c Fri Nov 19 07:13:04 2010 +0900 @@ -637,6 +637,15 @@ return subtype1 - subtype2; } +#if !GLIB_CHECK_VERSION(2,14,0) +static void hash_table_get_list_of_keys(gpointer key, gpointer value, gpointer user_data) +{ + GList **handlers = (GList **)user_data; + + *handlers = g_list_prepend(*handlers, key); +} +#endif /* GLIB < 2.14.0 */ + void oscar_login(PurpleAccount *account) { @@ -706,7 +715,12 @@ oscar_data_addhandler(od, SNAC_FAMILY_USERLOOKUP, 0x0003, purple_parse_searchreply, 0); g_string_append(msg, "Registered handlers: "); +#if GLIB_CHECK_VERSION(2,14,0) handlers = g_hash_table_get_keys(od->handlerlist); +#else + handlers = NULL; + g_hash_table_foreach(od->handlerlist, hash_table_get_list_of_keys, &handlers); +#endif /* GLIB < 2.14.0 */ sorted_handlers = g_list_sort(g_list_copy(handlers), compare_handlers); for (cur = sorted_handlers; cur; cur = cur->next) { guint x = GPOINTER_TO_UINT(cur->data); @@ -5722,7 +5736,7 @@ for (i = 0; encryption_keys[i]; i++) { PurpleKeyValuePair *kvp = g_new0(PurpleKeyValuePair, 1); - kvp->key = g_strdup(encryption_keys[i]); + kvp->key = g_strdup(_(encryption_keys[i])); kvp->value = g_strdup(encryption_values[i]); encryption_options = g_list_append(encryption_options, kvp); }