forked from jmug/stoatchat
feat: make Channel::server return a reference
This commit is contained in:
@@ -435,9 +435,9 @@ impl Channel {
|
||||
}
|
||||
|
||||
/// Clone this channel's server id
|
||||
pub fn server(&self) -> Option<String> {
|
||||
pub fn server(&self) -> Option<&str> {
|
||||
match self {
|
||||
Channel::TextChannel { server, .. } | Channel::VoiceChannel { server, .. } => Some(server.clone()),
|
||||
Channel::TextChannel { server, .. } | Channel::VoiceChannel { server, .. } => Some(server),
|
||||
_ => None
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
use livekit_protocol::ParticipantPermission;
|
||||
use redis_kiss::{get_connection as _get_connection, Conn, redis::Pipeline, AsyncCommands};
|
||||
use crate::{events::client::EventV1, models::{Channel, User}, util::{permissions::DatabasePermissionQuery, reference::Reference}, Database, Role, Server};
|
||||
use crate::{events::client::EventV1, models::{Channel, User}, util::{permissions::DatabasePermissionQuery, reference::Reference}, Database, Server};
|
||||
use revolt_models::v0::{self, PartialUserVoiceState, UserVoiceState};
|
||||
use revolt_permissions::{calculate_channel_permissions, ChannelPermission, PermissionValue};
|
||||
use revolt_result::{create_error, Result, ToRevoltError};
|
||||
|
||||
@@ -54,7 +54,7 @@ impl VoiceClient {
|
||||
.with_grants(VideoGrants {
|
||||
room_join: true,
|
||||
can_publish: true,
|
||||
can_publish_sources: vec![], // allowed_sources.into_iter().map(ToString::to_string).collect(),
|
||||
can_publish_sources: allowed_sources.into_iter().map(ToString::to_string).collect(),
|
||||
can_subscribe: permissions.has_channel_permission(ChannelPermission::Listen),
|
||||
room: channel.id().to_string(),
|
||||
..Default::default()
|
||||
|
||||
Reference in New Issue
Block a user