changeset 28773:088fac135139

On Windows, treat a 'xmpp:foo@bar.com' URI as opening an IM window.
author Paul Aurich <paul@darkrain42.org>
date Tue, 08 Dec 2009 07:41:37 +0000
parents d51d97e0d28d
children 7fb15df96ef4
files libpurple/protocols/jabber/libxmpp.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/libxmpp.c	Fri Dec 04 06:29:30 2009 +0000
+++ b/libpurple/protocols/jabber/libxmpp.c	Tue Dec 08 07:41:37 2009 +0000
@@ -295,7 +295,7 @@
 
 static gboolean xmpp_uri_handler(const char *proto, const char *user, GHashTable *params)
 {
-	char *acct_id = g_hash_table_lookup(params, "account");
+	char *acct_id = params ? g_hash_table_lookup(params, "account") : NULL;
 	PurpleAccount *acct;
 
 	if (g_ascii_strcasecmp(proto, "xmpp"))
@@ -307,7 +307,8 @@
 		return FALSE;
 
 	/* xmpp:romeo@montague.net?message;subject=Test%20Message;body=Here%27s%20a%20test%20message */
-	if (g_hash_table_lookup_extended(params, "message", NULL, NULL)) {
+	/* params is NULL if the URI has no '?' (or anything after it) */
+	if (!params || g_hash_table_lookup_extended(params, "message", NULL, NULL)) {
 		char *body = g_hash_table_lookup(params, "body");
 		if (user && *user) {
 			PurpleConversation *conv =