Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
Add Thread<Coment>::has_participant()
Matthias Beyer committed 8 months ago
commit 8240fde2e96e65712c2386eac8439c4d9a02f831
parent 646d4360e7d905f0a9ec87d32c6768c5390eabf3
1 file changed +8 -0
modified crates/radicle/src/cob/thread.rs
@@ -359,6 +359,14 @@ impl<T> Thread<T> {
    }
}

+
impl Thread<Comment> {
+
    pub fn has_participant(&self, actor: ActorId) -> bool {
+
        self.comments
+
            .iter()
+
            .any(|(_, c)| c.as_ref().is_some_and(|c| c.author() == actor))
+
    }
+
}
+

impl Thread {
    /// Apply a single action to the thread.
    fn action<R: ReadRepository>(