Fix a bug where channel invitations would show up in the channels section
Block non-members from reading channel information WIP: Make sure Arc::make_mut() works
This commit is contained in:
parent
6a7245b92b
commit
d00f6a490c
5 changed files with 138 additions and 33 deletions
|
@ -301,8 +301,10 @@ impl ChannelStore {
|
|||
.iter_mut()
|
||||
.find(|c| c.id == channel.id)
|
||||
{
|
||||
let existing_channel = Arc::make_mut(existing_channel);
|
||||
let existing_channel = Arc::get_mut(existing_channel)
|
||||
.expect("channel is shared, update would have been lost");
|
||||
existing_channel.name = channel.name;
|
||||
existing_channel.user_is_admin = channel.user_is_admin;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -320,7 +322,8 @@ impl ChannelStore {
|
|||
|
||||
for channel in payload.channels {
|
||||
if let Some(existing_channel) = self.channels.iter_mut().find(|c| c.id == channel.id) {
|
||||
let existing_channel = Arc::make_mut(existing_channel);
|
||||
let existing_channel = Arc::get_mut(existing_channel)
|
||||
.expect("channel is shared, update would have been lost");
|
||||
existing_channel.name = channel.name;
|
||||
existing_channel.user_is_admin = channel.user_is_admin;
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue