From 52d8bb2ebe6ef009d2adccbacfb3acbcca0a30c3 Mon Sep 17 00:00:00 2001 From: Thomas Meire Date: Sat, 2 Jan 2010 21:35:05 +0100 Subject: [PATCH] allow multiple rooms with /join (bug #604347) --- libempathy-gtk/empathy-chat.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c index 624b1a03..02d123b5 100644 --- a/libempathy-gtk/empathy-chat.c +++ b/libempathy-gtk/empathy-chat.c @@ -695,13 +695,24 @@ static void chat_command_join (EmpathyChat *chat, GStrv strv) { + guint i = 0; EmpathyChatPriv *priv = GET_PRIV (chat); - TpConnection *connection; - connection = empathy_tp_chat_get_connection (priv->tp_chat); - empathy_dispatcher_join_muc (connection, strv[1], - chat_command_join_cb, - chat); + GStrv rooms = g_strsplit_set (strv[1], ", ", -1); + + while (rooms[i] != NULL) { + /* ignore empty strings */ + if (EMP_STR_EMPTY (rooms[i])) { + TpConnection *connection; + + connection = empathy_tp_chat_get_connection (priv->tp_chat); + empathy_dispatcher_join_muc (connection, rooms[i], + chat_command_join_cb, + chat); + } + i++; + } + g_strfreev (rooms); } static void -- 2.39.2