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:
Mikayla 2023-08-08 11:47:13 -07:00
parent 6a7245b92b
commit d00f6a490c
No known key found for this signature in database
5 changed files with 138 additions and 33 deletions

View file

@ -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;