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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
pub mod ban_user;
pub mod forget_room;
pub mod get_member_events;
pub mod invite_user;
pub mod join_room_by_id;
pub mod join_room_by_id_or_alias;
pub mod joined_members;
pub mod joined_rooms;
pub mod kick_user;
pub mod leave_room;
#[cfg(feature = "unstable-msc2666")]
pub mod mutual_rooms;
pub mod unban_user;
use std::collections::BTreeMap;
use ruma_common::{thirdparty::Medium, OwnedServerName, OwnedServerSigningKeyId, OwnedUserId};
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Deserialize, Serialize)]
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
pub struct ThirdPartySigned {
pub sender: OwnedUserId,
pub mxid: OwnedUserId,
pub token: String,
pub signatures: BTreeMap<OwnedServerName, BTreeMap<OwnedServerSigningKeyId, String>>,
}
impl ThirdPartySigned {
pub fn new(
sender: OwnedUserId,
mxid: OwnedUserId,
token: String,
signatures: BTreeMap<OwnedServerName, BTreeMap<OwnedServerSigningKeyId, String>>,
) -> Self {
Self { sender, mxid, token, signatures }
}
}
#[derive(Clone, Debug, Deserialize, Serialize)]
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
pub struct Invite3pid {
pub id_server: String,
pub id_access_token: String,
pub medium: Medium,
pub address: String,
}
#[derive(Debug)]
#[allow(clippy::exhaustive_structs)]
pub struct Invite3pidInit {
pub id_server: String,
pub id_access_token: String,
pub medium: Medium,
pub address: String,
}
impl From<Invite3pidInit> for Invite3pid {
fn from(init: Invite3pidInit) -> Self {
let Invite3pidInit { id_server, id_access_token, medium, address } = init;
Self { id_server, id_access_token, medium, address }
}
}