[empathy] Properly check if the backlog flag is set
- From: Sjoerd Simons <sjoerds src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] Properly check if the backlog flag is set
- Date: Fri, 12 Aug 2011 12:18:07 +0000 (UTC)
commit 1560313cdfafa660b7400f44217a8741785e3103
Author: Sjoerd Simons <sjoerd simons collabora co uk>
Date: Fri Aug 12 12:21:45 2011 +0200
Properly check if the backlog flag is set
The backlog flag should be TRUE or FALSE, so the check for the flag
should result in either of those two values, not some other non-false
value
libempathy/empathy-message.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/libempathy/empathy-message.c b/libempathy/empathy-message.c
index 1c18cf5..06b3308 100644
--- a/libempathy/empathy-message.c
+++ b/libempathy/empathy-message.c
@@ -787,6 +787,7 @@ empathy_message_new_from_tp_message (TpMessage *tp_msg,
gint64 timestamp;
gint64 original_timestamp;
const GHashTable *part = tp_message_peek (tp_msg, 0);
+ gboolean is_backlog;
g_return_val_if_fail (TP_IS_MESSAGE (tp_msg), NULL);
@@ -799,6 +800,9 @@ empathy_message_new_from_tp_message (TpMessage *tp_msg,
original_timestamp = tp_asv_get_int64 (part,
"original-message-received", NULL);
+ is_backlog = (flags & TP_CHANNEL_TEXT_MESSAGE_FLAG_SCROLLBACK) ==
+ TP_CHANNEL_TEXT_MESSAGE_FLAG_SCROLLBACK;
+
message = g_object_new (EMPATHY_TYPE_MESSAGE,
"body", body,
"token", tp_message_get_token (tp_msg),
@@ -807,7 +811,7 @@ empathy_message_new_from_tp_message (TpMessage *tp_msg,
"timestamp", timestamp,
"original-timestamp", original_timestamp,
"flags", flags,
- "is-backlog", flags & TP_CHANNEL_TEXT_MESSAGE_FLAG_SCROLLBACK,
+ "is-backlog", is_backlog,
"incoming", incoming,
"tp-message", tp_msg,
NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]