empathy r851 - trunk/libempathy-gtk



Author: xclaesse
Date: Wed Apr  2 10:42:15 2008
New Revision: 851
URL: http://svn.gnome.org/viewvc/empathy?rev=851&view=rev

Log:
Correctly block events


Modified:
   trunk/libempathy-gtk/empathy-chat.c

Modified: trunk/libempathy-gtk/empathy-chat.c
==============================================================================
--- trunk/libempathy-gtk/empathy-chat.c	(original)
+++ trunk/libempathy-gtk/empathy-chat.c	Wed Apr  2 10:42:15 2008
@@ -1433,6 +1433,16 @@
 	g_type_class_add_private (object_class, sizeof (EmpathyChatPriv));
 }
 
+static gboolean
+chat_block_events_timeout_cb (gpointer data)
+{
+	EmpathyChatPriv *priv = GET_PRIV (data);
+
+	priv->block_events_timeout_id = 0;
+
+	return FALSE;
+}
+
 static void
 empathy_chat_init (EmpathyChat *chat)
 {
@@ -1449,6 +1459,11 @@
 	priv->sent_messages_index = -1;
 	priv->mc = empathy_mission_control_new ();
 
+	/* Block events for some time to avoid having "has come online" or
+	 * "joined" messages. */
+	priv->block_events_timeout_id =
+		g_timeout_add_seconds (1, chat_block_events_timeout_cb, chat);
+
 	dbus_g_proxy_connect_signal (DBUS_G_PROXY (priv->mc), "AccountStatusChanged",
 				     G_CALLBACK (chat_status_changed_cb),
 				     chat, NULL);
@@ -1506,16 +1521,6 @@
 	return priv->tp_chat;
 }
 
-static gboolean
-chat_block_events_timeout_cb (gpointer data)
-{
-	EmpathyChatPriv *priv = GET_PRIV (data);
-
-	priv->block_events_timeout_id = 0;
-
-	return FALSE;
-}
-
 void
 empathy_chat_set_tp_chat (EmpathyChat   *chat,
 			  EmpathyTpChat *tp_chat)
@@ -1562,16 +1567,11 @@
 			  G_CALLBACK (chat_destroy_cb),
 			  chat);
 
-	/* Block events for some time to avoid having "has come online" or
-	 * "joined" messages. */
+	gtk_widget_set_sensitive (chat->input_text_view, TRUE);
 	if (priv->block_events_timeout_id == 0) {
-		priv->block_events_timeout_id =
-			g_timeout_add_seconds (1, chat_block_events_timeout_cb, chat);
+		empathy_chat_view_append_event (chat->view, _("Connected"));
 	}
 
-	gtk_widget_set_sensitive (chat->input_text_view, TRUE);
-	empathy_chat_view_append_event (chat->view, _("Connected"));
-
 	g_object_notify (G_OBJECT (chat), "tp-chat");
 	g_object_notify (G_OBJECT (chat), "id");
 	g_object_notify (G_OBJECT (chat), "account");



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