Skip to main content

check_member_content

Function check_member_content 

Source
pub fn check_member_content(
    max_bytes: usize,
    json_len: usize,
    displayname: Option<&str>,
    avatar_url: Option<&str>,
) -> Result
Expand description

Validates a client-supplied m.room.member content from any route that accepts one.

json_len is the canonical length. displayname and avatar_url are passed only when the write stores them, so a value the room already holds is not bounded again. The content is refused over max_bytes, the display name over MAX_DISPLAYNAME_LENGTH characters, and the avatar URL over MAX_AVATAR_URL_LENGTH bytes or when it is not a valid mxc:// URI, all with M_BAD_JSON.