ruma_client_api/
profile.rs1#[cfg(feature = "unstable-msc4466")]
4use ruma_common::serde::StringEnum;
5#[cfg(feature = "client")]
6use ruma_common::{
7 api::{
8 MatrixVersion,
9 path_builder::{StablePathSelector, VersionHistory},
10 },
11 profile::ProfileFieldName,
12};
13
14#[cfg(feature = "unstable-msc4466")]
15use crate::PrivOwnedStr;
16
17pub mod delete_profile_field;
18pub mod get_avatar_url;
19pub mod get_display_name;
20pub mod get_profile;
21pub mod get_profile_field;
22#[cfg(feature = "client")]
23mod profile_field_serde;
24pub mod set_avatar_url;
25pub mod set_display_name;
26pub mod set_profile_field;
27mod static_profile_field;
28
29pub use self::static_profile_field::*;
30
31#[cfg(feature = "client")]
33const EXTENDED_PROFILE_FIELD_HISTORY: VersionHistory = VersionHistory::new(
34 &[(
35 Some("uk.tcpip.msc4133"),
36 "/_matrix/client/unstable/uk.tcpip.msc4133/profile/{user_id}/{field}",
37 )],
38 &[(
39 StablePathSelector::Version(MatrixVersion::V1_16),
40 "/_matrix/client/v3/profile/{user_id}/{field}",
41 )],
42 None,
43 None,
44);
45
46#[cfg(feature = "client")]
49fn field_existed_before_extended_profiles(field_name: &ProfileFieldName) -> bool {
50 matches!(field_name, ProfileFieldName::AvatarUrl | ProfileFieldName::DisplayName)
51}
52
53#[cfg(feature = "unstable-msc4466")]
58#[doc = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/src/doc/string_enum.md"))]
59#[derive(Clone, Default, StringEnum)]
60#[ruma_enum(rename_all = "snake_case")]
61#[cfg_attr(not(ruma_unstable_exhaustive_types), non_exhaustive)]
62pub enum PropagateTo {
63 #[default]
66 All,
67
68 Unchanged,
71
72 None,
74
75 #[doc(hidden)]
76 _Custom(PrivOwnedStr),
77}