aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-tp-chat.c
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2009-04-25 17:07:31 +0800
committerWill Thompson <will.thompson@collabora.co.uk>2009-04-25 17:07:31 +0800
commitb747b97984784a82724e538942854b89d3309006 (patch)
tree344ecb6d4c86c698b0ad68934ee61f35372c6aee /libempathy/empathy-tp-chat.c
parentc982861667c0441419ee4fdee2ea399ef8f26416 (diff)
downloadgsoc2013-empathy-b747b97984784a82724e538942854b89d3309006.tar
gsoc2013-empathy-b747b97984784a82724e538942854b89d3309006.tar.gz
gsoc2013-empathy-b747b97984784a82724e538942854b89d3309006.tar.bz2
gsoc2013-empathy-b747b97984784a82724e538942854b89d3309006.tar.lz
gsoc2013-empathy-b747b97984784a82724e538942854b89d3309006.tar.xz
gsoc2013-empathy-b747b97984784a82724e538942854b89d3309006.tar.zst
gsoc2013-empathy-b747b97984784a82724e538942854b89d3309006.zip
Fix a theoretical race listing pending messages
If you call ListPendingMessages before connecting to Received, the following could theoretically occur: Empathy --- ListPendingMessages --> CM Empathy <-- LPM returns --- CM <----- CM -----> Received Empathy connects to Received and thus you could miss a message. Connecting to Received before calling ListPendingMessages avoids this (mostly theoretical) bug. Signed-off-by: Will Thompson <will.thompson@collabora.co.uk>
Diffstat (limited to 'libempathy/empathy-tp-chat.c')
-rw-r--r--libempathy/empathy-tp-chat.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c
index 54e08d071..2f951e040 100644
--- a/libempathy/empathy-tp-chat.c
+++ b/libempathy/empathy-tp-chat.c
@@ -753,6 +753,10 @@ tp_chat_check_if_ready (EmpathyTpChat *chat)
DEBUG ("Ready!");
+ tp_cli_channel_type_text_connect_to_received (priv->channel,
+ tp_chat_received_cb,
+ NULL, NULL,
+ G_OBJECT (chat), NULL);
priv->listing_pending_messages = TRUE;
tp_cli_channel_type_text_call_list_pending_messages (priv->channel, -1,
FALSE,
@@ -760,10 +764,6 @@ tp_chat_check_if_ready (EmpathyTpChat *chat)
NULL, NULL,
G_OBJECT (chat));
- tp_cli_channel_type_text_connect_to_received (priv->channel,
- tp_chat_received_cb,
- NULL, NULL,
- G_OBJECT (chat), NULL);
tp_cli_channel_type_text_connect_to_sent (priv->channel,
tp_chat_sent_cb,
NULL, NULL,