aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Meire <blackskad@gmail.com>2010-01-03 04:35:05 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-01-07 01:27:17 +0800
commit52d8bb2ebe6ef009d2adccbacfb3acbcca0a30c3 (patch)
treef81b65c046a3c741cad62b87441584f2f9b151a9
parent772d724cb68633175ece7439ae0cc2a672ba7e10 (diff)
downloadgsoc2013-empathy-52d8bb2ebe6ef009d2adccbacfb3acbcca0a30c3.tar
gsoc2013-empathy-52d8bb2ebe6ef009d2adccbacfb3acbcca0a30c3.tar.gz
gsoc2013-empathy-52d8bb2ebe6ef009d2adccbacfb3acbcca0a30c3.tar.bz2
gsoc2013-empathy-52d8bb2ebe6ef009d2adccbacfb3acbcca0a30c3.tar.lz
gsoc2013-empathy-52d8bb2ebe6ef009d2adccbacfb3acbcca0a30c3.tar.xz
gsoc2013-empathy-52d8bb2ebe6ef009d2adccbacfb3acbcca0a30c3.tar.zst
gsoc2013-empathy-52d8bb2ebe6ef009d2adccbacfb3acbcca0a30c3.zip
allow multiple rooms with /join (bug #604347)
-rw-r--r--libempathy-gtk/empathy-chat.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index 624b1a03f..02d123b54 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