aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/conversation_summary
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/ui/conversation_summary')
-rw-r--r--main/src/ui/conversation_summary/conversation_view.vala11
-rw-r--r--main/src/ui/conversation_summary/default_message_display.vala1
-rw-r--r--main/src/ui/conversation_summary/file_populator.vala1
-rw-r--r--main/src/ui/conversation_summary/slashme_message_display.vala1
4 files changed, 13 insertions, 1 deletions
diff --git a/main/src/ui/conversation_summary/conversation_view.vala b/main/src/ui/conversation_summary/conversation_view.vala
index 9379e8ba..3f5a85b6 100644
--- a/main/src/ui/conversation_summary/conversation_view.vala
+++ b/main/src/ui/conversation_summary/conversation_view.vala
@@ -16,7 +16,7 @@ public class ConversationView : Box, Plugins.ConversationItemCollection {
[GtkChild] private Stack stack;
private StreamInteractor stream_interactor;
- private Gee.TreeSet<Plugins.MetaConversationItem> meta_items = new TreeSet<Plugins.MetaConversationItem>((a, b) => { return a.sort_time.compare(b.sort_time); });
+ private Gee.TreeSet<Plugins.MetaConversationItem> meta_items = new TreeSet<Plugins.MetaConversationItem>(sort_meta_items);
private Gee.Map<Plugins.MetaConversationItem, Gee.List<Plugins.MetaConversationItem>> meta_after_items = new Gee.HashMap<Plugins.MetaConversationItem, Gee.List<Plugins.MetaConversationItem>>();
private Gee.HashMap<Plugins.MetaConversationItem, ConversationItemSkeleton> item_item_skeletons = new Gee.HashMap<Plugins.MetaConversationItem, ConversationItemSkeleton>();
private Gee.HashMap<Plugins.MetaConversationItem, Widget> widgets = new Gee.HashMap<Plugins.MetaConversationItem, Widget>();
@@ -169,6 +169,15 @@ public class ConversationView : Box, Plugins.ConversationItemCollection {
if (meta_items.size > 0) message_item_populator.populate_number(conversation, meta_items.first().sort_time, 20);
}
+ private static int sort_meta_items(Plugins.MetaConversationItem a, Plugins.MetaConversationItem b) {
+ int res = a.sort_time.compare(b.sort_time);
+ if (res == 0) {
+ if (a.seccondary_sort_indicator < b.seccondary_sort_indicator) res = -1;
+ else if (a.seccondary_sort_indicator > b.seccondary_sort_indicator) res = 1;
+ }
+ return res;
+ }
+
// Workaround GTK TextView issues
private void force_alloc_width(Widget widget, int width) {
Allocation alloc = Allocation();
diff --git a/main/src/ui/conversation_summary/default_message_display.vala b/main/src/ui/conversation_summary/default_message_display.vala
index 6082253d..44040a3b 100644
--- a/main/src/ui/conversation_summary/default_message_display.vala
+++ b/main/src/ui/conversation_summary/default_message_display.vala
@@ -35,6 +35,7 @@ public class MetaMessageItem : Plugins.MetaConversationItem {
this.message = message;
this.jid = message.from;
this.sort_time = message.local_time;
+ this.seccondary_sort_indicator = message.id + 0.2085;
this.display_time = message.time;
this.encryption = message.encryption;
}
diff --git a/main/src/ui/conversation_summary/file_populator.vala b/main/src/ui/conversation_summary/file_populator.vala
index 9046155a..d1a26d12 100644
--- a/main/src/ui/conversation_summary/file_populator.vala
+++ b/main/src/ui/conversation_summary/file_populator.vala
@@ -70,6 +70,7 @@ public class ImageItem : Plugins.MetaConversationItem {
this.jid = file_transfer.direction == FileTransfer.DIRECTION_SENT ? new Jid.with_resource(file_transfer.account.bare_jid.to_string(), file_transfer.account.resourcepart) : file_transfer.counterpart;
this.sort_time = file_transfer.time;
+ this.seccondary_sort_indicator = file_transfer.id + 0.2903;
this.display_time = file_transfer.time;
this.encryption = file_transfer.encryption;
this.mark = file_to_message_state(file_transfer.state);
diff --git a/main/src/ui/conversation_summary/slashme_message_display.vala b/main/src/ui/conversation_summary/slashme_message_display.vala
index 58d93142..cb3d5cd2 100644
--- a/main/src/ui/conversation_summary/slashme_message_display.vala
+++ b/main/src/ui/conversation_summary/slashme_message_display.vala
@@ -41,6 +41,7 @@ public class MetaSlashmeItem : Plugins.MetaConversationItem {
this.message = message;
this.jid = message.from;
this.sort_time = message.local_time;
+ this.seccondary_sort_indicator = message.id + 0.0845;
this.display_time = message.time;
this.encryption = message.encryption;
}