mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-18 00:01:24 +01:00
client_server: use and provide authenticated media API
This commit is contained in:
parent
7f6ab63752
commit
79053ad052
4 changed files with 568 additions and 101 deletions
|
|
@ -24,6 +24,31 @@ pub(crate) struct Ar<T> {
|
|||
pub(crate) appservice_info: Option<RegistrationInfo>,
|
||||
}
|
||||
|
||||
impl<T> Ar<T> {
|
||||
pub(crate) fn map_body<F, U>(self, f: F) -> Ar<U>
|
||||
where
|
||||
F: FnOnce(T) -> U,
|
||||
{
|
||||
let Ar {
|
||||
body,
|
||||
sender_user,
|
||||
sender_device,
|
||||
sender_servername,
|
||||
json_body,
|
||||
appservice_info,
|
||||
} = self;
|
||||
|
||||
Ar {
|
||||
body: f(body),
|
||||
sender_user,
|
||||
sender_device,
|
||||
sender_servername,
|
||||
json_body,
|
||||
appservice_info,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Deref for Ar<T> {
|
||||
type Target = T;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue