Skip to main content

is_thread_hidden

Function is_thread_hidden 

Source
pub fn is_thread_hidden(
    hidden_threads: &[HiddenDmThreadEntry],
    room_owner_vk: &[u8; 32],
    peer: MemberId,
    max_message_ts: u64,
) -> bool
Expand description

Pure helper: should a DM thread for (room, peer) currently be hidden from the left rail?

Returns true iff the user has a HiddenDmThreadEntry for the thread AND no message in the thread has timestamp > hidden_at_ts. The strict > (not >=) on max_message_ts ensures that the message used to populate hidden_at_ts does not itself revive the thread. Any newer DM (inbound or outbound) crosses the threshold and revives.

hidden_threads is the full slice as loaded from the delegate; the lookup is linear because the list is tiny (bounded by the number of distinct DM pairs the user has actually hidden, which in practice is well under a hundred). Issue freenet/river#261.