aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-chat.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-04-02 17:42:15 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-04-02 17:42:15 +0800
commitd29ccc83e9103f9592a9d1be7a968e40165d8f9f (patch)
tree3ac84a65eb6df262691103920489d0cec821cf25 /libempathy-gtk/empathy-chat.c
parent370713a1df40ec01a7fca7a503580eebe6fc85bf (diff)
downloadgsoc2013-empathy-d29ccc83e9103f9592a9d1be7a968e40165d8f9f.tar
gsoc2013-empathy-d29ccc83e9103f9592a9d1be7a968e40165d8f9f.tar.gz
gsoc2013-empathy-d29ccc83e9103f9592a9d1be7a968e40165d8f9f.tar.bz2
gsoc2013-empathy-d29ccc83e9103f9592a9d1be7a968e40165d8f9f.tar.lz
gsoc2013-empathy-d29ccc83e9103f9592a9d1be7a968e40165d8f9f.tar.xz
gsoc2013-empathy-d29ccc83e9103f9592a9d1be7a968e40165d8f9f.tar.zst
gsoc2013-empathy-d29ccc83e9103f9592a9d1be7a968e40165d8f9f.zip
Correctly block events
svn path=/trunk/; revision=851
Diffstat (limited to 'libempathy-gtk/empathy-chat.c')
-rw-r--r--libempathy-gtk/empathy-chat.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index 5533541ff..4c0699bb1 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -1433,6 +1433,16 @@ empathy_chat_class_init (EmpathyChatClass *klass)
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 @@ empathy_chat_init (EmpathyChat *chat)
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 @@ empathy_chat_get_tp_chat (EmpathyChat *chat)
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 @@ empathy_chat_set_tp_chat (EmpathyChat *chat,
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");