client-api: don't require ts
request parameter for URL previews
spec does not say this is required and Element Android (legacy) is a client known to *not* send this query parameter. Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
22e89bde2b
commit
b2542df2bb
@ -10,6 +10,7 @@ Breaking changes:
|
|||||||
- The conversion from `PushRule` to `ConditionalPushRule` is infallible since
|
- The conversion from `PushRule` to `ConditionalPushRule` is infallible since
|
||||||
the `conditions` field is optional.
|
the `conditions` field is optional.
|
||||||
- `MissingConditionsError` was removed.
|
- `MissingConditionsError` was removed.
|
||||||
|
- The `ts` field in `Request` for `get_media_preview` is now `Option`.
|
||||||
|
|
||||||
Improvements:
|
Improvements:
|
||||||
|
|
||||||
|
@ -33,7 +33,8 @@ pub mod v3 {
|
|||||||
|
|
||||||
/// Preferred point in time (in milliseconds) to return a preview for.
|
/// Preferred point in time (in milliseconds) to return a preview for.
|
||||||
#[ruma_api(query)]
|
#[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.
|
/// Response type for the `get_media_preview` endpoint.
|
||||||
@ -49,9 +50,9 @@ pub mod v3 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Request {
|
impl Request {
|
||||||
/// Creates a new `Request` with the given url and timestamp.
|
/// Creates a new `Request` with the given url.
|
||||||
pub fn new(url: String, ts: MilliSecondsSinceUnixEpoch) -> Self {
|
pub fn new(url: String) -> Self {
|
||||||
Self { url, ts }
|
Self { url, ts: None }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user