diff options
author | Daniel Landau <daniel@landau.fi> | 2017-01-29 19:37:07 +0200 |
---|---|---|
committer | Alexander Akulich <akulichalexander@gmail.com> | 2024-08-01 21:51:13 +0300 |
commit | 5eaf8c99748b3d4e61afaba24ff6bf763f81695d (patch) | |
tree | d988d1a4c22866b06e29bc8ebafb7272f3f9871d | |
parent | 2e50d1855b3395b622c768094ff2b617a0208724 (diff) |
-rw-r--r-- | telepathy-logger/text-channel.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/telepathy-logger/text-channel.c b/telepathy-logger/text-channel.c index 8712cd5..ddb8e8e 100644 --- a/telepathy-logger/text-channel.c +++ b/telepathy-logger/text-channel.c @@ -519,6 +519,15 @@ store_pending_messages (TplTextChannel *self) { GList *it; + /* The list in pending_messages was ordered by arrival + * (pending_message_id), then it was prepended to to_log one by one, so + * we need te reverse it to get back the original order. + */ + to_log = g_list_reverse (to_log); + /* Sort by time stamp in case the messages arrive in a messed up order. + * g_list_sort is stable, so messages that arrive at the same time stamp + * (e.g. from a bouncer) will not lose their original order. + */ to_log = g_list_sort (to_log, (GCompareFunc) pending_message_compare_timestamp); |