diff libpurple/protocols/jabber/jabber.c @ 32198:bcf0b8ba1a79

jabber: Fix /join behavior. Closes #14205. Also marked a string for translation. "/join foo" fails because 'foo' passes nameprep.
author Paul Aurich <paul@darkrain42.org>
date Sun, 17 Jul 2011 05:08:07 +0000
parents 4f1bd59cb90a
children ac43f26c7f61
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c	Sun Jul 17 04:03:42 2011 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Sun Jul 17 05:08:07 2011 +0000
@@ -3009,7 +3009,7 @@
 {
 	JabberChat *chat = jabber_chat_find_by_conv(conv);
 	GHashTable *components;
-	JabberID *jid;
+	JabberID *jid = NULL;
 	const char *room = NULL, *server = NULL, *handle = NULL;
 
 	if (!chat || !args || !args[0])
@@ -3017,7 +3017,8 @@
 
 	components = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL);
 
-	jid = jabber_id_new(args[0]);
+	if (strchr(args[0], '@'))
+		jid = jabber_id_new(args[0]);
 	if (jid) {
 		room   = jid->node;
 		server = jid->domain;
@@ -3673,8 +3674,7 @@
 	                  PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY |
 	                  PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber",
 	                  jabber_cmd_chat_join,
-	                  _("join: &lt;room&gt; [password]:  Join a chat on this server."),
-	                  /* _("join: &lt;room[@server]&gt; [password]:  Join a chat."), */
+	                  _("join: &lt;room[@server]&gt; [password]:  Join a chat."),
 	                  NULL);
 	commands = g_slist_prepend(commands, GUINT_TO_POINTER(id));