chore: switch to ids for parameter
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
# Build Stage
|
||||
FROM ghcr.io/revoltchat/base:latest AS builder
|
||||
FROM debian:12 AS debian
|
||||
|
||||
# Bundle Stage
|
||||
FROM debian:bullseye-slim
|
||||
RUN apt-get update && \
|
||||
apt-get install -y ca-certificates && \
|
||||
apt-get clean
|
||||
FROM gcr.io/distroless/cc-debian12:nonroot
|
||||
COPY --from=builder /home/rust/src/target/release/revolt-voice-ingress ./
|
||||
EXPOSE 9000
|
||||
CMD ["./revolt-voice-ingress"]
|
||||
COPY --from=debian /usr/bin/uname /usr/bin/uname
|
||||
|
||||
USER nonroot
|
||||
CMD ["./revolt-voice-ingress"]
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::env;
|
||||
|
||||
|
||||
use livekit_protocol::WebhookEvent;
|
||||
use livekit_protocol::{TrackType, WebhookEvent};
|
||||
use revolt_database::{
|
||||
events::client::EventV1, util::reference::Reference, Database, DatabaseInfo,
|
||||
voice::{create_voice_state, delete_voice_state, update_voice_state_tracks, VoiceClient}
|
||||
@@ -85,6 +85,17 @@ async fn ingress(db: &State<Database>, voice_client: &State<VoiceClient>, body:
|
||||
.as_channel(db)
|
||||
.await?;
|
||||
|
||||
// remove the user if they try publish a video larger than 1080x720 or they publish data
|
||||
if body.event == "track_published"
|
||||
&& (
|
||||
(track.r#type == TrackType::Video as i32 && (track.width > 1080 || track.height > 720))
|
||||
| (track.r#type == TrackType::Data as i32)
|
||||
)
|
||||
{
|
||||
voice_client.remove_user(user_id, channel_id).await?;
|
||||
delete_voice_state(channel_id, channel.server().as_deref(), user_id).await?;
|
||||
}
|
||||
|
||||
let partial = update_voice_state_tracks(
|
||||
channel_id,
|
||||
channel.server().as_deref(),
|
||||
|
||||
Reference in New Issue
Block a user