From 7d2f995a097086be01426cc79c9c801dabaf9e3b Mon Sep 17 00:00:00 2001 From: fiaxh Date: Fri, 24 Mar 2017 22:57:05 +0100 Subject: Fix conversation last_active --- libdino/src/service/chat_interaction.vala | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libdino/src/service/chat_interaction.vala') diff --git a/libdino/src/service/chat_interaction.vala b/libdino/src/service/chat_interaction.vala index f6da1ee6..9943c3c3 100644 --- a/libdino/src/service/chat_interaction.vala +++ b/libdino/src/service/chat_interaction.vala @@ -51,8 +51,8 @@ public class ChatInteraction : StreamInteractionModule, Object { if (!last_input_interaction.has_key(conversation)) { send_chat_state_notification(conversation, Xep.ChatStateNotifications.STATE_COMPOSING); } - last_input_interaction[conversation] = new DateTime.now_utc(); - last_interface_interaction[conversation] = new DateTime.now_utc(); + last_input_interaction[conversation] = new DateTime.now_local(); + last_interface_interaction[conversation] = new DateTime.now_local(); } public void on_message_cleared(Conversation? conversation) { @@ -62,7 +62,7 @@ public class ChatInteraction : StreamInteractionModule, Object { } } - public void on_conversation_selected(Conversation? conversation) { + public void on_conversation_selected(Conversation conversation) { on_conversation_unfocused(selected_conversation); selected_conversation = conversation; on_conversation_focused(conversation); @@ -106,7 +106,7 @@ public class ChatInteraction : StreamInteractionModule, Object { if (!iter.valid && iter.has_next()) iter.next(); Conversation conversation = iter.get_key(); if (last_input_interaction.has_key(conversation) && - (new DateTime.now_utc()).difference(last_input_interaction[conversation]) >= 15 * TimeSpan.SECOND) { + (new DateTime.now_local()).difference(last_input_interaction[conversation]) >= 15 * TimeSpan.SECOND) { iter.unset(); send_chat_state_notification(conversation, Xep.ChatStateNotifications.STATE_PAUSED); } @@ -115,7 +115,7 @@ public class ChatInteraction : StreamInteractionModule, Object { if (!iter.valid && iter.has_next()) iter.next(); Conversation conversation = iter.get_key(); if (last_interface_interaction.has_key(conversation) && - (new DateTime.now_utc()).difference(last_interface_interaction[conversation]) >= 1.5 * TimeSpan.MINUTE) { + (new DateTime.now_local()).difference(last_interface_interaction[conversation]) >= 1.5 * TimeSpan.MINUTE) { iter.unset(); send_chat_state_notification(conversation, Xep.ChatStateNotifications.STATE_GONE); } -- cgit v1.2.3-54-g00ecf