Skip to main content

can_hide

Function can_hide 

Source
pub fn can_hide(
    owner_hex: Option<&str>,
    roster: &CommunityRoles,
    actor_hex: &str,
    author_hex: &str,
) -> bool
Expand description

May actor_hex remove a message authored by author_hex? The actor needs MANAGE_MESSAGES and a strict outrank; the owner is supreme and is never a valid target, so owner-protection falls out of the algebra with no carve-out.

Identities are normalized first: a message’s stored npub is BECH32 while the owner and the roster grants are keyed by lowercase HEX, and an unnormalized author matches neither — it skips owner-protection and misses the roster lookup, defaulting to the lowest rank.