Move Id to trait

This commit is contained in:
Jazz Turner-Baggs 2026-06-13 08:41:14 -07:00
parent 00776d2b9a
commit 14e616f0bb
No known key found for this signature in database
2 changed files with 7 additions and 0 deletions

View File

@ -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<S: ExternalServices> {
@ -37,4 +38,6 @@ pub(crate) trait GroupConvo<S: ExternalServices>: Convo<S> {
cx: &mut ServiceContext<S>,
members: &[IdentIdRef],
) -> Result<(), ChatError>;
fn id(&self) -> ConversationIdRef<'_>;
}

View File

@ -344,4 +344,8 @@ impl<S: ExternalServices> GroupConvo<S> for GroupV1Convo {
.publish(env)
.map_err(|e| ChatError::Generic(format!("Publish: {e}")))
}
fn id(&self) -> super::ConversationIdRef<'_> {
&self.convo_id
}
}