aboutsummaryrefslogtreecommitdiff
path: root/main/src
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-08-31 18:40:58 +0200
committerfiaxh <git@mx.ax.lt>2017-08-31 18:54:38 +0200
commitd2a5287effcf60a44084568a37c9c9091d336178 (patch)
tree392d24930cf5c635f114c3e4f30bfce930edf76f /main/src
parenta257b163376174e4f5efcbc82c9fdd56463c3191 (diff)
downloaddino-d2a5287effcf60a44084568a37c9c9091d336178.tar.gz
dino-d2a5287effcf60a44084568a37c9c9091d336178.zip
Use utc time everywhere
Diffstat (limited to 'main/src')
-rw-r--r--main/src/ui/conversation_selector/conversation_row.vala4
-rw-r--r--main/src/ui/conversation_summary/conversation_view.vala4
-rw-r--r--main/src/ui/conversation_summary/file_populator.vala6
-rw-r--r--main/src/ui/util/helper.vala2
4 files changed, 8 insertions, 8 deletions
diff --git a/main/src/ui/conversation_selector/conversation_row.vala b/main/src/ui/conversation_selector/conversation_row.vala
index ecad3467..d9432583 100644
--- a/main/src/ui/conversation_selector/conversation_row.vala
+++ b/main/src/ui/conversation_selector/conversation_row.vala
@@ -56,7 +56,7 @@ public abstract class ConversationRow : ListBoxRow {
Entities.Message? message = stream_interactor.get_module(MessageStorage.IDENTITY).get_last_message(conversation);
if (message != null) {
update_message(message.body.replace("\n", " "));
- update_time(message.time.to_local());
+ update_time(message.time.to_utc());
}
}
@@ -163,7 +163,7 @@ public abstract class ConversationRow : ListBoxRow {
}
private static string get_relative_time(DateTime datetime) {
- DateTime now = new DateTime.now_local();
+ DateTime now = new DateTime.now_utc();
TimeSpan timespan = now.difference(datetime);
if (timespan > 365 * TimeSpan.DAY) {
return datetime.get_year().to_string();
diff --git a/main/src/ui/conversation_summary/conversation_view.vala b/main/src/ui/conversation_summary/conversation_view.vala
index 370f7943..9379e8ba 100644
--- a/main/src/ui/conversation_summary/conversation_view.vala
+++ b/main/src/ui/conversation_summary/conversation_view.vala
@@ -134,11 +134,11 @@ public class ConversationView : Box, Plugins.ConversationItemCollection {
Dino.Application app = Dino.Application.get_default();
if (item_skeletons.size == 1) {
foreach (Plugins.ConversationItemPopulator populator in app.plugin_registry.conversation_item_populators) {
- populator.populate_between_widgets(conversation, item.sort_time, new DateTime.now_utc());
+ populator.populate_timespan(conversation, item.sort_time, new DateTime.now_utc());
}
} else {
foreach (Plugins.ConversationItemPopulator populator in app.plugin_registry.conversation_item_populators) {
- populator.populate_between_widgets(conversation, item.sort_time, meta_items.higher(item).sort_time);
+ populator.populate_timespan(conversation, item.sort_time, meta_items.higher(item).sort_time);
}
}
}
diff --git a/main/src/ui/conversation_summary/file_populator.vala b/main/src/ui/conversation_summary/file_populator.vala
index bdaeaa41..9046155a 100644
--- a/main/src/ui/conversation_summary/file_populator.vala
+++ b/main/src/ui/conversation_summary/file_populator.vala
@@ -31,15 +31,15 @@ class FilePopulator : Plugins.ConversationItemPopulator, Object {
public void close(Conversation conversation) { }
- public void populate_timespan(Conversation conversation, DateTime from, DateTime to) { }
-
- public void populate_between_widgets(Conversation conversation, DateTime from, DateTime to) {
+ public void populate_timespan(Conversation conversation, DateTime from, DateTime to) {
Gee.List<FileTransfer> transfers = stream_interactor.get_module(FileManager.IDENTITY).get_file_transfers(conversation.account, conversation.counterpart, from, to);
foreach (FileTransfer transfer in transfers) {
insert_file(transfer);
}
}
+ public void populate_between_widgets(Conversation conversation, DateTime from, DateTime to) { }
+
private void insert_file(FileTransfer transfer) {
if (transfer.mime_type.has_prefix("image")) {
item_collection.insert_item(new ImageItem(stream_interactor, transfer));
diff --git a/main/src/ui/util/helper.vala b/main/src/ui/util/helper.vala
index c94752ed..a4f800f8 100644
--- a/main/src/ui/util/helper.vala
+++ b/main/src/ui/util/helper.vala
@@ -126,7 +126,7 @@ public static bool is_dark_theme(Gtk.Widget widget) {
public static bool is_24h_format() {
GLib.Settings settings = new GLib.Settings("org.gnome.desktop.interface");
string settings_format = settings.get_string("clock-format");
- string p_format = (new DateTime.now_local()).format("%p");
+ string p_format = (new DateTime.now_utc()).format("%p");
return settings_format == "24h" || p_format == " ";
}