#include <telepathy-glib/account-manager.h>
#include <telepathy-glib/util.h>
#include <telepathy-logger/log-manager.h>
+#include <telepathy-logger/text-event.h>
#include <libempathy/empathy-contact-list.h>
#include <libempathy/empathy-gsettings.h>
#include <libempathy/empathy-keyring.h>
for (l = messages; l; l = g_list_next (l)) {
EmpathyMessage *message;
+ GList *supersedes;
g_assert (TPL_IS_EVENT (l->data));
+ /* we need the last message this one supersedes, which is the
+ * the original */
+ supersedes = tpl_text_event_dup_supersedes (l->data);
+
+ if (supersedes != NULL) {
+ message = empathy_message_from_tpl_log_event (
+ g_list_last (supersedes)->data);
+ empathy_chat_view_append_message (chat->view, message);
+
+ g_object_unref (message);
+ }
+
+ g_list_free_full (supersedes, g_object_unref);
+
+ /* append the latest message */
message = empathy_message_from_tpl_log_event (l->data);
g_object_unref (l->data);
- empathy_chat_view_append_message (chat->view, message);
+ if (empathy_message_is_edit (message))
+ empathy_chat_view_edit_message (chat->view, message);
+ else
+ empathy_chat_view_append_message (chat->view, message);
+
g_object_unref (message);
}
g_list_free (messages);