aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2020-01-22 01:24:14 +0100
committerMarvin W <git@larma.de>2020-01-22 01:24:14 +0100
commit3b0a27e14bcce3a06f0ac1199bb0acb5c3434444 (patch)
tree7f0f0a720b9d48e6eb81beb33f81b48cae74ff2b
parent8c5957537c63e2a8b9a937fe99db509b153df6c6 (diff)
downloaddino-3b0a27e14bcce3a06f0ac1199bb0acb5c3434444.tar.gz
dino-3b0a27e14bcce3a06f0ac1199bb0acb5c3434444.zip
Fix invalid header creation for date separators
-rw-r--r--libdino/src/plugin/interfaces.vala4
-rw-r--r--main/src/ui/conversation_summary/chat_state_populator.vala2
-rw-r--r--main/src/ui/conversation_summary/content_populator.vala4
-rw-r--r--main/src/ui/conversation_summary/conversation_item_skeleton.vala6
-rw-r--r--main/src/ui/conversation_summary/date_separator_populator.vala2
5 files changed, 7 insertions, 11 deletions
diff --git a/libdino/src/plugin/interfaces.vala b/libdino/src/plugin/interfaces.vala
index b8c98dde..535addf2 100644
--- a/libdino/src/plugin/interfaces.vala
+++ b/libdino/src/plugin/interfaces.vala
@@ -91,12 +91,12 @@ public abstract interface NotificationPopulator : Object {
public abstract class MetaConversationItem : Object {
public virtual string populator_id { get; set; }
- public virtual Jid jid { get; set; }
+ public virtual Jid? jid { get; set; default=null; }
public virtual bool dim { get; set; default=false; }
public virtual DateTime sort_time { get; set; default = new DateTime.now_utc(); }
public virtual long seccondary_sort_indicator { get; set; }
public virtual long tertiary_sort_indicator { get; set; }
- public virtual DateTime display_time { get; set; default = new DateTime.now_utc(); }
+ public virtual DateTime? display_time { get; set; default = null; }
public virtual Encryption encryption { get; set; default = Encryption.NONE; }
public virtual Entities.Message.Marked mark { get; set; default = Entities.Message.Marked.NONE; }
diff --git a/main/src/ui/conversation_summary/chat_state_populator.vala b/main/src/ui/conversation_summary/chat_state_populator.vala
index 291f3537..23363b03 100644
--- a/main/src/ui/conversation_summary/chat_state_populator.vala
+++ b/main/src/ui/conversation_summary/chat_state_populator.vala
@@ -89,7 +89,7 @@ private enum StateType {
}
private class MetaChatStateItem : Plugins.MetaConversationItem {
- public override Jid jid { get; set; }
+ public override Jid? jid { get; set; }
public override bool dim { get; set; default=true; }
public override DateTime sort_time { get; set; default=new DateTime.now_utc().add_years(10); }
diff --git a/main/src/ui/conversation_summary/content_populator.vala b/main/src/ui/conversation_summary/content_populator.vala
index 368f2a67..e8eee06c 100644
--- a/main/src/ui/conversation_summary/content_populator.vala
+++ b/main/src/ui/conversation_summary/content_populator.vala
@@ -67,9 +67,9 @@ public class ContentProvider : ContentItemCollection, Object {
}
public class ContentMetaItem : Plugins.MetaConversationItem {
- public override Jid jid { get; set; }
+ public override Jid? jid { get; set; }
public override DateTime sort_time { get; set; }
- public override DateTime display_time { get; set; }
+ public override DateTime? display_time { get; set; }
public override Encryption encryption { get; set; }
public ContentItem content_item;
diff --git a/main/src/ui/conversation_summary/conversation_item_skeleton.vala b/main/src/ui/conversation_summary/conversation_item_skeleton.vala
index 46669863..175e01ff 100644
--- a/main/src/ui/conversation_summary/conversation_item_skeleton.vala
+++ b/main/src/ui/conversation_summary/conversation_item_skeleton.vala
@@ -32,12 +32,8 @@ public class ConversationItemSkeleton : EventBox {
image.set_conversation_participant(stream_interactor, conversation, item.jid);
image_content_box.add(image);
}
- if (item.display_time != null) {
+ if (item.requires_header) {
metadata_header = new ItemMetaDataHeader(stream_interactor, conversation, item) { visible=true };
- if (!item.requires_header) {
- metadata_header.name_label.visible = false;
- metadata_header.dot_label.visible = false;
- }
header_content_box.add(metadata_header);
}
diff --git a/main/src/ui/conversation_summary/date_separator_populator.vala b/main/src/ui/conversation_summary/date_separator_populator.vala
index f1ad17ef..3ddb0d9a 100644
--- a/main/src/ui/conversation_summary/date_separator_populator.vala
+++ b/main/src/ui/conversation_summary/date_separator_populator.vala
@@ -36,7 +36,7 @@ class DateSeparatorPopulator : Plugins.ConversationItemPopulator, Plugins.Conver
public void populate_timespan(Conversation conversation, DateTime after, DateTime before) { }
private void on_inserted_item(Plugins.MetaConversationItem item) {
- if (item.display_time == null) return;
+ if (!(item is ContentMetaItem)) return;
DateTime time = item.sort_time.to_local();
DateTime msg_date = new DateTime.local(time.get_year(), time.get_month(), time.get_day_of_month(), 0, 0, 0);