aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2018-09-02 14:24:59 +0200
committerfiaxh <git@mx.ax.lt>2018-09-02 14:30:07 +0200
commit0f57191bea9e4bd44af36fafe22212e262ce8221 (patch)
tree568b8684d5b265955197bb1f0380752f32cbab9d
parentea7efd6399ec57bfaa9791fffc06e53a66cb2442 (diff)
downloaddino-0f57191bea9e4bd44af36fafe22212e262ce8221.tar.gz
dino-0f57191bea9e4bd44af36fafe22212e262ce8221.zip
Fix sent messages sometimes being displayed twice
-rw-r--r--libdino/src/service/content_item_store.vala5
-rw-r--r--main/src/ui/conversation_summary/content_populator.vala2
-rw-r--r--main/src/ui/global_search.vala6
3 files changed, 5 insertions, 8 deletions
diff --git a/libdino/src/service/content_item_store.vala b/libdino/src/service/content_item_store.vala
index 8c4f4665..0b89e288 100644
--- a/libdino/src/service/content_item_store.vala
+++ b/libdino/src/service/content_item_store.vala
@@ -26,7 +26,6 @@ public class ContentItemStore : StreamInteractionModule, Object {
this.stream_interactor = stream_interactor;
this.db = db;
- stream_interactor.get_module(MessageProcessor.IDENTITY).message_sent.connect((message, conversation) => insert_message(message, conversation));
stream_interactor.get_module(FileManager.IDENTITY).received_file.connect(insert_file_transfer);
}
@@ -180,7 +179,6 @@ public abstract class ContentItem : Object {
public string type_ { get; set; }
public Jid? jid { get; set; default=null; }
public DateTime? sort_time { get; set; default=null; }
- public double seccondary_sort_indicator { get; set; }
public DateTime? display_time { get; set; default=null; }
public Encryption? encryption { get; set; default=null; }
public Entities.Message.Marked? mark { get; set; default=null; }
@@ -190,7 +188,6 @@ public abstract class ContentItem : Object {
this.type_ = ty;
this.jid = jid;
this.sort_time = sort_time;
- this.seccondary_sort_indicator = id;
this.display_time = display_time;
this.encryption = encryption;
this.mark = mark;
@@ -202,7 +199,7 @@ public abstract class ContentItem : Object {
res = a.display_time.compare(b.display_time);
}
if (res == 0) {
- res = a.seccondary_sort_indicator - b.seccondary_sort_indicator > 0 ? 1 : -1;
+ res = a.id - b.id > 0 ? 1 : -1;
}
return res;
}
diff --git a/main/src/ui/conversation_summary/content_populator.vala b/main/src/ui/conversation_summary/content_populator.vala
index 9ebb9159..c19d0d26 100644
--- a/main/src/ui/conversation_summary/content_populator.vala
+++ b/main/src/ui/conversation_summary/content_populator.vala
@@ -78,7 +78,7 @@ public class ContentMetaItem : Plugins.MetaConversationItem {
public ContentMetaItem(ContentItem content_item, ContentItemWidgetFactory widget_factory) {
this.jid = content_item.jid;
this.sort_time = content_item.sort_time;
- this.seccondary_sort_indicator = content_item.seccondary_sort_indicator;
+ this.seccondary_sort_indicator = content_item.id;
this.display_time = content_item.display_time;
this.encryption = content_item.encryption;
this.mark = content_item.mark;
diff --git a/main/src/ui/global_search.vala b/main/src/ui/global_search.vala
index eadf142c..82aac76a 100644
--- a/main/src/ui/global_search.vala
+++ b/main/src/ui/global_search.vala
@@ -160,7 +160,7 @@ class GlobalSearch : Overlay {
string display_name = Util.get_conversation_display_name(stream_interactor, item.conversation);
string title = item.message.type_ == Message.Type.GROUPCHAT ? _("In %s").printf(display_name) : _("With %s").printf(display_name);
- Box header_box = new Box(Orientation.HORIZONTAL, 10) { margin_left=7, visible=true };
+ Box header_box = new Box(Orientation.HORIZONTAL, 10) { margin_start=7, visible=true };
header_box.add(new Label(@"<b>$(Markup.escape_text(title))</b>") { ellipsize=EllipsizeMode.END, xalign=0, use_markup=true, visible=true });
header_box.add(date_label);
@@ -223,7 +223,7 @@ class GlobalSearch : Overlay {
private Grid get_context_message_widget(MessageItem item) {
Grid grid = get_skeleton(item);
- grid.margin_left = 7;
+ grid.margin_start = 7;
Label label = new Label(item.message.body.replace("\n", "").replace("\r", "")) { ellipsize=EllipsizeMode.MIDDLE, xalign=0, visible=true };
grid.attach(label, 1, 1, 1, 1);
grid.opacity = 0.55;
@@ -231,7 +231,7 @@ class GlobalSearch : Overlay {
}
private Grid get_skeleton(MessageItem item) {
- AvatarImage image = new AvatarImage() { height=32, width=32, margin_right=7, valign=Align.START, visible=true, allow_gray = false };
+ AvatarImage image = new AvatarImage() { height=32, width=32, margin_end=7, valign=Align.START, visible=true, allow_gray = false };
image.set_jid(stream_interactor, item.jid, item.message.account);
Grid grid = new Grid() { row_homogeneous=false, visible=true };
grid.attach(image, 0, 0, 1, 2);