Merge remote-tracking branch 'upstream/main' into conduwuit-changes

This commit is contained in:
strawberry 2024-03-08 17:10:49 -05:00
commit 13b8386812
2 changed files with 6 additions and 4 deletions

View File

@ -10,6 +10,7 @@ Breaking changes:
- The conversion from `PushRule` to `ConditionalPushRule` is infallible since
the `conditions` field is optional.
- `MissingConditionsError` was removed.
- The `ts` field in `Request` for `get_media_preview` is now `Option`.
Improvements:

View File

@ -33,7 +33,8 @@ pub mod v3 {
/// Preferred point in time (in milliseconds) to return a preview for.
#[ruma_api(query)]
pub ts: MilliSecondsSinceUnixEpoch,
#[serde(skip_serializing_if = "Option::is_none")]
pub ts: Option<MilliSecondsSinceUnixEpoch>,
}
/// Response type for the `get_media_preview` endpoint.
@ -49,9 +50,9 @@ pub mod v3 {
}
impl Request {
/// Creates a new `Request` with the given url and timestamp.
pub fn new(url: String, ts: MilliSecondsSinceUnixEpoch) -> Self {
Self { url, ts }
/// Creates a new `Request` with the given url.
pub fn new(url: String) -> Self {
Self { url, ts: None }
}
}