blob: df30a6a654b67c9d258184103d27c316322040e4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
// SPDX-FileCopyrightText: 2025 cel <cel@bunny.garden>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
#[derive(Clone, Debug)]
pub struct Metadata {
pub bytes: u32,
pub hash: String,
pub r#type: String,
}
#[derive(Clone, Debug)]
pub struct Data {
pub hash: String,
pub data_b64: String,
}
#[derive(Clone, Debug)]
pub struct Avatar(Vec<u8>);
impl From<stanza::xep_0084::Info> for Metadata {
fn from(value: stanza::xep_0084::Info) -> Self {
Self {
bytes: value.bytes,
hash: value.id,
r#type: value.r#type,
}
}
}
impl From<stanza::xep_0084::Data> for Data {
fn from(value: stanza::xep_0084::Data) -> Self {
Self {
hash: todo!(),
data_b64: todo!(),
}
}
}
|