changeset 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 6f503dcd843e
children f7c94fc60a0c
files ChangeLog libpurple/protocols/jabber/jabber.c
diffstat 2 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Jul 17 04:03:42 2011 +0000
+++ b/ChangeLog	Sun Jul 17 05:08:07 2011 +0000
@@ -23,6 +23,8 @@
 	XMPP:
 	* Do not generate malformed XML ("</>") when setting an empty mood.
 	  (#14342)
+	* Fix the /join <room> behavior.  (Broken when adding support for
+	  <room>@<server>)  (#14205)
 
 version 2.9.0 (06/23/2011):
 	Pidgin:
--- 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));