From 14e616f0bbc9a98c3839d8bab4ea7c860f62d16b Mon Sep 17 00:00:00 2001 From: Jazz Turner-Baggs <473256+jazzz@users.noreply.github.com> Date: Sat, 13 Jun 2026 08:41:14 -0700 Subject: [PATCH] Move Id to trait --- core/conversations/src/conversation.rs | 3 +++ core/conversations/src/conversation/group_v1.rs | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/core/conversations/src/conversation.rs b/core/conversations/src/conversation.rs index 011be51..c184fbe 100644 --- a/core/conversations/src/conversation.rs +++ b/core/conversations/src/conversation.rs @@ -10,6 +10,7 @@ pub use privatev1::PrivateV1Convo; use shared_traits::IdentIdRef; pub type ConversationId = String; +pub type ConversationIdRef<'a> = &'a str; /// Behaviour shared by every conversation kind. pub(crate) trait Convo { @@ -37,4 +38,6 @@ pub(crate) trait GroupConvo: Convo { cx: &mut ServiceContext, members: &[IdentIdRef], ) -> Result<(), ChatError>; + + fn id(&self) -> ConversationIdRef<'_>; } diff --git a/core/conversations/src/conversation/group_v1.rs b/core/conversations/src/conversation/group_v1.rs index 99b79fa..3763eb6 100644 --- a/core/conversations/src/conversation/group_v1.rs +++ b/core/conversations/src/conversation/group_v1.rs @@ -344,4 +344,8 @@ impl GroupConvo for GroupV1Convo { .publish(env) .map_err(|e| ChatError::Generic(format!("Publish: {e}"))) } + + fn id(&self) -> super::ConversationIdRef<'_> { + &self.convo_id + } }