Add remove channel method
Move test client fields into appstate and fix tests Co-authored-by: max <max@zed.dev>
This commit is contained in:
parent
56d4d5d1a8
commit
74437b3988
15 changed files with 534 additions and 256 deletions
|
@ -51,6 +51,10 @@ impl ChannelStore {
|
|||
&self.channel_invitations
|
||||
}
|
||||
|
||||
pub fn channel_for_id(&self, channel_id: u64) -> Option<Arc<Channel>> {
|
||||
self.channels.iter().find(|c| c.id == channel_id).cloned()
|
||||
}
|
||||
|
||||
pub fn create_channel(
|
||||
&self,
|
||||
name: &str,
|
||||
|
@ -103,6 +107,14 @@ impl ChannelStore {
|
|||
false
|
||||
}
|
||||
|
||||
pub fn remove_channel(&self, channel_id: u64) -> impl Future<Output = Result<()>> {
|
||||
let client = self.client.clone();
|
||||
async move {
|
||||
client.request(proto::RemoveChannel { channel_id }).await?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
pub fn remove_member(
|
||||
&self,
|
||||
channel_id: u64,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue