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 9 months ago
commit dca7dc816db726184dba8445935268a75187127f
parent f00d1d67432882bef11fc940601f071efe55c88d
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>(