Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/EionRobb/pidgin-opensteamworks.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreionrobb <eionrobb@8ca6c67d-4297-256d-f884-781da6d5760b>2013-08-24 08:56:21 +0400
committereionrobb <eionrobb@8ca6c67d-4297-256d-f884-781da6d5760b>2013-08-24 08:56:21 +0400
commit4bdbc530a8237b3c5b270c9f24d8185c6e9310b8 (patch)
tree320c1c4e4fc8c5d07c7fb901e26ea71b35fa4bb0
parenteadddb30aabafda69a8a5a7b250670ebca0fe811 (diff)
Move gnome-keyring lib loading back into plugin_load again, adding some debug
-rw-r--r--steam-mobile/libsteam.c44
1 files changed, 17 insertions, 27 deletions
diff --git a/steam-mobile/libsteam.c b/steam-mobile/libsteam.c
index 4a5a031..aa99cc6 100644
--- a/steam-mobile/libsteam.c
+++ b/steam-mobile/libsteam.c
@@ -1220,17 +1220,28 @@ steam_buddy_remove(PurpleConnection *pc, PurpleBuddy *buddy, PurpleGroup *group)
static gboolean plugin_load(PurplePlugin *plugin)
{
+ purple_debug_info("steam", "Purple core UI name: %s\n", purple_core_get_ui());
core_is_haze = g_str_equal(purple_core_get_ui(), "haze");
-
+
#ifdef G_OS_UNIX
- if (core_is_haze) {
+ if (core_is_haze && gnome_keyring_lib == NULL) {
+ purple_debug_info("steam", "UI Core is Telepathy-Haze, attempting to load Gnome-Keyring\n");
+
+ gnome_keyring_lib = dlopen("libgnome-keyring.so", RTLD_LAZY);
if (!gnome_keyring_lib) {
- purple_debug_error("steam", "This plugin required Gnome-Keyring when used with Telepathy-Haze\n");
+ purple_debug_error("steam", "Could not load Gnome-Keyring library. This plugin requires Gnome-Keyring when used with Telepathy-Haze\n");
return FALSE;
}
- if (!my_gnome_keyring_store_password || !my_gnome_keyring_delete_password || !my_gnome_keyring_find_password) {
+
+ my_gnome_keyring_store_password = (gnome_keyring_store_password_type) dlsym(gnome_keyring_lib, "gnome_keyring_store_password");
+ my_gnome_keyring_delete_password = (gnome_keyring_delete_password_type) dlsym(gnome_keyring_lib, "gnome_keyring_delete_password");
+ my_gnome_keyring_find_password = (gnome_keyring_find_password_type) dlsym(gnome_keyring_lib, "gnome_keyring_find_password");
+ my_GKNP = (GnomeKeyringPasswordSchema *) dlsym(gnome_keyring_lib, "GNOME_KEYRING_NETWORK_PASSWORD");
+
+ if (!my_gnome_keyring_store_password || !my_gnome_keyring_delete_password || !my_gnome_keyring_find_password || !my_GKNP) {
dlclose(gnome_keyring_lib);
- purple_debug_error("steam", "This plugin required Gnome-Keyring when used with Telepathy-Haze\n");
+ gnome_keyring_lib = NULL;
+ purple_debug_error("steam", "Could not load Gnome-Keyring functions. This plugin requires Gnome-Keyring when used with Telepathy-Haze\n");
return FALSE;
}
}
@@ -1244,6 +1255,7 @@ static gboolean plugin_unload(PurplePlugin *plugin)
#ifdef G_OS_UNIX
if (gnome_keyring_lib) {
dlclose(gnome_keyring_lib);
+ gnome_keyring_lib = NULL;
}
#endif
return TRUE;
@@ -1326,28 +1338,6 @@ static void plugin_init(PurplePlugin *plugin)
prpl_info->protocol_options = g_list_append(
prpl_info->protocol_options, option);
- core_is_haze = g_str_equal(purple_core_get_ui(), "haze");
-
-#ifdef G_OS_UNIX
- if (core_is_haze) {
- gnome_keyring_lib = dlopen("libgnome-keyring.so", RTLD_LAZY);
- if (!gnome_keyring_lib) {
- purple_debug_error("steam", "This plugin required Gnome-Keyring when used with Telepathy-Haze\n");
- return;
- }
- my_gnome_keyring_store_password = (gnome_keyring_store_password_type) dlsym(gnome_keyring_lib, "gnome_keyring_store_password");
- my_gnome_keyring_delete_password = (gnome_keyring_delete_password_type) dlsym(gnome_keyring_lib, "gnome_keyring_delete_password");
- my_gnome_keyring_find_password = (gnome_keyring_find_password_type) dlsym(gnome_keyring_lib, "gnome_keyring_find_password");
- my_GKNP = (GnomeKeyringPasswordSchema *) dlsym(gnome_keyring_lib, "GNOME_KEYRING_NETWORK_PASSWORD");
-
- if (!my_gnome_keyring_store_password || !my_gnome_keyring_delete_password || !my_gnome_keyring_find_password) {
- dlclose(gnome_keyring_lib);
- purple_debug_error("steam", "This plugin required Gnome-Keyring when used with Telepathy-Haze\n");
- return;
- }
- }
-#endif
-
}
static PurplePluginProtocolInfo prpl_info = {