diff libpurple/protocols/oscar/util.c @ 27428:5048054d319a

Use the ui_info hash table instead of prefs when passing the clientstring and distid from the UIs to the oscar prpl. I realized that using a pref wasn't great because it's persistent, and if you switch from a UI that sets one of those strings to a UI that doesn't hen we'll keep using the old value.
author Mark Doliner <mark@kingant.net>
date Wed, 08 Jul 2009 20:11:07 +0000
parents 4f24d5da4cb3
children 74e487f82f39
line wrap: on
line diff
--- a/libpurple/protocols/oscar/util.c	Wed Jul 08 19:46:50 2009 +0000
+++ b/libpurple/protocols/oscar/util.c	Wed Jul 08 20:11:07 2009 +0000
@@ -35,6 +35,20 @@
 #include "win32dep.h"
 #endif
 
+int oscar_get_ui_info_int(const char *str, int default_value)
+{
+	GHashTable *ui_info;
+
+	ui_info = purple_core_get_ui_info();
+	if (ui_info != NULL) {
+		gpointer value;
+		if (g_hash_table_lookup_extended(ui_info, str, NULL, value))
+			return GPOINTER_TO_INT(value);
+	}
+
+	return default_value;
+}
+
 const char *oscar_get_ui_info_string(const char *str, const char *default_value)
 {
 	GHashTable *ui_info;