Sync Role as part of channels

Begin to fix guest notifications
This commit is contained in:
Conrad Irwin 2023-10-17 22:48:44 -06:00
parent 72ed8a6dd2
commit 70aed4a605
15 changed files with 323 additions and 266 deletions

View file

@ -413,7 +413,7 @@ async fn test_channel_buffer_disconnect(
channel_buffer_a.update(cx_a, |buffer, _| {
assert_eq!(
buffer.channel().as_ref(),
&channel(channel_id, "the-channel")
&channel(channel_id, "the-channel", proto::ChannelRole::Admin)
);
assert!(!buffer.is_connected());
});
@ -438,15 +438,16 @@ async fn test_channel_buffer_disconnect(
channel_buffer_b.update(cx_b, |buffer, _| {
assert_eq!(
buffer.channel().as_ref(),
&channel(channel_id, "the-channel")
&channel(channel_id, "the-channel", proto::ChannelRole::Member)
);
assert!(!buffer.is_connected());
});
}
fn channel(id: u64, name: &'static str) -> Channel {
fn channel(id: u64, name: &'static str, role: proto::ChannelRole) -> Channel {
Channel {
id,
role,
name: name.to_string(),
visibility: proto::ChannelVisibility::Members,
unseen_note_version: None,

View file

@ -152,6 +152,7 @@ async fn test_core_channels(
},
],
);
dbg!("-------");
let channel_c_id = client_a
.channel_store()
@ -1295,7 +1296,7 @@ fn assert_channel_invitations(
depth: 0,
name: channel.name.clone(),
id: channel.id,
user_is_admin: store.is_user_admin(channel.id),
user_is_admin: store.is_channel_admin(channel.id),
})
.collect::<Vec<_>>()
});
@ -1315,7 +1316,7 @@ fn assert_channels(
depth,
name: channel.name.clone(),
id: channel.id,
user_is_admin: store.is_user_admin(channel.id),
user_is_admin: store.is_channel_admin(channel.id),
})
.collect::<Vec<_>>()
});