changeset 25668:8c58f31f41eb

The BOSH User Agent should include the client name (and optionally version), not just the libpurple version. This is what was intended originally.
author Paul Aurich <paul@darkrain42.org>
date Tue, 20 Jan 2009 06:10:42 +0000
parents bf7338765863
children 828640306e31
files libpurple/protocols/jabber/bosh.c
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/bosh.c	Mon Jan 19 18:25:38 2009 +0000
+++ b/libpurple/protocols/jabber/bosh.c	Tue Jan 20 06:10:42 2009 +0000
@@ -105,13 +105,18 @@
 void jabber_bosh_init(void)
 {
 	GHashTable *ui_info = purple_core_get_ui_info();
+	const char *ui_name = NULL;
 	const char *ui_version = NULL;
 
-	if (ui_info)
+	if (ui_info) {
+		ui_name = g_hash_table_lookup(ui_info, "name");
 		ui_version = g_hash_table_lookup(ui_info, "version");
+	}
 
-	if (ui_version)
-		bosh_useragent = g_strdup_printf("%s (libpurple " VERSION ")", ui_version);
+	if (ui_name)
+		bosh_useragent = g_strdup_printf("%s%s%s (libpurple " VERSION ")",
+		                                 ui_name, ui_version ? " " : "",
+		                                 ui_version ? ui_version : "");
 	else
 		bosh_useragent = g_strdup("libpurple " VERSION);
 }