diff options
author | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2011-08-12 18:21:45 +0800 |
---|---|---|
committer | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2011-08-12 18:21:48 +0800 |
commit | 1560313cdfafa660b7400f44217a8741785e3103 (patch) | |
tree | 4a2029f9f6e0fbdb07180aae97c2a0a5a49e082c /libempathy/empathy-message.c | |
parent | 18dca3647b1b179bfc83269934f08a91f5e422df (diff) | |
download | gsoc2013-empathy-1560313cdfafa660b7400f44217a8741785e3103.tar gsoc2013-empathy-1560313cdfafa660b7400f44217a8741785e3103.tar.gz gsoc2013-empathy-1560313cdfafa660b7400f44217a8741785e3103.tar.bz2 gsoc2013-empathy-1560313cdfafa660b7400f44217a8741785e3103.tar.lz gsoc2013-empathy-1560313cdfafa660b7400f44217a8741785e3103.tar.xz gsoc2013-empathy-1560313cdfafa660b7400f44217a8741785e3103.tar.zst gsoc2013-empathy-1560313cdfafa660b7400f44217a8741785e3103.zip |
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
Diffstat (limited to 'libempathy/empathy-message.c')
-rw-r--r-- | 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 1c18cf53c..06b3308c5 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); |