[empathy] allow multiple rooms with /join (bug #604347)



commit 52d8bb2ebe6ef009d2adccbacfb3acbcca0a30c3
Author: Thomas Meire <blackskad gmail com>
Date:   Sat Jan 2 21:35:05 2010 +0100

    allow multiple rooms with /join (bug #604347)

 libempathy-gtk/empathy-chat.c |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)
---
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index 624b1a0..02d123b 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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]