Skip to main content Module profile Copy item path Source use std::borrow::Cow ; π use std::collections::BTreeMap ; π use std::sync::Arc ; π use futures::Stream; π use futures::StreamExt; π use futures::TryStreamExt; π use futures::future::Either; π use futures::future::join; π use futures::stream::empty; π use ruma::CanonicalJsonObject; π use ruma::CanonicalJsonValue; π use ruma::MxcUri; π use ruma::OwnedMxcUri; π use ruma::OwnedRoomId; π use ruma::OwnedUserId; π use ruma::RoomId; π use ruma::UserId; π use ruma::api::federation::query::get_profile_information; π use ruma::events::StateEventType; π use ruma::events::room::member::MembershipState; π use ruma::events::room::member::RoomMemberEventContent; π use ruma::profile::ProfileFieldName; π use ruma::profile::ProfileFieldValue; π use serde::Deserialize ; π use serde::Deserialize ; π use serde_json::Value ; π use tuwunel_core::Err ; π use tuwunel_core::Result ; π use tuwunel_core::err ; π use tuwunel_core::implement; π use tuwunel_core::smallvec::SmallVec; π use tuwunel_core::utils::BoolExt ; π use tuwunel_core::utils::MutexMap ; π use tuwunel_core::utils::MutexMapGuard ; π use tuwunel_core::utils::ReadyExt ; π use tuwunel_core::utils::future::TryExtExt ; π use tuwunel_core::utils::result::NotFound ; π use tuwunel_core::utils::stream::IterStream ; π use tuwunel_core::utils::stream::TryIgnore ; π use tuwunel_core::utils::stream::TryReadyExt ; π use tuwunel_core::utils::stream::automatic_width ; π use tuwunel_core::warn ; π use tuwunel_database::Deserialized ; π use tuwunel_database::Ignore ; π use tuwunel_database::Interfix ; π use tuwunel_database::Json ; π use tuwunel_database::KeyVal ; π use tuwunel_database::Map ; π use tuwunel_database::Txn ; π use tuwunel_database::deserialize_from_slice ; π use tuwunel_database::serialize_key ; π use tuwunel_matrix::PduBuilder ; π use tuwunel_matrix::pdu::Content ; π remote π Service Propagation Per-update policy for fanning a global profile change out to each of
the userβs joined rooms as a fresh m.room.member event. Mirrors the
MSC4466 propagate_to axis. MAX_AVATAR_URL_LENGTH π MAX_DISPLAYNAME_LENGTH Maximum local display name length, in characters. MAX_KEY_LENGTH π MSC4133 maximum profile field-name length, in bytes. MAX_PROFILE_SIZE π MSC4133 maximum total profile size (64 KiB), measured over the JSON of the
full profile including displayname and avatar_url. MAX_STATUS_EMOJI_LENGTH π MSC4426 maximum m.status emoji length, in bytes. MAX_STATUS_TEXT_LENGTH π MSC4426 maximum m.status text length, in bytes. MAX_TIMEZONE_COMPONENTS π Maximum number of /-separated components in an m.tz name. MAX_TIMEZONE_LENGTH π Maximum m.tz length, in bytes. avatar_matches π Whether the memberβs avatar reads as url. changed_writes π Returns the profile writes that change the member event. check_avatar_mxc π check_avatar_url π check_avatar_url_length π check_call π Validate an MSC4426 call indicator. check_displayname π Bound a display name by its character budget. check_displayname_length π check_field_length π Bound a display name or avatar URL by its length budget. check_length π Bound one profile value by its length budget. check_member_avatar_url Validates a member eventβs avatar URL. check_member_content Validates a client-supplied m.room.member content from any route that accepts one. check_member_displayname Bounds a member eventβs display name, in characters. check_member_size Bounds the canonical size of a client-supplied m.room.member content, in bytes. check_profile_key π Validate a profile field name against the Common Namespaced Identifier
Grammar: a lowercase-leading identifier over [a-z0-9_.-], matching the
reference homeserver. Length is bounded separately by MAX_KEY_LENGTH. check_profile_value π Validate a profile field value against the schema of the proposal naming
the field. check_status π Validate an MSC4426 status against its two required fields and their byte
budgets. check_timezone π Validate an MSC4175 time zone against the shape of an IANA Time Zone
Database name. field_matches π Whether the memberβs name field reads as value. holds_current π is_timezone_component π Test one /-separated component of an m.tz name. is_timezone_name π Test a string against the tzfile naming rules, narrowed to what every name
the database ships actually uses. member_holds π overlay_holds π overlay_member_content π Overlays the profile writes onto the previous member content. string_field Pairs a profile field with the string a write stores in it. write_field π ChangeKeyVal π A row of the profile change log: the fieldβs name rides the key so that a
write covering several fields needs one count, and the value names the user
for the rows keyed by room. ChangedFields π The field names one write actually changes, almost always just the one the
caller named. ChangedWrites π ClearedFields π The field names a profile holds when it is cleared. ProfileChange One logged profile write: the user whose profile was written, and the name
of a field the write logged. ProfileLock π ProfileValue One field of a profile write: the name and the value to store, or None
to clear it. ProspectiveProfile π The stored profile as it would read after candidate fields are written.