mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-04-27 18:51:13 -04:00
ffi: Correct timestamp value and remove is_read flag
The timestamp value of the Notification was not reliable since it was the timestamp in which it was generated internally, not the timestamp of when the event was sent, now we instead expose the `origin_server_ts` of the TimelineEvent. `is_read` is also very unreliable, so it's just removed for now.
This commit is contained in:
@@ -22,8 +22,6 @@ dictionary NotificationItem {
|
||||
boolean is_noisy;
|
||||
boolean is_direct;
|
||||
boolean is_encrypted;
|
||||
boolean is_read;
|
||||
u64 timestamp;
|
||||
};
|
||||
|
||||
interface TimelineEvent {};
|
||||
|
||||
@@ -19,6 +19,10 @@ impl TimelineEvent {
|
||||
self.0.sender().to_string()
|
||||
}
|
||||
|
||||
pub fn timestamp(&self) -> u64 {
|
||||
self.0.origin_server_ts().0.into()
|
||||
}
|
||||
|
||||
pub fn event_type(&self) -> Result<TimelineEventType, ClientError> {
|
||||
let event_type = match &self.0 {
|
||||
AnySyncTimelineEvent::MessageLike(event) => {
|
||||
|
||||
@@ -18,9 +18,6 @@ pub struct NotificationItem {
|
||||
pub is_noisy: bool,
|
||||
pub is_direct: bool,
|
||||
pub is_encrypted: bool,
|
||||
pub is_read: bool,
|
||||
|
||||
pub timestamp: u64,
|
||||
}
|
||||
|
||||
impl NotificationItem {
|
||||
@@ -48,8 +45,6 @@ impl NotificationItem {
|
||||
is_noisy,
|
||||
is_direct: room.is_direct().await?,
|
||||
is_encrypted: room.is_encrypted().await?,
|
||||
is_read: notification.read,
|
||||
timestamp: notification.ts.0.into(),
|
||||
};
|
||||
Ok(item)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user