[empathy/gnome-2-30: 1/5] factor out join_chatroom



commit 96da120918a480cb6137229e9a1b046d6ac960e1
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Thu Jun 3 11:00:44 2010 +0200

    factor out join_chatroom

 src/empathy-main-window.c |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)
---
diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c
index 7bd6fab..427f525 100644
--- a/src/empathy-main-window.c
+++ b/src/empathy-main-window.c
@@ -875,25 +875,37 @@ main_window_view_show_map_cb (GtkCheckMenuItem  *item,
 }
 
 static void
-main_window_favorite_chatroom_join (EmpathyChatroom *chatroom)
+join_chatroom (EmpathyChatroom *chatroom,
+	       gint64 timestamp)
 {
 	TpAccount      *account;
 	TpConnection   *connection;
 	const gchar    *room;
 
 	account = empathy_chatroom_get_account (chatroom);
-	if (tp_account_get_connection_status (account, NULL) !=
-					     TP_CONNECTION_STATUS_CONNECTED)
-		return;
 	connection = tp_account_get_connection (account);
 	g_assert (connection != NULL);
 	room = empathy_chatroom_get_room (chatroom);
 
 	DEBUG ("Requesting channel for '%s'", room);
+
 	empathy_dispatcher_join_muc (connection, room, NULL, NULL);
 }
 
 static void
+main_window_favorite_chatroom_join (EmpathyChatroom *chatroom)
+{
+	TpAccount      *account;
+
+	account = empathy_chatroom_get_account (chatroom);
+	if (tp_account_get_connection_status (account, NULL) !=
+					     TP_CONNECTION_STATUS_CONNECTED)
+		return;
+
+	join_chatroom (chatroom, gtk_get_current_event_time ());
+}
+
+static void
 main_window_favorite_chatroom_menu_activate_cb (GtkMenuItem    *menu_item,
 						EmpathyChatroom *chatroom)
 {



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