--- a/ChangeLog Sun Mar 06 22:38:45 2011 +0000
+++ b/ChangeLog Sun Mar 06 22:53:15 2011 +0000
@@ -28,6 +28,8 @@
* Don't treat the on-join status storms as 'new arrivals'. (Thijs
+ * Extend the /join command to support room JIDs, enabling you to join + a room on any server. (Solarius, Matěj Cepl, wyuka) (#4526) version 2.7.10 (02/06/2011):
--- a/libpurple/protocols/jabber/jabber.c Sun Mar 06 22:38:45 2011 +0000
+++ b/libpurple/protocols/jabber/jabber.c Sun Mar 06 22:53:15 2011 +0000
@@ -3008,21 +3008,44 @@
JabberChat *chat = jabber_chat_find_by_conv(conv);
- if(!chat || !args || !args[0])
+ const char *room = NULL, *server = NULL, *handle = NULL; + if (!chat || !args || !args[0]) return PURPLE_CMD_RET_FAILED;
components = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL);
- g_hash_table_replace(components, "room", args[0]);
- g_hash_table_replace(components, "server", chat->server);
- g_hash_table_replace(components, "handle", chat->handle);
- g_hash_table_replace(components, "password", args[1]);
+ jid = jabber_id_new(args[0]); + handle = jid->resource ? jid->resource : chat->handle; + /* If jabber_id_new failed, the user may have just passed in + * a room name. For backward compatibility, handle that here. + if (strchr(args[0], '@')) { + *error = g_strdup(_("Invalid XMPP ID")); + return PURPLE_CMD_RET_FAILED; + g_hash_table_insert(components, "room", (gpointer)room); + g_hash_table_insert(components, "server", (gpointer)server); + g_hash_table_insert(components, "handle", (gpointer)handle); + g_hash_table_insert(components, "password", args[1]); jabber_chat_join(purple_conversation_get_gc(conv), components);
g_hash_table_destroy(components);
return PURPLE_CMD_RET_OK;
@@ -3650,6 +3673,7 @@
PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber",
_("join: <room> [password]: Join a chat on this server."),
+ /* _("join: <room[@server]> [password]: Join a chat."), */ commands = g_slist_prepend(commands, GUINT_TO_POINTER(id));