Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Hörist <philipp@hoerist.com>2022-10-02 21:38:13 +0300
committerPhilipp Hörist <philipp@hoerist.com>2022-10-02 21:38:13 +0300
commit84008836fb40cf1a12f766a88d90dd46f0dda163 (patch)
tree6a99be54861d356f8d4466f4052faa8afc08d94c
parent9019cf24b4ebcfa081acfb5d1277c4e07e29866c (diff)
refactor: ChatListRow: Simplify setting timestamp
-rw-r--r--gajim/gtk/chat_list_row.py14
1 files changed, 4 insertions, 10 deletions
diff --git a/gajim/gtk/chat_list_row.py b/gajim/gtk/chat_list_row.py
index 1bfe7f51e..a97a32966 100644
--- a/gajim/gtk/chat_list_row.py
+++ b/gajim/gtk/chat_list_row.py
@@ -167,9 +167,7 @@ class ChatListRow(Gtk.ListBoxRow):
nickname=me_nickname,
additional_data=line.additional_data)
- self.timestamp = line.time
- uf_timestamp = get_uf_relative_time(line.time)
- self._ui.timestamp_label.set_text(uf_timestamp)
+ self.set_timestamp(line.time)
self.stanza_id = line.stanza_id
self.message_id = line.message_id
@@ -178,17 +176,13 @@ class ChatListRow(Gtk.ListBoxRow):
KindConstant.FILE_TRANSFER_OUTGOING):
self.set_message_text(
_('File'), icon_name='text-x-generic-symbolic')
- self.timestamp = line.time
- uf_timestamp = get_uf_relative_time(line.time)
- self._ui.timestamp_label.set_text(uf_timestamp)
+ self.set_timestamp(line.time)
if line.kind in (KindConstant.CALL_INCOMING,
KindConstant.CALL_OUTGOING):
self.set_message_text(
_('Call'), icon_name='call-start-symbolic')
- self.timestamp = line.time
- uf_timestamp = get_uf_relative_time(line.time)
- self._ui.timestamp_label.set_text(uf_timestamp)
+ self.set_timestamp(line.time)
self.show_all()
@@ -285,7 +279,7 @@ class ChatListRow(Gtk.ListBoxRow):
def set_stanza_id(self, stanza_id: str) -> None:
self.stanza_id = stanza_id
- def set_timestamp(self, timestamp: int) -> None:
+ def set_timestamp(self, timestamp: float) -> None:
self.timestamp = timestamp
self.update_time()