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