Temporarily join public channels as a member

This commit is contained in:
Conrad Irwin 2023-10-17 10:24:47 -06:00
parent 3412becfc5
commit 5b39fc8123
2 changed files with 3 additions and 4 deletions

View file

@ -135,7 +135,8 @@ impl Database {
.most_public_ancestor_for_channel(channel_id, &*tx) .most_public_ancestor_for_channel(channel_id, &*tx)
.await? .await?
.unwrap_or(channel_id); .unwrap_or(channel_id);
role = Some(ChannelRole::Guest); // TODO: change this back to Guest.
role = Some(ChannelRole::Member);
joined_channel_id = Some(channel_id_to_join); joined_channel_id = Some(channel_id_to_join);
channel_member::Entity::insert(channel_member::ActiveModel { channel_member::Entity::insert(channel_member::ActiveModel {
@ -789,7 +790,7 @@ impl Database {
user_id: UserId, user_id: UserId,
tx: &DatabaseTransaction, tx: &DatabaseTransaction,
) -> Result<()> { ) -> Result<()> {
match dbg!(self.channel_role_for_user(channel_id, user_id, tx).await)? { match self.channel_role_for_user(channel_id, user_id, tx).await? {
Some(ChannelRole::Admin) => Ok(()), Some(ChannelRole::Admin) => Ok(()),
Some(ChannelRole::Member) Some(ChannelRole::Member)
| Some(ChannelRole::Banned) | Some(ChannelRole::Banned)

View file

@ -2720,10 +2720,8 @@ async fn join_channel_internal(
channel_id: joined_room.channel_id.map(|id| id.to_proto()), channel_id: joined_room.channel_id.map(|id| id.to_proto()),
live_kit_connection_info, live_kit_connection_info,
})?; })?;
dbg!("Joined channel", &joined_channel);
if let Some(joined_channel) = joined_channel { if let Some(joined_channel) = joined_channel {
dbg!("CMU");
channel_membership_updated(db, joined_channel, &session).await? channel_membership_updated(db, joined_channel, &session).await?
} }