support timestamped appservice messaging

Co-authored-by: strawberry <strawberry@puppygock.gay>
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
Matthias Ahouansou 2024-08-14 20:01:34 -04:00 committed by Jason Volk
parent 66679c7522
commit 2d9aab2e79
14 changed files with 69 additions and 5 deletions

View file

@ -1,6 +1,6 @@
use std::{collections::BTreeMap, sync::Arc};
use ruma::{events::TimelineEventType, EventId};
use ruma::{events::TimelineEventType, EventId, MilliSecondsSinceUnixEpoch};
use serde::Deserialize;
use serde_json::value::RawValue as RawJsonValue;
@ -13,4 +13,8 @@ pub struct PduBuilder {
pub unsigned: Option<BTreeMap<String, serde_json::Value>>,
pub state_key: Option<String>,
pub redacts: Option<Arc<EventId>>,
/// For timestamped messaging, should only be used for appservices
///
/// Will be set to current time if None
pub timestamp: Option<MilliSecondsSinceUnixEpoch>,
}