From af8469d1f87f0294d9a37a11093a1031c589e7d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Thu, 9 Nov 2023 09:55:23 +0100 Subject: [PATCH] member-timestamp: Timestamps are in seconds We provide timestamps in seconds but they are treated as milliseconds so the formatted date and time are wrong --- .../view/content/room_history/member_timestamp/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/session/view/content/room_history/member_timestamp/mod.rs b/src/session/view/content/room_history/member_timestamp/mod.rs index 77ac4397..fdf996f7 100644 --- a/src/session/view/content/room_history/member_timestamp/mod.rs +++ b/src/session/view/content/room_history/member_timestamp/mod.rs @@ -17,7 +17,7 @@ mod imp { pub struct MemberTimestamp { /// The room member. pub member: glib::WeakRef, - /// The timestamp, in milliseconds since Unix Epoch. + /// The timestamp, in seconds since Unix Epoch. /// /// A value of 0 means no timestamp. pub timestamp: Cell, @@ -102,7 +102,7 @@ impl MemberTimestamp { self.notify("member"); } - /// The timestamp of this read receipt, in milliseconds since Unix Epoch, if + /// The timestamp of this read receipt, in seconds since Unix Epoch, if /// any. /// /// A value of 0 means no timestamp. @@ -129,7 +129,7 @@ impl MemberTimestamp { return String::new(); } - let datetime = glib::DateTime::from_unix_utc((timestamp / 1000) as i64) + let datetime = glib::DateTime::from_unix_utc(timestamp as i64) .and_then(|t| t.to_local()) .unwrap();