diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-05-25 12:50:01 +0200 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-05-25 12:50:01 +0200 |
commit | 2743dd452844fb234155e82efb106a839f9e8e6e (patch) | |
tree | 3ac29134418fad5a6456e67797169d17e9d827b7 /examples/client | |
parent | 0845f60ad48dc43f586da31cfeec01ddacb0c042 (diff) |
ignore messages until GetPendingMessages() has returned
Diffstat (limited to 'examples/client')
-rw-r--r-- | examples/client/text-handler.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/examples/client/text-handler.c b/examples/client/text-handler.c index a878491e8..a35433b8c 100644 --- a/examples/client/text-handler.c +++ b/examples/client/text-handler.c @@ -14,6 +14,8 @@ #include <telepathy-glib/telepathy-glib.h> +gboolean got_pending_msg = FALSE; + static void echo_message (TpChannel *channel, const gchar *text) @@ -42,6 +44,10 @@ message_received_cb (TpChannel *channel, { GArray *arr; + /* Ignore messages if we didn't fetch pending messages yet */ + if (!got_pending_msg) + return; + g_print ("received: %s\n", text); echo_message (channel, text); @@ -65,6 +71,8 @@ got_pending_messages_cb (TpChannel *channel, guint i; GArray *ids; + got_pending_msg = TRUE; + if (error != NULL) return; |