Skip to content
Snippets Groups Projects
Commit 2cc72de8 authored by Jason Volk's avatar Jason Volk Committed by 🥺
Browse files

fix lossy origin regression 12a8c9ba


Signed-off-by: default avatarJason Volk <jason@zemos.net>
parent 458e5681
No related branches found
No related tags found
No related merge requests found
...@@ -304,6 +304,7 @@ async fn sync_helper( ...@@ -304,6 +304,7 @@ async fn sync_helper(
let event = PduEvent { let event = PduEvent {
event_id: EventId::new(services().globals.server_name()).into(), event_id: EventId::new(services().globals.server_name()).into(),
sender: sender_user.clone(), sender: sender_user.clone(),
origin: None,
origin_server_ts: utils::millis_since_unix_epoch() origin_server_ts: utils::millis_since_unix_epoch()
.try_into() .try_into()
.expect("Timestamp is valid js_int value"), .expect("Timestamp is valid js_int value"),
......
...@@ -32,6 +32,8 @@ pub struct PduEvent { ...@@ -32,6 +32,8 @@ pub struct PduEvent {
pub event_id: Arc<EventId>, pub event_id: Arc<EventId>,
pub room_id: OwnedRoomId, pub room_id: OwnedRoomId,
pub sender: OwnedUserId, pub sender: OwnedUserId,
#[serde(skip_serializing_if = "Option::is_none")]
pub origin: Option<String>,
pub origin_server_ts: UInt, pub origin_server_ts: UInt,
#[serde(rename = "type")] #[serde(rename = "type")]
pub kind: TimelineEventType, pub kind: TimelineEventType,
......
...@@ -719,6 +719,7 @@ struct RoomCreate { ...@@ -719,6 +719,7 @@ struct RoomCreate {
event_id: ruma::event_id!("$thiswillbefilledinlater").into(), event_id: ruma::event_id!("$thiswillbefilledinlater").into(),
room_id: room_id.to_owned(), room_id: room_id.to_owned(),
sender: sender.to_owned(), sender: sender.to_owned(),
origin: None,
origin_server_ts: utils::millis_since_unix_epoch() origin_server_ts: utils::millis_since_unix_epoch()
.try_into() .try_into()
.expect("time is valid"), .expect("time is valid"),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment