✨ Add the capability to join a conversation
This commit is contained in:
@@ -44,6 +44,7 @@ pub trait RoomMessagingConsumerInterface {
|
||||
#[async_trait(?Send)]
|
||||
pub trait RoomMessagingProviderInterface {
|
||||
async fn get_avatar(&self, id: &RoomId) -> anyhow::Result<Option<Avatar>>;
|
||||
async fn join(&self, room_id: &RoomId) -> anyhow::Result<bool>;
|
||||
}
|
||||
|
||||
#[async_trait(?Send)]
|
||||
|
@@ -314,4 +314,10 @@ impl RoomStoreConsumerInterface for Room {
|
||||
fn spaces(&self) -> &Vec<SpaceId> {
|
||||
&self.spaces
|
||||
}
|
||||
|
||||
async fn join(&self) {
|
||||
if let Some(messaging_provider) = &self.messaging_provider {
|
||||
let _ = messaging_provider.join(&self.id).await;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -29,11 +29,11 @@ pub trait RoomStoreConsumerInterface {
|
||||
fn is_direct(&self) -> Option<bool>;
|
||||
fn name(&self) -> Option<String>;
|
||||
fn topic(&self) -> Option<String>;
|
||||
fn spaces(&self) -> &Vec<SpaceId>;
|
||||
|
||||
#[allow(dead_code)]
|
||||
async fn avatar(&self) -> Option<Avatar>;
|
||||
|
||||
fn spaces(&self) -> &Vec<SpaceId>;
|
||||
async fn join(&self);
|
||||
}
|
||||
|
||||
pub trait RoomStoreProviderInterface {
|
||||
|
Reference in New Issue
Block a user