WIP: continue channel management modal and rename panel to collab_panel
This commit is contained in:
parent
d450c4be9a
commit
6c4964f071
13 changed files with 303 additions and 131 deletions
|
@ -30,6 +30,11 @@ impl Entity for ChannelStore {
|
|||
type Event = ();
|
||||
}
|
||||
|
||||
pub enum ChannelMemberStatus {
|
||||
Invited,
|
||||
Member,
|
||||
}
|
||||
|
||||
impl ChannelStore {
|
||||
pub fn new(
|
||||
client: Arc<Client>,
|
||||
|
@ -115,6 +120,26 @@ impl ChannelStore {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn get_channel_members(
|
||||
&self,
|
||||
channel_id: ChannelId,
|
||||
) -> impl Future<Output = Result<HashMap<UserId, ChannelMemberStatus>>> {
|
||||
let client = self.client.clone();
|
||||
async move {
|
||||
let response = client
|
||||
.request(proto::GetChannelMembers { channel_id })
|
||||
.await?;
|
||||
let mut result = HashMap::default();
|
||||
for member_id in response.members {
|
||||
result.insert(member_id, ChannelMemberStatus::Member);
|
||||
}
|
||||
for invitee_id in response.invited_members {
|
||||
result.insert(invitee_id, ChannelMemberStatus::Invited);
|
||||
}
|
||||
Ok(result)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn remove_channel(&self, channel_id: ChannelId) -> impl Future<Output = Result<()>> {
|
||||
let client = self.client.clone();
|
||||
async move {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue