Skip to content

A platform for community discussion. Free, open, simple.

DEV: Rename Discourse Voice to Discourse Live (#44542)

Rafael dos Santos Silva8560d4ac0e9b
diff --git a/.gitignore b/.gitignore
index 8f57bb53f57..66258c53118 100644
--- a/.gitignore
+++ b/.gitignore
@@ -77,9 +77,9 @@
!/plugins/discourse-cakeday
!/plugins/discourse-rewind
!/plugins/discourse-workflows
-!/plugins/voice
-/plugins/voice/gems
-/plugins/voice/public/javascripts
+!/plugins/live
+/plugins/live/gems
+/plugins/live/public/javascripts
/plugins/*/auto_generated
/spec/fixtures/plugins/my_plugin/auto_generated
diff --git a/Gemfile b/Gemfile
index dc587600e40..71802d54d97 100644
--- a/Gemfile
+++ b/Gemfile
@@ -311,7 +311,7 @@ gem "smarter_json", require: false
gem "json_completer", require: false
gem "discourse_ai-tokenizers", require: false
-# for the voice plugin
+# for the live plugin
gem "discourse_voice_assets", require: false
gem "ed25519" # TODO: remove this as existing ssl gem should handle this
gem "Ascii85", require: false
diff --git a/app/models/notification.rb b/app/models/notification.rb
index 506120ff725..25037b77301 100644
--- a/app/models/notification.rb
+++ b/app/models/notification.rb
@@ -175,7 +175,7 @@ class Notification < ActiveRecord::Base
following_created_topic: 801, # Used by https://github.com/discourse/discourse-follow
following_replied: 802, # Used by https://github.com/discourse/discourse-follow
circles_activity: 900, # Used by https://github.com/discourse/discourse-circles
- voice_invitation: 1000, # Used by the voice plugin
+ live_invitation: 1000, # Used by the live plugin
)
end
diff --git a/db/structure.sql b/db/structure.sql
index 62d3dc8b3f0..48b02ee6af6 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -7546,6 +7546,230 @@ CREATE SEQUENCE public.linked_topics_id_seq
ALTER SEQUENCE public.linked_topics_id_seq OWNED BY public.linked_topics.id;
+--
+-- Name: live_co_presences; Type: TABLE; Schema: public; Owner: -
+--
+
+CREATE TABLE public.live_co_presences (
+ id bigint NOT NULL,
+ user_id_1 integer NOT NULL,
+ user_id_2 integer NOT NULL,
+ date date NOT NULL,
+ total_seconds integer DEFAULT 0 NOT NULL,
+ session_count integer DEFAULT 0 NOT NULL,
+ created_at timestamp(6) without time zone NOT NULL,
+ updated_at timestamp(6) without time zone NOT NULL,
+ CONSTRAINT chk_live_co_presences_user_order CHECK ((user_id_1 < user_id_2))
+);
+
+
+--
+-- Name: live_co_presences_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE public.live_co_presences_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: live_co_presences_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE public.live_co_presences_id_seq OWNED BY public.live_co_presences.id;
+
+
+--
+-- Name: live_invites; Type: TABLE; Schema: public; Owner: -
+--
+
+CREATE TABLE public.live_invites (
+ id bigint NOT NULL,
+ room_id bigint NOT NULL,
+ user_id bigint NOT NULL,
+ invited_by_id bigint NOT NULL,
+ source integer DEFAULT 0 NOT NULL,
+ redeemed_at timestamp(6) without time zone,
+ created_at timestamp(6) without time zone NOT NULL,
+ updated_at timestamp(6) without time zone NOT NULL
+);
+
+
+--
+-- Name: live_invites_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE public.live_invites_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: live_invites_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE public.live_invites_id_seq OWNED BY public.live_invites.id;
+
+
+--
+-- Name: live_recordings; Type: TABLE; Schema: public; Owner: -
+--
+
+CREATE TABLE public.live_recordings (
+ id bigint NOT NULL,
+ room_id bigint NOT NULL,
+ started_by_id bigint NOT NULL,
+ egress_id character varying NOT NULL,
+ status integer DEFAULT 0 NOT NULL,
+ filepath character varying NOT NULL,
+ filename character varying,
+ location character varying,
+ duration_ms bigint,
+ size_bytes bigint,
+ started_at timestamp(6) without time zone NOT NULL,
+ ended_at timestamp(6) without time zone,
+ created_at timestamp(6) without time zone NOT NULL,
+ updated_at timestamp(6) without time zone NOT NULL
+);
+
+
+--
+-- Name: live_recordings_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE public.live_recordings_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: live_recordings_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE public.live_recordings_id_seq OWNED BY public.live_recordings.id;
+
+
+--
+-- Name: live_room_memberships; Type: TABLE; Schema: public; Owner: -
+--
+
+CREATE TABLE public.live_room_memberships (
+ id bigint NOT NULL,
+ room_id bigint NOT NULL,
+ user_id bigint NOT NULL,
+ role integer DEFAULT 0 NOT NULL,
+ created_at timestamp(6) without time zone NOT NULL,
+ updated_at timestamp(6) without time zone NOT NULL
+);
+
+
+--
+-- Name: live_room_memberships_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE public.live_room_memberships_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: live_room_memberships_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE public.live_room_memberships_id_seq OWNED BY public.live_room_memberships.id;
+
+
+--
+-- Name: live_rooms; Type: TABLE; Schema: public; Owner: -
+--
+
+CREATE TABLE public.live_rooms (
+ id bigint NOT NULL,
+ name character varying NOT NULL,
+ slug character varying NOT NULL,
+ description text,
+ public boolean DEFAULT false NOT NULL,
+ max_participants integer,
+ creator_id bigint NOT NULL,
+ created_at timestamp(6) without time zone NOT NULL,
+ updated_at timestamp(6) without time zone NOT NULL,
+ cooked_description text,
+ room_type integer DEFAULT 0 NOT NULL,
+ video_enabled boolean DEFAULT true NOT NULL,
+ chat_channel_id bigint,
+ chat_idle_minutes integer DEFAULT 15 NOT NULL,
+ livekit_enabled boolean DEFAULT false NOT NULL,
+ max_quality_profile integer,
+ ephemeral boolean DEFAULT false NOT NULL,
+ last_occupied_at timestamp(6) without time zone
+);
+
+
+--
+-- Name: live_rooms_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE public.live_rooms_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: live_rooms_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE public.live_rooms_id_seq OWNED BY public.live_rooms.id;
+
+
+--
+-- Name: live_sessions; Type: TABLE; Schema: public; Owner: -
+--
+
+CREATE TABLE public.live_sessions (
+ id bigint NOT NULL,
+ user_id bigint NOT NULL,
+ room_id bigint NOT NULL,
+ joined_at timestamp(6) without time zone NOT NULL,
+ left_at timestamp(6) without time zone,
+ created_at timestamp(6) without time zone NOT NULL,
+ updated_at timestamp(6) without time zone NOT NULL
+);
+
+
+--
+-- Name: live_sessions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE public.live_sessions_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: live_sessions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE public.live_sessions_id_seq OWNED BY public.live_sessions.id;
+
+
--
-- Name: livestream_topic_chat_channels; Type: TABLE; Schema: public; Owner: -
--
@@ -13569,230 +13793,6 @@ CREATE SEQUENCE public.users_id_seq
ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id;
---
--- Name: voice_co_presences; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.voice_co_presences (
- id bigint NOT NULL,
- user_id_1 integer NOT NULL,
- user_id_2 integer NOT NULL,
- date date NOT NULL,
- total_seconds integer DEFAULT 0 NOT NULL,
- session_count integer DEFAULT 0 NOT NULL,
- created_at timestamp(6) without time zone NOT NULL,
- updated_at timestamp(6) without time zone NOT NULL,
- CONSTRAINT chk_voice_co_presences_user_order CHECK ((user_id_1 < user_id_2))
-);
-
-
---
--- Name: voice_co_presences_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.voice_co_presences_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: voice_co_presences_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.voice_co_presences_id_seq OWNED BY public.voice_co_presences.id;
-
-
---
--- Name: voice_invites; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.voice_invites (
- id bigint NOT NULL,
- room_id bigint NOT NULL,
- user_id bigint NOT NULL,
- invited_by_id bigint NOT NULL,
- source integer DEFAULT 0 NOT NULL,
- redeemed_at timestamp(6) without time zone,
- created_at timestamp(6) without time zone NOT NULL,
- updated_at timestamp(6) without time zone NOT NULL
-);
-
-
---
--- Name: voice_invites_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.voice_invites_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: voice_invites_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.voice_invites_id_seq OWNED BY public.voice_invites.id;
-
-
---
--- Name: voice_recordings; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.voice_recordings (
- id bigint NOT NULL,
- room_id bigint NOT NULL,
- started_by_id bigint NOT NULL,
- egress_id character varying NOT NULL,
- status integer DEFAULT 0 NOT NULL,
- filepath character varying NOT NULL,
- filename character varying,
- location character varying,
- duration_ms bigint,
- size_bytes bigint,
- started_at timestamp(6) without time zone NOT NULL,
- ended_at timestamp(6) without time zone,
- created_at timestamp(6) without time zone NOT NULL,
- updated_at timestamp(6) without time zone NOT NULL
-);
-
-
---
--- Name: voice_recordings_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.voice_recordings_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: voice_recordings_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.voice_recordings_id_seq OWNED BY public.voice_recordings.id;
-
-
---
--- Name: voice_room_memberships; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.voice_room_memberships (
- id bigint NOT NULL,
- room_id bigint NOT NULL,
- user_id bigint NOT NULL,
- role integer DEFAULT 0 NOT NULL,
- created_at timestamp(6) without time zone NOT NULL,
- updated_at timestamp(6) without time zone NOT NULL
-);
-
-
---
--- Name: voice_room_memberships_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.voice_room_memberships_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: voice_room_memberships_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.voice_room_memberships_id_seq OWNED BY public.voice_room_memberships.id;
-
-
---
--- Name: voice_rooms; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.voice_rooms (
- id bigint NOT NULL,
- name character varying NOT NULL,
- slug character varying NOT NULL,
- description text,
- public boolean DEFAULT false NOT NULL,
- max_participants integer,
- creator_id bigint NOT NULL,
- created_at timestamp(6) without time zone NOT NULL,
- updated_at timestamp(6) without time zone NOT NULL,
- cooked_description text,
- room_type integer DEFAULT 0 NOT NULL,
- video_enabled boolean DEFAULT true NOT NULL,
- chat_channel_id bigint,
- chat_idle_minutes integer DEFAULT 15 NOT NULL,
- livekit_enabled boolean DEFAULT false NOT NULL,
- max_quality_profile integer,
- ephemeral boolean DEFAULT false NOT NULL,
- last_occupied_at timestamp(6) without time zone
-);
-
-
---
--- Name: voice_rooms_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.voice_rooms_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: voice_rooms_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.voice_rooms_id_seq OWNED BY public.voice_rooms.id;
-
-
---
--- Name: voice_sessions; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.voice_sessions (
- id bigint NOT NULL,
- user_id bigint NOT NULL,
- room_id bigint NOT NULL,
- joined_at timestamp(6) without time zone NOT NULL,
- left_at timestamp(6) without time zone,
- created_at timestamp(6) without time zone NOT NULL,
- updated_at timestamp(6) without time zone NOT NULL
-);
-
-
---
--- Name: voice_sessions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.voice_sessions_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: voice_sessions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.voice_sessions_id_seq OWNED BY public.voice_sessions.id;
-
-
--
-- Name: watched_word_groups; Type: TABLE; Schema: public; Owner: -
--
@@ -15367,6 +15367,48 @@ ALTER TABLE ONLY public.javascript_caches ALTER COLUMN id SET DEFAULT nextval('p
ALTER TABLE ONLY public.linked_topics ALTER COLUMN id SET DEFAULT nextval('public.linked_topics_id_seq'::regclass);
+--
+-- Name: live_co_presences id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public.live_co_presences ALTER COLUMN id SET DEFAULT nextval('public.live_co_presences_id_seq'::regclass);
+
+
+--
+-- Name: live_invites id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public.live_invites ALTER COLUMN id SET DEFAULT nextval('public.live_invites_id_seq'::regclass);
+
+
+--
+-- Name: live_recordings id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public.live_recordings ALTER COLUMN id SET DEFAULT nextval('public.live_recordings_id_seq'::regclass);
+
+
+--
+-- Name: live_room_memberships id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public.live_room_memberships ALTER COLUMN id SET DEFAULT nextval('public.live_room_memberships_id_seq'::regclass);
+
+
+--
+-- Name: live_rooms id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public.live_rooms ALTER COLUMN id SET DEFAULT nextval('public.live_rooms_id_seq'::regclass);
+
+
+--
+-- Name: live_sessions id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public.live_sessions ALTER COLUMN id SET DEFAULT nextval('public.live_sessions_id_seq'::regclass);
+
+
--
-- Name: livestream_topic_chat_channels id; Type: DEFAULT; Schema: public; Owner: -
--
@@ -16473,48 +16515,6 @@ ALTER TABLE ONLY public.user_warnings ALTER COLUMN id SET DEFAULT nextval('publi
ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass);
---
--- Name: voice_co_presences id; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.voice_co_presences ALTER COLUMN id SET DEFAULT nextval('public.voice_co_presences_id_seq'::regclass);
-
-
---
--- Name: voice_invites id; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.voice_invites ALTER COLUMN id SET DEFAULT nextval('public.voice_invites_id_seq'::regclass);
-
-
---
--- Name: voice_recordings id; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.voice_recordings ALTER COLUMN id SET DEFAULT nextval('public.voice_recordings_id_seq'::regclass);
-
-
---
--- Name: voice_room_memberships id; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.voice_room_memberships ALTER COLUMN id SET DEFAULT nextval('public.voice_room_memberships_id_seq'::regclass);
-
-
---
--- Name: voice_rooms id; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.voice_rooms ALTER COLUMN id SET DEFAULT nextval('public.voice_rooms_id_seq'::regclass);
-
-
---
--- Name: voice_sessions id; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.voice_sessions ALTER COLUMN id SET DEFAULT nextval('public.voice_sessions_id_seq'::regclass);
-
-
--
-- Name: watched_word_groups id; Type: DEFAULT; Schema: public; Owner: -
--
@@ -18093,43 +18093,91 @@ ALTER TABLE ONLY public.inferred_concepts
--
--- Name: invited_groups invited_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: -
+-- Name: invited_groups invited_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public.invited_groups
+ ADD CONSTRAINT invited_groups_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: invited_users invited_users_pkey; Type: CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public.invited_users
+ ADD CONSTRAINT invited_users_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: invites invites_pkey; Type: CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public.invites
+ ADD CONSTRAINT invites_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: javascript_caches javascript_caches_pkey; Type: CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public.javascript_caches
+ ADD CONSTRAINT javascript_caches_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: linked_topics linked_topics_pkey; Type: CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public.linked_topics
+ ADD CONSTRAINT linked_topics_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: live_co_presences live_co_presences_pkey; Type: CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public.live_co_presences
+ ADD CONSTRAINT live_co_presences_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: live_invites live_invites_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
-ALTER TABLE ONLY public.invited_groups
- ADD CONSTRAINT invited_groups_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY public.live_invites
+ ADD CONSTRAINT live_invites_pkey PRIMARY KEY (id);
--
--- Name: invited_users invited_users_pkey; Type: CONSTRAINT; Schema: public; Owner: -
+-- Name: live_recordings live_recordings_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
-ALTER TABLE ONLY public.invited_users
- ADD CONSTRAINT invited_users_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY public.live_recordings
+ ADD CONSTRAINT live_recordings_pkey PRIMARY KEY (id);
--
--- Name: invites invites_pkey; Type: CONSTRAINT; Schema: public; Owner: -
+-- Name: live_room_memberships live_room_memberships_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
-ALTER TABLE ONLY public.invites
- ADD CONSTRAINT invites_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY public.live_room_memberships
+ ADD CONSTRAINT live_room_memberships_pkey PRIMARY KEY (id);
--
--- Name: javascript_caches javascript_caches_pkey; Type: CONSTRAINT; Schema: public; Owner: -
+-- Name: live_rooms live_rooms_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
-ALTER TABLE ONLY public.javascript_caches
- ADD CONSTRAINT javascript_caches_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY public.live_rooms
+ ADD CONSTRAINT live_rooms_pkey PRIMARY KEY (id);
--
--- Name: linked_topics linked_topics_pkey; Type: CONSTRAINT; Schema: public; Owner: -
+-- Name: live_sessions live_sessions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
-ALTER TABLE ONLY public.linked_topics
- ADD CONSTRAINT linked_topics_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY public.live_sessions
+ ADD CONSTRAINT live_sessions_pkey PRIMARY KEY (id);
--
@@ -19444,54 +19492,6 @@ ALTER TABLE ONLY public.user_search_data
ADD CONSTRAINT users_search_pkey PRIMARY KEY (user_id);
---
--- Name: voice_co_presences voice_co_presences_pkey; Type: CONSTRAINT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.voice_co_presences
- ADD CONSTRAINT voice_co_presences_pkey PRIMARY KEY (id);
-
-
---
--- Name: voice_invites voice_invites_pkey; Type: CONSTRAINT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.voice_invites
- ADD CONSTRAINT voice_invites_pkey PRIMARY KEY (id);
-
-
---
--- Name: voice_recordings voice_recordings_pkey; Type: CONSTRAINT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.voice_recordings
- ADD CONSTRAINT voice_recordings_pkey PRIMARY KEY (id);
-
-
---
--- Name: voice_room_memberships voice_room_memberships_pkey; Type: CONSTRAINT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.voice_room_memberships
- ADD CONSTRAINT voice_room_memberships_pkey PRIMARY KEY (id);
-
-
---
--- Name: voice_rooms voice_rooms_pkey; Type: CONSTRAINT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.voice_rooms
- ADD CONSTRAINT voice_rooms_pkey PRIMARY KEY (id);
-
-
---
--- Name: voice_sessions voice_sessions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.voice_sessions
- ADD CONSTRAINT voice_sessions_pkey PRIMARY KEY (id);
-
-
--
-- Name: watched_word_groups watched_word_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
@@ -20360,6 +20360,34 @@ CREATE INDEX idx_leaderboard_scores_lb_date ON public.gamification_leaderboard_s
CREATE UNIQUE INDEX idx_leaderboard_scores_lb_user_date ON public.gamification_leaderboard_scores USING btree (leaderboard_id, user_id, date);
+--
+-- Name: idx_live_co_presences_unique; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE UNIQUE INDEX idx_live_co_presences_unique ON public.live_co_presences USING btree (user_id_1, user_id_2, date);
+
+
+--
+-- Name: idx_live_invites_redeemed; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX idx_live_invites_redeemed ON public.live_invites USING btree (invited_by_id, user_id) WHERE (redeemed_at IS NOT NULL);
+
+
+--
+-- Name: idx_live_room_memberships_on_room_and_user; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE UNIQUE INDEX idx_live_room_memberships_on_room_and_user ON public.live_room_memberships USING btree (room_id, user_id);
+
+
+--
+-- Name: idx_live_sessions_orphaned; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX idx_live_sessions_orphaned ON public.live_sessions USING btree (left_at) WHERE (left_at IS NULL);
+
+
--
-- Name: idx_mcp_active_authorizations_unique; Type: INDEX; Schema: public; Owner: -
--
@@ -20710,34 +20738,6 @@ CREATE INDEX idx_users_ip_address ON public.users USING btree (ip_address);
CREATE INDEX idx_users_moderator ON public.users USING btree (id) WHERE moderator;
---
--- Name: idx_voice_co_presences_unique; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE UNIQUE INDEX idx_voice_co_presences_unique ON public.voice_co_presences USING btree (user_id_1, user_id_2, date);
-
-
---
--- Name: idx_voice_invites_redeemed; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX idx_voice_invites_redeemed ON public.voice_invites USING btree (invited_by_id, user_id) WHERE (redeemed_at IS NOT NULL);
-
-
---
--- Name: idx_voice_room_memberships_on_room_and_user; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE UNIQUE INDEX idx_voice_room_memberships_on_room_and_user ON public.voice_room_memberships USING btree (room_id, user_id);
-
-
---
--- Name: idx_voice_sessions_orphaned; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX idx_voice_sessions_orphaned ON public.voice_sessions USING btree (left_at) WHERE (left_at IS NULL);
-
-
--
-- Name: idx_web_hook_event_types_hooks_on_ids; Type: INDEX; Schema: public; Owner: -
--
@@ -22838,6 +22838,125 @@ CREATE UNIQUE INDEX index_linked_topics_on_topic_id_and_original_topic_id ON pub
CREATE UNIQUE INDEX index_linked_topics_on_topic_id_and_sequence ON public.linked_topics USING btree (topic_id, sequence);
+--
+-- Name: index_live_co_presences_on_user_id_1_and_date; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_live_co_presences_on_user_id_1_and_date ON public.live_co_presences USING btree (user_id_1, date);
+
+
+--
+-- Name: index_live_co_presences_on_user_id_2_and_date; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_live_co_presences_on_user_id_2_and_date ON public.live_co_presences USING btree (user_id_2, date);
+
+
+--
+-- Name: index_live_invites_on_room_id_and_user_id_and_invited_by_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE UNIQUE INDEX index_live_invites_on_room_id_and_user_id_and_invited_by_id ON public.live_invites USING btree (room_id, user_id, invited_by_id);
+
+
+--
+-- Name: index_live_invites_on_user_id_and_room_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_live_invites_on_user_id_and_room_id ON public.live_invites USING btree (user_id, room_id);
+
+
+--
+-- Name: index_live_recordings_on_egress_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE UNIQUE INDEX index_live_recordings_on_egress_id ON public.live_recordings USING btree (egress_id);
+
+
+--
+-- Name: index_live_recordings_on_room_id_and_started_at; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_live_recordings_on_room_id_and_started_at ON public.live_recordings USING btree (room_id, started_at);
+
+
+--
+-- Name: index_live_room_memberships_on_room_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_live_room_memberships_on_room_id ON public.live_room_memberships USING btree (room_id);
+
+
+--
+-- Name: index_live_room_memberships_on_user_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_live_room_memberships_on_user_id ON public.live_room_memberships USING btree (user_id);
+
+
+--
+-- Name: index_live_rooms_on_chat_channel_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_live_rooms_on_chat_channel_id ON public.live_rooms USING btree (chat_channel_id);
+
+
+--
+-- Name: index_live_rooms_on_creator_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_live_rooms_on_creator_id ON public.live_rooms USING btree (creator_id);
+
+
+--
+-- Name: index_live_rooms_on_ephemeral; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_live_rooms_on_ephemeral ON public.live_rooms USING btree (id) WHERE ephemeral;
+
+
+--
+-- Name: index_live_rooms_on_slug; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE UNIQUE INDEX index_live_rooms_on_slug ON public.live_rooms USING btree (slug);
+
+
+--
+-- Name: index_live_sessions_on_room_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_live_sessions_on_room_id ON public.live_sessions USING btree (room_id);
+
+
+--
+-- Name: index_live_sessions_on_room_id_and_joined_at; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_live_sessions_on_room_id_and_joined_at ON public.live_sessions USING btree (room_id, joined_at);
+
+
+--
+-- Name: index_live_sessions_on_user_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_live_sessions_on_user_id ON public.live_sessions USING btree (user_id);
+
+
+--
+-- Name: index_live_sessions_on_user_id_and_joined_at; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_live_sessions_on_user_id_and_joined_at ON public.live_sessions USING btree (user_id, joined_at);
+
+
+--
+-- Name: index_live_sessions_on_user_id_and_room_id_and_joined_at; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_live_sessions_on_user_id_and_room_id_and_joined_at ON public.live_sessions USING btree (user_id, room_id, joined_at);
+
+
--
-- Name: index_livestream_topic_chat_channels_on_chat_channel_id; Type: INDEX; Schema: public; Owner: -
--
@@ -25428,125 +25547,6 @@ CREATE UNIQUE INDEX index_users_on_username ON public.users USING btree (usernam
CREATE UNIQUE INDEX index_users_on_username_lower ON public.users USING btree (username_lower);
---
--- Name: index_voice_co_presences_on_user_id_1_and_date; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX index_voice_co_presences_on_user_id_1_and_date ON public.voice_co_presences USING btree (user_id_1, date);
-
-
---
--- Name: index_voice_co_presences_on_user_id_2_and_date; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX index_voice_co_presences_on_user_id_2_and_date ON public.voice_co_presences USING btree (user_id_2, date);
-
-
---
--- Name: index_voice_invites_on_room_id_and_user_id_and_invited_by_id; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE UNIQUE INDEX index_voice_invites_on_room_id_and_user_id_and_invited_by_id ON public.voice_invites USING btree (room_id, user_id, invited_by_id);
-
-
---
--- Name: index_voice_invites_on_user_id_and_room_id; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX index_voice_invites_on_user_id_and_room_id ON public.voice_invites USING btree (user_id, room_id);
-
-
---
--- Name: index_voice_recordings_on_egress_id; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE UNIQUE INDEX index_voice_recordings_on_egress_id ON public.voice_recordings USING btree (egress_id);
-
-
---
--- Name: index_voice_recordings_on_room_id_and_started_at; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX index_voice_recordings_on_room_id_and_started_at ON public.voice_recordings USING btree (room_id, started_at);
-
-
---
--- Name: index_voice_room_memberships_on_room_id; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX index_voice_room_memberships_on_room_id ON public.voice_room_memberships USING btree (room_id);
-
-
---
--- Name: index_voice_room_memberships_on_user_id; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX index_voice_room_memberships_on_user_id ON public.voice_room_memberships USING btree (user_id);
-
-
---
--- Name: index_voice_rooms_on_chat_channel_id; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX index_voice_rooms_on_chat_channel_id ON public.voice_rooms USING btree (chat_channel_id);
-
-
---
--- Name: index_voice_rooms_on_creator_id; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX index_voice_rooms_on_creator_id ON public.voice_rooms USING btree (creator_id);
-
-
---
--- Name: index_voice_rooms_on_ephemeral; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX index_voice_rooms_on_ephemeral ON public.voice_rooms USING btree (id) WHERE ephemeral;
-
-
---
--- Name: index_voice_rooms_on_slug; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE UNIQUE INDEX index_voice_rooms_on_slug ON public.voice_rooms USING btree (slug);
-
-
---
--- Name: index_voice_sessions_on_room_id; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX index_voice_sessions_on_room_id ON public.voice_sessions USING btree (room_id);
-
-
---
--- Name: index_voice_sessions_on_room_id_and_joined_at; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX index_voice_sessions_on_room_id_and_joined_at ON public.voice_sessions USING btree (room_id, joined_at);
-
-
---
--- Name: index_voice_sessions_on_user_id; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX index_voice_sessions_on_user_id ON public.voice_sessions USING btree (user_id);
-
-
---
--- Name: index_voice_sessions_on_user_id_and_joined_at; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX index_voice_sessions_on_user_id_and_joined_at ON public.voice_sessions USING btree (user_id, joined_at);
-
-
---
--- Name: index_voice_sessions_on_user_id_and_room_id_and_joined_at; Type: INDEX; Schema: public; Owner: -
---
-
-CREATE INDEX index_voice_sessions_on_user_id_and_room_id_and_joined_at ON public.voice_sessions USING btree (user_id, room_id, joined_at);
-
-
--
-- Name: index_watched_words_on_action_and_word; Type: INDEX; Schema: public; Owner: -
--
@@ -25948,11 +25948,11 @@ ALTER TABLE ONLY public.reviewable_notes
--
--- Name: voice_room_memberships fk_rails_a55e8c404b; Type: FK CONSTRAINT; Schema: public; Owner: -
+-- Name: live_room_memberships fk_rails_a55e8c404b; Type: FK CONSTRAINT; Schema: public; Owner: -
--
-ALTER TABLE ONLY public.voice_room_memberships
- ADD CONSTRAINT fk_rails_a55e8c404b FOREIGN KEY (room_id) REFERENCES public.voice_rooms(id);
+ALTER TABLE ONLY public.live_room_memberships
+ ADD CONSTRAINT fk_rails_a55e8c404b FOREIGN KEY (room_id) REFERENCES public.live_rooms(id);
--
@@ -26101,6 +26101,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('20261014065735'),
('20261013222431'),
('20261013183208'),
+('20261013160643'),
('20261013062937'),
('20261013010026'),
('20261013010022'),
diff --git a/frontend/asset-processor/rollup-virtual-imports.test.mjs b/frontend/asset-processor/rollup-virtual-imports.test.mjs
index 380ba6739a2..56cdc429add 100644
--- a/frontend/asset-processor/rollup-virtual-imports.test.mjs
+++ b/frontend/asset-processor/rollup-virtual-imports.test.mjs
@@ -101,7 +101,7 @@ describe("virtual:entrypoint", () => {
// so a plugin is free to keep these below the top level.
const nested = entrypoint(
[
- "discourse/app/services/voice-webrtc.js",
+ "discourse/app/services/live-webrtc.js",
"discourse/lib/discourse-markdown/spoiler.js",
"discourse-markdown/graphviz.js",
"pre-initializers/h-captcha.js",
@@ -111,7 +111,7 @@ describe("virtual:entrypoint", () => {
);
for (const name of [
- "discourse/app/services/voice-webrtc",
+ "discourse/app/services/live-webrtc",
"discourse/lib/discourse-markdown/spoiler",
"discourse-markdown/graphviz",
"pre-initializers/h-captcha",
diff --git a/frontend/discourse/app/ui-kit/d-nav-item.gjs b/frontend/discourse/app/ui-kit/d-nav-item.gjs
index 473f5c4f8b7..d62b3faa178 100644
--- a/frontend/discourse/app/ui-kit/d-nav-item.gjs
+++ b/frontend/discourse/app/ui-kit/d-nav-item.gjs
@@ -41,16 +41,6 @@ export default class DNavItem extends Component {
}
if (this.args.routeParam) {
- // This is needed because the setting route is underneath /admin/plugins/:plugin_id,
- // but is not a child route of the plugin routes themselves. E.g. discourse-ai
- // for the plugin ID has its own nested routes defined in the plugin.
- if (this.router.currentRoute.name === "adminPlugins.show.settings") {
- return (
- this.router.currentRoute.parent.params.plugin_id ===
- this.args.routeParam
- );
- }
-
if (this.router.currentRoute.name === "adminConfig.login.plugin-tab") {
return (
this.router.currentRoute.params.wildcard === this.args.routeParam
diff --git a/frontend/discourse/tests/fixtures/concerns/notification-types.js b/frontend/discourse/tests/fixtures/concerns/notification-types.js
index 9d279f00d07..cbdea90a61a 100644
--- a/frontend/discourse/tests/fixtures/concerns/notification-types.js
+++ b/frontend/discourse/tests/fixtures/concerns/notification-types.js
@@ -52,5 +52,5 @@ export const NOTIFICATION_TYPES = {
following_created_topic: 801,
following_replied: 802,
circles_activity: 900,
- voice_invitation: 1000,
+ live_invitation: 1000,
};
diff --git a/migrations/importer/lib/migrations/importer/pg_encoder_cache.rb b/migrations/importer/lib/migrations/importer/pg_encoder_cache.rb
index d3110b642e2..fbb15779eda 100644
--- a/migrations/importer/lib/migrations/importer/pg_encoder_cache.rb
+++ b/migrations/importer/lib/migrations/importer/pg_encoder_cache.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require "json"
require "pg"
module Migrations
@@ -8,15 +7,6 @@ module Migrations
module PgEncoderCache
@encoders = {}
- # PG::TextEncoder::JSON passes the `quirks_mode` keyword, which the json gem
- # dropped in 3.0; fixed in pg upstream but unreleased as of 1.6.3 — drop
- # this once a fixed pg version is required
- class JsonEncoder < PG::SimpleEncoder
- def encode(value)
- ::JSON.generate(value)
- end
- end
-
ENCODER_MAP = {
"bool" => -> { PG::TextEncoder::Boolean.new },
"date" => -> { PG::TextEncoder::Date.new },
@@ -24,8 +14,8 @@ module Migrations
"inet" => -> { PG::TextEncoder::Inet.new },
"int4" => -> { PG::TextEncoder::Integer.new },
"int8" => -> { PG::TextEncoder::Integer.new },
- "json" => -> { JsonEncoder.new },
- "jsonb" => -> { JsonEncoder.new },
+ "json" => -> { PG::TextEncoder::JSON.new },
+ "jsonb" => -> { PG::TextEncoder::JSON.new },
"text" => -> { PG::TextEncoder::String.new },
"timestamp" => -> { PG::TextEncoder::String.new },
"uuid" => -> { PG::TextEncoder::String.new },
diff --git a/migrations/importer/spec/lib/migrations/importer/pg_encoder_cache_spec.rb b/migrations/importer/spec/lib/migrations/importer/pg_encoder_cache_spec.rb
index 5d08c77d8ca..2608e08421b 100644
--- a/migrations/importer/spec/lib/migrations/importer/pg_encoder_cache_spec.rb
+++ b/migrations/importer/spec/lib/migrations/importer/pg_encoder_cache_spec.rb
@@ -1,8 +1,8 @@
# frozen_string_literal: true
RSpec.describe Migrations::Importer::PgEncoderCache do
- describe "JsonEncoder" do
- subject(:encoder) { described_class::JsonEncoder.new }
+ describe "the JSON encoder" do
+ subject(:encoder) { described_class.get_encoder("json") }
it "encodes hashes, arrays and scalars as JSON" do
expect(encoder.encode({ "a" => 1 })).to eq('{"a":1}')
@@ -18,8 +18,8 @@ RSpec.describe Migrations::Importer::PgEncoderCache do
describe ".get_encoder" do
it "returns the JSON encoder for json and jsonb" do
- expect(described_class.get_encoder("json")).to be_a(described_class::JsonEncoder)
- expect(described_class.get_encoder("jsonb")).to be_a(described_class::JsonEncoder)
+ expect(described_class.get_encoder("json")).to be_a(PG::TextEncoder::JSON)
+ expect(described_class.get_encoder("jsonb")).to be_a(PG::TextEncoder::JSON)
end
it "normalizes PG's internal array type names" do
@@ -33,17 +33,4 @@ RSpec.describe Migrations::Importer::PgEncoderCache do
)
end
end
-
- it "still needs JsonEncoder instead of PG::TextEncoder::JSON" do
- # whether PG::TextEncoder::JSON raises depends on the loaded json version,
- # so check what pg ships instead of calling it
- encode_source_path = PG::TextEncoder::JSON.instance_method(:encode).source_location&.first
-
- expect(encode_source_path).not_to be_nil,
- "PG::TextEncoder::JSON#encode is no longer plain Ruby — " \
- "check whether JsonEncoder is still needed"
- expect(File.read(encode_source_path)).to include("quirks_mode"),
- "the installed pg no longer passes quirks_mode — " \
- "replace JsonEncoder with PG::TextEncoder::JSON and delete this example"
- end
end
diff --git a/migrations/tooling/config/schema/intermediate_db/ignored.rb b/migrations/tooling/config/schema/intermediate_db/ignored.rb
index e5b79048bd9..b90b74dfd90 100644
--- a/migrations/tooling/config/schema/intermediate_db/ignored.rb
+++ b/migrations/tooling/config/schema/intermediate_db/ignored.rb
@@ -195,6 +195,12 @@ Migrations::Tooling::Schema.ignored do
:invited_users,
:invites,
:javascript_caches,
+ :live_co_presences,
+ :live_invites,
+ :live_recordings,
+ :live_room_memberships,
+ :live_rooms,
+ :live_sessions,
:mcp_audit_logs,
:mcp_group_scopes,
:mcp_oauth_access_tokens,
@@ -241,12 +247,6 @@ Migrations::Tooling::Schema.ignored do
:translation_overrides,
:unsubscribe_keys,
:upcoming_change_events,
- :voice_co_presences,
- :voice_invites,
- :voice_recordings,
- :voice_room_memberships,
- :voice_rooms,
- :voice_sessions,
:watched_word_groups,
:watched_words,
:web_crawler_requests
diff --git a/migrations/tooling/config/schema/plugin_manifest.yml b/migrations/tooling/config/schema/plugin_manifest.yml
index 165cda04d90..a78c782c55f 100644
--- a/migrations/tooling/config/schema/plugin_manifest.yml
+++ b/migrations/tooling/config/schema/plugin_manifest.yml
@@ -249,21 +249,21 @@ plugins:
- discourse_workflows_workflow_versions
- discourse_workflows_workflows
columns: {}
+ live:
+ tables:
+ - live_co_presences
+ - live_invites
+ - live_recordings
+ - live_room_memberships
+ - live_rooms
+ - live_sessions
+ columns: {}
poll:
tables:
- poll_options
- poll_votes
- polls
columns: {}
- voice:
- tables:
- - voice_co_presences
- - voice_invites
- - voice_recordings
- - voice_room_memberships
- - voice_rooms
- - voice_sessions
- columns: {}
plugin_checksums:
automation: d168107063ed75d7e568f1c1250866f8
boards: 7196f10413674b3c08480ff2aa42b2e8
@@ -275,7 +275,7 @@ plugin_checksums:
discourse-cakeday: a5bb91366c8dc8d267088eb0c2679187
discourse-captcha: 9c98c6231f69399ad711b7ef2b858d87
discourse-chat-integration: ffa3bf5dba9089491d2fc02971eb96f8
- discourse-data-explorer: c6b824f9409ce4407895bdcb5563b5a0
+ discourse-data-explorer: b8a25c2772d05fe6a11716352c88bab8
discourse-events: 5d4a88ec24f58c6ea11f53e76a23bfb8
discourse-gamification: 633256e241b030fddcc059076f7474f8
discourse-github: 3bd17b2c09828e232e7565edbf2c746f
@@ -299,8 +299,8 @@ plugin_checksums:
discourse-user-notes: 4c1e04fac5708b51c1b09bd8ed0d786c
discourse-workflows: af0c2fc0b7e1f38cf57abe16633ab2a1
discourse-zendesk-plugin: b78b305590ffedda38455574a19fdd38
+ live: 4dc04fc7516e9509dc986ff3b102572a
poll: e481f2cfa0e7c22778dee12a1e9c33c6
styleguide: 0fd92e5ef0c99ee047f206961a587544
- voice: 2a524af29a649ac652323ae1bc977a82
failed_plugins: []
incomplete: false
diff --git a/plugins/discourse-rewind/app/services/discourse_rewind/action/voice_usage.rb b/plugins/discourse-rewind/app/services/discourse_rewind/action/live_usage.rb
similarity index 82%
rename from plugins/discourse-rewind/app/services/discourse_rewind/action/voice_usage.rb
rename to plugins/discourse-rewind/app/services/discourse_rewind/action/live_usage.rb
index b1e7c914487..b4d01f05574 100644
--- a/plugins/discourse-rewind/app/services/discourse_rewind/action/voice_usage.rb
+++ b/plugins/discourse-rewind/app/services/discourse_rewind/action/live_usage.rb
@@ -2,7 +2,7 @@
module DiscourseRewind
module Action
- class VoiceUsage < BaseReport
+ class LiveUsage < BaseReport
MINIMUM_SECONDS = 1.hour.to_i
TOP_LIMIT = 3
@@ -49,13 +49,13 @@ module DiscourseRewind
},
],
},
- identifier: "voice-usage",
+ identifier: "live-usage",
}
def call
return FakeData if should_use_fake_data?
- sessions = Voice::Session.where(user_id: user.id, joined_at: date)
+ sessions = Live::Session.where(user_id: user.id, joined_at: date)
total_seconds, call_count =
sessions.pick(Arel.sql("COALESCE(SUM(#{duration_sql}), 0)::bigint"), Arel.sql("COUNT(*)"))
@@ -68,13 +68,13 @@ module DiscourseRewind
top_rooms: top_rooms(sessions),
top_contacts:,
},
- identifier: "voice-usage",
+ identifier: "live-usage",
}
end
def self.filter_for_viewer(report, guardian:, for_user:)
top_rooms = report[:data][:top_rooms]
- visible_room_ids = Voice::Room.visible_to(guardian).where(id: top_rooms.pluck(:room_id)).ids
+ visible_room_ids = Live::Room.visible_to(guardian).where(id: top_rooms.pluck(:room_id)).ids
report.deep_merge(
data: {
@@ -87,7 +87,7 @@ module DiscourseRewind
end
def self.enabled?
- plugin_enabled?("voice")
+ plugin_enabled?("live")
end
private
@@ -96,9 +96,9 @@ module DiscourseRewind
<<~SQL
EXTRACT(EPOCH FROM (
COALESCE(
- voice_sessions.left_at,
- LEAST(CURRENT_TIMESTAMP, voice_sessions.joined_at + INTERVAL '#{UNENDED_SESSION_CAP}')
- ) - voice_sessions.joined_at
+ live_sessions.left_at,
+ LEAST(CURRENT_TIMESTAMP, live_sessions.joined_at + INTERVAL '#{UNENDED_SESSION_CAP}')
+ ) - live_sessions.joined_at
))
SQL
end
@@ -106,14 +106,14 @@ module DiscourseRewind
def top_rooms(sessions)
sessions
.joins(:room)
- .merge(Voice::Room.persistent)
- .group("voice_rooms.id", "voice_rooms.name", "voice_rooms.slug")
- .order(Arel.sql("SUM(#{duration_sql}) DESC"), "voice_rooms.id")
+ .merge(Live::Room.persistent)
+ .group("live_rooms.id", "live_rooms.name", "live_rooms.slug")
+ .order(Arel.sql("SUM(#{duration_sql}) DESC"), "live_rooms.id")
.limit(TOP_LIMIT)
.pluck(
- "voice_rooms.id",
- "voice_rooms.name",
- "voice_rooms.slug",
+ "live_rooms.id",
+ "live_rooms.name",
+ "live_rooms.slug",
Arel.sql("SUM(#{duration_sql})::bigint"),
)
.map { |room_id, name, slug, seconds| { room_id:, name:, slug:, seconds: } }
@@ -122,7 +122,7 @@ module DiscourseRewind
def top_contacts
# Over-fetch to leave headroom for contacts dropped below (bots, deleted users).
contact_seconds =
- Voice::CoPresence
+ Live::CoPresence
.where("user_id_1 = :id OR user_id_2 = :id", id: user.id)
.where(date: date.first.to_date..date.last.to_date)
.group(Arel.sql("CASE WHEN user_id_1 = #{user.id} THEN user_id_2 ELSE user_id_1 END"))
diff --git a/plugins/discourse-rewind/app/services/discourse_rewind/fetch_reports.rb b/plugins/discourse-rewind/app/services/discourse_rewind/fetch_reports.rb
index 8ce83336e92..435cd1f467c 100644
--- a/plugins/discourse-rewind/app/services/discourse_rewind/fetch_reports.rb
+++ b/plugins/discourse-rewind/app/services/discourse_rewind/fetch_reports.rb
@@ -43,7 +43,7 @@ module DiscourseRewind
Action::TimeOfDayActivity,
Action::NewUserInteractions,
Action::ChatUsage,
- Action::VoiceUsage,
+ Action::LiveUsage,
Action::AiUsage,
Action::Assignments,
Action::Invites,
diff --git a/plugins/discourse-rewind/assets/javascripts/discourse/components/reports/voice-usage.gjs b/plugins/discourse-rewind/assets/javascripts/discourse/components/reports/live-usage.gjs
similarity index 80%
rename from plugins/discourse-rewind/assets/javascripts/discourse/components/reports/voice-usage.gjs
rename to plugins/discourse-rewind/assets/javascripts/discourse/components/reports/live-usage.gjs
index 4c494c6f699..efde752e487 100644
--- a/plugins/discourse-rewind/assets/javascripts/discourse/components/reports/voice-usage.gjs
+++ b/plugins/discourse-rewind/assets/javascripts/discourse/components/reports/live-usage.gjs
@@ -9,41 +9,41 @@ import { i18nForOwner } from "discourse/plugins/discourse-rewind/discourse/lib/r
function airtime(seconds) {
const hours = Math.floor(seconds / 3600);
if (hours > 0) {
- return i18n("discourse_rewind.reports.voice_usage.hours", { count: hours });
+ return i18n("discourse_rewind.reports.live_usage.hours", { count: hours });
}
- return i18n("discourse_rewind.reports.voice_usage.minutes", {
+ return i18n("discourse_rewind.reports.live_usage.minutes", {
count: Math.floor(seconds / 60),
});
}
-export default class VoiceUsage extends Component {
+export default class LiveUsage extends Component {
get subtitleText() {
return i18nForOwner(
- "discourse_rewind.reports.voice_usage.subtitle",
+ "discourse_rewind.reports.live_usage.subtitle",
this.args.isOwnRewind,
{ username: this.args.user?.username }
);
}
get callCountText() {
- return i18n("discourse_rewind.reports.voice_usage.call_count", {
+ return i18n("discourse_rewind.reports.live_usage.call_count", {
count: this.args.report.data.call_count,
});
}
<template>
- <div class="rewind-report-page --voice-usage">
+ <div class="rewind-report-page --live-usage">
<div class="phone-bill">
<div class="phone-bill__header">
<div class="phone-bill__title">
- {{i18n "discourse_rewind.reports.voice_usage.title"}}
+ {{i18n "discourse_rewind.reports.live_usage.title"}}
</div>
<div class="phone-bill__subtitle">{{this.subtitleText}}</div>
</div>
<div class="phone-bill__total">
<div class="phone-bill__total-label">
- {{i18n "discourse_rewind.reports.voice_usage.total_airtime"}}
+ {{i18n "discourse_rewind.reports.live_usage.total_airtime"}}
</div>
<div class="phone-bill__total-value">
{{airtime @report.data.total_seconds}}
@@ -54,7 +54,7 @@ export default class VoiceUsage extends Component {
{{#if @report.data.top_contacts.length}}
<div class="phone-bill__section">
<div class="phone-bill__section-title">
- {{i18n "discourse_rewind.reports.voice_usage.top_contacts"}}
+ {{i18n "discourse_rewind.reports.live_usage.top_contacts"}}
</div>
<ol class="phone-bill__items">
{{#each @report.data.top_contacts as |contact|}}
@@ -83,14 +83,14 @@ export default class VoiceUsage extends Component {
{{#if @report.data.top_rooms.length}}
<div class="phone-bill__section">
<div class="phone-bill__section-title">
- {{i18n "discourse_rewind.reports.voice_usage.top_rooms"}}
+ {{i18n "discourse_rewind.reports.live_usage.top_rooms"}}
</div>
<ol class="phone-bill__items">
{{#each @report.data.top_rooms as |room|}}
<li class="phone-bill__item">
<a
class="phone-bill__item-name"
- href={{getURL (concat "/voice/r/" room.slug)}}
+ href={{getURL (concat "/live/r/" room.slug)}}
>
{{room.name}}
</a>
@@ -105,7 +105,7 @@ export default class VoiceUsage extends Component {
{{/if}}
<div class="phone-bill__footer">
- {{i18n "discourse_rewind.reports.voice_usage.amount_due"}}
+ {{i18n "discourse_rewind.reports.live_usage.amount_due"}}
</div>
</div>
</div>
diff --git a/plugins/discourse-rewind/assets/javascripts/discourse/components/rewind.gjs b/plugins/discourse-rewind/assets/javascripts/discourse/components/rewind.gjs
index 908882833f0..dda61e191f0 100644
--- a/plugins/discourse-rewind/assets/javascripts/discourse/components/rewind.gjs
+++ b/plugins/discourse-rewind/assets/javascripts/discourse/components/rewind.gjs
@@ -26,6 +26,7 @@ import ChatUsage from "discourse/plugins/discourse-rewind/discourse/components/r
import FBFF from "discourse/plugins/discourse-rewind/discourse/components/reports/fbff";
import RewindHeader from "discourse/plugins/discourse-rewind/discourse/components/reports/header";
import Invites from "discourse/plugins/discourse-rewind/discourse/components/reports/invites";
+import LiveUsage from "discourse/plugins/discourse-rewind/discourse/components/reports/live-usage";
import MostViewedCategories from "discourse/plugins/discourse-rewind/discourse/components/reports/most-viewed-categories";
import MostViewedTags from "discourse/plugins/discourse-rewind/discourse/components/reports/most-viewed-tags";
import NewUserInteractions from "discourse/plugins/discourse-rewind/discourse/components/reports/new-user-interactions";
@@ -33,7 +34,6 @@ import Reactions from "discourse/plugins/discourse-rewind/discourse/components/r
import ReadingTime from "discourse/plugins/discourse-rewind/discourse/components/reports/reading-time";
import TimeOfDayActivity from "discourse/plugins/discourse-rewind/discourse/components/reports/time-of-day-activity";
import TopWords from "discourse/plugins/discourse-rewind/discourse/components/reports/top-words";
-import VoiceUsage from "discourse/plugins/discourse-rewind/discourse/components/reports/voice-usage";
import WritingAnalysis from "discourse/plugins/discourse-rewind/discourse/components/reports/writing-analysis";
const REPORT_COMPONENTS = {
@@ -52,7 +52,7 @@ const REPORT_COMPONENTS = {
"reading-time": ReadingTime,
"time-of-day-activity": TimeOfDayActivity,
"top-words": TopWords,
- "voice-usage": VoiceUsage,
+ "live-usage": LiveUsage,
"writing-analysis": WritingAnalysis,
};
diff --git a/plugins/discourse-rewind/assets/stylesheets/common/_index.scss b/plugins/discourse-rewind/assets/stylesheets/common/_index.scss
index 4f38203d0ea..5eab94afb11 100644
--- a/plugins/discourse-rewind/assets/stylesheets/common/_index.scss
+++ b/plugins/discourse-rewind/assets/stylesheets/common/_index.scss
@@ -23,4 +23,4 @@
@import "ai-usage";
@import "assignments";
@import "invites";
-@import "voice-usage";
+@import "live-usage";
diff --git a/plugins/discourse-rewind/assets/stylesheets/common/voice-usage.scss b/plugins/discourse-rewind/assets/stylesheets/common/live-usage.scss
similarity index 99%
rename from plugins/discourse-rewind/assets/stylesheets/common/voice-usage.scss
rename to plugins/discourse-rewind/assets/stylesheets/common/live-usage.scss
index 3985aa1556e..ea4254b9d70 100644
--- a/plugins/discourse-rewind/assets/stylesheets/common/voice-usage.scss
+++ b/plugins/discourse-rewind/assets/stylesheets/common/live-usage.scss
@@ -1,4 +1,4 @@
-.--voice-usage {
+.--live-usage {
.phone-bill {
position: relative;
width: 100%;
diff --git a/plugins/discourse-rewind/config/locales/client.en.yml b/plugins/discourse-rewind/config/locales/client.en.yml
index a21483b1cc6..a8db7336106 100644
--- a/plugins/discourse-rewind/config/locales/client.en.yml
+++ b/plugins/discourse-rewind/config/locales/client.en.yml
@@ -129,7 +129,7 @@ en:
message_4: "Your average message length was <strong>%{length}</strong> characters"
message_5: "Your favorite channels:"
dancing_baby_alt: "Dancing baby"
- voice_usage:
+ live_usage:
title: Phone bill
subtitle: Your voice call statement
subtitle_others: "%{username}'s voice call statement"
diff --git a/plugins/discourse-rewind/spec/actions/voice_usage_spec.rb b/plugins/discourse-rewind/spec/actions/live_usage_spec.rb
similarity index 88%
rename from plugins/discourse-rewind/spec/actions/voice_usage_spec.rb
rename to plugins/discourse-rewind/spec/actions/live_usage_spec.rb
index 89144f6ec71..62ee16cd623 100644
--- a/plugins/discourse-rewind/spec/actions/voice_usage_spec.rb
+++ b/plugins/discourse-rewind/spec/actions/live_usage_spec.rb
@@ -1,15 +1,15 @@
# frozen_string_literal: true
-RSpec.describe DiscourseRewind::Action::VoiceUsage do
+RSpec.describe DiscourseRewind::Action::LiveUsage do
fab!(:user)
fab!(:friend, :user)
- fab!(:public_room) { Fabricate(:voice_room, public: true) }
- fab!(:private_room, :voice_room)
+ fab!(:public_room) { Fabricate(:live_room, public: true) }
+ fab!(:private_room, :live_room)
- before { SiteSetting.voice_enabled = true }
+ before { SiteSetting.live_enabled = true }
def fabricate_session(room:, joined_at:, duration:)
- Fabricate(:voice_session, user:, room:, joined_at:, left_at: duration && joined_at + duration)
+ Fabricate(:live_session, user:, room:, joined_at:, left_at: duration && joined_at + duration)
end
describe ".call" do
@@ -23,12 +23,12 @@ RSpec.describe DiscourseRewind::Action::VoiceUsage do
fabricate_session(room: public_room, joined_at: random_datetime, duration: 2.hours)
fabricate_session(room: private_room, joined_at: random_datetime, duration: 1.hour)
fabricate_session(
- room: Fabricate(:voice_ephemeral_room),
+ room: Fabricate(:live_ephemeral_room),
joined_at: random_datetime,
duration: 1.hour,
)
fabricate_session(room: public_room, joined_at: 2.years.ago, duration: 5.hours)
- Voice::CoPresence.create!(
+ Live::CoPresence.create!(
user_id_1: [user.id, friend.id].min,
user_id_2: [user.id, friend.id].max,
date: random_datetime.to_date,
diff --git a/plugins/voice/README.md b/plugins/live/README.md
similarity index 68%
rename from plugins/voice/README.md
rename to plugins/live/README.md
index 399bd420892..49d059c51c1 100644
--- a/plugins/voice/README.md
+++ b/plugins/live/README.md
@@ -1,6 +1,6 @@
-# Voice
+# Live
-Voice is a Discourse plugin that adds Discord-style voice rooms powered by WebRTC. Rooms appear in the sidebar; users join or leave with a single click and talk peer-to-peer — no media goes through the Discourse server. Sites that need bigger calls can optionally route rooms through a hosted or self-hosted [LiveKit](https://livekit.io) media server.
+Live is a Discourse plugin that adds Discord-style voice and video rooms powered by WebRTC. Rooms appear in the sidebar; users join or leave with a single click and talk peer-to-peer — no media goes through the Discourse server. Sites that need bigger calls can optionally route rooms through a hosted or self-hosted [LiveKit](https://livekit.io) media server.
> **Status:** early alpha — test with small groups before opening to a full community.
@@ -14,14 +14,14 @@ Voice is a Discourse plugin that adds Discord-style voice rooms powered by WebRT
- **Themed audio cues** — synthesized tones for calls, connect/disconnect, user join/leave, and mute/deafen toggles follow each listener's existing **Chat notifications** sound choice. **None**, missing, or legacy choices use **Classic and clean**.
- **Noise suppression** — optional DTLN-based background noise filtering via WebAssembly. See [Noise Suppression](#noise-suppression).
- **Live subtitles** — optional viewer-side captions powered by NVIDIA Parakeet speech recognition running locally via WebGPU. See [Live Subtitles](#live-subtitles).
-- **Video and screen sharing** — optional, off by default. Each room gets a full page at `/voice/r/<slug>` with a tile grid; camera and screen share toggle without renegotiation, and senders only encode toward peers who are actually watching the page. Rooms can opt out individually. See [Video](#video).
+- **Video and screen sharing** — optional, off by default. Each room gets a full page at `/live/r/<slug>` with a tile grid; camera and screen share toggle without renegotiation, and senders only encode toward peers who are actually watching the page. Rooms can opt out individually. See [Video](#video).
- **Video settings with background blur** — a per-room video settings modal with a live preview, camera device picker, and MediaPipe-powered background blur with an adjustable strength slider. See [Background Blur](#background-blur).
- **Pure browser WebRTC** — signaling through Discourse + MessageBus; media stays peer-to-peer, no SFU/MCU required.
- **Optional LiveKit SFU** — point the plugin at a self-hosted LiveKit server and route all rooms (or individually opted-in rooms) through it for enterprise-scale calls; everything else keeps working identically. See [LiveKit](#livekit-media-server-sfu).
## Installation
-Voice is a core plugin bundled with Discourse — no installation needed. Enable it via **Admin > Settings > Plugins > voice enabled**.
+Live is a core plugin bundled with Discourse — no installation needed. Enable it via **Admin > Settings > Plugins > live enabled**.
The plugin seeds a default "Watercooler" room on first enable.
@@ -29,28 +29,28 @@ The plugin seeds a default "Watercooler" room on first enable.
| Setting | Description |
| ------------------------------------ | ------------------------------------------------------------------------------------ |
-| `voice_enabled` | Master switch. |
-| `voice_allowed_groups` | Groups that can access voice rooms (default: everyone). |
-| `voice_create_room_allowed_groups` | Groups that can create new rooms (default: admins, moderators, TL2). |
-| `voice_max_rooms_per_user` | Max rooms per creator (default 5). |
-| `voice_participant_ttl_seconds` | Redis presence TTL in seconds (default 30). Client heartbeat refreshes every 10s. |
-| `voice_video_allowed_groups` | Groups that can share their camera. Empty turns cameras off site-wide. |
-| `voice_screen_share_allowed_groups` | Groups that can share their screen. Empty turns screen sharing off site-wide. |
-| `voice_video_max_publishers` | Max simultaneous video/screen publishers per room (default 8). |
-| `voice_video_background_blur_enabled` | Allow users to blur their camera background (default on; requires video). |
-| `voice_stun_servers` | STUN server addresses (pipe-separated). |
-| `voice_turn_servers` | TURN server addresses for NAT traversal. |
-| `voice_livekit_url` | WebSocket URL of a self-hosted LiveKit server (empty = mesh only). |
-| `voice_livekit_api_key` / `_api_secret` | LiveKit API credentials used to sign short-lived room tokens. |
-| `voice_livekit_room_policy` | Which rooms use LiveKit: `disabled` (default), `per_room`, or `all_rooms`. |
+| `live_enabled` | Master switch. |
+| `live_allowed_groups` | Groups that can access live rooms (default: everyone). |
+| `live_create_room_allowed_groups` | Groups that can create new rooms (default: admins, moderators, TL2). |
+| `live_max_rooms_per_user` | Max rooms per creator (default 5). |
+| `live_participant_ttl_seconds` | Redis presence TTL in seconds (default 30). Client heartbeat refreshes every 10s. |
+| `live_video_allowed_groups` | Groups that can share their camera. Empty turns cameras off site-wide. |
+| `live_screen_share_allowed_groups` | Groups that can share their screen. Empty turns screen sharing off site-wide. |
+| `live_video_max_publishers` | Max simultaneous video/screen publishers per room (default 8). |
+| `live_video_background_blur_enabled` | Allow users to blur their camera background (default on; requires video). |
+| `live_stun_servers` | STUN server addresses (pipe-separated). |
+| `live_turn_servers` | TURN server addresses for NAT traversal. |
+| `live_livekit_url` | WebSocket URL of a self-hosted LiveKit server (empty = mesh only). |
+| `live_livekit_api_key` / `_api_secret` | LiveKit API credentials used to sign short-lived room tokens. |
+| `live_livekit_room_policy` | Which rooms use LiveKit: `disabled` (default), `per_room`, or `all_rooms`. |
## Video
-When a user's groups allow camera or screen sharing (and the room's own video toggle is on), the room view at `/voice/r/<slug>` shows a video grid alongside the usual controls. Audio joins stay sidebar-first and unchanged; video lives on the page.
+When a user's groups allow camera or screen sharing (and the room's own video toggle is on), the room view at `/live/r/<slug>` shows a video grid alongside the usual controls. Audio joins stay sidebar-first and unchanged; video lives on the page.
- Still pure mesh: a video m-line is pre-negotiated on every peer connection, so toggling the camera or a screen share is a `replaceTrack` with no renegotiation.
- Senders attach video only toward participants currently on the room page (`watching_video` presence flag) — every skipped peer saves a full encoder session.
-- Encoding quality scales down with watcher count (720p ≤3 watchers, 480p ≤6, 360p beyond) and is capped by `voice_video_max_publishers`.
+- Encoding quality scales down with watcher count (720p ≤3 watchers, 480p ≤6, 360p beyond) and is capped by `live_video_max_publishers`.
- Camera and screen share are mutually exclusive per user. Stage rooms do not support video yet.
- On LiveKit-routed rooms the mesh details above are handled by the SFU instead: each track is published once with simulcast, and per-watcher gating happens on the subscriber side. The UI, the `watching_video` flag, and the publisher cap behave identically.
@@ -80,7 +80,7 @@ The MediaPipe runtime, wasm binaries, and the `selfie_segmenter.tflite` model (a
## LiveKit media server (SFU)
-By default media is pure peer-to-peer, which is ideal for small rooms but scales upstream bandwidth with room size. Deploy your own [LiveKit](https://livekit.io) server and set `voice_livekit_url`, `voice_livekit_api_key`, `voice_livekit_api_secret`, and `voice_livekit_room_policy` to route rooms through it — each participant then publishes every track exactly once, whatever the room size.
+By default media is pure peer-to-peer, which is ideal for small rooms but scales upstream bandwidth with room size. Deploy your own [LiveKit](https://livekit.io) server and set `live_livekit_url`, `live_livekit_api_key`, `live_livekit_api_secret`, and `live_livekit_room_policy` to route rooms through it — each participant then publishes every track exactly once, whatever the room size.
- The server picks each call's transport when its first participant joins and pins it for the whole call; a room is never split across transports, and setting changes only affect the next call.
- Presence, sessions, stats, mute/deafen/PTT, noise suppression, and background blur are transport-independent — they behave identically on both paths.
@@ -104,7 +104,7 @@ Microphone → AudioContext → AudioWorkletNode (engine) → MediaStreamDestina
All engines share one worklet runtime (`src/ns-worklet/runtime.js` in the discourse_voice_assets gem) and protocol: the main thread fetches the engine's assets and posts the bytes to the worklet, which instantiates them and answers a `ready` handshake once a warm-up denoise succeeds — only then is the suppressed track published, so an enabled mode always means the filter is really running.
-Pre-built assets ship in the [discourse_voice_assets](https://github.com/discourse/discourse_voice_assets) gem under stable filenames, served from a gem-version-stamped path (`public/javascripts/<gem version>/<engine>/`) that the client learns from the site serializer — the versioned URL busts the immutable `/plugins/` caches, so a gem bump needs no plugin change. The gem's build scripts clone each upstream at a pinned commit (applying patches where needed); `spec/integrity/voice_assets_spec.rb` pins the filenames the loaders reference against the gem's vendor tree.
+Pre-built assets ship in the [discourse_voice_assets](https://github.com/discourse/discourse_voice_assets) gem under stable filenames, served from a gem-version-stamped path (`public/javascripts/<gem version>/<engine>/`) that the client learns from the site serializer — the versioned URL busts the immutable `/plugins/` caches, so a gem bump needs no plugin change. The gem's build scripts clone each upstream at a pinned commit (applying patches where needed); `spec/integrity/live_assets_spec.rb` pins the filenames the loaders reference against the gem's vendor tree.
## Live Subtitles
@@ -114,29 +114,29 @@ Opt-in, viewer-side captions: the user who enables subtitles transcribes the rem
remote stream → Silero VAD (per participant) → utterance PCM → Worker (Parakeet, WebGPU) → caption overlay
```
-Each remote mic stream gets a [Silero VAD](https://github.com/ricky0123/vad) finding utterance boundaries; while a speaker keeps talking, the utterance-so-far is re-transcribed every ~1.5s as a provisional line that updates in place, and the speech-end pass finalizes it. Utterances are transcribed by one shared model in a Web Worker (quantized encoder on WebGPU, int8 decoder on single-threaded WASM — multithreaded WASM would require COOP/COEP headers). Requires WebGPU; gated by the `voice_subtitles_enabled` site setting.
+Each remote mic stream gets a [Silero VAD](https://github.com/ricky0123/vad) finding utterance boundaries; while a speaker keeps talking, the utterance-so-far is re-transcribed every ~1.5s as a provisional line that updates in place, and the speech-end pass finalizes it. Utterances are transcribed by one shared model in a Web Worker (quantized encoder on WebGPU, int8 decoder on single-threaded WASM — multithreaded WASM would require COOP/COEP headers). Requires WebGPU; gated by the `live_subtitles_enabled` site setting.
-Each user picks the model in their voice settings (stored per browser, like the noise-suppression mode; registry in `lib/voice/stt-models.js`): **Best quality** (Parakeet Ultra, 4-bit encoder, ~410 MB, the default) or **Smaller** (Parakeet Redux, ternary encoder stored as 2-bit, ~210 MB, less accurate in noise and in several languages). Switching reloads the worker on the new model, and the worker keeps only the current model in storage.
+Each user picks the model in their voice settings (stored per browser, like the noise-suppression mode; registry in `lib/live/stt-models.js`): **Best quality** (Parakeet Ultra, 4-bit encoder, ~410 MB, the default) or **Smaller** (Parakeet Redux, ternary encoder stored as 2-bit, ~210 MB, less accurate in noise and in several languages). Switching reloads the worker on the new model, and the worker keeps only the current model in storage.
-The runtime bundles (worker, VAD, onnxruntime, ~30 MB) are pinned and shipped in the discourse_voice_assets gem (served here from `public/javascripts/<gem version>/stt/`, built by the gem's `scripts/build-stt-assets.sh`). The model weights are **not** committed: they download on first use from Discourse's HuggingFace repository ([Discourse/Discourse-STT](https://huggingface.co/Discourse/Discourse-STT), pinned to a commit; kept in a durable Cache API store), or from a self-hosted mirror configured via `voice_stt_model_base_url` — see [docs/subtitles-model-mirror.md](docs/subtitles-model-mirror.md) for what to mirror and how.
+The runtime bundles (worker, VAD, onnxruntime, ~30 MB) are pinned and shipped in the discourse_voice_assets gem (served here from `public/javascripts/<gem version>/stt/`, built by the gem's `scripts/build-stt-assets.sh`). The model weights are **not** committed: they download on first use from Discourse's HuggingFace repository ([Discourse/Discourse-STT](https://huggingface.co/Discourse/Discourse-STT), pinned to a commit; kept in a durable Cache API store), or from a self-hosted mirror configured via `live_stt_model_base_url` — see [docs/subtitles-model-mirror.md](docs/subtitles-model-mirror.md) for what to mirror and how.
An end-to-end smoke check (`scripts/smoke-stt-worker.mjs`, real model on WebGPU in Chromium) lives in the gem alongside the build script.
## Development
```bash
-bin/rspec plugins/voice/spec # Ruby specs
-bin/lint plugins/voice # JS/SCSS/Ruby lint
+bin/rspec plugins/live/spec # Ruby specs
+bin/lint plugins/live # JS/SCSS/Ruby lint
```
Key entry points:
-- `app/controllers/voice/rooms_controller.rb` — room CRUD, signaling relay, participant state (mute/deafen/video/watching)
-- `app/controllers/voice/page_controller.rb` — serves the full-page room view at `/voice/r/:slug`
-- `lib/voice/guardian_extension.rb` — authorization (group-based access and room creation permissions)
-- `assets/javascripts/discourse/app/services/voice-webrtc.js` — WebRTC orchestration, audio controls, video/screen-share publishing, sound effects
-- `assets/javascripts/discourse/initializers/voice-sidebar.js` — sidebar section, click/context-menu handlers
-- `assets/javascripts/discourse/components/voice/room-page.gjs` — room page: tile grid, call controls, watching lifecycle
+- `app/controllers/live/rooms_controller.rb` — room CRUD, signaling relay, participant state (mute/deafen/video/watching)
+- `app/controllers/live/page_controller.rb` — serves the full-page room view at `/live/r/:slug`
+- `lib/live/guardian_extension.rb` — authorization (group-based access and room creation permissions)
+- `assets/javascripts/discourse/app/services/live-webrtc.js` — WebRTC orchestration, audio controls, video/screen-share publishing, sound effects
+- `assets/javascripts/discourse/initializers/live-sidebar.js` — sidebar section, click/context-menu handlers
+- `assets/javascripts/discourse/components/live/room-page.gjs` — room page: tile grid, call controls, watching lifecycle
## Known Limitations
diff --git a/plugins/voice/admin/assets/javascripts/admin/adapters/voice-room.js b/plugins/live/admin/assets/javascripts/admin/adapters/live-room.js
similarity index 51%
rename from plugins/voice/admin/assets/javascripts/admin/adapters/voice-room.js
rename to plugins/live/admin/assets/javascripts/admin/adapters/live-room.js
index fc913df4379..6ec0960bf7f 100644
--- a/plugins/voice/admin/assets/javascripts/admin/adapters/voice-room.js
+++ b/plugins/live/admin/assets/javascripts/admin/adapters/live-room.js
@@ -1,16 +1,16 @@
import RestAdapter from "discourse/adapters/rest";
-export default class VoiceRoomAdapter extends RestAdapter {
+export default class LiveRoomAdapter extends RestAdapter {
jsonMode = true;
basePath() {
- return "/admin/plugins/voice/";
+ return "/admin/plugins/live/";
}
pathFor(store, type, id) {
return id === undefined
- ? "/admin/plugins/voice/rooms.json"
- : `/admin/plugins/voice/rooms/${id}.json`;
+ ? "/admin/plugins/live/rooms.json"
+ : `/admin/plugins/live/rooms/${id}.json`;
}
apiNameFor() {
diff --git a/plugins/voice/admin/assets/javascripts/admin/components/voice-dashboard.gjs b/plugins/live/admin/assets/javascripts/admin/components/live-dashboard.gjs
similarity index 66%
rename from plugins/voice/admin/assets/javascripts/admin/components/voice-dashboard.gjs
rename to plugins/live/admin/assets/javascripts/admin/components/live-dashboard.gjs
index 3886b6b3040..19afc00c5fd 100644
--- a/plugins/voice/admin/assets/javascripts/admin/components/voice-dashboard.gjs
+++ b/plugins/live/admin/assets/javascripts/admin/components/live-dashboard.gjs
@@ -2,7 +2,7 @@ import Component from "@glimmer/component";
import DashboardPeriodSelector from "discourse/admin/components/dashboard-period-selector";
import dAvatar from "discourse/ui-kit/helpers/d-avatar";
import { i18n } from "discourse-i18n";
-import VoiceLivekitStatus from "discourse/plugins/voice/admin/components/voice-livekit-status";
+import LiveLivekitStatus from "discourse/plugins/live/admin/components/live-livekit-status";
function formatDuration(seconds) {
if (!seconds || seconds <= 0) {
@@ -18,7 +18,7 @@ function formatDuration(seconds) {
return `${m}m`;
}
-export default class VoiceDashboard extends Component {
+export default class LiveDashboard extends Component {
get overview() {
return this.args.model?.overview;
}
@@ -36,9 +36,9 @@ export default class VoiceDashboard extends Component {
}
<template>
- <section class="voice-dashboard">
- <div class="voice-dashboard__header">
- <h2>{{i18n "voice.admin.dashboard.overview"}}</h2>
+ <section class="live-dashboard">
+ <div class="live-dashboard__header">
+ <h2>{{i18n "live.admin.dashboard.overview"}}</h2>
<DashboardPeriodSelector
@endDate={{@controller.endDate}}
@period={{@controller.period}}
@@ -49,46 +49,46 @@ export default class VoiceDashboard extends Component {
</div>
{{#if this.hasData}}
- <div class="voice-dashboard__stats-cards">
- <div class="voice-dashboard__card">
+ <div class="live-dashboard__stats-cards">
+ <div class="live-dashboard__card">
<span
- class="voice-dashboard__card-value"
+ class="live-dashboard__card-value"
>{{this.overview.total_sessions}}</span>
- <span class="voice-dashboard__card-label">{{i18n
- "voice.admin.dashboard.total_sessions"
+ <span class="live-dashboard__card-label">{{i18n
+ "live.admin.dashboard.total_sessions"
}}</span>
</div>
- <div class="voice-dashboard__card">
+ <div class="live-dashboard__card">
<span
- class="voice-dashboard__card-value"
+ class="live-dashboard__card-value"
>{{this.overview.unique_users}}</span>
- <span class="voice-dashboard__card-label">{{i18n
- "voice.admin.dashboard.unique_users"
+ <span class="live-dashboard__card-label">{{i18n
+ "live.admin.dashboard.unique_users"
}}</span>
</div>
- <div class="voice-dashboard__card">
- <span class="voice-dashboard__card-value">{{formatDuration
+ <div class="live-dashboard__card">
+ <span class="live-dashboard__card-value">{{formatDuration
this.overview.avg_duration
}}</span>
- <span class="voice-dashboard__card-label">{{i18n
- "voice.admin.dashboard.avg_duration"
+ <span class="live-dashboard__card-label">{{i18n
+ "live.admin.dashboard.avg_duration"
}}</span>
</div>
</div>
{{#if this.rooms.length}}
- <h3>{{i18n "voice.admin.dashboard.top_rooms"}}</h3>
- <table class="d-table voice-dashboard__rooms-table">
+ <h3>{{i18n "live.admin.dashboard.top_rooms"}}</h3>
+ <table class="d-table live-dashboard__rooms-table">
<thead class="d-table__header">
<tr>
<th class="d-table__header-cell">{{i18n
- "voice.admin.dashboard.room_name"
+ "live.admin.dashboard.room_name"
}}</th>
<th class="d-table__header-cell">{{i18n
- "voice.admin.dashboard.unique_users"
+ "live.admin.dashboard.unique_users"
}}</th>
<th class="d-table__header-cell">{{i18n
- "voice.admin.dashboard.total_time"
+ "live.admin.dashboard.total_time"
}}</th>
</tr>
</thead>
@@ -99,18 +99,18 @@ export default class VoiceDashboard extends Component {
{{#if room.room_name}}
{{room.room_name}}
{{else}}
- {{i18n "voice.admin.dashboard.deleted_room"}}
+ {{i18n "live.admin.dashboard.deleted_room"}}
{{/if}}
</td>
<td class="d-table__cell --detail">
<div class="d-table__mobile-label">
- {{i18n "voice.admin.dashboard.unique_users"}}
+ {{i18n "live.admin.dashboard.unique_users"}}
</div>
{{room.unique_users}}
</td>
<td class="d-table__cell --detail">
<div class="d-table__mobile-label">
- {{i18n "voice.admin.dashboard.total_time"}}
+ {{i18n "live.admin.dashboard.total_time"}}
</div>
{{formatDuration room.total_seconds}}
</td>
@@ -121,18 +121,18 @@ export default class VoiceDashboard extends Component {
{{/if}}
{{#if this.users.length}}
- <h3>{{i18n "voice.admin.dashboard.top_users"}}</h3>
- <table class="d-table voice-dashboard__users-table">
+ <h3>{{i18n "live.admin.dashboard.top_users"}}</h3>
+ <table class="d-table live-dashboard__users-table">
<thead class="d-table__header">
<tr>
<th class="d-table__header-cell">{{i18n
- "voice.admin.dashboard.user"
+ "live.admin.dashboard.user"
}}</th>
<th class="d-table__header-cell">{{i18n
- "voice.admin.dashboard.sessions"
+ "live.admin.dashboard.sessions"
}}</th>
<th class="d-table__header-cell">{{i18n
- "voice.admin.dashboard.total_time"
+ "live.admin.dashboard.total_time"
}}</th>
</tr>
</thead>
@@ -142,7 +142,7 @@ export default class VoiceDashboard extends Component {
<td class="d-table__cell --overview">
{{#if u.username}}
<a
- class="voice-dashboard__user-cell"
+ class="live-dashboard__user-cell"
data-user-card={{u.username}}
href="/admin/users/{{u.user_id}}/{{u.username}}"
>
@@ -150,18 +150,18 @@ export default class VoiceDashboard extends Component {
<span>{{u.username}}</span>
</a>
{{else}}
- {{i18n "voice.admin.dashboard.deleted_user"}}
+ {{i18n "live.admin.dashboard.deleted_user"}}
{{/if}}
</td>
<td class="d-table__cell --detail">
<div class="d-table__mobile-label">
- {{i18n "voice.admin.dashboard.sessions"}}
+ {{i18n "live.admin.dashboard.sessions"}}
</div>
{{u.session_count}}
</td>
<td class="d-table__cell --detail">
<div class="d-table__mobile-label">
- {{i18n "voice.admin.dashboard.total_time"}}
+ {{i18n "live.admin.dashboard.total_time"}}
</div>
{{formatDuration u.total_seconds}}
</td>
@@ -171,12 +171,12 @@ export default class VoiceDashboard extends Component {
</table>
{{/if}}
{{else}}
- <p class="voice-dashboard__empty">{{i18n
- "voice.admin.dashboard.no_data"
+ <p class="live-dashboard__empty">{{i18n
+ "live.admin.dashboard.no_data"
}}</p>
{{/if}}
- <VoiceLivekitStatus />
+ <LiveLivekitStatus />
</section>
</template>
}
diff --git a/plugins/voice/admin/assets/javascripts/admin/components/voice-livekit-status.gjs b/plugins/live/admin/assets/javascripts/admin/components/live-livekit-status.gjs
similarity index 80%
rename from plugins/voice/admin/assets/javascripts/admin/components/voice-livekit-status.gjs
rename to plugins/live/admin/assets/javascripts/admin/components/live-livekit-status.gjs
index 288c13a8e03..22b797cdfd0 100644
--- a/plugins/voice/admin/assets/javascripts/admin/components/voice-livekit-status.gjs
+++ b/plugins/live/admin/assets/javascripts/admin/components/live-livekit-status.gjs
@@ -14,9 +14,9 @@ const STATE_ICONS = {
error: "circle-xmark",
};
-const PREFIX = "voice.admin.dashboard.livekit";
+const PREFIX = "live.admin.dashboard.livekit";
-export default class VoiceLivekitStatus extends Component {
+export default class LiveLivekitStatus extends Component {
@tracked status;
@tracked loading = true;
@tracked loadFailed = false;
@@ -64,13 +64,13 @@ export default class VoiceLivekitStatus extends Component {
} else {
const missing = [];
if (!status.settings.url_present) {
- missing.push("voice_livekit_url");
+ missing.push("live_livekit_url");
}
if (!status.settings.api_key_present) {
- missing.push("voice_livekit_api_key");
+ missing.push("live_livekit_api_key");
}
if (!status.settings.api_secret_present) {
- missing.push("voice_livekit_api_secret");
+ missing.push("live_livekit_api_secret");
}
checks.push({
state: "error",
@@ -151,7 +151,7 @@ export default class VoiceLivekitStatus extends Component {
"webhook:",
" urls:",
` - ${this.status.webhook_url}`,
- " api_key: your_api_key # the value of voice_livekit_api_key",
+ " api_key: your_api_key # the value of live_livekit_api_key",
].join("\n");
}
@@ -183,7 +183,7 @@ export default class VoiceLivekitStatus extends Component {
try {
this.status = await ajax(
- `/admin/plugins/voice/livekit/${refreshProbe ? "probe" : "status"}.json`,
+ `/admin/plugins/live/livekit/${refreshProbe ? "probe" : "status"}.json`,
refreshProbe ? { type: "POST" } : {}
);
} catch {
@@ -209,27 +209,27 @@ export default class VoiceLivekitStatus extends Component {
<template>
{{#if this.visible}}
- <div class="voice-livekit-status">
- <div class="voice-livekit-status__header">
- <h3>{{i18n "voice.admin.dashboard.livekit.title"}}</h3>
+ <div class="live-livekit-status">
+ <div class="live-livekit-status__header">
+ <h3>{{i18n "live.admin.dashboard.livekit.title"}}</h3>
<DButton
- class="btn-default btn-small voice-livekit-status__refresh"
+ class="btn-default btn-small live-livekit-status__refresh"
@action={{this.refresh}}
@disabled={{this.loading}}
@icon="arrows-rotate"
- @label="voice.admin.dashboard.livekit.refresh"
+ @label="live.admin.dashboard.livekit.refresh"
/>
</div>
<DConditionalLoadingSpinner @condition={{this.loading}}>
{{#if this.loadFailed}}
- <p class="voice-livekit-status__load-failed">{{i18n
- "voice.admin.dashboard.livekit.load_failed"
+ <p class="live-livekit-status__load-failed">{{i18n
+ "live.admin.dashboard.livekit.load_failed"
}}</p>
{{else}}
- <ul class="voice-livekit-status__checks">
+ <ul class="live-livekit-status__checks">
{{#each this.checks as |check|}}
- <li class="voice-livekit-status__check --{{check.state}}">
+ <li class="live-livekit-status__check --{{check.state}}">
{{dIcon check.icon}}
<span>
{{check.label}}
@@ -243,31 +243,31 @@ export default class VoiceLivekitStatus extends Component {
</ul>
{{#if this.showWebhookConfig}}
- <div class="voice-livekit-status__webhook-config">
+ <div class="live-livekit-status__webhook-config">
<p>{{i18n
- "voice.admin.dashboard.livekit.webhook_config_hint"
+ "live.admin.dashboard.livekit.webhook_config_hint"
}}</p>
<pre><code>{{this.webhookConfigSnippet}}</code></pre>
</div>
{{/if}}
{{#if this.status.configured}}
- <h4>{{i18n "voice.admin.dashboard.livekit.rooms_title"}}</h4>
+ <h4>{{i18n "live.admin.dashboard.livekit.rooms_title"}}</h4>
{{#if this.roomRows.length}}
- <table class="d-table voice-livekit-status__rooms">
+ <table class="d-table live-livekit-status__rooms">
<thead class="d-table__header">
<tr>
<th class="d-table__header-cell">{{i18n
- "voice.admin.dashboard.livekit.room"
+ "live.admin.dashboard.livekit.room"
}}</th>
<th class="d-table__header-cell">{{i18n
- "voice.admin.dashboard.livekit.discourse_participants"
+ "live.admin.dashboard.livekit.discourse_participants"
}}</th>
<th class="d-table__header-cell">{{i18n
- "voice.admin.dashboard.livekit.livekit_participants"
+ "live.admin.dashboard.livekit.livekit_participants"
}}</th>
<th class="d-table__header-cell">{{i18n
- "voice.admin.dashboard.livekit.room_status"
+ "live.admin.dashboard.livekit.room_status"
}}</th>
</tr>
</thead>
@@ -278,7 +278,7 @@ export default class VoiceLivekitStatus extends Component {
<td class="d-table__cell --detail">
<div class="d-table__mobile-label">
{{i18n
- "voice.admin.dashboard.livekit.discourse_participants"
+ "live.admin.dashboard.livekit.discourse_participants"
}}
</div>
{{row.presenceCount}}
@@ -286,36 +286,36 @@ export default class VoiceLivekitStatus extends Component {
<td class="d-table__cell --detail">
<div class="d-table__mobile-label">
{{i18n
- "voice.admin.dashboard.livekit.livekit_participants"
+ "live.admin.dashboard.livekit.livekit_participants"
}}
</div>
{{if row.probed row.livekitCount "—"}}
</td>
<td
- class="d-table__cell --detail voice-livekit-status__room-diff"
+ class="d-table__cell --detail live-livekit-status__room-diff"
>
<div class="d-table__mobile-label">
- {{i18n "voice.admin.dashboard.livekit.room_status"}}
+ {{i18n "live.admin.dashboard.livekit.room_status"}}
</div>
{{#if row.error}}
<span class="--error">
{{dIcon "circle-xmark"}}
{{i18n
- "voice.admin.dashboard.livekit.room_error"
+ "live.admin.dashboard.livekit.room_error"
error=row.error
}}
</span>
{{else if row.inSync}}
<span class="--ok">
{{dIcon "circle-check"}}
- {{i18n "voice.admin.dashboard.livekit.in_sync"}}
+ {{i18n "live.admin.dashboard.livekit.in_sync"}}
</span>
{{else if row.probed}}
{{#if row.missingOnLivekit}}
<div class="--warning">
{{dIcon "triangle-exclamation"}}
{{i18n
- "voice.admin.dashboard.livekit.missing_on_livekit"
+ "live.admin.dashboard.livekit.missing_on_livekit"
users=row.missingOnLivekit
}}
</div>
@@ -324,7 +324,7 @@ export default class VoiceLivekitStatus extends Component {
<div class="--warning">
{{dIcon "triangle-exclamation"}}
{{i18n
- "voice.admin.dashboard.livekit.missing_in_presence"
+ "live.admin.dashboard.livekit.missing_in_presence"
users=row.missingInPresence
}}
</div>
@@ -338,8 +338,8 @@ export default class VoiceLivekitStatus extends Component {
</tbody>
</table>
{{else}}
- <p class="voice-livekit-status__no-rooms">{{i18n
- "voice.admin.dashboard.livekit.no_rooms"
+ <p class="live-livekit-status__no-rooms">{{i18n
+ "live.admin.dashboard.livekit.no_rooms"
}}</p>
{{/if}}
{{/if}}
diff --git a/plugins/voice/admin/assets/javascripts/admin/components/voice-recording-list.gjs b/plugins/live/admin/assets/javascripts/admin/components/live-recording-list.gjs
similarity index 71%
rename from plugins/voice/admin/assets/javascripts/admin/components/voice-recording-list.gjs
rename to plugins/live/admin/assets/javascripts/admin/components/live-recording-list.gjs
index 1e4160ab3c0..2b615cf3cc6 100644
--- a/plugins/voice/admin/assets/javascripts/admin/components/voice-recording-list.gjs
+++ b/plugins/live/admin/assets/javascripts/admin/components/live-recording-list.gjs
@@ -11,7 +11,7 @@ import dAvatar from "discourse/ui-kit/helpers/d-avatar";
import dFormatDate from "discourse/ui-kit/helpers/d-format-date";
import { i18n } from "discourse-i18n";
-const PREFIX = "voice.admin.recordings";
+const PREFIX = "live.admin.recordings";
function formatDuration(durationMs) {
if (!durationMs) {
@@ -29,7 +29,7 @@ function formatDuration(durationMs) {
: `${minutes}:${pad(seconds)}`;
}
-export default class VoiceRecordingList extends Component {
+export default class LiveRecordingList extends Component {
@tracked extraRecordings = [];
@tracked hasMoreOverride = null;
@tracked loadingMore = false;
@@ -56,7 +56,7 @@ export default class VoiceRecordingList extends Component {
this.loadingMore = true;
try {
const payload = await ajax(
- `/admin/plugins/voice/recordings.json?offset=${this.recordings.length}`
+ `/admin/plugins/live/recordings.json?offset=${this.recordings.length}`
);
this.extraRecordings = [...this.extraRecordings, ...payload.recordings];
this.hasMoreOverride = payload.has_more;
@@ -68,17 +68,17 @@ export default class VoiceRecordingList extends Component {
}
<template>
- <section class="voice-recordings">
+ <section class="live-recordings">
<DPageSubheader
- @descriptionLabel={{i18n "voice.admin.recordings.description"}}
- @titleLabel={{i18n "voice.admin.recordings_title"}}
+ @descriptionLabel={{i18n "live.admin.recordings.description"}}
+ @titleLabel={{i18n "live.admin.recordings_title"}}
/>
{{#unless @model.last_webhook_at}}
<DFlashMessage
- class="voice-recordings__webhook-note"
+ class="live-recordings__webhook-note"
@flash={{i18n
- "voice.admin.recordings.webhook_config_hint"
+ "live.admin.recordings.webhook_config_hint"
}}
@type="info"
@@ -86,38 +86,38 @@ export default class VoiceRecordingList extends Component {
{{/unless}}
{{#if this.recordings.length}}
- <table class="d-table voice-recordings__table">
+ <table class="d-table live-recordings__table">
<thead class="d-table__header">
<tr>
<th class="d-table__header-cell">{{i18n
- "voice.admin.recordings.room"
+ "live.admin.recordings.room"
}}</th>
<th class="d-table__header-cell">{{i18n
- "voice.admin.recordings.requested_by"
+ "live.admin.recordings.requested_by"
}}</th>
<th class="d-table__header-cell">{{i18n
- "voice.admin.recordings.status"
+ "live.admin.recordings.status"
}}</th>
<th class="d-table__header-cell">{{i18n
- "voice.admin.recordings.started_at"
+ "live.admin.recordings.started_at"
}}</th>
<th class="d-table__header-cell">{{i18n
- "voice.admin.recordings.duration"
+ "live.admin.recordings.duration"
}}</th>
<th class="d-table__header-cell">{{i18n
- "voice.admin.recordings.file"
+ "live.admin.recordings.file"
}}</th>
</tr>
</thead>
<tbody>
{{#each this.recordings as |recording|}}
<tr class="d-table__row">
- <td class="d-table__cell --overview voice-recordings__room">
+ <td class="d-table__cell --overview live-recordings__room">
{{recording.room_name}}
</td>
- <td class="d-table__cell --detail voice-recordings__requester">
+ <td class="d-table__cell --detail live-recordings__requester">
<div class="d-table__mobile-label">
- {{i18n "voice.admin.recordings.requested_by"}}
+ {{i18n "live.admin.recordings.requested_by"}}
</div>
{{#if recording.started_by}}
{{dAvatar recording.started_by imageSize="tiny"}}
@@ -126,31 +126,31 @@ export default class VoiceRecordingList extends Component {
-
{{/if}}
</td>
- <td class="d-table__cell --detail voice-recordings__status">
+ <td class="d-table__cell --detail live-recordings__status">
<div class="d-table__mobile-label">
- {{i18n "voice.admin.recordings.status"}}
+ {{i18n "live.admin.recordings.status"}}
</div>
<span
- class="voice-recordings__status-badge --{{recording.status}}"
+ class="live-recordings__status-badge --{{recording.status}}"
>
{{this.statusLabel recording.status}}
</span>
</td>
- <td class="d-table__cell --detail voice-recordings__started-at">
+ <td class="d-table__cell --detail live-recordings__started-at">
<div class="d-table__mobile-label">
- {{i18n "voice.admin.recordings.started_at"}}
+ {{i18n "live.admin.recordings.started_at"}}
</div>
{{dFormatDate recording.started_at leaveAgo="true"}}
</td>
- <td class="d-table__cell --detail voice-recordings__duration">
+ <td class="d-table__cell --detail live-recordings__duration">
<div class="d-table__mobile-label">
- {{i18n "voice.admin.recordings.duration"}}
+ {{i18n "live.admin.recordings.duration"}}
</div>
{{this.formatDuration recording.duration_ms}}
</td>
- <td class="d-table__cell --detail voice-recordings__file">
+ <td class="d-table__cell --detail live-recordings__file">
<div class="d-table__mobile-label">
- {{i18n "voice.admin.recordings.file"}}
+ {{i18n "live.admin.recordings.file"}}
</div>
{{#if (this.isDownloadUrl recording.location)}}
<a
@@ -158,7 +158,7 @@ export default class VoiceRecordingList extends Component {
rel="noopener noreferrer"
target="_blank"
>
- {{i18n "voice.admin.recordings.download"}}
+ {{i18n "live.admin.recordings.download"}}
</a>
{{else}}
<code>{{this.filePath recording}}</code>
@@ -172,15 +172,15 @@ export default class VoiceRecordingList extends Component {
<DConditionalLoadingSpinner @condition={{this.loadingMore}}>
{{#if this.hasMore}}
<DButton
- class="btn-default voice-recordings__load-more"
+ class="btn-default live-recordings__load-more"
@action={{this.loadMore}}
- @label="voice.admin.recordings.load_more"
+ @label="live.admin.recordings.load_more"
/>
{{/if}}
</DConditionalLoadingSpinner>
{{else}}
- <p class="voice-recordings__empty">
- {{i18n "voice.admin.recordings.empty"}}
+ <p class="live-recordings__empty">
+ {{i18n "live.admin.recordings.empty"}}
</p>
{{/if}}
</section>
diff --git a/plugins/voice/admin/assets/javascripts/admin/components/voice-room-list.gjs b/plugins/live/admin/assets/javascripts/admin/components/live-room-list.gjs
similarity index 68%
rename from plugins/voice/admin/assets/javascripts/admin/components/voice-room-list.gjs
rename to plugins/live/admin/assets/javascripts/admin/components/live-room-list.gjs
index 2f82f98fed5..60bc21fa14d 100644
--- a/plugins/voice/admin/assets/javascripts/admin/components/voice-room-list.gjs
+++ b/plugins/live/admin/assets/javascripts/admin/components/live-room-list.gjs
@@ -17,18 +17,18 @@ import dAvatar from "discourse/ui-kit/helpers/d-avatar";
import dFormatDate from "discourse/ui-kit/helpers/d-format-date";
import { i18n } from "discourse-i18n";
-export default class VoiceRoomList extends Component {
+export default class LiveRoomList extends Component {
@service dialog;
@action
async endCall(room) {
await this.dialog.yesNoConfirm({
- message: i18n("voice.admin.end_call.confirm", {
+ message: i18n("live.admin.end_call.confirm", {
name: escapeExpression(room.name),
}),
didConfirm: async () => {
try {
- await ajax(`/admin/plugins/voice/rooms/${room.id}/end_call`, {
+ await ajax(`/admin/plugins/live/rooms/${room.id}/end_call`, {
type: "POST",
});
room.set("live_participant_count", 0);
@@ -44,7 +44,7 @@ export default class VoiceRoomList extends Component {
await closeMenu();
await this.dialog.deleteConfirm({
- message: i18n("voice.admin.destroy_room.confirm", {
+ message: i18n("live.admin.destroy_room.confirm", {
name: escapeExpression(room.name),
}),
didConfirm: async () => {
@@ -59,39 +59,39 @@ export default class VoiceRoomList extends Component {
}
<template>
- <section class="voice-rooms-table">
- <DPageSubheader @titleLabel={{i18n "voice.admin.rooms_title"}}>
+ <section class="live-rooms-table">
+ <DPageSubheader @titleLabel={{i18n "live.admin.rooms_title"}}>
<:actions as |actions|>
<actions.Primary
- class="voice-admin__create-btn"
+ class="live-admin__create-btn"
@icon="plus"
- @label="voice.admin.create_room"
- @route="adminPlugins.show.voice-rooms.new"
+ @label="live.admin.create_room"
+ @route="adminPlugins.show.live-rooms.new"
/>
</:actions>
</DPageSubheader>
{{#if @rooms.length}}
- <table class="d-table voice-rooms">
+ <table class="d-table live-rooms">
<thead class="d-table__header">
<tr>
<th class="d-table__header-cell">{{i18n
- "voice.admin.room.name"
+ "live.admin.room.name"
}}</th>
<th class="d-table__header-cell">{{i18n
- "voice.admin.room.creator"
+ "live.admin.room.creator"
}}</th>
<th class="d-table__header-cell">{{i18n
- "voice.admin.room.public"
+ "live.admin.room.public"
}}</th>
<th class="d-table__header-cell">{{i18n
- "voice.admin.room.max_participants"
+ "live.admin.room.max_participants"
}}</th>
<th class="d-table__header-cell">{{i18n
- "voice.admin.room.member_count"
+ "live.admin.room.member_count"
}}</th>
<th class="d-table__header-cell">{{i18n
- "voice.admin.room.created_at"
+ "live.admin.room.created_at"
}}</th>
<th></th>
</tr>
@@ -99,24 +99,24 @@ export default class VoiceRoomList extends Component {
<tbody>
{{#each @rooms as |room|}}
<tr class="d-table__row">
- <td class="d-table__cell --overview voice-rooms__name">
+ <td class="d-table__cell --overview live-rooms__name">
<LinkTo
- class="d-table__overview-link voice-rooms__name-link"
+ class="d-table__overview-link live-rooms__name-link"
@model={{room.id}}
- @route="adminPlugins.show.voice-rooms.edit"
+ @route="adminPlugins.show.live-rooms.edit"
>
<strong
class="d-table__overview-name"
>{{room.name}}</strong>
</LinkTo>
</td>
- <td class="d-table__cell --detail voice-rooms__creator">
+ <td class="d-table__cell --detail live-rooms__creator">
<div class="d-table__mobile-label">
- {{i18n "voice.admin.room.creator"}}
+ {{i18n "live.admin.room.creator"}}
</div>
{{#if room.creator}}
<DUserLink
- class="voice-rooms__creator-link"
+ class="live-rooms__creator-link"
@user={{room.creator}}
>
{{dAvatar room.creator imageSize="tiny"}}
@@ -124,9 +124,9 @@ export default class VoiceRoomList extends Component {
</DUserLink>
{{/if}}
</td>
- <td class="d-table__cell --detail voice-rooms__public">
+ <td class="d-table__cell --detail live-rooms__public">
<div class="d-table__mobile-label">
- {{i18n "voice.admin.room.public"}}
+ {{i18n "live.admin.room.public"}}
</div>
{{#if room.public}}
{{i18n "yes_value"}}
@@ -134,11 +134,9 @@ export default class VoiceRoomList extends Component {
{{i18n "no_value"}}
{{/if}}
</td>
- <td
- class="d-table__cell --detail voice-rooms__max-participants"
- >
+ <td class="d-table__cell --detail live-rooms__max-participants">
<div class="d-table__mobile-label">
- {{i18n "voice.admin.room.max_participants"}}
+ {{i18n "live.admin.room.max_participants"}}
</div>
{{#if room.max_participants}}
{{room.max_participants}}
@@ -146,24 +144,24 @@ export default class VoiceRoomList extends Component {
-
{{/if}}
</td>
- <td class="d-table__cell --detail voice-rooms__member-count">
+ <td class="d-table__cell --detail live-rooms__member-count">
<div class="d-table__mobile-label">
- {{i18n "voice.admin.room.member_count"}}
+ {{i18n "live.admin.room.member_count"}}
</div>
{{room.member_count}}
</td>
- <td class="d-table__cell --detail voice-rooms__created-at">
+ <td class="d-table__cell --detail live-rooms__created-at">
<div class="d-table__mobile-label">
- {{i18n "voice.admin.room.created_at"}}
+ {{i18n "live.admin.room.created_at"}}
</div>
{{dFormatDate room.created_at leaveAgo="true"}}
</td>
- <td class="d-table__cell --controls voice-rooms__controls">
+ <td class="d-table__cell --controls live-rooms__controls">
{{#if room.live_participant_count}}
<DButton
- class="btn-small btn-danger voice-rooms__end-call"
+ class="btn-small btn-danger live-rooms__end-call"
@icon="phone-slash"
- @title="voice.admin.end_call.title"
+ @title="live.admin.end_call.title"
{{on "click" (fn this.endCall room)}}
/>
{{/if}}
@@ -171,14 +169,14 @@ export default class VoiceRoomList extends Component {
<LinkTo
class="btn btn-default btn-text btn-small"
@model={{room.id}}
- @route="adminPlugins.show.voice-rooms.edit"
+ @route="adminPlugins.show.live-rooms.edit"
>
- {{i18n "voice.admin.edit"}}
+ {{i18n "live.admin.edit"}}
</LinkTo>
<DMenu
@icon="ellipsis-vertical"
- @identifier="voice-rooms-menu"
+ @identifier="live-rooms-menu"
@placement="bottom-end"
@title={{i18n "more_options"}}
@triggerClass="btn-default btn-small"
@@ -187,7 +185,7 @@ export default class VoiceRoomList extends Component {
<DDropdownMenu as |dropdown|>
<dropdown.item>
<DButton
- class="btn-transparent --danger voice-rooms__delete"
+ class="btn-transparent --danger live-rooms__delete"
@action={{fn this.destroyRoom room menu.close}}
@icon="trash-can"
@label="delete"
@@ -203,10 +201,10 @@ export default class VoiceRoomList extends Component {
</table>
{{else}}
<AdminConfigAreaEmptyList
- @ctaClass="voice-admin__create-btn"
- @ctaLabel="voice.admin.create_room"
- @ctaRoute="adminPlugins.show.voice-rooms.new"
- @emptyLabel="voice.admin.no_rooms_yet"
+ @ctaClass="live-admin__create-btn"
+ @ctaLabel="live.admin.create_room"
+ @ctaRoute="adminPlugins.show.live-rooms.new"
+ @emptyLabel="live.admin.no_rooms_yet"
/>
{{/if}}
</section>
diff --git a/plugins/voice/admin/assets/javascripts/admin/models/voice-room.js b/plugins/live/admin/assets/javascripts/admin/models/live-room.js
similarity index 95%
rename from plugins/voice/admin/assets/javascripts/admin/models/voice-room.js
rename to plugins/live/admin/assets/javascripts/admin/models/live-room.js
index 34840a36e3e..e5ea6ef882d 100644
--- a/plugins/voice/admin/assets/javascripts/admin/models/voice-room.js
+++ b/plugins/live/admin/assets/javascripts/admin/models/live-room.js
@@ -26,7 +26,7 @@ function withNullsForUndefined(properties) {
return normalized;
}
-export default class VoiceRoom extends RestModel {
+export default class LiveRoom extends RestModel {
createProperties() {
return withNullsForUndefined(this.getProperties(SAVED_PROPERTIES));
}
diff --git a/plugins/voice/admin/assets/javascripts/discourse/controllers/admin-plugins/show/voice-dashboard.js b/plugins/live/admin/assets/javascripts/discourse/controllers/admin-plugins/show/live-dashboard.js
similarity index 95%
rename from plugins/voice/admin/assets/javascripts/discourse/controllers/admin-plugins/show/voice-dashboard.js
rename to plugins/live/admin/assets/javascripts/discourse/controllers/admin-plugins/show/live-dashboard.js
index 5394f9ee525..b15805273d7 100644
--- a/plugins/voice/admin/assets/javascripts/discourse/controllers/admin-plugins/show/voice-dashboard.js
+++ b/plugins/live/admin/assets/javascripts/discourse/controllers/admin-plugins/show/live-dashboard.js
@@ -2,7 +2,7 @@ import { tracked } from "@glimmer/tracking";
import Controller from "@ember/controller";
import { action } from "@ember/object";
-export default class VoiceDashboardController extends Controller {
+export default class LiveDashboardController extends Controller {
@tracked period = "weekly";
@tracked start_date = null;
@tracked end_date = null;
diff --git a/plugins/voice/admin/assets/javascripts/discourse/controllers/admin-plugins/show/voice-rooms/new.js b/plugins/live/admin/assets/javascripts/discourse/controllers/admin-plugins/show/live-rooms/edit.js
similarity index 60%
rename from plugins/voice/admin/assets/javascripts/discourse/controllers/admin-plugins/show/voice-rooms/new.js
rename to plugins/live/admin/assets/javascripts/discourse/controllers/admin-plugins/show/live-rooms/edit.js
index 5df05e18fa0..da016f56837 100644
--- a/plugins/voice/admin/assets/javascripts/discourse/controllers/admin-plugins/show/voice-rooms/new.js
+++ b/plugins/live/admin/assets/javascripts/discourse/controllers/admin-plugins/show/live-rooms/edit.js
@@ -3,16 +3,16 @@ import { action } from "@ember/object";
import { service } from "@ember/service";
import { i18n } from "discourse-i18n";
-export default class VoiceRoomsNewController extends Controller {
+export default class LiveRoomsEditController extends Controller {
@service router;
@service toasts;
@action
saveRoom() {
this.toasts.success({
- data: { message: i18n("voice.admin.room_created") },
+ data: { message: i18n("live.admin.room_updated") },
duration: "short",
});
- this.router.transitionTo("adminPlugins.show.voice-rooms.index");
+ this.router.transitionTo("adminPlugins.show.live-rooms.index");
}
}
diff --git a/plugins/voice/admin/assets/javascripts/discourse/controllers/admin-plugins/show/voice-rooms/index.js b/plugins/live/admin/assets/javascripts/discourse/controllers/admin-plugins/show/live-rooms/index.js
similarity index 77%
rename from plugins/voice/admin/assets/javascripts/discourse/controllers/admin-plugins/show/voice-rooms/index.js
rename to plugins/live/admin/assets/javascripts/discourse/controllers/admin-plugins/show/live-rooms/index.js
index 293ccdf5fd5..92ce2f61d44 100644
--- a/plugins/voice/admin/assets/javascripts/discourse/controllers/admin-plugins/show/voice-rooms/index.js
+++ b/plugins/live/admin/assets/javascripts/discourse/controllers/admin-plugins/show/live-rooms/index.js
@@ -2,7 +2,7 @@ import Controller from "@ember/controller";
import { action } from "@ember/object";
import { removeValueFromArray } from "discourse/lib/array-tools";
-export default class VoiceRoomsIndexController extends Controller {
+export default class LiveRoomsIndexController extends Controller {
@action
destroyRoom(room) {
removeValueFromArray(this.model.content, room);
diff --git a/plugins/voice/admin/assets/javascripts/discourse/controllers/admin-plugins/show/voice-rooms/edit.js b/plugins/live/admin/assets/javascripts/discourse/controllers/admin-plugins/show/live-rooms/new.js
similarity index 60%
rename from plugins/voice/admin/assets/javascripts/discourse/controllers/admin-plugins/show/voice-rooms/edit.js
rename to plugins/live/admin/assets/javascripts/discourse/controllers/admin-plugins/show/live-rooms/new.js
index 0175ed88944..15a7602787f 100644
--- a/plugins/voice/admin/assets/javascripts/discourse/controllers/admin-plugins/show/voice-rooms/edit.js
+++ b/plugins/live/admin/assets/javascripts/discourse/controllers/admin-plugins/show/live-rooms/new.js
@@ -3,16 +3,16 @@ import { action } from "@ember/object";
import { service } from "@ember/service";
import { i18n } from "discourse-i18n";
-export default class VoiceRoomsEditController extends Controller {
+export default class LiveRoomsNewController extends Controller {
@service router;
@service toasts;
@action
saveRoom() {
this.toasts.success({
- data: { message: i18n("voice.admin.room_updated") },
+ data: { message: i18n("live.admin.room_created") },
duration: "short",
});
- this.router.transitionTo("adminPlugins.show.voice-rooms.index");
+ this.router.transitionTo("adminPlugins.show.live-rooms.index");
}
}
diff --git a/plugins/voice/admin/assets/javascripts/discourse/routes/admin-plugins/show/voice-dashboard.js b/plugins/live/admin/assets/javascripts/discourse/routes/admin-plugins/show/live-dashboard.js
similarity index 69%
rename from plugins/voice/admin/assets/javascripts/discourse/routes/admin-plugins/show/voice-dashboard.js
rename to plugins/live/admin/assets/javascripts/discourse/routes/admin-plugins/show/live-dashboard.js
index 2a4d167e807..2376f5a118a 100644
--- a/plugins/voice/admin/assets/javascripts/discourse/routes/admin-plugins/show/voice-dashboard.js
+++ b/plugins/live/admin/assets/javascripts/discourse/routes/admin-plugins/show/live-dashboard.js
@@ -1,7 +1,7 @@
import Route from "@ember/routing/route";
import { ajax } from "discourse/lib/ajax";
-export default class VoiceDashboardRoute extends Route {
+export default class LiveDashboardRoute extends Route {
queryParams = {
period: { refreshModel: true },
start_date: { refreshModel: true },
@@ -9,13 +9,13 @@ export default class VoiceDashboardRoute extends Route {
};
async model() {
- const controller = this.controllerFor("admin-plugins.show.voice-dashboard");
+ const controller = this.controllerFor("admin-plugins.show.live-dashboard");
const queryString = this.#buildQuery(controller);
const [overview, rooms, users] = await Promise.all([
- ajax(`/admin/plugins/voice/stats/overview.json?${queryString}`),
- ajax(`/admin/plugins/voice/stats/rooms.json?${queryString}`),
- ajax(`/admin/plugins/voice/stats/users.json?${queryString}`),
+ ajax(`/admin/plugins/live/stats/overview.json?${queryString}`),
+ ajax(`/admin/plugins/live/stats/rooms.json?${queryString}`),
+ ajax(`/admin/plugins/live/stats/users.json?${queryString}`),
]);
return { overview, rooms: rooms.rooms, users: users.users };
diff --git a/plugins/live/admin/assets/javascripts/discourse/routes/admin-plugins/show/live-recordings.js b/plugins/live/admin/assets/javascripts/discourse/routes/admin-plugins/show/live-recordings.js
new file mode 100644
index 00000000000..c736b3adfe4
--- /dev/null
+++ b/plugins/live/admin/assets/javascripts/discourse/routes/admin-plugins/show/live-recordings.js
@@ -0,0 +1,8 @@
+import Route from "@ember/routing/route";
+import { ajax } from "discourse/lib/ajax";
+
+export default class LiveRecordingsRoute extends Route {
+ async model() {
+ return await ajax("/admin/plugins/live/recordings.json");
+ }
+}
diff --git a/plugins/live/admin/assets/javascripts/discourse/routes/admin-plugins/show/live-rooms.js b/plugins/live/admin/assets/javascripts/discourse/routes/admin-plugins/show/live-rooms.js
new file mode 100644
index 00000000000..c44210b4ce4
--- /dev/null
+++ b/plugins/live/admin/assets/javascripts/discourse/routes/admin-plugins/show/live-rooms.js
@@ -0,0 +1,3 @@
+import Route from "@ember/routing/route";
+
+export default class LiveRoomsRoute extends Route {}
diff --git a/plugins/voice/admin/assets/javascripts/discourse/routes/admin-plugins/show/voice-rooms/edit.js b/plugins/live/admin/assets/javascripts/discourse/routes/admin-plugins/show/live-rooms/edit.js
similarity index 54%
rename from plugins/voice/admin/assets/javascripts/discourse/routes/admin-plugins/show/voice-rooms/edit.js
rename to plugins/live/admin/assets/javascripts/discourse/routes/admin-plugins/show/live-rooms/edit.js
index 563d4120a9f..6ebf5b145bc 100644
--- a/plugins/voice/admin/assets/javascripts/discourse/routes/admin-plugins/show/voice-rooms/edit.js
+++ b/plugins/live/admin/assets/javascripts/discourse/routes/admin-plugins/show/live-rooms/edit.js
@@ -1,10 +1,10 @@
import { service } from "@ember/service";
import DiscourseRoute from "discourse/routes/discourse";
-export default class VoiceRoomsEditRoute extends DiscourseRoute {
+export default class LiveRoomsEditRoute extends DiscourseRoute {
@service store;
model(params) {
- return this.store.find("voice-room", params.id);
+ return this.store.find("live-room", params.id);
}
}
diff --git a/plugins/voice/admin/assets/javascripts/discourse/routes/admin-plugins/show/voice-rooms/index.js b/plugins/live/admin/assets/javascripts/discourse/routes/admin-plugins/show/live-rooms/index.js
similarity index 67%
rename from plugins/voice/admin/assets/javascripts/discourse/routes/admin-plugins/show/voice-rooms/index.js
rename to plugins/live/admin/assets/javascripts/discourse/routes/admin-plugins/show/live-rooms/index.js
index 775638174fe..8e43d70720a 100644
--- a/plugins/voice/admin/assets/javascripts/discourse/routes/admin-plugins/show/voice-rooms/index.js
+++ b/plugins/live/admin/assets/javascripts/discourse/routes/admin-plugins/show/live-rooms/index.js
@@ -2,11 +2,11 @@ import { action } from "@ember/object";
import { service } from "@ember/service";
import DiscourseRoute from "discourse/routes/discourse";
-export default class VoiceRoomsIndexRoute extends DiscourseRoute {
+export default class LiveRoomsIndexRoute extends DiscourseRoute {
@service store;
model() {
- return this.store.findAll("voice-room");
+ return this.store.findAll("live-room");
}
@action
diff --git a/plugins/voice/admin/assets/javascripts/discourse/routes/admin-plugins/show/voice-rooms/new.js b/plugins/live/admin/assets/javascripts/discourse/routes/admin-plugins/show/live-rooms/new.js
similarity index 54%
rename from plugins/voice/admin/assets/javascripts/discourse/routes/admin-plugins/show/voice-rooms/new.js
rename to plugins/live/admin/assets/javascripts/discourse/routes/admin-plugins/show/live-rooms/new.js
index 5081a672a90..257ba1bb88d 100644
--- a/plugins/voice/admin/assets/javascripts/discourse/routes/admin-plugins/show/voice-rooms/new.js
+++ b/plugins/live/admin/assets/javascripts/discourse/routes/admin-plugins/show/live-rooms/new.js
@@ -1,10 +1,10 @@
import { service } from "@ember/service";
import DiscourseRoute from "discourse/routes/discourse";
-export default class VoiceRoomsNewRoute extends DiscourseRoute {
+export default class LiveRoomsNewRoute extends DiscourseRoute {
@service store;
model() {
- return this.store.createRecord("voice-room");
+ return this.store.createRecord("live-room");
}
}
diff --git a/plugins/live/admin/assets/javascripts/discourse/templates/admin-plugins/show/live-dashboard.gjs b/plugins/live/admin/assets/javascripts/discourse/templates/admin-plugins/show/live-dashboard.gjs
new file mode 100644
index 00000000000..9d838f4faf0
--- /dev/null
+++ b/plugins/live/admin/assets/javascripts/discourse/templates/admin-plugins/show/live-dashboard.gjs
@@ -0,0 +1,5 @@
+import LiveDashboard from "discourse/plugins/live/admin/components/live-dashboard";
+
+export default <template>
+ <LiveDashboard @controller={{@controller}} @model={{@model}} />
+</template>
diff --git a/plugins/live/admin/assets/javascripts/discourse/templates/admin-plugins/show/live-recordings.gjs b/plugins/live/admin/assets/javascripts/discourse/templates/admin-plugins/show/live-recordings.gjs
new file mode 100644
index 00000000000..e84ff53844e
--- /dev/null
+++ b/plugins/live/admin/assets/javascripts/discourse/templates/admin-plugins/show/live-recordings.gjs
@@ -0,0 +1,3 @@
+import LiveRecordingList from "discourse/plugins/live/admin/components/live-recording-list";
+
+export default <template><LiveRecordingList @model={{@model}} /></template>
diff --git a/plugins/live/admin/assets/javascripts/discourse/templates/admin-plugins/show/live-rooms/edit.gjs b/plugins/live/admin/assets/javascripts/discourse/templates/admin-plugins/show/live-rooms/edit.gjs
new file mode 100644
index 00000000000..efe292ca686
--- /dev/null
+++ b/plugins/live/admin/assets/javascripts/discourse/templates/admin-plugins/show/live-rooms/edit.gjs
@@ -0,0 +1,5 @@
+import LiveRoomForm from "discourse/plugins/live/discourse/components/live-room-form";
+
+export default <template>
+ <LiveRoomForm @onSave={{@controller.saveRoom}} @room={{@controller.model}} />
+</template>
diff --git a/plugins/voice/admin/assets/javascripts/discourse/templates/admin-plugins/show/voice-rooms/index.gjs b/plugins/live/admin/assets/javascripts/discourse/templates/admin-plugins/show/live-rooms/index.gjs
similarity index 55%
rename from plugins/voice/admin/assets/javascripts/discourse/templates/admin-plugins/show/voice-rooms/index.gjs
rename to plugins/live/admin/assets/javascripts/discourse/templates/admin-plugins/show/live-rooms/index.gjs
index 787ea93ba96..f93a3fb921f 100644
--- a/plugins/voice/admin/assets/javascripts/discourse/templates/admin-plugins/show/voice-rooms/index.gjs
+++ b/plugins/live/admin/assets/javascripts/discourse/templates/admin-plugins/show/live-rooms/index.gjs
@@ -1,7 +1,7 @@
-import VoiceRoomList from "discourse/plugins/voice/admin/components/voice-room-list";
+import LiveRoomList from "discourse/plugins/live/admin/components/live-room-list";
export default <template>
- <VoiceRoomList
+ <LiveRoomList
@onDestroy={{@controller.destroyRoom}}
@rooms={{@controller.model.content}}
/>
diff --git a/plugins/live/admin/assets/javascripts/discourse/templates/admin-plugins/show/live-rooms/new.gjs b/plugins/live/admin/assets/javascripts/discourse/templates/admin-plugins/show/live-rooms/new.gjs
new file mode 100644
index 00000000000..efe292ca686
--- /dev/null
+++ b/plugins/live/admin/assets/javascripts/discourse/templates/admin-plugins/show/live-rooms/new.gjs
@@ -0,0 +1,5 @@
+import LiveRoomForm from "discourse/plugins/live/discourse/components/live-room-form";
+
+export default <template>
+ <LiveRoomForm @onSave={{@controller.saveRoom}} @room={{@controller.model}} />
+</template>
diff --git a/plugins/voice/app/controllers/voice/admin_controller.rb b/plugins/live/app/controllers/live/admin_controller.rb
similarity index 79%
rename from plugins/voice/app/controllers/voice/admin_controller.rb
rename to plugins/live/app/controllers/live/admin_controller.rb
index 22902cd8dc4..4f4266d41f5 100644
--- a/plugins/voice/app/controllers/voice/admin_controller.rb
+++ b/plugins/live/app/controllers/live/admin_controller.rb
@@ -1,8 +1,8 @@
# frozen_string_literal: true
-module Voice
+module Live
class AdminController < ::Admin::AdminController
- requires_plugin "voice"
+ requires_plugin "live"
def index
end
diff --git a/plugins/voice/app/controllers/voice/admin_livekit_controller.rb b/plugins/live/app/controllers/live/admin_livekit_controller.rb
similarity index 95%
rename from plugins/voice/app/controllers/voice/admin_livekit_controller.rb
rename to plugins/live/app/controllers/live/admin_livekit_controller.rb
index 0ed9087370d..052186c78f2 100644
--- a/plugins/voice/app/controllers/voice/admin_livekit_controller.rb
+++ b/plugins/live/app/controllers/live/admin_livekit_controller.rb
@@ -1,11 +1,11 @@
# frozen_string_literal: true
-module Voice
+module Live
# Status payloads report presence booleans, latencies and error strings —
# never setting values. A request spec pins that the API secret cannot
# appear here (or in any serializer) whatever state the probes are in.
class AdminLivekitController < ::Admin::AdminController
- requires_plugin "voice"
+ requires_plugin "live"
def status
render json: status_payload
@@ -36,7 +36,7 @@ module Voice
last_webhook_at: Livekit.last_webhook_at&.iso8601,
# For the ready-to-paste server config snippet; derived from the
# site's own URL, not from any LiveKit setting.
- webhook_url: "#{Discourse.base_url}/voice/livekit/webhook",
+ webhook_url: "#{Discourse.base_url}/live/livekit/webhook",
last_probe: probe_result || Livekit::HealthCheck.last_probe,
rooms: [],
}
diff --git a/plugins/voice/app/controllers/voice/admin_recordings_controller.rb b/plugins/live/app/controllers/live/admin_recordings_controller.rb
similarity index 61%
rename from plugins/voice/app/controllers/voice/admin_recordings_controller.rb
rename to plugins/live/app/controllers/live/admin_recordings_controller.rb
index 5edfad8f3dd..f9d18c1ccd5 100644
--- a/plugins/voice/app/controllers/voice/admin_recordings_controller.rb
+++ b/plugins/live/app/controllers/live/admin_recordings_controller.rb
@@ -1,14 +1,14 @@
# frozen_string_literal: true
-module Voice
+module Live
class AdminRecordingsController < ::Admin::AdminController
- requires_plugin "voice"
+ requires_plugin "live"
PAGE_SIZE = 50
def index
recordings =
- Voice::Recording
+ Live::Recording
.includes(:room, :started_by)
.order(started_at: :desc)
.offset(params[:offset].to_i.clamp(0..))
@@ -19,10 +19,10 @@ module Voice
recordings = recordings.first(PAGE_SIZE)
render json: {
- recordings: serialize_data(recordings, Voice::AdminRecordingSerializer, root: false),
+ recordings: serialize_data(recordings, Live::AdminRecordingSerializer, root: false),
has_more: has_more,
- last_webhook_at: Voice::Livekit.last_webhook_at&.iso8601,
- webhook_url: "#{Discourse.base_url}/voice/livekit/webhook",
+ last_webhook_at: Live::Livekit.last_webhook_at&.iso8601,
+ webhook_url: "#{Discourse.base_url}/live/livekit/webhook",
}
end
end
diff --git a/plugins/voice/app/controllers/voice/admin_rooms_controller.rb b/plugins/live/app/controllers/live/admin_rooms_controller.rb
similarity index 68%
rename from plugins/voice/app/controllers/voice/admin_rooms_controller.rb
rename to plugins/live/app/controllers/live/admin_rooms_controller.rb
index 04b1ae93bfa..86606ae77fb 100644
--- a/plugins/voice/app/controllers/voice/admin_rooms_controller.rb
+++ b/plugins/live/app/controllers/live/admin_rooms_controller.rb
@@ -1,22 +1,22 @@
# frozen_string_literal: true
-module Voice
+module Live
class AdminRoomsController < ::Admin::AdminController
- requires_plugin "voice"
+ requires_plugin "live"
def index
- rooms = Voice::Room.includes(:creator, :room_memberships).order(:name).all
+ rooms = Live::Room.includes(:creator, :room_memberships).order(:name).all
render_serialized rooms, AdminRoomSerializer, root: :rooms
end
def show
- room = Voice::Room.includes(:creator, :room_memberships).find(params[:id])
+ room = Live::Room.includes(:creator, :room_memberships).find(params[:id])
render_serialized room, AdminRoomSerializer, root: :room
end
def create
- room = Voice::Room.new(room_params)
+ room = Live::Room.new(room_params)
room.creator = current_user
if room.save
@@ -27,7 +27,7 @@ module Voice
end
def update
- room = Voice::Room.find(params[:id])
+ room = Live::Room.find(params[:id])
if room.update(room_params)
render_serialized room, AdminRoomSerializer, root: :room
@@ -37,9 +37,9 @@ module Voice
end
def destroy
- room = Voice::Room.find(params[:id])
+ room = Live::Room.find(params[:id])
room.destroy!
- Voice::AgentManager.evict_agents_in_room!(room)
+ Live::AgentManager.evict_agents_in_room!(room)
head :no_content
end
@@ -49,11 +49,11 @@ module Voice
# `kicked` message a room-level kick uses — the client handler already
# forces a clean leave, so no new client message types are needed.
def end_call
- room = Voice::Room.find(params[:id])
- participant_ids = Voice::ParticipantTracker.user_ids(room.id)
+ room = Live::Room.find(params[:id])
+ participant_ids = Live::ParticipantTracker.user_ids(room.id)
- Voice::AgentManager.evict_agents_in_room!(room)
- participant_ids.each { |user_id| Voice::RoomBroadcaster.publish_kick(room, user_id) }
+ Live::AgentManager.evict_agents_in_room!(room)
+ participant_ids.each { |user_id| Live::RoomBroadcaster.publish_kick(room, user_id) }
head :no_content
end
@@ -76,10 +76,10 @@ module Voice
:max_quality_profile,
)
if permitted.key?(:room_type)
- permitted[:room_type] = Voice::Room.room_type_from_name!(permitted[:room_type])
+ permitted[:room_type] = Live::Room.room_type_from_name!(permitted[:room_type])
end
if permitted.key?(:max_quality_profile)
- permitted[:max_quality_profile] = Voice::Room::QUALITY_PROFILES[
+ permitted[:max_quality_profile] = Live::Room::QUALITY_PROFILES[
permitted[:max_quality_profile].to_s
]
end
diff --git a/plugins/voice/app/controllers/voice/admin_stats_controller.rb b/plugins/live/app/controllers/live/admin_stats_controller.rb
similarity index 84%
rename from plugins/voice/app/controllers/voice/admin_stats_controller.rb
rename to plugins/live/app/controllers/live/admin_stats_controller.rb
index c84def3526f..efe37309411 100644
--- a/plugins/voice/app/controllers/voice/admin_stats_controller.rb
+++ b/plugins/live/app/controllers/live/admin_stats_controller.rb
@@ -1,8 +1,8 @@
# frozen_string_literal: true
-module Voice
+module Live
class AdminStatsController < ::Admin::AdminController
- requires_plugin "voice"
+ requires_plugin "live"
PERIOD_DAYS = { "daily" => 1, "weekly" => 7, "monthly" => 30, "quarterly" => 90 }.freeze
DURATION_SQL = "EXTRACT(EPOCH FROM (COALESCE(left_at, NOW()) - joined_at))"
@@ -20,13 +20,13 @@ module Voice
def rooms
rows =
sessions_in_period
- .joins("LEFT JOIN voice_rooms ON voice_rooms.id = voice_sessions.room_id")
- .group(:room_id, "voice_rooms.name")
+ .joins("LEFT JOIN live_rooms ON live_rooms.id = live_sessions.room_id")
+ .group(:room_id, "live_rooms.name")
.select(
- "voice_sessions.room_id",
+ "live_sessions.room_id",
# NULL when the room was deleted; the dashboard renders a fallback.
- "voice_rooms.name AS room_name",
- "COUNT(DISTINCT voice_sessions.user_id) AS unique_users",
+ "live_rooms.name AS room_name",
+ "COUNT(DISTINCT live_sessions.user_id) AS unique_users",
"ROUND(SUM(#{DURATION_SQL})) AS total_seconds",
)
.order(Arel.sql("total_seconds DESC"))
@@ -50,7 +50,7 @@ module Voice
sessions_in_period
.group(:user_id)
.select(
- "voice_sessions.user_id",
+ "live_sessions.user_id",
"COUNT(*) AS session_count",
"ROUND(SUM(#{DURATION_SQL})) AS total_seconds",
)
@@ -83,14 +83,14 @@ module Voice
start_date = Date.parse(params[:start_date])
end_date = Date.parse(params[:end_date])
- Voice::Session.where(
+ Live::Session.where(
"joined_at >= ? AND joined_at <= ?",
start_date.beginning_of_day,
end_date.end_of_day,
)
else
days = PERIOD_DAYS.fetch(params[:period].to_s, 7)
- Voice::Session.where("joined_at > ?", days.days.ago)
+ Live::Session.where("joined_at > ?", days.days.ago)
end
end
end
diff --git a/plugins/live/app/controllers/live/agents_controller.rb b/plugins/live/app/controllers/live/agents_controller.rb
new file mode 100644
index 00000000000..689e00201c2
--- /dev/null
+++ b/plugins/live/app/controllers/live/agents_controller.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+module Live
+ class AgentsController < ApplicationController
+ def index
+ unless guardian.can_invite_live_agents? && Live::AgentBot.available?
+ raise Discourse::InvalidAccess
+ end
+
+ refresh = params[:refresh].to_s == "true"
+ RateLimiter.new(current_user, "live-agent-list-refresh", 6, 1.minute).performed! if refresh
+
+ result = Live::Livekit::CloudAgentClient.list(refresh:)
+ if result[:ok]
+ render json: { agents: result[:agents] }
+ else
+ render_json_error(I18n.t("live.errors.agent_list_failed"), status: 503)
+ end
+ end
+ end
+end
diff --git a/plugins/voice/app/controllers/voice/application_controller.rb b/plugins/live/app/controllers/live/application_controller.rb
similarity index 58%
rename from plugins/voice/app/controllers/voice/application_controller.rb
rename to plugins/live/app/controllers/live/application_controller.rb
index dc4a22bf65d..ac0b0339eed 100644
--- a/plugins/voice/app/controllers/voice/application_controller.rb
+++ b/plugins/live/app/controllers/live/application_controller.rb
@@ -1,8 +1,8 @@
# frozen_string_literal: true
-module Voice
+module Live
class ApplicationController < ::ApplicationController
- requires_plugin ::Voice::PLUGIN_NAME
+ requires_plugin ::Live::PLUGIN_NAME
before_action :ensure_logged_in
before_action :ensure_enabled!
@@ -10,7 +10,7 @@ module Voice
private
def ensure_enabled!
- raise Discourse::InvalidAccess.new(I18n.t("voice.errors.not_enabled")) unless Voice.enabled?
+ raise Discourse::InvalidAccess.new(I18n.t("live.errors.not_enabled")) unless Live.enabled?
end
end
end
diff --git a/plugins/voice/app/controllers/voice/calls_controller.rb b/plugins/live/app/controllers/live/calls_controller.rb
similarity index 73%
rename from plugins/voice/app/controllers/voice/calls_controller.rb
rename to plugins/live/app/controllers/live/calls_controller.rb
index dcd5c48e339..2d67918b728 100644
--- a/plugins/voice/app/controllers/voice/calls_controller.rb
+++ b/plugins/live/app/controllers/live/calls_controller.rb
@@ -1,35 +1,35 @@
# frozen_string_literal: true
-module Voice
+module Live
# Starts a direct call: an ephemeral room holding the caller and callee as
# peers, surfaced to the callee by the ring the inviter publishes. The room
# reaps itself through the ephemeral TTL if the call never connects.
class CallsController < ApplicationController
def create
- unless guardian.can_start_voice_call?
- raise Discourse::InvalidAccess.new(I18n.t("voice.errors.not_authorized"))
+ unless guardian.can_start_live_call?
+ raise Discourse::InvalidAccess.new(I18n.t("live.errors.not_authorized"))
end
username = params.require(:username).to_s
callee = User.real.not_staged.find_by(username_lower: username.downcase)
raise Discourse::NotFound if callee.nil?
- if callee.id == current_user.id || callee.bot? || !callee.guardian.can_access_voice?
+ if callee.id == current_user.id || callee.bot? || !callee.guardian.can_access_live?
raise Discourse::InvalidParameters.new(:username)
end
# One message for every preference-based refusal (mute, ignore, personal
# messages disabled or allowlisted), matching what personal messages and
# chat DMs reveal without saying which preference applied.
- unless guardian.can_call_voice_user?(callee)
+ unless guardian.can_call_live_user?(callee)
raise Discourse::InvalidAccess.new(
"cannot call user",
nil,
- custom_message: "voice.errors.cannot_call_user",
+ custom_message: "live.errors.cannot_call_user",
)
end
- RateLimiter.new(current_user, "voice-calls", 10, 1.minute).performed!
+ RateLimiter.new(current_user, "live-calls", 10, 1.minute).performed!
# The ring consumes the daily invite budget inside RoomInviter; checked
# here first so an exhausted budget rejects the call before an ephemeral
@@ -37,23 +37,23 @@ module Voice
invite_limiter =
RateLimiter.new(
current_user,
- "voice-invites-daily",
- SiteSetting.voice_max_invites_per_day,
+ "live-invites-daily",
+ SiteSetting.live_max_invites_per_day,
1.day,
)
unless invite_limiter.can_perform?
- raise RateLimiter::LimitExceeded.new(invite_limiter.seconds_to_wait, "voice-invites-daily")
+ raise RateLimiter::LimitExceeded.new(invite_limiter.seconds_to_wait, "live-invites-daily")
end
room =
- Voice::EphemeralRoomManager.create!(
+ Live::EphemeralRoomManager.create!(
creator: current_user,
# Named for both parties so neither side reads it as someone else's
# room. Truncated because two maximum-length usernames can exceed
# the room name limit.
name:
I18n.t(
- "voice.call.room_name",
+ "live.call.room_name",
caller: current_user.username,
callee: callee.username,
).truncate(80),
@@ -62,14 +62,14 @@ module Voice
)
begin
- Voice::RoomInviter.invite!(room: room, inviter: current_user, users: [callee])
+ Live::RoomInviter.invite!(room: room, inviter: current_user, users: [callee])
rescue StandardError
# A call that could not ring must not leave an orphaned room behind.
- Voice::EphemeralRoomManager.destroy!(room)
+ Live::EphemeralRoomManager.destroy!(room)
raise
end
- render_serialized room, Voice::RoomSerializer, root: :room
+ render_serialized room, Live::RoomSerializer, root: :room
end
end
end
diff --git a/plugins/voice/app/controllers/voice/chat_threads_controller.rb b/plugins/live/app/controllers/live/chat_threads_controller.rb
similarity index 82%
rename from plugins/voice/app/controllers/voice/chat_threads_controller.rb
rename to plugins/live/app/controllers/live/chat_threads_controller.rb
index 41564a36e93..14e511a9be1 100644
--- a/plugins/voice/app/controllers/voice/chat_threads_controller.rb
+++ b/plugins/live/app/controllers/live/chat_threads_controller.rb
@@ -1,13 +1,13 @@
# frozen_string_literal: true
-module Voice
+module Live
class ChatThreadsController < ApplicationController
- # Answers "which voice room did this chat thread come from?" for the
+ # Answers "which live room did this chat thread come from?" for the
# back-to-room button chat renders in session thread headers. Every miss —
# unknown thread, not a session thread, invisible channel or room — is the
# same 404, so the endpoint reveals nothing about what exists.
def show
- raise Discourse::NotFound unless Voice::ChatSession.chat_available?
+ raise Discourse::NotFound unless Live::ChatSession.chat_available?
thread = ::Chat::Thread.find_by(id: params[:id])
raise Discourse::NotFound if thread.blank?
@@ -20,14 +20,14 @@ module Voice
raise Discourse::NotFound unless thread.channel.threading_enabled || thread.force
raise Discourse::NotFound unless original_message_visible?(thread)
- room = Voice::Room.find_by(id: thread.custom_fields[Voice::THREAD_ROOM_ID_FIELD].to_i)
+ room = Live::Room.find_by(id: thread.custom_fields[Live::THREAD_ROOM_ID_FIELD].to_i)
raise Discourse::NotFound if room.blank?
# A marker pointing at a room that has since been linked to a different
# channel is stale — the thread is no longer one of the room's session
# threads.
raise Discourse::NotFound if room.chat_channel_id != thread.channel_id
- raise Discourse::NotFound unless guardian.can_see_voice_room?(room)
+ raise Discourse::NotFound unless guardian.can_see_live_room?(room)
render json: {
id: room.id,
@@ -37,7 +37,7 @@ module Voice
# ended session's thread links back to the room, but arriving
# there shouldn't open a chat panel for a conversation that has
# already rolled over.
- chat_active: Voice::ChatSession.state(room)[:thread_id] == thread.id,
+ chat_active: Live::ChatSession.state(room)[:thread_id] == thread.id,
}
end
diff --git a/plugins/voice/app/controllers/voice/contacts_controller.rb b/plugins/live/app/controllers/live/contacts_controller.rb
similarity index 80%
rename from plugins/voice/app/controllers/voice/contacts_controller.rb
rename to plugins/live/app/controllers/live/contacts_controller.rb
index 57c0a106d95..421b13e4f7d 100644
--- a/plugins/voice/app/controllers/voice/contacts_controller.rb
+++ b/plugins/live/app/controllers/live/contacts_controller.rb
@@ -1,11 +1,11 @@
# frozen_string_literal: true
-module Voice
+module Live
class ContactsController < ApplicationController
def index
- raise Discourse::NotFound unless SiteSetting.voice_analytics_enabled
+ raise Discourse::NotFound unless SiteSetting.live_analytics_enabled
- contacts = Voice::CoPresence.top_contacts_for(current_user.id, since: 30.days.ago, limit: 10)
+ contacts = Live::CoPresence.top_contacts_for(current_user.id, since: 30.days.ago, limit: 10)
users = User.where(id: contacts.map(&:contact_id)).index_by(&:id)
diff --git a/plugins/voice/app/controllers/voice/invites_controller.rb b/plugins/live/app/controllers/live/invites_controller.rb
similarity index 76%
rename from plugins/voice/app/controllers/voice/invites_controller.rb
rename to plugins/live/app/controllers/live/invites_controller.rb
index c262d1b7594..7a6b56abcd4 100644
--- a/plugins/voice/app/controllers/voice/invites_controller.rb
+++ b/plugins/live/app/controllers/live/invites_controller.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-module Voice
+module Live
class InvitesController < ApplicationController
MAX_USERS_PER_REQUEST = 10
SUGGESTION_LIMIT = 10
@@ -8,8 +8,8 @@ module Voice
before_action :load_room
def create
- guardian.ensure_can_invite_to_voice_room!(@room)
- RateLimiter.new(current_user, "voice-invites", 10, 1.minute).performed!
+ guardian.ensure_can_invite_to_live_room!(@room)
+ RateLimiter.new(current_user, "live-invites", 10, 1.minute).performed!
# Bounded before any normalization or query construction: `limit` below
# caps the rows returned, not the size of the IN list an oversized
@@ -27,9 +27,9 @@ module Voice
.where(username_lower: usernames.map(&:downcase))
.limit(MAX_USERS_PER_REQUEST)
- invited = Voice::RoomInviter.invite!(room: @room, inviter: current_user, users: users)
+ invited = Live::RoomInviter.invite!(room: @room, inviter: current_user, users: users)
# Users the inviter named but the inviter service refused (no access to
- # voice, can't join this room, …) — surfaced so the modal can explain
+ # Live, can't join this room, …) — surfaced so the modal can explain
# instead of failing silently.
skipped = users.to_a - invited
render json: {
@@ -41,11 +41,11 @@ module Voice
# People the current user has shared this room with recently, most time
# together first — the shortlist the invite modal opens with.
def suggestions
- guardian.ensure_can_invite_to_voice_room!(@room)
+ guardian.ensure_can_invite_to_live_room!(@room)
rows =
- if SiteSetting.voice_analytics_enabled
- Voice::Session.top_room_companions_for(
+ if SiteSetting.live_analytics_enabled
+ Live::Session.top_room_companions_for(
current_user.id,
@room.id,
since: 30.days.ago,
@@ -57,7 +57,7 @@ module Voice
[]
end
- present_ids = Voice::ParticipantTracker.user_ids(@room.id)
+ present_ids = Live::ParticipantTracker.user_ids(@room.id)
rows = rows.reject { |row| present_ids.include?(row.companion_id) }
users = User.real.not_staged.where(id: rows.map(&:companion_id)).index_by(&:id)
@@ -68,8 +68,8 @@ module Voice
user = users[row.companion_id]
next unless user
# Session history outlives group membership: only people who can
- # still use voice rooms are worth suggesting.
- next unless user.guardian.can_access_voice?
+ # still use live rooms are worth suggesting.
+ next unless user.guardian.can_access_live?
BasicUserSerializer
.new(user, scope: guardian, root: false)
@@ -84,7 +84,7 @@ module Voice
private
def load_room
- @room = Voice::Room.find(params[:room_id])
+ @room = Live::Room.find(params[:room_id])
end
end
end
diff --git a/plugins/voice/app/controllers/voice/livekit_webhooks_controller.rb b/plugins/live/app/controllers/live/livekit_webhooks_controller.rb
similarity index 87%
rename from plugins/voice/app/controllers/voice/livekit_webhooks_controller.rb
rename to plugins/live/app/controllers/live/livekit_webhooks_controller.rb
index 236a0af178d..60ff0ae6e93 100644
--- a/plugins/voice/app/controllers/voice/livekit_webhooks_controller.rb
+++ b/plugins/live/app/controllers/live/livekit_webhooks_controller.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-module Voice
+module Live
# Human events only reconcile existing presence; agents require an authorized
# session verified against the current provider connection.
class LivekitWebhooksController < ApplicationController
@@ -20,7 +20,7 @@ module Voice
body: body,
)
rescue Livekit::WebhookVerifier::VerificationError
- Voice.warn("[voice-livekit] rejected webhook: verification failed")
+ Live.warn("[live-livekit] rejected webhook: verification failed")
return head :forbidden
end
@@ -86,15 +86,11 @@ module Voice
# rejoin predates the disconnect), but the SID can. Departures without
# SID context on either side keep expiring — reconcile-only backstop.
sid = event.dig("participant", "sid")
- known_sid = Voice::ParticipantTracker.livekit_sid(room.id, user_id)
+ known_sid = Live::ParticipantTracker.livekit_sid(room.id, user_id)
return if sid.present? && known_sid.present? && sid != known_sid
expired =
- Voice::ParticipantTracker.expire_presence(
- room.id,
- user_id,
- gone_at: event_created_at(event),
- )
+ Live::ParticipantTracker.expire_presence(room.id, user_id, gone_at: event_created_at(event))
if expired
if ParticipantTracker.human_user_ids(room.id).empty? && AgentManager.provider_room?(room.id)
AgentManager.evict_agents_in_room!(room)
@@ -108,7 +104,7 @@ module Voice
return if room.nil?
AgentManager.evict_agents_in_room!(room, delete_room: false)
- Voice::ParticipantTracker.clear_livekit_sids(room.id)
+ Live::ParticipantTracker.clear_livekit_sids(room.id)
end
# Egress events name the room inside egressInfo, not in a room object,
@@ -120,10 +116,10 @@ module Voice
room_id = Livekit.room_id_from_name(room_name)
return if room_id.nil?
- room = Voice::Room.find_by(id: room_id)
+ room = Live::Room.find_by(id: room_id)
return if room.nil?
- Voice::RecordingManager.handle_egress_ended(room, egress_info)
+ Live::RecordingManager.handle_egress_ended(room, egress_info)
end
# Resolves the event's LiveKit room name back to a room, ignoring events
@@ -133,9 +129,9 @@ module Voice
def event_room(event)
room_id = Livekit.room_id_from_name(event.dig("room", "name"))
return if room_id.nil?
- return if Voice::ParticipantTracker.pinned_transport(room_id) != "livekit"
+ return if Live::ParticipantTracker.pinned_transport(room_id) != "livekit"
- Voice::Room.find_by(id: room_id)
+ Live::Room.find_by(id: room_id)
end
# Proto3 JSON renders int64 as a string; tolerate a plain number too.
diff --git a/plugins/voice/app/controllers/voice/page_controller.rb b/plugins/live/app/controllers/live/page_controller.rb
similarity index 83%
rename from plugins/voice/app/controllers/voice/page_controller.rb
rename to plugins/live/app/controllers/live/page_controller.rb
index 4d3c880f204..1e5f6721d29 100644
--- a/plugins/voice/app/controllers/voice/page_controller.rb
+++ b/plugins/live/app/controllers/live/page_controller.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-module Voice
+module Live
class PageController < ApplicationController
# Anonymous visitors may view public room pages when access is open to
# everyone, mirroring the rooms directory; the guardian gates the rest.
@@ -11,10 +11,10 @@ module Voice
skip_before_action :check_xhr, only: :show
def show
- room = Voice::Room.find_by(slug: params[:slug])
+ room = Live::Room.find_by(slug: params[:slug])
raise Discourse::NotFound if room.blank?
- guardian.ensure_can_see_voice_room!(room)
+ guardian.ensure_can_see_live_room!(room)
render "default/empty"
end
diff --git a/plugins/live/app/controllers/live/room_memberships_controller.rb b/plugins/live/app/controllers/live/room_memberships_controller.rb
new file mode 100644
index 00000000000..f6ab902e5ac
--- /dev/null
+++ b/plugins/live/app/controllers/live/room_memberships_controller.rb
@@ -0,0 +1,97 @@
+# frozen_string_literal: true
+
+module Live
+ class RoomMembershipsController < ApplicationController
+ before_action :load_room
+
+ def index
+ guardian.ensure_can_manage_live_room!(@room)
+ render_serialized @room.room_memberships, Live::RoomMembershipSerializer, root: :memberships
+ end
+
+ def create
+ guardian.ensure_can_manage_live_room!(@room)
+ user = fetch_user
+ role = Live::RoomMembership.role_value(params[:role])
+ ensure_agent_role_allowed!(user)
+ membership = @room.room_memberships.find_or_initialize_by(user: user)
+ membership.role = role
+ membership.save!
+
+ if Live::ParticipantTracker.user_ids(@room.id).include?(user.id)
+ metadata = Live::ParticipantTracker.get_metadata(@room.id, user.id)
+ metadata[:role] = membership.role_name
+ metadata.delete(:hand_raised_at) if membership.can_speak?
+ Live::ParticipantTracker.update_metadata(@room.id, user.id, metadata)
+ Live::RoomBroadcaster.publish_role_change(@room, user.id, membership.role_name)
+ Live::RoomBroadcaster.publish_participants(@room)
+ Live::Livekit::RoomServiceClient.update_participant(@room, user)
+ end
+
+ render_serialized membership, Live::RoomMembershipSerializer, root: :membership
+ end
+
+ def update
+ guardian.ensure_can_manage_live_room!(@room)
+ membership = @room.room_memberships.find(params[:id])
+ new_role = params.require(:role)
+ role = Live::RoomMembership.role_value(new_role)
+ ensure_agent_role_allowed!(membership.user)
+ membership.update!(role: role)
+
+ if Live::ParticipantTracker.user_ids(@room.id).include?(membership.user_id)
+ metadata = Live::ParticipantTracker.get_metadata(@room.id, membership.user_id)
+ metadata[:role] = membership.role_name
+ metadata.delete(:hand_raised_at) if membership.can_speak?
+ Live::ParticipantTracker.update_metadata(@room.id, membership.user_id, metadata)
+ Live::RoomBroadcaster.publish_role_change(@room, membership.user_id, membership.role_name)
+ Live::RoomBroadcaster.publish_participants(@room)
+ # Lets a promoted stage listener publish without reconnecting; on
+ # failure the client falls back to re-minting a token and reconnecting.
+ Live::Livekit::RoomServiceClient.update_participant(@room, membership.user)
+ end
+
+ render_serialized membership, Live::RoomMembershipSerializer, root: :membership
+ end
+
+ def destroy
+ guardian.ensure_can_manage_live_room!(@room)
+ membership = @room.room_memberships.find(params[:id])
+ user_id = membership.user_id
+ membership.destroy!
+
+ if Live::ParticipantTracker.user_ids(@room.id).include?(user_id)
+ metadata = Live::ParticipantTracker.get_metadata(@room.id, user_id)
+ metadata[:role] = "participant"
+ Live::ParticipantTracker.update_metadata(@room.id, user_id, metadata)
+ Live::RoomBroadcaster.publish_role_change(@room, user_id, "participant")
+ Live::RoomBroadcaster.publish_participants(@room)
+ if (user = User.find_by(id: user_id))
+ Live::Livekit::RoomServiceClient.update_participant(@room, user)
+ end
+ end
+
+ head :no_content
+ end
+
+ private
+
+ def ensure_agent_role_allowed!(user)
+ raise Discourse::InvalidParameters.new(:user_id) if user.bot?
+ end
+
+ def fetch_user
+ if params[:user_id]
+ User.find(params[:user_id])
+ elsif params[:username]
+ User.find_by_username_or_email(params[:username])
+ else
+ raise Discourse::InvalidParameters
+ end
+ end
+
+ def load_room
+ @room = Live::Room.find(params[:room_id])
+ end
+ end
+end
diff --git a/plugins/voice/app/controllers/voice/rooms_controller.rb b/plugins/live/app/controllers/live/rooms_controller.rb
similarity index 59%
rename from plugins/voice/app/controllers/voice/rooms_controller.rb
rename to plugins/live/app/controllers/live/rooms_controller.rb
index 56b72de93b5..b7895522b33 100644
--- a/plugins/voice/app/controllers/voice/rooms_controller.rb
+++ b/plugins/live/app/controllers/live/rooms_controller.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-module Voice
+module Live
class RoomsController < ApplicationController
# Signal budgets are accounted in relayed events (not HTTP requests), so a
# legitimate full-room Trickle ICE burst — one offer plus batched
@@ -43,120 +43,120 @@ module Voice
]
def index
- Voice::DefaultRoomSeeder.ensure!
+ Live::DefaultRoomSeeder.ensure!
# Capture before the room snapshot so a concurrent event is replayed rather than skipped.
- index_message_bus_last_id = MessageBus.last_id(Voice.room_index_channel)
+ index_message_bus_last_id = MessageBus.last_id(Live.room_index_channel)
rooms =
- Voice::Room
+ Live::Room
.visible_to(guardian)
.includes(:room_memberships)
.order(:created_at, :id)
- .select { |room| guardian.can_see_voice_room?(room) }
- directory_entries = Voice::RoomDirectoryPreloader.preload(rooms)
+ .select { |room| guardian.can_see_live_room?(room) }
+ directory_entries = Live::RoomDirectoryPreloader.preload(rooms)
chat_rooms =
rooms.select do |room|
entry = directory_entries[room.id]
- guardian.can_manage_voice_room?(room) ||
+ guardian.can_manage_live_room?(room) ||
entry&.participant_users&.any? { |participant| participant.id == current_user&.id }
end
chat_availability = rooms.to_h { |room| [room.id, false] }
- chat_availability.merge!(Voice::ChatSession.available_for_rooms(chat_rooms, guardian))
+ chat_availability.merge!(Live::ChatSession.available_for_rooms(chat_rooms, guardian))
render_json_dump(
rooms:
serialize_data(
rooms,
- Voice::RoomSerializer,
+ Live::RoomSerializer,
directory_entries: directory_entries,
chat_availability: chat_availability,
),
- can_create_room: guardian.can_create_voice_room?,
+ can_create_room: guardian.can_create_live_room?,
index_message_bus_last_id: index_message_bus_last_id,
)
end
def show
- guardian.ensure_can_see_voice_room!(@room)
- render_serialized @room, Voice::RoomSerializer, root: :room, include_visit_count: true
+ guardian.ensure_can_see_live_room!(@room)
+ render_serialized @room, Live::RoomSerializer, root: :room, include_visit_count: true
end
def create
- guardian.ensure_can_create_voice_room!
+ guardian.ensure_can_create_live_room!
# Ephemeral rooms are created by features on the user's behalf (with
# their own TTL-based cap), not by the user — they don't count here.
- if current_user.voice_rooms.persistent.count >= SiteSetting.voice_max_rooms_per_user
- raise Discourse::InvalidParameters.new(I18n.t("voice.errors.room_limit"))
+ if current_user.live_rooms.persistent.count >= SiteSetting.live_max_rooms_per_user
+ raise Discourse::InvalidParameters.new(I18n.t("live.errors.room_limit"))
end
- room = Voice::Room.new(room_params)
+ room = Live::Room.new(room_params)
room.creator = current_user
if room.save
- Voice::DirectoryBroadcaster.broadcast(action: :created, room: room)
- Voice::BadgeGranterHooks.on_room_create(current_user)
- render_serialized room, Voice::RoomSerializer, root: :room
+ Live::DirectoryBroadcaster.broadcast(action: :created, room: room)
+ Live::BadgeGranterHooks.on_room_create(current_user)
+ render_serialized room, Live::RoomSerializer, root: :room
else
render_json_error room
end
end
def update
- guardian.ensure_can_manage_voice_room!(@room)
+ guardian.ensure_can_manage_live_room!(@room)
name_changed = room_params[:name].present? && room_params[:name] != @room.name
if @room.update(room_params)
- Voice::DirectoryBroadcaster.broadcast(action: :updated, room: @room)
+ Live::DirectoryBroadcaster.broadcast(action: :updated, room: @room)
refresh_participant_statuses(@room) if name_changed
- render_serialized @room, Voice::RoomSerializer, root: :room
+ render_serialized @room, Live::RoomSerializer, root: :room
else
render_json_error @room
end
end
def destroy
- guardian.ensure_can_manage_voice_room!(@room)
+ guardian.ensure_can_manage_live_room!(@room)
# Built before the destroy so the broadcast still targets the members
# whose memberships the destroy cascades away.
- broadcaster = Voice::DirectoryBroadcaster.new(@room, :destroyed)
+ broadcaster = Live::DirectoryBroadcaster.new(@room, :destroyed)
@room.destroy!
broadcaster.broadcast
- Voice::Livekit::RoomServiceClient.delete_room(@room)
- Voice::ParticipantTracker.clear_transport_pin(@room.id)
+ Live::Livekit::RoomServiceClient.delete_room(@room)
+ Live::ParticipantTracker.clear_transport_pin(@room.id)
render json: success_json
end
def join
- guardian.ensure_can_join_voice_room!(@room)
- RateLimiter.new(current_user, "voice-joins", 30, 1.minute).performed!
+ guardian.ensure_can_join_live_room!(@room)
+ RateLimiter.new(current_user, "live-joins", 30, 1.minute).performed!
# A repeated join carrying the live participant session (a UI retry, a
# duplicated request) refreshes the existing grant instead of re-running
# join side effects: no session rotation, no second analytics session,
# no badge/invite re-fires, no roster rebroadcast.
if repeat_join?
- transport = Voice::ParticipantTracker.pinned_transport(@room.id) || "mesh"
+ transport = Live::ParticipantTracker.pinned_transport(@room.id) || "mesh"
livekit = nil
if transport == "livekit"
livekit = mint_livekit_payload
if livekit.nil?
- return(render_json_error(I18n.t("voice.errors.livekit_unavailable"), status: 503))
+ return(render_json_error(I18n.t("live.errors.livekit_unavailable"), status: 503))
end
end
- Voice::ParticipantTracker.add(@room.id, current_user.id)
- Voice::ParticipantTracker.refresh_participant_session(@room.id, current_user.id)
- Voice::ParticipantTracker.refresh_transport_pin(@room.id)
+ Live::ParticipantTracker.add(@room.id, current_user.id)
+ Live::ParticipantTracker.refresh_participant_session(@room.id, current_user.id)
+ Live::ParticipantTracker.refresh_transport_pin(@room.id)
payload = {
transport: transport,
participant_session_id: params[:participant_session_id],
- ice: Voice::IceConfig.payload(current_user),
+ ice: Live::IceConfig.payload(current_user),
room:
- Voice::RoomSerializer.new(
+ Live::RoomSerializer.new(
@room,
scope: guardian,
root: false,
@@ -169,8 +169,8 @@ module Voice
# Resolved before presence is added, so a LiveKit failure rejects the
# join without leaving the user in the roster.
- transport = Voice::ParticipantTracker.pinned_transport(@room.id)
- transport ||= Voice::Livekit.available_for?(@room) ? "livekit" : "mesh"
+ transport = Live::ParticipantTracker.pinned_transport(@room.id)
+ transport ||= Live::Livekit.available_for?(@room) ? "livekit" : "mesh"
livekit = nil
if transport == "livekit"
@@ -180,17 +180,17 @@ module Voice
# Fall back to mesh only when explicitly enabled and the room is
# empty — an occupied LiveKit room must never be split, and silent
# degradation hides outages from ops.
- if SiteSetting.voice_livekit_mesh_fallback &&
- Voice::ParticipantTracker.human_user_ids(@room.id).empty?
- Voice::AgentManager.evict_agents_in_room!(@room)
+ if SiteSetting.live_livekit_mesh_fallback &&
+ Live::ParticipantTracker.human_user_ids(@room.id).empty?
+ Live::AgentManager.evict_agents_in_room!(@room)
transport = "mesh"
else
- return(render_json_error(I18n.t("voice.errors.livekit_unavailable"), status: 503))
+ return(render_json_error(I18n.t("live.errors.livekit_unavailable"), status: 503))
end
end
end
- transport = Voice::ParticipantTracker.pin_transport!(@room.id, transport)
+ transport = Live::ParticipantTracker.pin_transport!(@room.id, transport)
# A concurrent first join can win the pin race with a different
# transport (e.g. settings changed between the two resolutions) —
@@ -198,20 +198,20 @@ module Voice
if transport == "livekit" && livekit.nil?
livekit = mint_livekit_payload
if livekit.nil?
- return(render_json_error(I18n.t("voice.errors.livekit_unavailable"), status: 503))
+ return(render_json_error(I18n.t("live.errors.livekit_unavailable"), status: 503))
end
end
livekit = nil if transport == "mesh"
- Voice::ParticipantTracker.clear_left(@room.id, current_user.id)
+ Live::ParticipantTracker.clear_left(@room.id, current_user.id)
admission =
- Voice::ParticipantTracker.add_within_capacity(
+ Live::ParticipantTracker.add_within_capacity(
@room.id,
current_user.id,
@room.effective_max_participants,
)
- return render_json_error(I18n.t("voice.errors.room_full"), status: 422) if admission == :full
+ return render_json_error(I18n.t("live.errors.room_full"), status: 422) if admission == :full
# A joiner already in the roster but without the live session proof (a
# reloaded tab, a second device — or a client replaying this endpoint)
@@ -224,53 +224,53 @@ module Voice
previous_metadata =
(
if takeover
- Voice::ParticipantTracker.get_metadata(@room.id, current_user.id)
+ Live::ParticipantTracker.get_metadata(@room.id, current_user.id)
else
{}
end
)
participant_session_id =
- Voice::ParticipantTracker.create_participant_session!(@room.id, current_user.id)
+ Live::ParticipantTracker.create_participant_session!(@room.id, current_user.id)
membership = @room.room_memberships.find_by(user_id: current_user.id)
role = membership&.role_name || "participant"
metadata = { role: role, last_heartbeat_at: Time.now.to_f }
- if SiteSetting.voice_analytics_enabled
+ if SiteSetting.live_analytics_enabled
session = nil
if previous_metadata[:session_id]
session =
- Voice::Session.find_by(
+ Live::Session.find_by(
id: previous_metadata[:session_id],
user_id: current_user.id,
room_id: @room.id,
left_at: nil,
)
end
- session ||= Voice::Session.create!(user: current_user, room: @room, joined_at: Time.current)
+ session ||= Live::Session.create!(user: current_user, room: @room, joined_at: Time.current)
metadata[:session_id] = session.id
end
metadata[:skip_status] = true if params[:skip_status].present?
- Voice::ParticipantTracker.update_metadata(@room.id, current_user.id, metadata)
+ Live::ParticipantTracker.update_metadata(@room.id, current_user.id, metadata)
if takeover
- Voice::RoomBroadcaster.publish_participants_if_changed(@room)
+ Live::RoomBroadcaster.publish_participants_if_changed(@room)
else
- Voice::RoomBroadcaster.publish_participants(@room)
+ Live::RoomBroadcaster.publish_participants(@room)
- participants = Voice::ParticipantTracker.list(@room.id)
- Voice::BadgeGranterHooks.on_join(current_user, @room, participants)
+ participants = Live::ParticipantTracker.list(@room.id)
+ Live::BadgeGranterHooks.on_join(current_user, @room, participants)
if params[:invited_by].present?
invite =
- Voice::Invite.redeem!(
+ Live::Invite.redeem!(
room: @room,
user: current_user,
inviter_username: params[:invited_by],
)
- Voice::BadgeGranterHooks.on_invite_redeemed(invite) if invite
+ Live::BadgeGranterHooks.on_invite_redeemed(invite) if invite
end
end
@@ -280,14 +280,14 @@ module Voice
# notification stays unread forever.
mark_invitation_notifications_read!
- Voice::UserStatusManager.set_voice_status(current_user, @room) if params[:skip_status].blank?
+ Live::UserStatusManager.set_live_status(current_user, @room) if params[:skip_status].blank?
payload = {
transport: transport,
participant_session_id: participant_session_id,
- ice: Voice::IceConfig.payload(current_user),
+ ice: Live::IceConfig.payload(current_user),
room:
- Voice::RoomSerializer.new(
+ Live::RoomSerializer.new(
@room,
scope: guardian,
root: false,
@@ -304,67 +304,67 @@ module Voice
# it. 410 tells the client the room instance ended: stop the ladder,
# tear down locally, and offer a rejoin.
def livekit_token
- guardian.ensure_can_join_voice_room!(@room)
- RateLimiter.new(current_user, "voice-livekit-token", 10, 1.minute).performed!
+ guardian.ensure_can_join_live_room!(@room)
+ RateLimiter.new(current_user, "live-livekit-token", 10, 1.minute).performed!
- if Voice::ParticipantTracker.pinned_transport(@room.id) != "livekit"
- return(render_json_error(I18n.t("voice.errors.livekit_room_instance_ended"), status: 410))
+ if Live::ParticipantTracker.pinned_transport(@room.id) != "livekit"
+ return(render_json_error(I18n.t("live.errors.livekit_room_instance_ended"), status: 410))
end
# The reconnect ladder may have outlived presence, but it must still
# claim a slot atomically before receiving a new LiveKit join token.
admission =
- Voice::ParticipantTracker.add_within_capacity(
+ Live::ParticipantTracker.add_within_capacity(
@room.id,
current_user.id,
@room.effective_max_participants,
)
- return render_json_error(I18n.t("voice.errors.room_full"), status: 422) if admission == :full
+ return render_json_error(I18n.t("live.errors.room_full"), status: 422) if admission == :full
# The reconnect ladder only runs while the client considers itself in the
# call, so an admitted explicit token request voids any leave/kick tombstone.
- Voice::ParticipantTracker.clear_left(@room.id, current_user.id)
+ Live::ParticipantTracker.clear_left(@room.id, current_user.id)
# The session may have expired along with the lapsed presence — mint a
# fresh one so heartbeat/state keep working after the reconnect.
participant_session_id =
- Voice::ParticipantTracker.create_participant_session!(@room.id, current_user.id)
- metadata = Voice::ParticipantTracker.get_metadata(@room.id, current_user.id)
+ Live::ParticipantTracker.create_participant_session!(@room.id, current_user.id)
+ metadata = Live::ParticipantTracker.get_metadata(@room.id, current_user.id)
metadata[:last_heartbeat_at] = Time.now.to_f
- Voice::ParticipantTracker.update_metadata(@room.id, current_user.id, metadata)
- Voice::ParticipantTracker.refresh_transport_pin(@room.id)
- Voice::RoomBroadcaster.publish_participants_if_changed(@room)
+ Live::ParticipantTracker.update_metadata(@room.id, current_user.id, metadata)
+ Live::ParticipantTracker.refresh_transport_pin(@room.id)
+ Live::RoomBroadcaster.publish_participants_if_changed(@room)
livekit = mint_livekit_payload
if livekit.nil?
- return(render_json_error(I18n.t("voice.errors.livekit_unavailable"), status: 503))
+ return(render_json_error(I18n.t("live.errors.livekit_unavailable"), status: 503))
end
render json: livekit.merge(participant_session_id: participant_session_id)
end
def start_recording
- guardian.ensure_can_manage_voice_room!(@room)
- render json: { recording: Voice::RecordingManager.start!(@room, current_user) }
- rescue Voice::RecordingManager::Error => e
+ guardian.ensure_can_manage_live_room!(@room)
+ render json: { recording: Live::RecordingManager.start!(@room, current_user) }
+ rescue Live::RecordingManager::Error => e
render_json_error(e.message, status: 422)
end
def stop_recording
- guardian.ensure_can_manage_voice_room!(@room)
- Voice::RecordingManager.stop!(@room)
+ guardian.ensure_can_manage_live_room!(@room)
+ Live::RecordingManager.stop!(@room)
head :no_content
- rescue Voice::RecordingManager::Error => e
+ rescue Live::RecordingManager::Error => e
render_json_error(e.message, status: 422)
end
def leave
- guardian.ensure_can_join_voice_room!(@room)
+ guardian.ensure_can_join_live_room!(@room)
# A leave from a stale tab — carrying a participant session that a newer
# join has since superseded — must not tear down the presence and
# session the newer tab now owns.
if params[:participant_session_id].present? &&
- !Voice::ParticipantTracker.valid_participant_session?(
+ !Live::ParticipantTracker.valid_participant_session?(
@room.id,
current_user.id,
params[:participant_session_id],
@@ -373,30 +373,30 @@ module Voice
end
session = close_session_for(@room.id, current_user.id)
- Voice::ParticipantTracker.mark_left(@room.id, current_user.id)
- Voice::ParticipantTracker.remove(@room.id, current_user.id)
- if Voice::ParticipantTracker.human_user_ids(@room.id).empty?
- Voice::AgentManager.evict_agents_in_room!(@room)
- end
- Voice::UserStatusManager.clear_voice_status(current_user)
- Voice::RoomBroadcaster.publish_participants(@room)
- Voice::BadgeGranterHooks.on_leave(current_user, session)
+ Live::ParticipantTracker.mark_left(@room.id, current_user.id)
+ Live::ParticipantTracker.remove(@room.id, current_user.id)
+ if Live::ParticipantTracker.human_user_ids(@room.id).empty?
+ Live::AgentManager.evict_agents_in_room!(@room)
+ end
+ Live::UserStatusManager.clear_live_status(current_user)
+ Live::RoomBroadcaster.publish_participants(@room)
+ Live::BadgeGranterHooks.on_leave(current_user, session)
head :no_content
end
def heartbeat
- guardian.ensure_can_join_voice_room!(@room)
+ guardian.ensure_can_join_live_room!(@room)
# A beat already in flight when the user left (or was kicked) must not
# resurrect their presence; only join/livekit_token re-establish it.
- return head :no_content if Voice::ParticipantTracker.recently_left?(@room.id, current_user.id)
+ return head :no_content if Live::ParticipantTracker.recently_left?(@room.id, current_user.id)
ensure_participant_session!
- Voice::ParticipantTracker.add(@room.id, current_user.id)
- Voice::ParticipantTracker.refresh_participant_session(@room.id, current_user.id)
+ Live::ParticipantTracker.add(@room.id, current_user.id)
+ Live::ParticipantTracker.refresh_participant_session(@room.id, current_user.id)
- metadata = Voice::ParticipantTracker.get_metadata(@room.id, current_user.id)
+ metadata = Live::ParticipantTracker.get_metadata(@room.id, current_user.id)
metadata[:last_heartbeat_at] = Time.now.to_f
if params.key?(:idle_state)
@@ -404,22 +404,22 @@ module Voice
metadata[:idle_state] = idle_state if %w[active idle afk].include?(idle_state)
end
- Voice::ParticipantTracker.update_metadata(@room.id, current_user.id, metadata)
- Voice::ParticipantTracker.refresh_transport_pin(@room.id)
+ Live::ParticipantTracker.update_metadata(@room.id, current_user.id, metadata)
+ Live::ParticipantTracker.refresh_transport_pin(@room.id)
# Keep an in-progress chat session alive while someone is present, so it
# only rolls over to a new thread once the room is idle AND empty.
- Voice::ChatSession.touch!(@room)
+ Live::ChatSession.touch!(@room)
# Detect and broadcast any drift (idle change, or a participant whose TTL
# lapsed after an abrupt disconnect) now that metadata is persisted.
- Voice::RoomBroadcaster.publish_participants_if_changed(@room)
+ Live::RoomBroadcaster.publish_participants_if_changed(@room)
- if !metadata[:skip_status] && Voice::UserStatusManager.voice_status_active?(current_user)
+ if !metadata[:skip_status] && Live::UserStatusManager.live_status_active?(current_user)
if metadata[:idle_state] == "afk"
- Voice::UserStatusManager.set_afk_status(current_user, @room)
+ Live::UserStatusManager.set_afk_status(current_user, @room)
else
- Voice::UserStatusManager.set_voice_status(current_user, @room)
+ Live::UserStatusManager.set_live_status(current_user, @room)
end
end
@@ -427,53 +427,53 @@ module Voice
end
def participants
- guardian.ensure_can_join_voice_room!(@room)
+ guardian.ensure_can_join_live_room!(@room)
render json: {
participants:
- Voice::RoomBroadcaster.participant_entries(
+ Live::RoomBroadcaster.participant_entries(
@room,
- Voice::ParticipantTracker.list(@room.id),
+ Live::ParticipantTracker.list(@room.id),
guardian: guardian,
- metadata: Voice::ParticipantTracker.get_all_metadata(@room.id),
+ metadata: Live::ParticipantTracker.get_all_metadata(@room.id),
),
}
end
def state
- guardian.ensure_can_join_voice_room!(@room)
+ guardian.ensure_can_join_live_room!(@room)
ensure_participant_session!
- RateLimiter.new(current_user, "voice-room-state", 40, 10.seconds).performed!
+ RateLimiter.new(current_user, "live-room-state", 40, 10.seconds).performed!
if STATE_FIELDS.none? { |field| params.key?(field) }
- raise Discourse::InvalidParameters.new(I18n.t("voice.errors.state_change_required"))
+ raise Discourse::InvalidParameters.new(I18n.t("live.errors.state_change_required"))
end
bool = ActiveModel::Type::Boolean.new
wants_unmute = params.key?(:muted) && !bool.cast(params[:muted])
- if wants_unmute && @room.stage? && !guardian.can_speak_in_voice_room?(@room)
- raise Discourse::InvalidAccess.new(I18n.t("voice.errors.listeners_cannot_unmute"))
+ if wants_unmute && @room.stage? && !guardian.can_speak_in_live_room?(@room)
+ raise Discourse::InvalidAccess.new(I18n.t("live.errors.listeners_cannot_unmute"))
end
wants_camera = params.key?(:video) && bool.cast(params[:video])
wants_screen = params.key?(:screen) && bool.cast(params[:screen])
- if wants_camera && !guardian.can_publish_video_in_voice_room?(@room)
- raise Discourse::InvalidAccess.new(I18n.t("voice.errors.video_not_allowed"))
+ if wants_camera && !guardian.can_publish_video_in_live_room?(@room)
+ raise Discourse::InvalidAccess.new(I18n.t("live.errors.video_not_allowed"))
end
- if wants_screen && !guardian.can_screen_share_in_voice_room?(@room)
- raise Discourse::InvalidAccess.new(I18n.t("voice.errors.screen_share_not_allowed"))
+ if wants_screen && !guardian.can_screen_share_in_live_room?(@room)
+ raise Discourse::InvalidAccess.new(I18n.t("live.errors.screen_share_not_allowed"))
end
if wants_camera || wants_screen
if video_publisher_count(@room, exclude_user_id: current_user.id) >=
- SiteSetting.voice_video_max_publishers
- raise Discourse::InvalidParameters.new(I18n.t("voice.errors.video_publisher_limit"))
+ SiteSetting.live_video_max_publishers
+ raise Discourse::InvalidParameters.new(I18n.t("live.errors.video_publisher_limit"))
end
end
- metadata = Voice::ParticipantTracker.get_metadata(@room.id, current_user.id)
+ metadata = Live::ParticipantTracker.get_metadata(@room.id, current_user.id)
previous_metadata = metadata.dup
metadata[:is_muted] = bool.cast(params[:muted]) if params.key?(:muted)
metadata[:is_deafened] = bool.cast(params[:deafened]) if params.key?(:deafened)
@@ -486,9 +486,9 @@ module Voice
# rebroadcast to every participant.
return head :no_content if metadata == previous_metadata
- Voice::ParticipantTracker.update_metadata(@room.id, current_user.id, metadata)
+ Live::ParticipantTracker.update_metadata(@room.id, current_user.id, metadata)
- Voice::RoomBroadcaster.publish_participants(@room)
+ Live::RoomBroadcaster.publish_participants(@room)
head :no_content
end
@@ -496,57 +496,57 @@ module Voice
alias toggle_mute state
def invite_agent
- raise Discourse::InvalidAccess unless guardian.can_invite_voice_agent?(@room)
+ raise Discourse::InvalidAccess unless guardian.can_invite_live_agent?(@room)
dispatch_id =
- Voice::AgentDispatcher.dispatch!(room: @room, agent_name: params.require(:agent_name))
+ Live::AgentDispatcher.dispatch!(room: @room, agent_name: params.require(:agent_name))
render json: { dispatch_id: }, status: :created
- rescue Voice::AgentManager::AuthorizationError
- render_json_error(I18n.t("voice.errors.agent_dispatch_forbidden"), status: 403)
- rescue Voice::AgentDispatcher::DispatchError
- render_json_error(I18n.t("voice.errors.agent_dispatch_failed"), status: 503)
+ rescue Live::AgentManager::AuthorizationError
+ render_json_error(I18n.t("live.errors.agent_dispatch_forbidden"), status: 403)
+ rescue Live::AgentDispatcher::DispatchError
+ render_json_error(I18n.t("live.errors.agent_dispatch_failed"), status: 503)
end
def kick
- guardian.ensure_can_manage_voice_room!(@room)
+ guardian.ensure_can_manage_live_room!(@room)
user_id = params.require(:user_id).to_i
if user_id == current_user.id
- raise Discourse::InvalidParameters.new(I18n.t("voice.errors.cannot_kick_self"))
+ raise Discourse::InvalidParameters.new(I18n.t("live.errors.cannot_kick_self"))
end
if user_id == @room.creator_id
- raise Discourse::InvalidParameters.new(I18n.t("voice.errors.cannot_kick_creator"))
+ raise Discourse::InvalidParameters.new(I18n.t("live.errors.cannot_kick_creator"))
end
- Voice::AgentManager.evict!(room: @room, user_id: user_id) if user_id.negative?
+ Live::AgentManager.evict!(room: @room, user_id: user_id) if user_id.negative?
session = close_session_for(@room.id, user_id)
- Voice::ParticipantTracker.mark_left(@room.id, user_id)
- Voice::ParticipantTracker.remove(@room.id, user_id)
+ Live::ParticipantTracker.mark_left(@room.id, user_id)
+ Live::ParticipantTracker.remove(@room.id, user_id)
kicked_user = User.find_by(id: user_id)
- Voice::UserStatusManager.clear_voice_status(kicked_user) if kicked_user
+ Live::UserStatusManager.clear_live_status(kicked_user) if kicked_user
- Voice::BadgeGranterHooks.on_leave(kicked_user, session) if kicked_user
- Voice::RoomBroadcaster.publish_kick(@room, user_id)
- Voice::RoomBroadcaster.publish_participants(@room)
+ Live::BadgeGranterHooks.on_leave(kicked_user, session) if kicked_user
+ Live::RoomBroadcaster.publish_kick(@room, user_id)
+ Live::RoomBroadcaster.publish_participants(@room)
# The client-side kicked handler already forces a clean leave; this
# additionally evicts the media session from the SFU.
- Voice::Livekit::RoomServiceClient.remove_participant(@room, user_id) unless user_id.negative?
+ Live::Livekit::RoomServiceClient.remove_participant(@room, user_id) unless user_id.negative?
- if Voice::ParticipantTracker.human_user_ids(@room.id).empty? &&
- Voice::AgentManager.provider_room?(@room.id)
- Voice::AgentManager.evict_agents_in_room!(@room)
- Voice::RoomBroadcaster.publish_participants(@room)
+ if Live::ParticipantTracker.human_user_ids(@room.id).empty? &&
+ Live::AgentManager.provider_room?(@room.id)
+ Live::AgentManager.evict_agents_in_room!(@room)
+ Live::RoomBroadcaster.publish_participants(@room)
end
head :no_content
end
def flag
- RateLimiter.new(current_user, "flag_voice_user", 4, 1.minute).performed!
+ RateLimiter.new(current_user, "flag_live_user", 4, 1.minute).performed!
permitted = params.permit(:user_id, :flag_type_id, :message)
@@ -563,7 +563,7 @@ module Voice
raise Discourse::InvalidParameters.new(:message) if permitted[:message].blank?
result =
- Voice::ReviewQueue.new.flag_user(
+ Live::ReviewQueue.new.flag_user(
@room,
target_user,
guardian,
@@ -579,22 +579,22 @@ module Voice
end
def request_to_speak
- guardian.ensure_can_request_to_speak_in_voice_room!(@room)
+ guardian.ensure_can_request_to_speak_in_live_room!(@room)
# The session (not the eventually-consistent roster) is what proves the
# user is actually in the call.
ensure_participant_session!
- if Voice::ParticipantTracker.raise_hand(@room.id, current_user.id)
+ if Live::ParticipantTracker.raise_hand(@room.id, current_user.id)
raised_at =
- Voice::ParticipantTracker.get_metadata(@room.id, current_user.id)[:hand_raised_at]
- Voice::RoomBroadcaster.publish_hand_raise(
+ Live::ParticipantTracker.get_metadata(@room.id, current_user.id)[:hand_raised_at]
+ Live::RoomBroadcaster.publish_hand_raise(
@room,
current_user.id,
raised: true,
raised_at: raised_at,
reason: "raised",
)
- Voice::RoomBroadcaster.publish_participants(@room)
+ Live::RoomBroadcaster.publish_participants(@room)
end
head :no_content
@@ -604,68 +604,63 @@ module Voice
target_id = params[:user_id].present? ? params[:user_id].to_i : current_user.id
if target_id == current_user.id
- guardian.ensure_can_join_voice_room!(@room)
+ guardian.ensure_can_join_live_room!(@room)
ensure_participant_session!
else
# A moderator dismissing someone else's raised hand is a management
# action and must not require the moderator to be in the call.
- guardian.ensure_can_manage_voice_room!(@room)
+ guardian.ensure_can_manage_live_room!(@room)
end
- if Voice::ParticipantTracker.lower_hand(@room.id, target_id)
+ if Live::ParticipantTracker.lower_hand(@room.id, target_id)
reason = target_id == current_user.id ? "withdrawn" : "dismissed"
- Voice::RoomBroadcaster.publish_hand_raise(@room, target_id, raised: false, reason: reason)
- Voice::RoomBroadcaster.publish_participants(@room)
+ Live::RoomBroadcaster.publish_hand_raise(@room, target_id, raised: false, reason: reason)
+ Live::RoomBroadcaster.publish_participants(@room)
end
head :no_content
end
def signal
- guardian.ensure_can_join_voice_room!(@room)
+ guardian.ensure_can_join_live_room!(@room)
# Room eligibility alone is not enough: signaling authority comes from
# the server-attested session minted by join, so an eligible user who
# never joined can't reach anyone's media stack.
ensure_participant_session!
- RateLimiter.new(
- current_user,
- "voice-signals",
- SIGNAL_REQUESTS_PER_USER,
- 10.seconds,
- ).performed!
+ RateLimiter.new(current_user, "live-signals", SIGNAL_REQUESTS_PER_USER, 10.seconds).performed!
# Defense in depth: LiveKit rooms never exchange WebRTC signals.
- if Voice::ParticipantTracker.pinned_transport(@room.id) == "livekit"
- return(render_json_error(I18n.t("voice.errors.livekit_no_signaling"), status: 422))
+ if Live::ParticipantTracker.pinned_transport(@room.id) == "livekit"
+ return(render_json_error(I18n.t("live.errors.livekit_no_signaling"), status: 422))
end
raw_payload = params[:payload]
raw_payload = raw_payload.to_unsafe_h if raw_payload.respond_to?(:to_unsafe_h)
if raw_payload.blank?
- raise Discourse::InvalidParameters.new(I18n.t("voice.errors.missing_payload"))
+ raise Discourse::InvalidParameters.new(I18n.t("live.errors.missing_payload"))
end
- messages = Voice::SignalValidator.parse!(raw_payload, room: @room)
+ messages = Live::SignalValidator.parse!(raw_payload, room: @room)
if messages.blank?
- raise Discourse::InvalidParameters.new(I18n.t("voice.errors.missing_payload"))
+ raise Discourse::InvalidParameters.new(I18n.t("live.errors.missing_payload"))
end
total_events = messages.sum { |message| message[:events].size }
- Voice::ControlPlaneLimiter.perform!(
+ Live::ControlPlaneLimiter.perform!(
"signal-events:user:#{current_user.id}",
limit: SIGNAL_EVENTS_PER_USER_PER_MINUTE,
period: 1.minute,
weight: total_events,
)
- Voice::ControlPlaneLimiter.perform!(
+ Live::ControlPlaneLimiter.perform!(
"signal-events:room:#{@room.id}",
limit: SIGNAL_EVENTS_PER_ROOM_PER_MINUTE,
period: 1.minute,
weight: total_events,
)
- relay = Voice::SignalRelay.new(@room)
+ relay = Live::SignalRelay.new(@room)
messages.each do |message|
relay.publish!(
from: current_user,
@@ -681,17 +676,17 @@ module Voice
# thread) so the panel can render it. Does not create or change anything.
def chat_session
ensure_chat_available!
- render json: Voice::ChatSession.state(@room)
+ render json: Live::ChatSession.state(@room)
end
# Prepares the room's chat session for the caller: rolls a stale session
# over and follows them on the linked channel so chat's own message
# endpoints accept their posts. Never creates a thread — that only happens
# with the session's first message (see #chat_message); every later message
- # goes through chat's regular API, not through Voice.
+ # goes through chat's regular API, not through Live.
def ensure_chat_session
ensure_chat_available!
- render json: Voice::ChatSession.start!(@room, current_user)
+ render json: Live::ChatSession.start!(@room, current_user)
end
# Posts the session's opening message, creating the thread it roots. Only
@@ -705,8 +700,8 @@ module Voice
# per-user flood limit + auto-silence that chat enforces in its own
# controller — apply it here so this endpoint isn't a way around it.
::Chat::MessageRateLimiter.run!(current_user)
- render json: Voice::ChatSession.post_message!(@room, current_user, text)
- rescue Voice::ChatSession::Error => e
+ render json: Live::ChatSession.post_message!(@room, current_user, text)
+ rescue Live::ChatSession::Error => e
# The chat plugin rejected the message for a reason worth showing (a
# duplicate, a too-long message, threading disabled, …) — surface it
# instead of the generic 403 that an access error would produce.
@@ -716,7 +711,7 @@ module Voice
private
def ensure_participant_session!
- if Voice::ParticipantTracker.valid_participant_session?(
+ if Live::ParticipantTracker.valid_participant_session?(
@room.id,
current_user.id,
params[:participant_session_id],
@@ -726,29 +721,29 @@ module Voice
# Sustained probing with a missing or stale session is cut off before it
# can accumulate into free Redis/roster work.
- RateLimiter.new(current_user, "voice-session-denied", 30, 1.minute).performed!
+ RateLimiter.new(current_user, "live-session-denied", 30, 1.minute).performed!
raise Discourse::InvalidAccess.new(
- :voice_participant_session_required,
+ :live_participant_session_required,
nil,
- custom_message: "voice.errors.participant_session_required",
+ custom_message: "live.errors.participant_session_required",
)
end
def repeat_join?
params[:participant_session_id].present? &&
- Voice::ParticipantTracker.valid_participant_session?(
+ Live::ParticipantTracker.valid_participant_session?(
@room.id,
current_user.id,
params[:participant_session_id],
- ) && Voice::ParticipantTracker.user_ids(@room.id).include?(current_user.id)
+ ) && Live::ParticipantTracker.user_ids(@room.id).include?(current_user.id)
end
def mark_invitation_notifications_read!
notification_ids =
current_user
.notifications
- .where(notification_type: Notification.types[:voice_invitation], read: false)
+ .where(notification_type: Notification.types[:live_invitation], read: false)
.select { |notification| notification.data_hash[:room_id] == @room.id }
.map(&:id)
return if notification_ids.empty?
@@ -760,54 +755,54 @@ module Voice
# Broad rescue is deliberate: a LiveKit problem must surface as the 503
# handled by the callers, never as an opaque 500.
def mint_livekit_payload
- token = Voice::Livekit.mint_token(user: current_user, room: @room, guardian: guardian)
- { url: SiteSetting.voice_livekit_url, token: token }
+ token = Live::Livekit.mint_token(user: current_user, room: @room, guardian: guardian)
+ { url: SiteSetting.live_livekit_url, token: token }
rescue StandardError => e
- Rails.logger.error("[voice-livekit] token mint failed for room #{@room.id}: #{e.class}")
+ Rails.logger.error("[live-livekit] token mint failed for room #{@room.id}: #{e.class}")
nil
end
def ensure_chat_available!
- guardian.ensure_can_join_voice_room!(@room)
- unless Voice::ChatSession.available_for?(@room, guardian)
+ guardian.ensure_can_join_live_room!(@room)
+ unless Live::ChatSession.available_for?(@room, guardian)
raise Discourse::InvalidAccess.new(
- :voice_chat_unavailable,
+ :live_chat_unavailable,
nil,
- custom_message: "voice.errors.chat_unavailable",
+ custom_message: "live.errors.chat_unavailable",
)
end
- if Voice::ParticipantTracker.user_ids(@room.id).exclude?(current_user.id)
+ if Live::ParticipantTracker.user_ids(@room.id).exclude?(current_user.id)
raise Discourse::InvalidAccess.new(
- :voice_chat_requires_presence,
+ :live_chat_requires_presence,
nil,
- custom_message: "voice.errors.chat_requires_presence",
+ custom_message: "live.errors.chat_requires_presence",
)
end
end
def refresh_participant_statuses(room)
- Voice::ParticipantTracker
+ Live::ParticipantTracker
.user_ids(room.id)
.each do |uid|
user = User.find_by(id: uid)
next unless user
- next unless Voice::UserStatusManager.voice_status_active?(user)
- Voice::UserStatusManager.set_voice_status(user, room)
+ next unless Live::UserStatusManager.live_status_active?(user)
+ Live::UserStatusManager.set_live_status(user, room)
end
end
def close_session_for(room_id, user_id)
- metadata = Voice::ParticipantTracker.get_metadata(room_id, user_id)
+ metadata = Live::ParticipantTracker.get_metadata(room_id, user_id)
return unless metadata[:session_id]
- session = Voice::Session.find_by(id: metadata[:session_id])
+ session = Live::Session.find_by(id: metadata[:session_id])
session&.close!
session
end
def video_publisher_count(room, exclude_user_id: nil)
- active_ids = Voice::ParticipantTracker.user_ids(room.id)
- all_metadata = Voice::ParticipantTracker.get_all_metadata(room.id)
+ active_ids = Live::ParticipantTracker.user_ids(room.id)
+ all_metadata = Live::ParticipantTracker.get_all_metadata(room.id)
active_ids.count do |user_id|
next false if user_id == exclude_user_id
@@ -832,10 +827,10 @@ module Voice
:max_quality_profile,
)
if permitted.key?(:room_type)
- permitted[:room_type] = Voice::Room.room_type_from_name!(permitted[:room_type])
+ permitted[:room_type] = Live::Room.room_type_from_name!(permitted[:room_type])
end
if permitted.key?(:max_quality_profile)
- permitted[:max_quality_profile] = Voice::Room::QUALITY_PROFILES[
+ permitted[:max_quality_profile] = Live::Room::QUALITY_PROFILES[
permitted[:max_quality_profile].to_s
]
end
@@ -844,8 +839,8 @@ module Voice
def load_room
@room =
- Voice::Room.find_by(id: params[:id]) ||
- Voice::Room.find_by!(slug: params[:id] || params[:slug])
+ Live::Room.find_by(id: params[:id]) ||
+ Live::Room.find_by!(slug: params[:id] || params[:slug])
end
end
end
diff --git a/plugins/voice/app/jobs/regular/voice_livekit_probe.rb b/plugins/live/app/jobs/regular/live_livekit_probe.rb
similarity index 60%
rename from plugins/voice/app/jobs/regular/voice_livekit_probe.rb
rename to plugins/live/app/jobs/regular/live_livekit_probe.rb
index 2a8cc3a3b19..739d3ba52fa 100644
--- a/plugins/voice/app/jobs/regular/voice_livekit_probe.rb
+++ b/plugins/live/app/jobs/regular/live_livekit_probe.rb
@@ -4,21 +4,21 @@ module Jobs
# One-shot connectivity probe enqueued whenever a LiveKit setting changes,
# so a bad URL or key pair surfaces on the admin status panel (and in the
# logs) within seconds of saving — not at the first user's failed join.
- class VoiceLivekitProbe < ::Jobs::Base
+ class LiveLivekitProbe < ::Jobs::Base
sidekiq_options retry: false
def execute(args)
- unless ::Voice::Livekit.configured?
+ unless ::Live::Livekit.configured?
# Deconfiguring is also a settings change: drop the stale result
# instead of reporting the health of a server we no longer use.
- ::Voice::Livekit::HealthCheck.clear_probe!
+ ::Live::Livekit::HealthCheck.clear_probe!
return
end
- result = ::Voice::Livekit::HealthCheck.connectivity_check
- ::Voice::Livekit::HealthCheck.store_probe!(result)
+ result = ::Live::Livekit::HealthCheck.connectivity_check
+ ::Live::Livekit::HealthCheck.store_probe!(result)
- ::Voice.warn("[voice-livekit] connectivity probe failed") if !result[:ok]
+ ::Live.warn("[live-livekit] connectivity probe failed") if !result[:ok]
end
end
end
diff --git a/plugins/voice/app/jobs/scheduled/voice/cleanup_ephemeral_rooms.rb b/plugins/live/app/jobs/scheduled/live/cleanup_ephemeral_rooms.rb
similarity index 60%
rename from plugins/voice/app/jobs/scheduled/voice/cleanup_ephemeral_rooms.rb
rename to plugins/live/app/jobs/scheduled/live/cleanup_ephemeral_rooms.rb
index 4d881556270..559a35fe93b 100644
--- a/plugins/voice/app/jobs/scheduled/voice/cleanup_ephemeral_rooms.rb
+++ b/plugins/live/app/jobs/scheduled/live/cleanup_ephemeral_rooms.rb
@@ -1,14 +1,14 @@
# frozen_string_literal: true
module Jobs
- module Voice
+ module Live
class CleanupEphemeralRooms < ::Jobs::Scheduled
every 5.minutes
def execute(_args)
- return unless SiteSetting.voice_enabled
+ return unless SiteSetting.live_enabled
- ::Voice::EphemeralRoomManager.cleanup!
+ ::Live::EphemeralRoomManager.cleanup!
end
end
end
diff --git a/plugins/live/app/jobs/scheduled/live/close_orphaned_sessions.rb b/plugins/live/app/jobs/scheduled/live/close_orphaned_sessions.rb
new file mode 100644
index 00000000000..9bb3ebd9b25
--- /dev/null
+++ b/plugins/live/app/jobs/scheduled/live/close_orphaned_sessions.rb
@@ -0,0 +1,38 @@
+# frozen_string_literal: true
+
+module Jobs
+ module Live
+ class CloseOrphanedSessions < ::Jobs::Scheduled
+ every 5.minutes
+
+ def execute(_args)
+ return unless SiteSetting.live_enabled && SiteSetting.live_analytics_enabled
+
+ participant_cache = {}
+
+ ::Live::Session.orphaned.find_each do |session|
+ participant_ids =
+ participant_cache[session.room_id] ||= ::Live::ParticipantTracker.user_ids(
+ session.room_id,
+ )
+ next if participant_ids.include?(session.user_id)
+
+ left_at =
+ ::Live::ParticipantTracker.last_heartbeat_at(session.room_id, session.user_id) ||
+ Time.current
+
+ session.close!(at: left_at)
+ ::Live::ParticipantTracker.remove(session.room_id, session.user_id)
+
+ room = ::Live::Room.find_by(id: session.room_id)
+ if room && ::Live::ParticipantTracker.human_user_ids(room.id).empty?
+ ::Live::AgentManager.evict_agents_in_room!(room)
+ end
+
+ user = User.find_by(id: session.user_id)
+ ::Live::BadgeGranterHooks.on_leave(user, session) if user
+ end
+ end
+ end
+ end
+end
diff --git a/plugins/live/app/jobs/scheduled/live/purge_old_sessions.rb b/plugins/live/app/jobs/scheduled/live/purge_old_sessions.rb
new file mode 100644
index 00000000000..1a2ab9e6b12
--- /dev/null
+++ b/plugins/live/app/jobs/scheduled/live/purge_old_sessions.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+module Jobs
+ module Live
+ class PurgeOldSessions < ::Jobs::Scheduled
+ every 1.day
+
+ def execute(_args)
+ return unless SiteSetting.live_enabled
+
+ days = SiteSetting.live_session_retention_days
+ return if days <= 0
+
+ cutoff = days.days.ago
+ ::Live::Session.where("created_at < ?", cutoff).in_batches(of: 1000).delete_all
+ ::Live::CoPresence.where("date < ?", cutoff.to_date).in_batches(of: 1000).delete_all
+ end
+ end
+ end
+end
diff --git a/plugins/voice/app/jobs/scheduled/voice/reconcile_recordings.rb b/plugins/live/app/jobs/scheduled/live/reconcile_recordings.rb
similarity index 67%
rename from plugins/voice/app/jobs/scheduled/voice/reconcile_recordings.rb
rename to plugins/live/app/jobs/scheduled/live/reconcile_recordings.rb
index a94c6a79ef4..02e1e78e5db 100644
--- a/plugins/voice/app/jobs/scheduled/voice/reconcile_recordings.rb
+++ b/plugins/live/app/jobs/scheduled/live/reconcile_recordings.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
module Jobs
- module Voice
+ module Live
# Delivery backstop for call recordings: webhooks are the fast path, but
# they are optional server configuration — this sweep resolves any
# recording still marked live by polling the Egress service, so the
@@ -12,13 +12,13 @@ module Jobs
cluster_concurrency 1
def execute(_args)
- return unless SiteSetting.voice_enabled
- return unless SiteSetting.voice_livekit_recording_enabled
- return unless ::Voice::Livekit.configured?
+ return unless SiteSetting.live_enabled
+ return unless SiteSetting.live_livekit_recording_enabled
+ return unless ::Live::Livekit.configured?
# The common case is no unresolved recordings — skip without HTTP.
- return unless ::Voice::Recording.recording.exists?
+ return unless ::Live::Recording.recording.exists?
- ::Voice::RecordingManager.reconcile_pending!
+ ::Live::RecordingManager.reconcile_pending!
end
end
end
diff --git a/plugins/voice/app/jobs/scheduled/voice/update_co_presence.rb b/plugins/live/app/jobs/scheduled/live/update_co_presence.rb
similarity index 66%
rename from plugins/voice/app/jobs/scheduled/voice/update_co_presence.rb
rename to plugins/live/app/jobs/scheduled/live/update_co_presence.rb
index 876f7d3d1e5..11aa3b0265a 100644
--- a/plugins/voice/app/jobs/scheduled/voice/update_co_presence.rb
+++ b/plugins/live/app/jobs/scheduled/live/update_co_presence.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
module Jobs
- module Voice
+ module Live
class UpdateCoPresence < ::Jobs::Scheduled
every 5.minutes
@@ -9,17 +9,17 @@ module Jobs
GAP_THRESHOLD = 10.minutes
def execute(_args)
- return unless SiteSetting.voice_enabled && SiteSetting.voice_analytics_enabled
+ return unless SiteSetting.live_enabled && SiteSetting.live_analytics_enabled
each_active_room do |room_id|
# Bounded by the site capacity ceiling even if Redis holds strays,
# since the pair count below grows quadratically.
user_ids =
- ::Voice::ParticipantTracker
+ ::Live::ParticipantTracker
.user_ids(room_id)
.select(&:positive?)
.sort
- .first(SiteSetting.voice_max_room_participants)
+ .first(SiteSetting.live_max_room_participants)
next if user_ids.size < 2
today = Date.today
@@ -32,21 +32,18 @@ module Jobs
private
def each_active_room(&block)
- pattern = "#{::Voice::ParticipantTracker::KEY_NAMESPACE}:*:participants"
+ namespace = ::Live::ParticipantTracker::KEY_NAMESPACE
+ key_pattern = /#{Regexp.escape(namespace)}:(\d+):participants/
Discourse
.redis
- .scan_each(match: pattern) do |key|
- yield Regexp.last_match(1).to_i if key =~ /voice:room:(\d+):participants/
+ .scan_each(match: "#{namespace}:*:participants") do |key|
+ yield Regexp.last_match(1).to_i if key =~ key_pattern
end
end
def upsert_co_presence(user_a, user_b, date)
record =
- ::Voice::CoPresence.find_or_initialize_by(
- user_id_1: user_a,
- user_id_2: user_b,
- date: date,
- )
+ ::Live::CoPresence.find_or_initialize_by(user_id_1: user_a, user_id_2: user_b, date: date)
gap = record.new_record? || record.updated_at < GAP_THRESHOLD.ago
diff --git a/plugins/voice/app/jobs/scheduled/publish_room_participants.rb b/plugins/live/app/jobs/scheduled/publish_room_participants.rb
similarity index 65%
rename from plugins/voice/app/jobs/scheduled/publish_room_participants.rb
rename to plugins/live/app/jobs/scheduled/publish_room_participants.rb
index f54ac65a2be..af690edcbf6 100644
--- a/plugins/voice/app/jobs/scheduled/publish_room_participants.rb
+++ b/plugins/live/app/jobs/scheduled/publish_room_participants.rb
@@ -13,40 +13,40 @@ module Jobs
# gone, but its (empty) state still needs re-broadcasting for a while,
# otherwise a single missed leave message shows ghosts until reload.
def execute(args)
- return unless ::Voice.enabled?
+ return unless ::Live.enabled?
- provider_room_ids = ::Voice::AgentManager.provider_room_ids
- room_ids = ::Voice::ParticipantTracker.recently_active_room_ids | provider_room_ids
+ provider_room_ids = ::Live::AgentManager.provider_room_ids
+ room_ids = ::Live::ParticipantTracker.recently_active_room_ids | provider_room_ids
- # Auto voice statuses have no ends_at, so a lapsed heartbeat must drop
+ # Auto live statuses have no ends_at, so a lapsed heartbeat must drop
# the status the same way it drops the roster entry. Live-anywhere is
# the keep criterion: a user mid-move between rooms is still live.
live_user_ids =
- room_ids.flat_map { |room_id| ::Voice::ParticipantTracker.user_ids(room_id) }.uniq
- ::Voice::UserStatusManager.clear_stale_statuses(live_user_ids)
+ room_ids.flat_map { |room_id| ::Live::ParticipantTracker.user_ids(room_id) }.uniq
+ ::Live::UserStatusManager.clear_stale_statuses(live_user_ids)
return if room_ids.empty?
remaining_provider_room_ids = provider_room_ids.to_set
- ::Voice::Room
+ ::Live::Room
.where(id: room_ids)
.find_each do |room|
remaining_provider_room_ids.delete(room.id)
# Backstop for the pin-clear on last leave: a room that emptied
# without one (crashed clients, missed leave) must not hold its
# transport for the next call.
- if ::Voice::ParticipantTracker.human_user_ids(room.id).empty?
+ if ::Live::ParticipantTracker.human_user_ids(room.id).empty?
# Agent cleanup survives expired pins and retries provider failures.
- ::Voice::AgentManager.evict_agents_in_room!(room)
+ ::Live::AgentManager.evict_agents_in_room!(room)
else
- ::Voice::AgentManager.reconcile(room)
+ ::Live::AgentManager.reconcile(room)
end
- ::Voice::RoomBroadcaster.publish_participants(room)
+ ::Live::RoomBroadcaster.publish_participants(room)
end
# Provider cleanup must outlive the database row when deletion fails remotely.
remaining_provider_room_ids.each do |room_id|
- ::Voice::AgentManager.evict_agents_in_room!(::Voice::Room.new(id: room_id))
+ ::Live::AgentManager.evict_agents_in_room!(::Live::Room.new(id: room_id))
end
end
end
diff --git a/plugins/voice/app/models/voice/co_presence.rb b/plugins/live/app/models/live/co_presence.rb
similarity index 79%
rename from plugins/voice/app/models/voice/co_presence.rb
rename to plugins/live/app/models/live/co_presence.rb
index e6456003201..b77f29a8a36 100644
--- a/plugins/voice/app/models/voice/co_presence.rb
+++ b/plugins/live/app/models/live/co_presence.rb
@@ -1,8 +1,8 @@
# frozen_string_literal: true
-module Voice
+module Live
class CoPresence < ActiveRecord::Base
- self.table_name = "#{Voice.table_name_prefix}co_presences"
+ self.table_name = "#{Live.table_name_prefix}co_presences"
belongs_to :user_1, class_name: "User"
belongs_to :user_2, class_name: "User"
@@ -27,7 +27,7 @@ end
# == Schema Information
#
-# Table name: voice_co_presences
+# Table name: live_co_presences
#
# id :bigint not null, primary key
# date :date not null
@@ -40,7 +40,7 @@ end
#
# Indexes
#
-# idx_voice_co_presences_unique (user_id_1,user_id_2,date) UNIQUE
-# index_voice_co_presences_on_user_id_1_and_date (user_id_1,date)
-# index_voice_co_presences_on_user_id_2_and_date (user_id_2,date)
+# idx_live_co_presences_unique (user_id_1,user_id_2,date) UNIQUE
+# index_live_co_presences_on_user_id_1_and_date (user_id_1,date)
+# index_live_co_presences_on_user_id_2_and_date (user_id_2,date)
#
diff --git a/plugins/voice/app/models/voice/invite.rb b/plugins/live/app/models/live/invite.rb
similarity index 79%
rename from plugins/voice/app/models/voice/invite.rb
rename to plugins/live/app/models/live/invite.rb
index d4f64586c6f..f73b0e97215 100644
--- a/plugins/voice/app/models/voice/invite.rb
+++ b/plugins/live/app/models/live/invite.rb
@@ -1,8 +1,8 @@
# frozen_string_literal: true
-module Voice
+module Live
class Invite < ActiveRecord::Base
- self.table_name = "#{Voice.table_name_prefix}invites"
+ self.table_name = "#{Live.table_name_prefix}invites"
SOURCES = { notification: 0, link: 1 }
@@ -36,7 +36,7 @@ end
# == Schema Information
#
-# Table name: voice_invites
+# Table name: live_invites
#
# id :bigint not null, primary key
# redeemed_at :datetime
@@ -49,7 +49,7 @@ end
#
# Indexes
#
-# idx_voice_invites_redeemed (invited_by_id,user_id) WHERE (redeemed_at IS NOT NULL)
-# index_voice_invites_on_room_id_and_user_id_and_invited_by_id (room_id,user_id,invited_by_id) UNIQUE
-# index_voice_invites_on_user_id_and_room_id (user_id,room_id)
+# idx_live_invites_redeemed (invited_by_id,user_id) WHERE (redeemed_at IS NOT NULL)
+# index_live_invites_on_room_id_and_user_id_and_invited_by_id (room_id,user_id,invited_by_id) UNIQUE
+# index_live_invites_on_user_id_and_room_id (user_id,room_id)
#
diff --git a/plugins/voice/app/models/voice/recording.rb b/plugins/live/app/models/live/recording.rb
similarity index 82%
rename from plugins/voice/app/models/voice/recording.rb
rename to plugins/live/app/models/live/recording.rb
index 4f1ce027fcd..c762c107421 100644
--- a/plugins/voice/app/models/voice/recording.rb
+++ b/plugins/live/app/models/live/recording.rb
@@ -1,16 +1,16 @@
# frozen_string_literal: true
-module Voice
+module Live
# Durable log of a call recording, one row per LiveKit egress. The Redis
# recording state dies with the room instance, but the egress_ended webhook
# — which carries the file's final location — usually arrives after that,
# so delivery (the requester's PM, the admin listing) needs this row.
class Recording < ActiveRecord::Base
- self.table_name = "#{Voice.table_name_prefix}recordings"
+ self.table_name = "#{Live.table_name_prefix}recordings"
enum :status, { recording: 0, completed: 1, failed: 2 }
- belongs_to :room, class_name: "Voice::Room"
+ belongs_to :room, class_name: "Live::Room"
belongs_to :started_by, class_name: "User"
validates :egress_id, presence: true, uniqueness: true
@@ -26,7 +26,7 @@ end
# == Schema Information
#
-# Table name: voice_recordings
+# Table name: live_recordings
#
# id :bigint not null, primary key
# duration_ms :bigint
@@ -45,6 +45,6 @@ end
#
# Indexes
#
-# index_voice_recordings_on_egress_id (egress_id) UNIQUE
-# index_voice_recordings_on_room_id_and_started_at (room_id,started_at)
+# index_live_recordings_on_egress_id (egress_id) UNIQUE
+# index_live_recordings_on_room_id_and_started_at (room_id,started_at)
#
diff --git a/plugins/voice/app/models/voice/room.rb b/plugins/live/app/models/live/room.rb
similarity index 84%
rename from plugins/voice/app/models/voice/room.rb
rename to plugins/live/app/models/live/room.rb
index 9102e15eb4e..e431b0a7f61 100644
--- a/plugins/voice/app/models/voice/room.rb
+++ b/plugins/live/app/models/live/room.rb
@@ -1,8 +1,8 @@
# frozen_string_literal: true
-module Voice
+module Live
class Room < ActiveRecord::Base
- self.table_name = "#{Voice.table_name_prefix}rooms"
+ self.table_name = "#{Live.table_name_prefix}rooms"
# TODO(02-2027): Remove this line
self.ignored_columns += %i[chat_thread_title_template]
@@ -15,9 +15,9 @@ module Voice
QUALITY_PROFILES = { "standard" => 0, "high" => 1, "maximum" => 2 }.freeze
belongs_to :creator, class_name: "User"
- has_many :room_memberships, class_name: "Voice::RoomMembership", dependent: :destroy
+ has_many :room_memberships, class_name: "Live::RoomMembership", dependent: :destroy
has_many :members, through: :room_memberships, source: :user
- has_many :recordings, class_name: "Voice::Recording", dependent: :delete_all
+ has_many :recordings, class_name: "Live::Recording", dependent: :delete_all
validates :name, presence: true, length: { maximum: 80 }
validates :slug, presence: true, uniqueness: true
@@ -48,22 +48,22 @@ module Voice
def self.visible_to(guardian)
rooms = persistent
- return rooms.none unless SiteSetting.voice_enabled?
+ return rooms.none unless SiteSetting.live_enabled?
- unless guardian.can_access_voice?
- return guardian.voice_public_access? ? rooms.public_rooms : rooms.none
+ unless guardian.can_access_live?
+ return guardian.live_public_access? ? rooms.public_rooms : rooms.none
end
return rooms if guardian.is_staff?
rooms.where(<<~SQL, user_id: guardian.user.id)
- "voice_rooms"."public"
- OR "voice_rooms"."creator_id" = :user_id
+ "live_rooms"."public"
+ OR "live_rooms"."creator_id" = :user_id
OR EXISTS (
SELECT 1
- FROM "voice_room_memberships"
- WHERE "voice_room_memberships"."room_id" = "voice_rooms"."id"
- AND "voice_room_memberships"."user_id" = :user_id
+ FROM "live_room_memberships"
+ WHERE "live_room_memberships"."room_id" = "live_rooms"."id"
+ AND "live_room_memberships"."user_id" = :user_id
)
SQL
end
@@ -93,7 +93,7 @@ module Voice
# The hard presence cap: a room-level limit can lower the site ceiling,
# never raise it. Enforced atomically when presence is established.
def effective_max_participants
- [max_participants, SiteSetting.voice_max_room_participants].compact.min
+ [max_participants, SiteSetting.live_max_room_participants].compact.min
end
def membership_for(user)
@@ -131,7 +131,7 @@ module Voice
end
def message_bus_targets
- public? ? Voice.public_room_message_bus_targets : { user_ids: member_ids }
+ public? ? Live.public_room_message_bus_targets : { user_ids: member_ids }
end
def chat_linked?
@@ -190,11 +190,11 @@ module Voice
def ensure_creator_membership
room_memberships.find_or_create_by!(user: creator) do |membership|
- membership.role = Voice::RoomMembership::ROLE_MODERATOR
+ membership.role = Live::RoomMembership::ROLE_MODERATOR
end
end
- # Voice never edits chat channels itself (that would silently change a
+ # Live never edits chat channels itself (that would silently change a
# setting for everyone else using it, on behalf of a user who may not have
# permission to edit that channel at all) — a channel has to already have
# threading enabled before it can be linked.
@@ -213,7 +213,7 @@ end
# == Schema Information
#
-# Table name: voice_rooms
+# Table name: live_rooms
#
# id :bigint not null, primary key
# chat_idle_minutes :integer default(15), not null
@@ -236,8 +236,8 @@ end
#
# Indexes
#
-# index_voice_rooms_on_chat_channel_id (chat_channel_id)
-# index_voice_rooms_on_creator_id (creator_id)
-# index_voice_rooms_on_ephemeral (id) WHERE ephemeral
-# index_voice_rooms_on_slug (slug) UNIQUE
+# index_live_rooms_on_chat_channel_id (chat_channel_id)
+# index_live_rooms_on_creator_id (creator_id)
+# index_live_rooms_on_ephemeral (id) WHERE ephemeral
+# index_live_rooms_on_slug (slug) UNIQUE
#
diff --git a/plugins/voice/app/models/voice/room_membership.rb b/plugins/live/app/models/live/room_membership.rb
similarity index 76%
rename from plugins/voice/app/models/voice/room_membership.rb
rename to plugins/live/app/models/live/room_membership.rb
index 70bef8ce334..1a0c756acf4 100644
--- a/plugins/voice/app/models/voice/room_membership.rb
+++ b/plugins/live/app/models/live/room_membership.rb
@@ -1,10 +1,10 @@
# frozen_string_literal: true
-module Voice
+module Live
class RoomMembership < ActiveRecord::Base
- self.table_name = "#{Voice.table_name_prefix}room_memberships"
+ self.table_name = "#{Live.table_name_prefix}room_memberships"
- belongs_to :room, class_name: "Voice::Room"
+ belongs_to :room, class_name: "Live::Room"
belongs_to :user
ROLE_PARTICIPANT = 0
@@ -52,7 +52,7 @@ end
# == Schema Information
#
-# Table name: voice_room_memberships
+# Table name: live_room_memberships
#
# id :bigint not null, primary key
# role :integer default(0), not null
@@ -63,11 +63,11 @@ end
#
# Indexes
#
-# idx_voice_room_memberships_on_room_and_user (room_id,user_id) UNIQUE
-# index_voice_room_memberships_on_room_id (room_id)
-# index_voice_room_memberships_on_user_id (user_id)
+# idx_live_room_memberships_on_room_and_user (room_id,user_id) UNIQUE
+# index_live_room_memberships_on_room_id (room_id)
+# index_live_room_memberships_on_user_id (user_id)
#
# Foreign Keys
#
-# fk_rails_... (room_id => voice_rooms.id)
+# fk_rails_... (room_id => live_rooms.id)
#
diff --git a/plugins/voice/app/models/voice/session.rb b/plugins/live/app/models/live/session.rb
similarity index 84%
rename from plugins/voice/app/models/voice/session.rb
rename to plugins/live/app/models/live/session.rb
index 3bc89d33be3..30889cd68b7 100644
--- a/plugins/voice/app/models/voice/session.rb
+++ b/plugins/live/app/models/live/session.rb
@@ -1,14 +1,14 @@
# frozen_string_literal: true
-module Voice
+module Live
class Session < ActiveRecord::Base
- self.table_name = "#{Voice.table_name_prefix}sessions"
+ self.table_name = "#{Live.table_name_prefix}sessions"
# optional: sessions are history and outlive both their room's and their
# user's deletion — close! must still work on a session whose room or
# user is gone.
belongs_to :user, optional: true
- belongs_to :room, class_name: "Voice::Room", optional: true
+ belongs_to :room, class_name: "Live::Room", optional: true
scope :orphaned, -> { where(left_at: nil) }
@@ -76,8 +76,8 @@ module Voice
SELECT theirs.user_id AS companion_id,
SUM(#{overlap_seconds})::bigint AS total_seconds,
MAX(GREATEST(mine.joined_at, theirs.joined_at)) AS last_together_at
- FROM voice_sessions mine
- JOIN voice_sessions theirs
+ FROM live_sessions mine
+ JOIN live_sessions theirs
ON theirs.room_id = mine.room_id
AND theirs.user_id <> mine.user_id
AND theirs.joined_at < COALESCE(mine.left_at, CURRENT_TIMESTAMP)
@@ -103,7 +103,7 @@ end
# == Schema Information
#
-# Table name: voice_sessions
+# Table name: live_sessions
#
# id :bigint not null, primary key
# joined_at :datetime not null
@@ -115,10 +115,10 @@ end
#
# Indexes
#
-# idx_voice_sessions_orphaned (left_at) WHERE (left_at IS NULL)
-# index_voice_sessions_on_room_id (room_id)
-# index_voice_sessions_on_room_id_and_joined_at (room_id,joined_at)
-# index_voice_sessions_on_user_id (user_id)
-# index_voice_sessions_on_user_id_and_joined_at (user_id,joined_at)
-# index_voice_sessions_on_user_id_and_room_id_and_joined_at (user_id,room_id,joined_at)
+# idx_live_sessions_orphaned (left_at) WHERE (left_at IS NULL)
+# index_live_sessions_on_room_id (room_id)
+# index_live_sessions_on_room_id_and_joined_at (room_id,joined_at)
+# index_live_sessions_on_user_id (user_id)
+# index_live_sessions_on_user_id_and_joined_at (user_id,joined_at)
+# index_live_sessions_on_user_id_and_room_id_and_joined_at (user_id,room_id,joined_at)
#
diff --git a/plugins/voice/app/models/reviewable_voice_user.rb b/plugins/live/app/models/reviewable_live_user.rb
similarity index 94%
rename from plugins/voice/app/models/reviewable_voice_user.rb
rename to plugins/live/app/models/reviewable_live_user.rb
index 4f257b574a5..411c90d8e59 100644
--- a/plugins/voice/app/models/reviewable_voice_user.rb
+++ b/plugins/live/app/models/reviewable_live_user.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-class ReviewableVoiceUser < Reviewable
+class ReviewableLiveUser < Reviewable
include ReviewableActionBuilder
def self.additional_args(params)
@@ -8,11 +8,11 @@ class ReviewableVoiceUser < Reviewable
end
def serializer
- ReviewableVoiceUserSerializer
+ ReviewableLiveUserSerializer
end
def session
- @session ||= target || Voice::Session.find_by(id: target_id)
+ @session ||= target || Live::Session.find_by(id: target_id)
end
def flagged_by_user_ids
@@ -94,7 +94,7 @@ class ReviewableVoiceUser < Reviewable
user = target_created_by.reload
{
- decision_facts: "The user reported during a voice call was suspended.",
+ decision_facts: "The user reported during a live call was suspended.",
decision_account: "DECISION_ACCOUNT_SUSPENDED",
content_type: ["CONTENT_TYPE_OTHER"],
content_type_other: "User account",
@@ -109,7 +109,7 @@ class ReviewableVoiceUser < Reviewable
{
decision_facts:
- "The user reported during a voice call had their ability to participate restricted.",
+ "The user reported during a live call had their ability to participate restricted.",
decision_provision: "DECISION_PROVISION_PARTIAL_SUSPENSION",
content_type: ["CONTENT_TYPE_OTHER"],
content_type_other: "User account",
diff --git a/plugins/voice/app/serializers/voice/admin_recording_serializer.rb b/plugins/live/app/serializers/live/admin_recording_serializer.rb
similarity index 97%
rename from plugins/voice/app/serializers/voice/admin_recording_serializer.rb
rename to plugins/live/app/serializers/live/admin_recording_serializer.rb
index 38a6887ed6c..ae35dac639b 100644
--- a/plugins/voice/app/serializers/voice/admin_recording_serializer.rb
+++ b/plugins/live/app/serializers/live/admin_recording_serializer.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-module Voice
+module Live
class AdminRecordingSerializer < ApplicationSerializer
attributes :id,
:room_id,
diff --git a/plugins/voice/app/serializers/voice/admin_room_serializer.rb b/plugins/live/app/serializers/live/admin_room_serializer.rb
similarity index 92%
rename from plugins/voice/app/serializers/voice/admin_room_serializer.rb
rename to plugins/live/app/serializers/live/admin_room_serializer.rb
index 47db9e14881..8efb4f3ad20 100644
--- a/plugins/voice/app/serializers/voice/admin_room_serializer.rb
+++ b/plugins/live/app/serializers/live/admin_room_serializer.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-module Voice
+module Live
class AdminRoomSerializer < ApplicationSerializer
attributes :id,
:name,
@@ -34,7 +34,7 @@ module Voice
end
def live_participant_count
- Voice::ParticipantTracker.user_ids(object.id).size
+ Live::ParticipantTracker.user_ids(object.id).size
end
end
end
diff --git a/plugins/voice/app/serializers/voice/room_membership_serializer.rb b/plugins/live/app/serializers/live/room_membership_serializer.rb
similarity index 95%
rename from plugins/voice/app/serializers/voice/room_membership_serializer.rb
rename to plugins/live/app/serializers/live/room_membership_serializer.rb
index 23ed13dde98..de4b2214e7e 100644
--- a/plugins/voice/app/serializers/voice/room_membership_serializer.rb
+++ b/plugins/live/app/serializers/live/room_membership_serializer.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-module Voice
+module Live
class RoomMembershipSerializer < ApplicationSerializer
attributes :id, :room_id, :user_id, :role, :role_name, :created_at, :updated_at
diff --git a/plugins/voice/app/serializers/voice/room_serializer.rb b/plugins/live/app/serializers/live/room_serializer.rb
similarity index 86%
rename from plugins/voice/app/serializers/voice/room_serializer.rb
rename to plugins/live/app/serializers/live/room_serializer.rb
index 776a8f666aa..45292f95dd8 100644
--- a/plugins/voice/app/serializers/voice/room_serializer.rb
+++ b/plugins/live/app/serializers/live/room_serializer.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-module Voice
+module Live
class RoomSerializer < ApplicationSerializer
attributes :id,
:name,
@@ -33,7 +33,7 @@ module Voice
:recording,
:ringing
- has_one :membership, serializer: Voice::RoomMembershipSerializer, embed: :objects
+ has_one :membership, serializer: Live::RoomMembershipSerializer, embed: :objects
def include_ringing?
object.ephemeral?
@@ -43,7 +43,7 @@ module Voice
# with when they were last rung so clients can stop showing ones whose
# ring has run out. The client hides entries for users already present.
def ringing
- invites = Voice::Invite.where(room_id: object.id, redeemed_at: nil)
+ invites = Live::Invite.where(room_id: object.id, redeemed_at: nil)
users = User.real.not_staged.where(id: invites.map(&:user_id)).index_by(&:id)
invites.filter_map do |invite|
@@ -70,11 +70,11 @@ module Voice
def message_bus_last_id
return directory_entry.message_bus_last_id if directory_entry
- MessageBus.last_id(Voice.room_channel(object.id))
+ MessageBus.last_id(Live.room_channel(object.id))
end
def active_participants
- Voice::RoomBroadcaster.participant_entries(
+ Live::RoomBroadcaster.participant_entries(
object,
tracked_participants,
guardian: scope,
@@ -92,11 +92,11 @@ module Voice
def can_manage
return @can_manage if defined?(@can_manage)
- @can_manage = scope.can_manage_voice_room?(object)
+ @can_manage = scope.can_manage_live_room?(object)
end
def can_invite
- scope.can_invite_to_voice_room?(object)
+ scope.can_invite_to_live_room?(object)
end
def description_excerpt
@@ -104,7 +104,7 @@ module Voice
end
def visit_count
- Voice::Session.where(user_id: scope.user.id, room_id: object.id).count
+ Live::Session.where(user_id: scope.user.id, room_id: object.id).count
end
def include_visit_count?
@@ -116,7 +116,7 @@ module Voice
# room's own video_enabled and the stage role are left out: broadcasts
# carry both live and the client combines them with these.
def video_allowed
- scope.eligible_to_publish_video_in_voice_room?(object)
+ scope.eligible_to_publish_video_in_live_room?(object)
end
def include_video_allowed?
@@ -124,7 +124,7 @@ module Voice
end
def screen_share_allowed
- scope.eligible_to_screen_share_in_voice_room?(object)
+ scope.eligible_to_screen_share_in_live_room?(object)
end
def include_screen_share_allowed?
@@ -138,7 +138,7 @@ module Voice
if @options[:chat_availability]&.key?(object.id)
@options[:chat_availability][object.id]
else
- Voice::ChatSession.available_for?(object, scope)
+ Live::ChatSession.available_for?(object, scope)
end
end
@@ -176,10 +176,10 @@ module Voice
if directory_entry
directory_entry.pinned_transport
else
- Voice::ParticipantTracker.pinned_transport(object.id)
+ Live::ParticipantTracker.pinned_transport(object.id)
end
- pinned_transport || (Voice::Livekit.available_for?(object) ? "livekit" : "mesh")
+ pinned_transport || (Live::Livekit.available_for?(object) ? "livekit" : "mesh")
end
# Not gated per user: an active recording is something everyone who can
@@ -191,7 +191,7 @@ module Voice
if directory_entry
directory_entry.recording
else
- Voice::RecordingManager.status(object.id)
+ Live::RecordingManager.status(object.id)
end
end
@@ -214,7 +214,7 @@ module Voice
if directory_entry
directory_entry.participant_users
else
- Voice::ParticipantTracker.list(object.id)
+ Live::ParticipantTracker.list(object.id)
end
end
@@ -225,7 +225,7 @@ module Voice
if directory_entry
directory_entry.participant_metadata
else
- Voice::ParticipantTracker.get_all_metadata(object.id)
+ Live::ParticipantTracker.get_all_metadata(object.id)
end
end
diff --git a/plugins/voice/app/serializers/reviewable_voice_user_serializer.rb b/plugins/live/app/serializers/reviewable_live_user_serializer.rb
similarity index 68%
rename from plugins/voice/app/serializers/reviewable_voice_user_serializer.rb
rename to plugins/live/app/serializers/reviewable_live_user_serializer.rb
index 469dd93e4e5..faa34c20be5 100644
--- a/plugins/voice/app/serializers/reviewable_voice_user_serializer.rb
+++ b/plugins/live/app/serializers/reviewable_live_user_serializer.rb
@@ -2,7 +2,7 @@
require_dependency "reviewable_serializer"
-class ReviewableVoiceUserSerializer < ReviewableSerializer
+class ReviewableLiveUserSerializer < ReviewableSerializer
payload_attributes :message, :room_id, :room_name, :room_slug
attributes :room_url
@@ -11,6 +11,6 @@ class ReviewableVoiceUserSerializer < ReviewableSerializer
end
def room_url
- "/voice/r/#{object.payload["room_slug"]}"
+ "/live/r/#{object.payload["room_slug"]}"
end
end
diff --git a/plugins/voice/app/services/voice/agent_bot.rb b/plugins/live/app/services/live/agent_bot.rb
similarity index 70%
rename from plugins/voice/app/services/voice/agent_bot.rb
rename to plugins/live/app/services/live/agent_bot.rb
index b8a00cdb0d2..c8912d1ea8c 100644
--- a/plugins/voice/app/services/voice/agent_bot.rb
+++ b/plugins/live/app/services/live/agent_bot.rb
@@ -1,19 +1,19 @@
# frozen_string_literal: true
-module Voice
+module Live
class AgentBot
USERNAME = "livekit_agent_bot"
STORE_KEY = "livekit_agent_bot_id"
def self.user
- id = PluginStore.get("voice", STORE_KEY).to_i
+ id = PluginStore.get("live", STORE_KEY).to_i
User.find_by(id:) if id < -1
end
def self.ensure!
- return unless SiteSetting.voice_livekit_agent_enabled
+ return unless SiteSetting.live_livekit_agent_enabled
- DistributedMutex.synchronize("voice:agent_bot") do
+ DistributedMutex.synchronize("live:agent_bot") do
user ||
User.transaction do
bot =
@@ -26,7 +26,7 @@ module Voice
approved: true,
trust_level: TrustLevel[1],
)
- PluginStore.set("voice", STORE_KEY, bot.id)
+ PluginStore.set("live", STORE_KEY, bot.id)
bot
end
end
@@ -34,7 +34,7 @@ module Voice
def self.available?
bot = user
- SiteSetting.voice_livekit_agent_enabled && Livekit.cloud? && Livekit.configured? &&
+ SiteSetting.live_livekit_agent_enabled && Livekit.cloud? && Livekit.configured? &&
bot&.active? && !bot.suspended?
end
end
diff --git a/plugins/voice/app/services/voice/agent_dispatcher.rb b/plugins/live/app/services/live/agent_dispatcher.rb
similarity index 96%
rename from plugins/voice/app/services/voice/agent_dispatcher.rb
rename to plugins/live/app/services/live/agent_dispatcher.rb
index 80f4d3b94c2..055b3a89918 100644
--- a/plugins/voice/app/services/voice/agent_dispatcher.rb
+++ b/plugins/live/app/services/live/agent_dispatcher.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-module Voice
+module Live
class AgentDispatcher
class DispatchError < StandardError
end
@@ -10,7 +10,7 @@ module Voice
raise Discourse::InvalidParameters.new(:agent_name)
end
agent_name = agent_name.strip
- DistributedMutex.synchronize("voice:dispatch:#{room.id}") do
+ DistributedMutex.synchronize("live:dispatch:#{room.id}") do
bot = AgentManager.authorize!(room:)
AgentManager.revoke_session(room.id, bot.id)
session_id = AgentManager.authorize_session!(room:, agent_name:)
@@ -18,7 +18,7 @@ module Voice
"bot_user_id" => bot.id,
"session_id" => session_id,
"agent_name" => agent_name,
- "metadata" => { voice_session_id: session_id }.to_json,
+ "metadata" => { live_session_id: session_id }.to_json,
"created_at" => Time.now.to_i,
}
save(room.id, record)
@@ -144,6 +144,7 @@ module Voice
private_class_method :save
def self.key(room_id)
+ # Pre-rename key, kept so in-flight state survives the deploy.
"voice:agent:dispatches:#{room_id}"
end
private_class_method :key
diff --git a/plugins/voice/app/services/voice/agent_manager.rb b/plugins/live/app/services/live/agent_manager.rb
similarity index 96%
rename from plugins/voice/app/services/voice/agent_manager.rb
rename to plugins/live/app/services/live/agent_manager.rb
index 55ca651e829..cc747de3ef5 100644
--- a/plugins/voice/app/services/voice/agent_manager.rb
+++ b/plugins/live/app/services/live/agent_manager.rb
@@ -1,8 +1,9 @@
# frozen_string_literal: true
-module Voice
+module Live
class AgentManager
SESSION_TTL = 15.minutes
+ # Pre-rename key, kept so in-flight state survives the deploy.
PROVIDER_ROOMS_KEY = "voice:agent:provider_rooms"
class AuthorizationError < StandardError
@@ -11,7 +12,7 @@ module Voice
class << self
def authorize!(room:)
bot = AgentBot.user
- unless Voice.enabled? && AgentBot.available? && room.public? &&
+ unless Live.enabled? && AgentBot.available? && room.public? &&
ParticipantTracker.pinned_transport(room.id) == "livekit" &&
ParticipantTracker.human_user_ids(room.id).any?
raise AuthorizationError
@@ -152,6 +153,7 @@ module Voice
end
def session_key(room_id, user_id)
+ # Pre-rename key, kept so in-flight state survives the deploy.
"voice:agent:session:#{room_id}:#{user_id}"
end
end
diff --git a/plugins/voice/app/services/voice/badge_granter_hooks.rb b/plugins/live/app/services/live/badge_granter_hooks.rb
similarity index 90%
rename from plugins/voice/app/services/voice/badge_granter_hooks.rb
rename to plugins/live/app/services/live/badge_granter_hooks.rb
index 81c768772fb..76447471f01 100644
--- a/plugins/voice/app/services/voice/badge_granter_hooks.rb
+++ b/plugins/live/app/services/live/badge_granter_hooks.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-module Voice
+module Live
class BadgeGranterHooks
def self.on_leave(user, session)
return unless badges_enabled?
@@ -33,13 +33,13 @@ module Voice
grant("Plus One", inviter) if inviter
end
- BADGE_GROUP_NAME = "Voice"
+ BADGE_GROUP_NAME = "Live"
# The site setting is a master switch over the whole grouping. Badges are
# flipped in bulk, so the per-badge save callbacks that keep user badge
# counts consistent run once here instead.
def self.enable_all!
- badges = voice_badges.where(enabled: false)
+ badges = live_badges.where(enabled: false)
return unless badges.exists?
scheduled_badge_ids = badges.where.not(query: nil).pluck(:id)
@@ -49,7 +49,7 @@ module Voice
end
def self.disable_all!
- badges = voice_badges.where(enabled: true)
+ badges = live_badges.where(enabled: true)
return unless badges.exists?
badges.update_all(enabled: false)
@@ -92,7 +92,7 @@ module Voice
other_ids = participants.map(&:id) - [user.id]
return false if other_ids.empty?
- Voice::CoPresence
+ Live::CoPresence
.where("(user_id_1 = :uid OR user_id_2 = :uid)", uid: user.id)
.where("(user_id_1 IN (:others) OR user_id_2 IN (:others))", others: other_ids)
.none?
@@ -103,7 +103,7 @@ module Voice
time.in_time_zone(tz).hour
end
- def voice_badges
+ def live_badges
Badge.joins(:badge_grouping).where(badge_groupings: { name: BADGE_GROUP_NAME })
end
@@ -115,8 +115,8 @@ module Voice
# Every badge here is derived from analytics sessions, so without them
# nothing can be earned.
def badges_enabled?
- SiteSetting.enable_badges && SiteSetting.voice_enabled &&
- SiteSetting.voice_badges_enabled && SiteSetting.voice_analytics_enabled
+ SiteSetting.enable_badges && SiteSetting.live_enabled && SiteSetting.live_badges_enabled &&
+ SiteSetting.live_analytics_enabled
end
end
end
diff --git a/plugins/voice/app/services/voice/chat_session.rb b/plugins/live/app/services/live/chat_session.rb
similarity index 93%
rename from plugins/voice/app/services/voice/chat_session.rb
rename to plugins/live/app/services/live/chat_session.rb
index 38300c938f5..30548f92720 100644
--- a/plugins/voice/app/services/voice/chat_session.rb
+++ b/plugins/live/app/services/live/chat_session.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
-module Voice
- # Bridges a voice room to the Discourse chat plugin.
+module Live
+ # Bridges a live room to the Discourse chat plugin.
#
# A room is linked to a chat channel; each "chat session" lives in a thread on
# that channel. A session's thread is only created when someone actually sends
@@ -10,7 +10,7 @@ module Voice
# after the room.
#
# From then on participants read and post through chat's own UI and API;
- # Voice only tracks WHICH thread is the room's live session.
+ # Live only tracks WHICH thread is the room's live session.
#
# The live thread id lives in Redis, keyed by room. Liveness is derived from
# two sources: the timestamp of the thread's most recent chat message
@@ -28,12 +28,13 @@ module Voice
class Error < StandardError
end
+ # Pre-rename key, kept so in-flight state survives the deploy.
KEY_NAMESPACE = "voice:room"
SAFETY_TTL = 1.day.to_i
class << self
def chat_available?
- defined?(::Chat) && SiteSetting.voice_chat_enabled && SiteSetting.chat_enabled
+ defined?(::Chat) && SiteSetting.live_chat_enabled && SiteSetting.chat_enabled
end
# Whether the current user can use chat in this room (chat installed +
@@ -164,9 +165,9 @@ module Voice
room.chat_channel ||
raise(
Discourse::InvalidAccess.new(
- :voice_chat_unavailable,
+ :live_chat_unavailable,
nil,
- custom_message: "voice.errors.chat_unavailable",
+ custom_message: "live.errors.chat_unavailable",
),
)
end
@@ -203,7 +204,7 @@ module Voice
# and a miss would be cached as "not a session thread". Unlike the
# Redis pointer, the marker outlives the session, tracing any past
# session thread back to its room.
- thread.upsert_custom_fields(Voice::THREAD_ROOM_ID_FIELD => room.id)
+ thread.upsert_custom_fields(Live::THREAD_ROOM_ID_FIELD => room.id)
store_thread(room, thread.id)
publish_state(room)
@@ -239,12 +240,12 @@ module Voice
def ensure_threading_enabled!(channel)
return if channel.threading_enabled?
- raise Error, I18n.t("voice.errors.chat_threading_disabled")
+ raise Error, I18n.t("live.errors.chat_threading_disabled")
end
def raise_unless_chat_success(result)
return if result.success?
- Voice.warn("[voice] chat operation failed")
+ Live.warn("[live] chat operation failed")
raise Error, chat_failure_message(result)
end
@@ -257,8 +258,7 @@ module Voice
if record.respond_to?(:errors) && record.errors.present?
return record.errors.full_messages.to_sentence
end
- Service::StepsInspector.new(result).error.presence ||
- I18n.t("voice.errors.chat_unavailable")
+ Service::StepsInspector.new(result).error.presence || I18n.t("live.errors.chat_unavailable")
end
# Publishes a content-free "something changed" signal, not the state
@@ -269,7 +269,7 @@ module Voice
# `available_for?` for the requesting user on every call.
def publish_state(room)
MessageBus.publish(
- Voice.room_chat_channel(room.id),
+ Live.room_chat_channel(room.id),
{ type: "updated" },
**message_bus_targets(room),
)
@@ -280,7 +280,7 @@ module Voice
# member still sees the panel follow along.
def message_bus_targets(room)
targets = room.message_bus_targets
- participant_ids = Voice::ParticipantTracker.user_ids(room.id)
+ participant_ids = Live::ParticipantTracker.user_ids(room.id)
return targets if participant_ids.empty?
targets.merge(user_ids: Array(targets[:user_ids] || []) | participant_ids)
end
@@ -340,14 +340,14 @@ module Voice
# so user text containing tokens like %{room} or gsub escapes is safe.
def opener_for(room, message)
I18n.t(
- "voice.chat.default_thread_opener",
- room: "##{room.slug}::#{Voice::RoomHashtagDataSource.type}",
+ "live.chat.default_thread_opener",
+ room: "##{room.slug}::#{Live::RoomHashtagDataSource.type}",
message: message,
)
end
def title_for(room)
- I18n.t("voice.chat.default_thread_title", room: room.name.to_s).strip
+ I18n.t("live.chat.default_thread_title", room: room.name.to_s).strip
end
def redis
diff --git a/plugins/voice/app/services/voice/control_plane_limiter.rb b/plugins/live/app/services/live/control_plane_limiter.rb
similarity index 90%
rename from plugins/voice/app/services/voice/control_plane_limiter.rb
rename to plugins/live/app/services/live/control_plane_limiter.rb
index 3908d64ba5e..b16a25673c7 100644
--- a/plugins/voice/app/services/voice/control_plane_limiter.rb
+++ b/plugins/live/app/services/live/control_plane_limiter.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-module Voice
+module Live
# Fixed-window weighted rate limiter. Unlike core RateLimiter, one call can
# consume several units of budget — a signal request is accounted by the
# events it relays, not by being a single HTTP request — so burst-heavy but
@@ -11,7 +11,7 @@ module Voice
return if RateLimiter.disabled?
redis = Discourse.redis.without_namespace
- redis_key = Discourse.redis.namespace_key("voice-budget:#{key}")
+ redis_key = Discourse.redis.namespace_key("live-budget:#{key}")
count = redis.incrby(redis_key, weight)
ttl = redis.ttl(redis_key)
diff --git a/plugins/voice/app/services/voice/default_room_seeder.rb b/plugins/live/app/services/live/default_room_seeder.rb
similarity index 67%
rename from plugins/voice/app/services/voice/default_room_seeder.rb
rename to plugins/live/app/services/live/default_room_seeder.rb
index 2d98dd5f302..d2698938598 100644
--- a/plugins/voice/app/services/voice/default_room_seeder.rb
+++ b/plugins/live/app/services/live/default_room_seeder.rb
@@ -1,14 +1,14 @@
# frozen_string_literal: true
-module Voice
+module Live
class DefaultRoomSeeder
DEFAULT_NAME = "Watercooler"
- MUTEX = "voice-default-room-seeder"
+ MUTEX = "live-default-room-seeder"
def self.ensure!
- return unless SiteSetting.voice_enabled?
+ return unless SiteSetting.live_enabled?
return unless schema_ready?
- return if Voice::Room.persistent.exists?
+ return if Live::Room.persistent.exists?
# Runs at plugin activation, which can precede pending migrations (dev
# DBs, rake db:migrate itself) — and Room queries the newest columns.
@@ -21,17 +21,17 @@ module Voice
end
DistributedMutex.synchronize(MUTEX) do
- next if Voice::Room.persistent.exists?
+ next if Live::Room.persistent.exists?
room =
- Voice::Room.create!(
+ Live::Room.create!(
name: DEFAULT_NAME,
- description: I18n.t("voice.defaults.watercooler_description"),
+ description: I18n.t("live.defaults.watercooler_description"),
public: true,
creator: Discourse.system_user,
)
- Voice::DirectoryBroadcaster.broadcast(action: :created, room: room)
+ Live::DirectoryBroadcaster.broadcast(action: :created, room: room)
end
end
@@ -41,8 +41,8 @@ module Voice
return true if @schema_ready[site]
connection = ActiveRecord::Base.connection
- @schema_ready[site] = connection.table_exists?(:voice_rooms) &&
- connection.column_exists?(:voice_rooms, :ephemeral)
+ @schema_ready[site] = connection.table_exists?(:live_rooms) &&
+ connection.column_exists?(:live_rooms, :ephemeral)
end
private_class_method :schema_ready?
end
diff --git a/plugins/voice/app/services/voice/directory_broadcaster.rb b/plugins/live/app/services/live/directory_broadcaster.rb
similarity index 90%
rename from plugins/voice/app/services/voice/directory_broadcaster.rb
rename to plugins/live/app/services/live/directory_broadcaster.rb
index db459f2a6f9..7981082ee68 100644
--- a/plugins/voice/app/services/voice/directory_broadcaster.rb
+++ b/plugins/live/app/services/live/directory_broadcaster.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-module Voice
+module Live
class DirectoryBroadcaster
def self.broadcast(action:, room:)
new(room, action).broadcast
@@ -14,7 +14,7 @@ module Voice
@action = action
@targets =
if room.public?
- Voice.public_room_message_bus_targets
+ Live.public_room_message_bus_targets
else
{ user_ids: room.member_ids }
end
@@ -30,11 +30,11 @@ module Voice
return if targets[:user_ids] == []
MessageBus.publish(
- Voice.room_index_channel,
+ Live.room_index_channel,
{
type: action,
room:
- Voice::RoomSerializer
+ Live::RoomSerializer
.new(room, scope: Guardian.new(nil), root: false)
.as_json
.except(:can_manage, :can_invite, :membership),
diff --git a/plugins/voice/app/services/voice/ephemeral_room_manager.rb b/plugins/live/app/services/live/ephemeral_room_manager.rb
similarity index 80%
rename from plugins/voice/app/services/voice/ephemeral_room_manager.rb
rename to plugins/live/app/services/live/ephemeral_room_manager.rb
index 1dc42a76d20..b26c80d7d1f 100644
--- a/plugins/voice/app/services/voice/ephemeral_room_manager.rb
+++ b/plugins/live/app/services/live/ephemeral_room_manager.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-module Voice
+module Live
# Backend API for ephemeral rooms: short-lived rooms created by other
# features (a direct call between two users, a scheduled event's stage)
# rather than by a user filling in the room form. They never appear in the
@@ -22,17 +22,17 @@ module Voice
# The count and create must not be raceable, or concurrent call
# attempts could blow past the cap.
- DistributedMutex.synchronize("voice-ephemeral-rooms-#{creator.id}") do
- if Voice::Room.ephemeral.where(creator_id: creator.id).count >= MAX_LIVE_ROOMS_PER_CREATOR
+ DistributedMutex.synchronize("live-ephemeral-rooms-#{creator.id}") do
+ if Live::Room.ephemeral.where(creator_id: creator.id).count >= MAX_LIVE_ROOMS_PER_CREATOR
raise Discourse::InvalidAccess.new(
- :voice_ephemeral_room_limit,
+ :live_ephemeral_room_limit,
nil,
- custom_message: "voice.errors.ephemeral_room_limit",
+ custom_message: "live.errors.ephemeral_room_limit",
)
end
room =
- Voice::Room.create!(
+ Live::Room.create!(
ephemeral: true,
creator: creator,
name: name,
@@ -60,10 +60,10 @@ module Voice
# between creation and the first join, and a call where everyone's
# presence briefly lapses at once.
def self.cleanup!
- ttl = SiteSetting.voice_ephemeral_room_ttl_minutes.minutes
+ ttl = SiteSetting.live_ephemeral_room_ttl_minutes.minutes
- Voice::Room.ephemeral.find_each do |room|
- if Voice::ParticipantTracker.human_user_ids(room.id).any?
+ Live::Room.ephemeral.find_each do |room|
+ if Live::ParticipantTracker.human_user_ids(room.id).any?
room.update_column(:last_occupied_at, Time.current)
elsif (room.last_occupied_at || room.created_at) < ttl.ago
destroy!(room)
@@ -77,8 +77,8 @@ module Voice
raise Discourse::InvalidParameters.new(:room) unless room.ephemeral?
room.destroy!
- Voice::Livekit::RoomServiceClient.delete_room(room)
- Voice::ParticipantTracker.clear(room.id)
+ Live::Livekit::RoomServiceClient.delete_room(room)
+ Live::ParticipantTracker.clear(room.id)
end
end
end
diff --git a/plugins/voice/app/services/voice/participant_tracker.rb b/plugins/live/app/services/live/participant_tracker.rb
similarity index 96%
rename from plugins/voice/app/services/voice/participant_tracker.rb
rename to plugins/live/app/services/live/participant_tracker.rb
index 3d3a785002c..b2eedabb3ac 100644
--- a/plugins/voice/app/services/voice/participant_tracker.rb
+++ b/plugins/live/app/services/live/participant_tracker.rb
@@ -1,7 +1,8 @@
# frozen_string_literal: true
-module Voice
+module Live
class ParticipantTracker
+ # Pre-rename key, kept so in-flight state survives the deploy.
KEY_NAMESPACE = "voice:room"
RECENTLY_ACTIVE_ROOMS_KEY = "voice:recently_active_rooms"
SAFETY_TTL = 30.minutes.to_i
@@ -67,7 +68,7 @@ module Voice
# snapshot cannot restore presence after a moderator has revoked it.
def commit_agent(room_id, user_id, session_key:, proof:, ttl:, metadata:, sid:)
score =
- Time.now.to_f + [AGENT_PRESENCE_TTL - SiteSetting.voice_participant_ttl_seconds, 0].max
+ Time.now.to_f + [AGENT_PRESENCE_TTL - SiteSetting.live_participant_ttl_seconds, 0].max
keys = [session_key, key(room_id), metadata_key(room_id), livekit_sid_key(room_id)]
committed =
COMMIT_AGENT.eval(
@@ -95,7 +96,7 @@ module Voice
score = Time.now.to_f
# Agents are verified by the minute sweep, not browser heartbeats.
score += [
- AGENT_PRESENCE_TTL - SiteSetting.voice_participant_ttl_seconds,
+ AGENT_PRESENCE_TTL - SiteSetting.live_participant_ttl_seconds,
0,
].max if user_id.to_i.negative?
redis.zadd(key(room_id), score, user_id)
@@ -117,7 +118,7 @@ module Voice
return :full if user_id.to_i <= 0
now = Time.now.to_f
- cutoff = now - SiteSetting.voice_participant_ttl_seconds
+ cutoff = now - SiteSetting.live_participant_ttl_seconds
result =
ADD_WITHIN_CAPACITY.eval(
redis.without_namespace,
@@ -177,7 +178,7 @@ module Voice
# 2x the presence TTL (like the transport pin) so a briefly-lapsed
# heartbeat can still self-heal presence before the session dies.
def participant_session_ttl
- SiteSetting.voice_participant_ttl_seconds.to_i * 2
+ SiteSetting.live_participant_ttl_seconds.to_i * 2
end
# Short-lived tombstone for a deliberate departure (leave/kick), letting
@@ -230,7 +231,7 @@ module Voice
return false if score.nil?
return false if user_id.to_i.positive? && gone_at && score > gone_at.to_f
- expired_score = Time.now.to_f - SiteSetting.voice_participant_ttl_seconds - 1
+ expired_score = Time.now.to_f - SiteSetting.live_participant_ttl_seconds - 1
redis.zadd(key(room_id), [score, expired_score].min, user_id, xx: true)
touch_recently_active(room_id)
true
@@ -245,7 +246,7 @@ module Voice
room_ids = room_ids.map(&:to_i).uniq
return {} if room_ids.empty?
- cutoff = Time.now.to_f - SiteSetting.voice_participant_ttl_seconds
+ cutoff = Time.now.to_f - SiteSetting.live_participant_ttl_seconds
participant_futures = {}
metadata_futures = {}
scalar_future = nil
@@ -285,7 +286,7 @@ module Voice
end
def user_ids(room_id, migrated: false)
- cutoff = Time.now.to_f - SiteSetting.voice_participant_ttl_seconds
+ cutoff = Time.now.to_f - SiteSetting.live_participant_ttl_seconds
redis.zrangebyscore(key(room_id), cutoff, "+inf").map(&:to_i).reject(&:zero?)
rescue Redis::CommandError => e
raise if e.message.exclude?("WRONGTYPE") || migrated
@@ -420,7 +421,7 @@ module Voice
end
def transport_pin_ttl
- SiteSetting.voice_participant_ttl_seconds.to_i * 2
+ SiteSetting.live_participant_ttl_seconds.to_i * 2
end
def touch_recently_active(room_id)
diff --git a/plugins/voice/app/services/voice/recording_manager.rb b/plugins/live/app/services/live/recording_manager.rb
similarity index 76%
rename from plugins/voice/app/services/voice/recording_manager.rb
rename to plugins/live/app/services/live/recording_manager.rb
index 4c3081b815e..bf5c9aa3f47 100644
--- a/plugins/voice/app/services/voice/recording_manager.rb
+++ b/plugins/live/app/services/live/recording_manager.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-module Voice
+module Live
# Starts and stops server-side recordings of a room's live call and owns
# the room-wide "this call is being recorded" state. Recording is a LiveKit
# egress, so it only exists for calls pinned to that transport; the live
@@ -29,14 +29,14 @@ module Voice
class << self
def available_for?(room)
- SiteSetting.voice_livekit_recording_enabled &&
- Voice::ParticipantTracker.pinned_transport(room.id) == "livekit"
+ SiteSetting.live_livekit_recording_enabled &&
+ Live::ParticipantTracker.pinned_transport(room.id) == "livekit"
end
# Public shape shared by the serializer, the broadcasts, and the
# start endpoint's response.
def status(room_id)
- status_from_info(Voice::ParticipantTracker.recording(room_id))
+ status_from_info(Live::ParticipantTracker.recording(room_id))
end
def status_from_info(info)
@@ -52,29 +52,29 @@ module Voice
end
def start!(room, user)
- raise Error, I18n.t("voice.errors.recording_unavailable") unless available_for?(room)
- if Voice::ParticipantTracker.recording(room.id)
- raise Error, I18n.t("voice.errors.recording_already_active")
+ raise Error, I18n.t("live.errors.recording_unavailable") unless available_for?(room)
+ if Live::ParticipantTracker.recording(room.id)
+ raise Error, I18n.t("live.errors.recording_already_active")
end
# The random suffix makes the storage path a capability: the final
# URL is only ever shared with the requester, so it must not be
# derivable from public facts like the room name and start time.
- filepath = "#{SiteSetting.voice_livekit_recording_filepath}-#{SecureRandom.hex(8)}"
+ filepath = "#{SiteSetting.live_livekit_recording_filepath}-#{SecureRandom.hex(8)}"
- result = Voice::Livekit::EgressClient.start_room_composite(room, filepath: filepath)
- raise Error, I18n.t("voice.errors.recording_failed") unless result[:ok]
+ result = Live::Livekit::EgressClient.start_room_composite(room, filepath: filepath)
+ raise Error, I18n.t("live.errors.recording_failed") unless result[:ok]
egress_id = result[:data]["egress_id"] || result[:data]["egressId"]
started_at = Time.zone.now
- Voice::Recording.create!(
+ Live::Recording.create!(
room: room,
started_by: user,
egress_id: egress_id,
filepath: filepath,
started_at: started_at,
)
- Voice::ParticipantTracker.set_recording(
+ Live::ParticipantTracker.set_recording(
room.id,
egress_id: egress_id,
user_id: user.id,
@@ -86,17 +86,17 @@ module Voice
end
def stop!(room)
- info = Voice::ParticipantTracker.recording(room.id)
- raise Error, I18n.t("voice.errors.recording_not_active") if info.nil?
+ info = Live::ParticipantTracker.recording(room.id)
+ raise Error, I18n.t("live.errors.recording_not_active") if info.nil?
- result = Voice::Livekit::EgressClient.stop(info[:egress_id])
+ result = Live::Livekit::EgressClient.stop(info[:egress_id])
# A failed stop keeps the state: the egress may well still be
# capturing, and claiming otherwise is worse than asking the
# moderator to retry. The egress_ended webhook and the state's TTL
# clean up an egress that already ended on its own.
- raise Error, I18n.t("voice.errors.recording_stop_failed") unless result[:ok]
+ raise Error, I18n.t("live.errors.recording_stop_failed") unless result[:ok]
- Voice::ParticipantTracker.clear_recording(room.id)
+ Live::ParticipantTracker.clear_recording(room.id)
broadcast(room)
end
@@ -106,17 +106,17 @@ module Voice
# requester, then clears any still-live room state.
def handle_egress_ended(room, egress_info)
egress_id = (egress_info["egress_id"] || egress_info["egressId"]).to_s
- recording = Voice::Recording.find_by(egress_id: egress_id)
+ recording = Live::Recording.find_by(egress_id: egress_id)
if recording&.recording?
finalize_recording(recording, egress_info)
deliver_recording(recording) if recording.completed?
end
- info = Voice::ParticipantTracker.recording(room.id)
+ info = Live::ParticipantTracker.recording(room.id)
return if info.nil? || info[:egress_id] != egress_id
- Voice::ParticipantTracker.clear_recording(room.id)
+ Live::ParticipantTracker.clear_recording(room.id)
broadcast(room)
end
@@ -126,11 +126,11 @@ module Voice
# carries, so a finished egress goes through the exact same
# finalize-and-deliver path.
def reconcile_pending!
- Voice::Recording
+ Live::Recording
.recording
.includes(:room)
.find_each do |recording|
- result = Voice::Livekit::EgressClient.list(egress_id: recording.egress_id)
+ result = Live::Livekit::EgressClient.list(egress_id: recording.egress_id)
next unless result[:ok]
info = Array(result[:data]["items"]).first
@@ -171,16 +171,16 @@ module Voice
body_key =
if recording.location.present?
- "voice.recording_ready_pm.body_with_link"
+ "live.recording_ready_pm.body_with_link"
else
- "voice.recording_ready_pm.body_with_path"
+ "live.recording_ready_pm.body_with_path"
end
PostCreator.create!(
Discourse.system_user,
archetype: Archetype.private_message,
target_usernames: requester.username,
- title: I18n.t("voice.recording_ready_pm.title", room_name: recording.room.name),
+ title: I18n.t("live.recording_ready_pm.title", room_name: recording.room.name),
raw:
I18n.t(
body_key,
@@ -194,14 +194,14 @@ module Voice
rescue StandardError => e
# Delivery is best-effort: the recording is safe and listed in the
# admin panel even when the PM cannot be created.
- Voice.warn(
- "[voice-livekit] recording PM failed for recording #{recording.id}: " \
+ Live.warn(
+ "[live-livekit] recording PM failed for recording #{recording.id}: " \
"#{e.class}",
)
end
def format_duration(duration_ms)
- return I18n.t("voice.recording_ready_pm.unknown_duration") if duration_ms.blank?
+ return I18n.t("live.recording_ready_pm.unknown_duration") if duration_ms.blank?
total_seconds = duration_ms / 1000
minutes, seconds = total_seconds.divmod(60)
@@ -214,7 +214,7 @@ module Voice
end
def broadcast(room)
- Voice::RoomBroadcaster.new(room).publish_room(
+ Live::RoomBroadcaster.new(room).publish_room(
{ type: "recording", recording: status(room.id) },
)
end
diff --git a/plugins/voice/app/services/voice/review_queue.rb b/plugins/live/app/services/live/review_queue.rb
similarity index 81%
rename from plugins/voice/app/services/voice/review_queue.rb
rename to plugins/live/app/services/live/review_queue.rb
index aa1a330e66a..f876e966cf4 100644
--- a/plugins/voice/app/services/voice/review_queue.rb
+++ b/plugins/live/app/services/live/review_queue.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-module Voice
+module Live
# Mirrors Chat::ReviewQueue for flags raised against a room participant.
# Only the "something else" (notify_moderators) flag is supported: rooms
# have no post or message to attach a canned flag reason to, so every flag
@@ -10,19 +10,19 @@ module Voice
def flag_user(room, target_user, guardian, flag_type_id, opts = {})
result = { success: false, errors: [] }
- guardian.ensure_can_flag_voice_user!(room, target_user)
+ guardian.ensure_can_flag_live_user!(room, target_user)
- session = Voice::Session.where(room: room, user: target_user).order(joined_at: :desc).first
+ session = Live::Session.where(room: room, user: target_user).order(joined_at: :desc).first
if session.blank?
- result[:errors] << I18n.t("voice.errors.flag_target_never_joined")
+ result[:errors] << I18n.t("live.errors.flag_target_never_joined")
return result
end
existing_reviewable = Reviewable.includes(:reviewable_scores).find_by(target: session)
if !can_flag_again?(existing_reviewable, guardian.user)
- result[:errors] << I18n.t("voice.errors.flag_already_handled")
+ result[:errors] << I18n.t("live.errors.flag_already_handled")
return result
end
@@ -35,7 +35,7 @@ module Voice
end
reviewable =
- ReviewableVoiceUser.needs_review!(
+ ReviewableLiveUser.needs_review!(
created_by: guardian.user,
target: session,
reviewable_by_moderator: true,
@@ -67,18 +67,18 @@ module Voice
def companion_pm_creator(room, target_user, flagger, opts)
title =
I18n.t(
- "voice.reviewable_score_types.notify_moderators.pm_title",
+ "live.reviewable_score_types.notify_moderators.pm_title",
username: target_user.username,
locale: SiteSetting.default_locale,
)
body =
I18n.t(
- "voice.reviewable_score_types.notify_moderators.pm_body",
+ "live.reviewable_score_types.notify_moderators.pm_body",
message: opts[:message],
username: target_user.username,
room_name: room.name,
- link: "#{Discourse.base_url}/voice/r/#{room.slug}",
+ link: "#{Discourse.base_url}/live/r/#{room.slug}",
locale: SiteSetting.default_locale,
)
diff --git a/plugins/voice/app/services/voice/room_broadcaster.rb b/plugins/live/app/services/live/room_broadcaster.rb
similarity index 80%
rename from plugins/voice/app/services/voice/room_broadcaster.rb
rename to plugins/live/app/services/live/room_broadcaster.rb
index 0ae96eaaf40..3fd9640cddf 100644
--- a/plugins/voice/app/services/voice/room_broadcaster.rb
+++ b/plugins/live/app/services/live/room_broadcaster.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-module Voice
+module Live
class RoomBroadcaster
def self.publish_participants(room)
new(room).publish_participants
@@ -37,14 +37,14 @@ module Voice
# or screen-audio track from this, not from its own rights. Every roster
# a client can seed from goes through here so none of them lacks them.
def self.participant_entries(room, users, guardian:, metadata:)
- entitlements = Voice::MediaEntitlements.for_users(room, users)
+ entitlements = Live::MediaEntitlements.for_users(room, users)
users.map do |user|
BasicUserSerializer
.new(user, scope: guardian, root: false)
.as_json
.merge(metadata[user.id] || {})
- .merge(entitlements[user.id] || Voice::MediaEntitlements::NONE)
+ .merge(entitlements[user.id] || Live::MediaEntitlements::NONE)
end
end
@@ -59,17 +59,17 @@ module Voice
participants:
self.class.participant_entries(
room,
- Voice::ParticipantTracker.list(room.id),
+ Live::ParticipantTracker.list(room.id),
guardian: Guardian.new(nil),
- metadata: Voice::ParticipantTracker.get_all_metadata(room.id),
+ metadata: Live::ParticipantTracker.get_all_metadata(room.id),
),
}
- MessageBus.publish(Voice.room_channel(room.id), payload, **room_message_bus_targets)
+ MessageBus.publish(Live.room_channel(room.id), payload, **room_message_bus_targets)
# Keep the stored fingerprint in sync so the heartbeat backstop doesn't
# redundantly re-broadcast the state we just sent.
- Voice::ParticipantTracker.update_fingerprint(room.id, fingerprint)
+ Live::ParticipantTracker.update_fingerprint(room.id, fingerprint)
end
# Backstop for ghosts left by abrupt disconnects (refresh, tab close,
@@ -77,8 +77,8 @@ module Voice
# compares the live membership/state against the last broadcast and emits a
# single participants broadcast when — and only when — something changed.
def publish_participants_if_changed
- fingerprint = Voice::ParticipantTracker.participants_fingerprint(room.id)
- previous = Voice::ParticipantTracker.swap_fingerprint(room.id, fingerprint)
+ fingerprint = Live::ParticipantTracker.participants_fingerprint(room.id)
+ previous = Live::ParticipantTracker.swap_fingerprint(room.id, fingerprint)
return if previous == fingerprint
publish_participants(fingerprint: fingerprint)
@@ -86,7 +86,7 @@ module Voice
def publish_room(payload)
MessageBus.publish(
- Voice.room_channel(room.id),
+ Live.room_channel(room.id),
payload.merge(room_id: room.id),
**room_message_bus_targets,
)
@@ -94,18 +94,18 @@ module Voice
def publish_kick(user_id)
MessageBus.publish(
- Voice.room_channel(room.id),
+ Live.room_channel(room.id),
{ type: "kicked", room_id: room.id },
user_ids: [user_id],
)
end
def publish_role_change(user_id, new_role)
- participant_ids = Voice::ParticipantTracker.user_ids(room.id)
+ participant_ids = Live::ParticipantTracker.user_ids(room.id)
return if participant_ids.empty?
MessageBus.publish(
- Voice.room_channel(room.id),
+ Live.room_channel(room.id),
{ type: "role_change", room_id: room.id, user_id: user_id, role: new_role },
user_ids: participant_ids,
)
@@ -114,11 +114,11 @@ module Voice
# Lightweight event alongside the authoritative participants broadcast, so
# clients can toast on raises/dismissals without diffing rosters.
def publish_hand_raise(user_id, raised:, raised_at: nil, reason: nil)
- participant_ids = Voice::ParticipantTracker.user_ids(room.id)
+ participant_ids = Live::ParticipantTracker.user_ids(room.id)
return if participant_ids.empty?
MessageBus.publish(
- Voice.room_channel(room.id),
+ Live.room_channel(room.id),
{
type: "hand_raise",
room_id: room.id,
@@ -141,7 +141,7 @@ module Voice
# it would restrict delivery to just those users.
return targets if targets.blank?
- participant_ids = Voice::ParticipantTracker.user_ids(room.id)
+ participant_ids = Live::ParticipantTracker.user_ids(room.id)
return targets if participant_ids.empty?
targets.merge(user_ids: Array(targets[:user_ids] || []) | participant_ids)
diff --git a/plugins/voice/app/services/voice/room_directory_preloader.rb b/plugins/live/app/services/live/room_directory_preloader.rb
similarity index 85%
rename from plugins/voice/app/services/voice/room_directory_preloader.rb
rename to plugins/live/app/services/live/room_directory_preloader.rb
index 32c05bc5cf8..366e78cb92b 100644
--- a/plugins/voice/app/services/voice/room_directory_preloader.rb
+++ b/plugins/live/app/services/live/room_directory_preloader.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-module Voice
+module Live
class RoomDirectoryPreloader
Entry =
Data.define(
@@ -23,9 +23,9 @@ module Voice
room_ids = @rooms.map(&:id)
return {} if room_ids.empty?
- channels_by_room_id = room_ids.to_h { |room_id| [room_id, Voice.room_channel(room_id)] }
+ channels_by_room_id = room_ids.to_h { |room_id| [room_id, Live.room_channel(room_id)] }
last_ids = MessageBus.last_ids(*channels_by_room_id.values)
- room_states = Voice::ParticipantTracker.room_states(room_ids)
+ room_states = Live::ParticipantTracker.room_states(room_ids)
users_by_id =
User.where(id: room_states.values.flat_map(&:participant_ids).uniq).index_by(&:id)
@@ -39,7 +39,7 @@ module Voice
participant_users: state.participant_ids.filter_map { |user_id| users_by_id[user_id] },
participant_metadata: state.participant_metadata,
pinned_transport: state.pinned_transport,
- recording: Voice::RecordingManager.status_from_info(state.recording_info),
+ recording: Live::RecordingManager.status_from_info(state.recording_info),
),
]
end
diff --git a/plugins/voice/app/services/voice/room_inviter.rb b/plugins/live/app/services/live/room_inviter.rb
similarity index 84%
rename from plugins/voice/app/services/voice/room_inviter.rb
rename to plugins/live/app/services/live/room_inviter.rb
index ca92141b2b4..6acef20c38a 100644
--- a/plugins/voice/app/services/voice/room_inviter.rb
+++ b/plugins/live/app/services/live/room_inviter.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-module Voice
+module Live
# Delivers room invites: records them (so redeemed ones can award badges),
# grants private-room invitees a membership, and notifies each invitee in
# Discourse and via web push.
@@ -30,17 +30,17 @@ module Voice
def invite!
return if @user.id == @inviter.id || @user.bot?
- return unless @user.guardian.can_access_voice?
+ return unless @user.guardian.can_access_live?
ensure_membership! unless @room.public?
- return unless @user.guardian.can_join_voice_room?(@room)
+ return unless @user.guardian.can_join_live_room?(@room)
invite =
- Voice::Invite.create_or_find_by(
+ Live::Invite.create_or_find_by(
room_id: @room.id,
user_id: @user.id,
invited_by_id: @inviter.id,
- ) { |new_invite| new_invite.source = Voice::Invite::SOURCES[:notification] }
+ ) { |new_invite| new_invite.source = Live::Invite::SOURCES[:notification] }
# Reported as invited either way: an inviter must not be able to tell
# they are muted, or probe how recently someone else already invited.
@@ -71,22 +71,22 @@ module Voice
# The room page prompts for the invite to be redeemed on an actual join,
# so notification clicks and shared links land on the same URL.
def invite_path
- "/voice/r/#{@room.slug}/invited-by/#{@inviter.username_lower}"
+ "/live/r/#{@room.slug}/invited-by/#{@inviter.username_lower}"
end
def ensure_membership!
@room
.room_memberships
.find_or_create_by!(user: @user) do |membership|
- membership.role = Voice::RoomMembership::ROLE_PARTICIPANT
+ membership.role = Live::RoomMembership::ROLE_PARTICIPANT
end
end
def notify!(invite)
RateLimiter.new(
@inviter,
- "voice-invites-daily",
- SiteSetting.voice_max_invites_per_day,
+ "live-invites-daily",
+ SiteSetting.live_max_invites_per_day,
1.day,
).performed!
@@ -98,7 +98,7 @@ module Voice
calling = @room.ephemeral?
@user.notifications.create!(
- notification_type: Notification.types[:voice_invitation],
+ notification_type: Notification.types[:live_invitation],
high_priority: true,
data: {
room_id: @room.id,
@@ -109,17 +109,17 @@ module Voice
}.compact.to_json,
)
- i18n_scope = calling ? "voice.call_notification" : "voice.invite_notification"
+ i18n_scope = calling ? "live.call_notification" : "live.invite_notification"
payload = nil
I18n.with_locale(@user.effective_locale) do
payload = {
- notification_type: Notification.types[:voice_invitation],
+ notification_type: Notification.types[:live_invitation],
username: @inviter.username,
translated_title:
I18n.t("#{i18n_scope}.title", username: @inviter.username, room_name: @room.name),
excerpt: I18n.t("#{i18n_scope}.excerpt", room_name: @room.name),
post_url: invite_path,
- tag: "#{Discourse.current_hostname}-voice-invite-#{@room.id}",
+ tag: "#{Discourse.current_hostname}-live-invite-#{@room.id}",
}
end
@@ -141,12 +141,12 @@ module Voice
# is waiting once it ends.
ring_devices!(notified_at) unless @user.do_not_disturb?
- Voice::RoomBroadcaster.publish_ringing(@room, @user, notified_at: notified_at)
+ Live::RoomBroadcaster.publish_ringing(@room, @user, notified_at: notified_at)
end
def ring_devices!(notified_at)
MessageBus.publish(
- "/voice/call-ring/#{@user.id}",
+ "/live/call-ring/#{@user.id}",
{
room_id: @room.id,
room_slug: @room.slug,
diff --git a/plugins/voice/app/services/voice/signal_relay.rb b/plugins/live/app/services/live/signal_relay.rb
similarity index 81%
rename from plugins/voice/app/services/voice/signal_relay.rb
rename to plugins/live/app/services/live/signal_relay.rb
index 3bb68e52f84..4047b4f9b72 100644
--- a/plugins/voice/app/services/voice/signal_relay.rb
+++ b/plugins/live/app/services/live/signal_relay.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-module Voice
+module Live
class SignalRelay
def initialize(room)
@room = room
@@ -13,13 +13,13 @@ module Voice
# a provisional participant before the roster broadcast catches up.
def publish!(from:, recipient_id:, events:)
if events.blank? || recipient_id.blank?
- raise Discourse::InvalidParameters.new(I18n.t("voice.errors.missing_payload"))
+ raise Discourse::InvalidParameters.new(I18n.t("live.errors.missing_payload"))
end
- return false unless Voice::ParticipantTracker.participant_session?(room.id, recipient_id)
+ return false unless Live::ParticipantTracker.participant_session?(room.id, recipient_id)
MessageBus.publish(
- Voice.room_channel(room.id),
+ Live.room_channel(room.id),
{
type: "signal",
room_id: room.id,
diff --git a/plugins/voice/app/services/voice/signal_validator.rb b/plugins/live/app/services/live/signal_validator.rb
similarity index 98%
rename from plugins/voice/app/services/voice/signal_validator.rb
rename to plugins/live/app/services/live/signal_validator.rb
index 41bbe50f424..0bf73cd30d5 100644
--- a/plugins/voice/app/services/voice/signal_validator.rb
+++ b/plugins/live/app/services/live/signal_validator.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-module Voice
+module Live
# Parses a signal request body into ordered per-recipient event batches,
# enforcing the signaling schema: only offer/answer/candidate events, exact
# per-type shapes, and hard size/count limits. Any unknown, malformed, or
@@ -141,7 +141,7 @@ module Voice
end
def reject!
- raise Discourse::InvalidParameters.new(I18n.t("voice.errors.invalid_signal"))
+ raise Discourse::InvalidParameters.new(I18n.t("live.errors.invalid_signal"))
end
end
end
diff --git a/plugins/live/app/services/live/statistics.rb b/plugins/live/app/services/live/statistics.rb
new file mode 100644
index 00000000000..fef4482de9f
--- /dev/null
+++ b/plugins/live/app/services/live/statistics.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+module Live
+ class Statistics
+ def self.about_users
+ return {} unless SiteSetting.live_enabled && SiteSetting.live_analytics_enabled
+
+ { "7_days": Live::Session.where("joined_at > ?", 7.days.ago).distinct.count(:user_id) }
+ end
+ end
+end
diff --git a/plugins/voice/app/validators/voice_livekit_agent_validator.rb b/plugins/live/app/validators/live_livekit_agent_validator.rb
similarity index 52%
rename from plugins/voice/app/validators/voice_livekit_agent_validator.rb
rename to plugins/live/app/validators/live_livekit_agent_validator.rb
index 71fbaa518f3..dacfce22a53 100644
--- a/plugins/voice/app/validators/voice_livekit_agent_validator.rb
+++ b/plugins/live/app/validators/live_livekit_agent_validator.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-class VoiceLivekitAgentValidator
+class LiveLivekitAgentValidator
def initialize(opts = {})
end
@@ -8,13 +8,13 @@ class VoiceLivekitAgentValidator
return true unless value.to_s == "t" || value == true
@error_key =
- if !Voice::Livekit.cloud? || !Voice::Livekit.configured?
- "voice_livekit_agent_requires_cloud"
+ if !Live::Livekit.cloud? || !Live::Livekit.configured?
+ "live_livekit_agent_requires_cloud"
elsif User
- .where(username_lower: Voice::AgentBot::USERNAME)
- .where.not(id: Voice::AgentBot.user&.id)
+ .where(username_lower: Live::AgentBot::USERNAME)
+ .where.not(id: Live::AgentBot.user&.id)
.exists?
- "voice_livekit_agent_username_taken"
+ "live_livekit_agent_username_taken"
end
@error_key.nil?
end
diff --git a/plugins/voice/app/validators/voice_livekit_policy_validator.rb b/plugins/live/app/validators/live_livekit_policy_validator.rb
similarity index 51%
rename from plugins/voice/app/validators/voice_livekit_policy_validator.rb
rename to plugins/live/app/validators/live_livekit_policy_validator.rb
index d1cb1573930..e3742cc9d87 100644
--- a/plugins/voice/app/validators/voice_livekit_policy_validator.rb
+++ b/plugins/live/app/validators/live_livekit_policy_validator.rb
@@ -1,10 +1,10 @@
# frozen_string_literal: true
# Refuses any LiveKit room policy other than "disabled" unless the server URL
-# (a valid wss:// origin — see VoiceLivekitUrlValidator), API key, and API
+# (a valid wss:// origin — see LiveLivekitUrlValidator), API key, and API
# secret are all present, so admins get a config-time failure instead of a
# first-join failure.
-class VoiceLivekitPolicyValidator
+class LiveLivekitPolicyValidator
def initialize(opts = {})
@opts = opts
end
@@ -13,12 +13,12 @@ class VoiceLivekitPolicyValidator
return true if value == "disabled"
@error_key =
- if !VoiceLivekitUrlValidator.acceptable?(SiteSetting.voice_livekit_url)
- "voice_livekit_policy_requires_url"
- elsif SiteSetting.voice_livekit_api_key.blank?
- "voice_livekit_policy_requires_api_key"
- elsif SiteSetting.voice_livekit_api_secret.blank?
- "voice_livekit_policy_requires_api_secret"
+ if !LiveLivekitUrlValidator.acceptable?(SiteSetting.live_livekit_url)
+ "live_livekit_policy_requires_url"
+ elsif SiteSetting.live_livekit_api_key.blank?
+ "live_livekit_policy_requires_api_key"
+ elsif SiteSetting.live_livekit_api_secret.blank?
+ "live_livekit_policy_requires_api_secret"
end
@error_key.nil?
diff --git a/plugins/live/app/validators/live_livekit_recording_s3_bucket_validator.rb b/plugins/live/app/validators/live_livekit_recording_s3_bucket_validator.rb
new file mode 100644
index 00000000000..23ef8617d89
--- /dev/null
+++ b/plugins/live/app/validators/live_livekit_recording_s3_bucket_validator.rb
@@ -0,0 +1,35 @@
+# frozen_string_literal: true
+
+class LiveLivekitRecordingS3BucketValidator
+ include RegexSettingValidation
+
+ def initialize(opts = {})
+ initialize_regex_opts(opts)
+ end
+
+ def valid_value?(value)
+ @error_key = nil
+ @regex_fail = false
+ return true if value.blank?
+ return false if !regex_match?(value)
+
+ @error_key =
+ if SiteSetting.live_livekit_recording_s3_access_key_id.blank? ||
+ SiteSetting.live_livekit_recording_s3_secret_access_key.blank?
+ "live_livekit_recording_s3_requires_credentials"
+ elsif SiteSetting.live_livekit_recording_s3_region.blank? &&
+ SiteSetting.live_livekit_recording_s3_endpoint.blank?
+ "live_livekit_recording_s3_requires_region"
+ elsif !SiteSetting.live_livekit_url.start_with?("wss://")
+ "live_livekit_recording_s3_requires_wss"
+ end
+
+ @error_key.nil?
+ end
+
+ def error_message
+ return I18n.t(@regex_error) if @regex_fail
+
+ I18n.t("site_settings.errors.#{@error_key}") if @error_key
+ end
+end
diff --git a/plugins/voice/app/validators/voice_livekit_url_validator.rb b/plugins/live/app/validators/live_livekit_url_validator.rb
similarity index 80%
rename from plugins/voice/app/validators/voice_livekit_url_validator.rb
rename to plugins/live/app/validators/live_livekit_url_validator.rb
index 765ee390de5..8c7bacf9994 100644
--- a/plugins/voice/app/validators/voice_livekit_url_validator.rb
+++ b/plugins/live/app/validators/live_livekit_url_validator.rb
@@ -5,9 +5,9 @@
# with a host and no credentials — and TLS is mandatory in production, both
# for the signaling WebSocket and the derived HTTPS API calls. Address-level
# SSRF protection happens at request time via FinalDestination.
-class VoiceLivekitUrlValidator
+class LiveLivekitUrlValidator
def self.acceptable?(value)
- value.present? && VoiceLivekitUrlValidator.new.valid_value?(value)
+ value.present? && LiveLivekitUrlValidator.new.valid_value?(value)
end
def initialize(opts = {})
@@ -20,13 +20,13 @@ class VoiceLivekitUrlValidator
uri = URI.parse(value.to_s)
@error_key =
if %w[ws wss].exclude?(uri.scheme.to_s) || uri.host.blank? || uri.userinfo.present?
- "voice_livekit_url_invalid"
+ "live_livekit_url_invalid"
elsif uri.scheme == "ws" && Rails.env.production?
- "voice_livekit_url_requires_wss"
+ "live_livekit_url_requires_wss"
end
@error_key.nil?
rescue URI::Error
- @error_key = "voice_livekit_url_invalid"
+ @error_key = "live_livekit_url_invalid"
false
end
diff --git a/plugins/voice/app/validators/voice_turn_secret_servers_validator.rb b/plugins/live/app/validators/live_turn_secret_servers_validator.rb
similarity index 62%
rename from plugins/voice/app/validators/voice_turn_secret_servers_validator.rb
rename to plugins/live/app/validators/live_turn_secret_servers_validator.rb
index 4e36492e6f0..3d141bf8366 100644
--- a/plugins/voice/app/validators/voice_turn_secret_servers_validator.rb
+++ b/plugins/live/app/validators/live_turn_secret_servers_validator.rb
@@ -2,16 +2,16 @@
# Secret-authenticated TURN servers are unusable without the shared secret,
# so admins get a config-time failure instead of dead ICE entries.
-class VoiceTurnSecretServersValidator
+class LiveTurnSecretServersValidator
def initialize(opts = {})
@opts = opts
end
def valid_value?(value)
- value.blank? || SiteSetting.voice_turn_secret.present?
+ value.blank? || SiteSetting.live_turn_secret.present?
end
def error_message
- I18n.t("site_settings.errors.voice_turn_secret_servers_requires_secret")
+ I18n.t("site_settings.errors.live_turn_secret_servers_requires_secret")
end
end
diff --git a/plugins/voice/assets/javascripts/admin-voice-route-map.js b/plugins/live/assets/javascripts/admin-live-route-map.js
similarity index 70%
rename from plugins/voice/assets/javascripts/admin-voice-route-map.js
rename to plugins/live/assets/javascripts/admin-live-route-map.js
index 4af9631669e..6ec2ef35467 100644
--- a/plugins/voice/assets/javascripts/admin-voice-route-map.js
+++ b/plugins/live/assets/javascripts/admin-live-route-map.js
@@ -4,10 +4,10 @@ export default {
path: "/plugins",
map() {
- this.route("voice-dashboard");
- this.route("voice-recordings");
+ this.route("live-dashboard");
+ this.route("live-recordings");
this.route(
- "voice-rooms",
+ "live-rooms",
function () {
this.route("new");
diff --git a/plugins/voice/assets/javascripts/discourse/app/services/voice-calls.js b/plugins/live/assets/javascripts/discourse/app/services/live-calls.js
similarity index 81%
rename from plugins/voice/assets/javascripts/discourse/app/services/voice-calls.js
rename to plugins/live/assets/javascripts/discourse/app/services/live-calls.js
index 6de52abea0b..291702b8d7d 100644
--- a/plugins/voice/assets/javascripts/discourse/app/services/voice-calls.js
+++ b/plugins/live/assets/javascripts/discourse/app/services/live-calls.js
@@ -2,24 +2,21 @@ import Service, { service } from "@ember/service";
import { ajax } from "discourse/lib/ajax";
import { bind } from "discourse/lib/decorators";
import { isPrimaryTab } from "discourse/lib/utilities";
-import VoiceIncomingCallModal from "../../components/modal/voice-incoming-call.gjs";
-import { claimCallAlert } from "../../lib/voice/call-alert-dedup.js";
-import { RING_SECONDS } from "../../lib/voice/call-constants.js";
-import { setPendingInviteRef } from "../../lib/voice/invite-ref.js";
-import {
- startRingtone,
- stopCallSounds,
-} from "../../lib/voice/sound-effects.js";
+import LiveIncomingCallModal from "../../components/modal/live-incoming-call.gjs";
+import { claimCallAlert } from "../../lib/live/call-alert-dedup.js";
+import { RING_SECONDS } from "../../lib/live/call-constants.js";
+import { setPendingInviteRef } from "../../lib/live/invite-ref.js";
+import { startRingtone, stopCallSounds } from "../../lib/live/sound-effects.js";
// Direct calls: starts them (user-card button) and answers them (the ring
// event published when someone invites this user into an ephemeral room).
-export default class VoiceCallsService extends Service {
+export default class LiveCallsService extends Service {
@service currentUser;
@service messageBus;
@service modal;
@service router;
- @service("voice-rooms") voiceRooms;
- @service("voice-webrtc") voiceWebrtc;
+ @service("live-rooms") liveRooms;
+ @service("live-webrtc") liveWebrtc;
#subscribed = false;
#ringtoneRetry = null;
@@ -34,7 +31,7 @@ export default class VoiceCallsService extends Service {
}
get #ringChannel() {
- return `/voice/call-ring/${this.currentUser.id}`;
+ return `/live/call-ring/${this.currentUser.id}`;
}
listen() {
@@ -50,14 +47,14 @@ export default class VoiceCallsService extends Service {
// tone once the caller is connected and alone, and silences it when the
// callee's peer arrives.
async callUser(username) {
- const response = await ajax("/voice/calls", {
+ const response = await ajax("/live/calls", {
type: "POST",
data: { username },
});
const room = response.room;
- this.voiceRooms.upsertRoom?.(room);
- this.router.transitionTo("voice-room", room.slug, {
+ this.liveRooms.upsertRoom?.(room);
+ this.router.transitionTo("live-room", room.slug, {
queryParams: { join: "true" },
});
@@ -80,7 +77,7 @@ export default class VoiceCallsService extends Service {
// Already in that call (answered from the push notification, or rung for
// a room this user is sitting in).
- if (this.voiceWebrtc.activeRoomId === data.room_id) {
+ if (this.liveWebrtc.activeRoomId === data.room_id) {
return;
}
@@ -104,7 +101,7 @@ export default class VoiceCallsService extends Service {
}
});
this.modal
- .show(VoiceIncomingCallModal, {
+ .show(LiveIncomingCallModal, {
model: { ring: data, remainingMs, calls: this },
})
.finally(() => {
@@ -118,7 +115,7 @@ export default class VoiceCallsService extends Service {
// Joining through the invite ref credits the caller, the same as joining
// from the notification link.
setPendingInviteRef(ring.room_slug, ring.caller_username);
- this.router.transitionTo("voice-room", ring.room_slug, {
+ this.router.transitionTo("live-room", ring.room_slug, {
queryParams: { join: "true" },
});
}
diff --git a/plugins/voice/assets/javascripts/discourse/app/services/voice-rooms.js b/plugins/live/assets/javascripts/discourse/app/services/live-rooms.js
similarity index 96%
rename from plugins/voice/assets/javascripts/discourse/app/services/voice-rooms.js
rename to plugins/live/assets/javascripts/discourse/app/services/live-rooms.js
index 7cb53bcb73c..7255c492fb7 100644
--- a/plugins/voice/assets/javascripts/discourse/app/services/voice-rooms.js
+++ b/plugins/live/assets/javascripts/discourse/app/services/live-rooms.js
@@ -39,7 +39,7 @@ class ParticipantSpeakingState {
@tracked speaking = false;
}
-export default class VoiceRoomsService extends Service {
+export default class LiveRoomsService extends Service {
@service currentUser;
@service messageBus;
@service siteSettings;
@@ -56,13 +56,13 @@ export default class VoiceRoomsService extends Service {
constructor() {
super(...arguments);
- if (!this.siteSettings.voice_enabled) {
+ if (!this.siteSettings.live_enabled) {
return;
}
- // Anonymous visitors only bootstrap when Voice is open to everyone; the
+ // Anonymous visitors only bootstrap when Live is open to everyone; the
// server then returns just the public rooms.
- if (!this.currentUser && !this.site.voice_public_access) {
+ if (!this.currentUser && !this.site.live_public_access) {
return;
}
@@ -71,12 +71,9 @@ export default class VoiceRoomsService extends Service {
willDestroy() {
super.willDestroy(...arguments);
- this.messageBus.unsubscribe(
- "/voice/rooms/index",
- this.handleDirectoryEvent
- );
+ this.messageBus.unsubscribe("/live/rooms/index", this.handleDirectoryEvent);
this.#roomSubscriptions.forEach((callback, roomId) => {
- this.messageBus.unsubscribe(`/voice/rooms/${roomId}`, callback);
+ this.messageBus.unsubscribe(`/live/rooms/${roomId}`, callback);
});
this.#roomSubscriptions.clear();
this.#roomHandlers.clear();
@@ -452,7 +449,7 @@ export default class VoiceRoomsService extends Service {
}
async #bootstrap() {
- const payload = await ajax("/voice/rooms.json");
+ const payload = await ajax("/live/rooms.json");
this.canCreateRoom = payload.can_create_room ?? false;
this.#hydrateRooms(payload.rooms);
@@ -460,7 +457,7 @@ export default class VoiceRoomsService extends Service {
// published while the payload was in flight; subscribing without one
// would silently drop those events.
this.messageBus.subscribe(
- "/voice/rooms/index",
+ "/live/rooms/index",
this.handleDirectoryEvent,
payload.index_message_bus_last_id ?? -1
);
@@ -486,7 +483,7 @@ export default class VoiceRoomsService extends Service {
return;
}
- const channel = `/voice/rooms/${roomId}`;
+ const channel = `/live/rooms/${roomId}`;
const callback = (message) => this.handleRoomBroadcast(message);
this.messageBus.subscribe(channel, callback, lastId ?? -1);
this.#roomSubscriptions.set(roomId, callback);
@@ -495,7 +492,7 @@ export default class VoiceRoomsService extends Service {
#teardownRoomSubscription(roomId) {
const callback = this.#roomSubscriptions.get(roomId);
if (callback) {
- const channel = `/voice/rooms/${roomId}`;
+ const channel = `/live/rooms/${roomId}`;
this.messageBus.unsubscribe(channel, callback);
this.#roomSubscriptions.delete(roomId);
}
diff --git a/plugins/voice/assets/javascripts/discourse/app/services/voice-webrtc.js b/plugins/live/assets/javascripts/discourse/app/services/live-webrtc.js
similarity index 90%
rename from plugins/voice/assets/javascripts/discourse/app/services/voice-webrtc.js
rename to plugins/live/assets/javascripts/discourse/app/services/live-webrtc.js
index d4804e5d673..c1b10ca8de7 100644
--- a/plugins/voice/assets/javascripts/discourse/app/services/voice-webrtc.js
+++ b/plugins/live/assets/javascripts/discourse/app/services/live-webrtc.js
@@ -6,27 +6,27 @@ import { ajax } from "discourse/lib/ajax";
import { manuallyTrack } from "discourse/lib/tracked-tools";
import Draft from "discourse/models/draft";
import { i18n } from "discourse-i18n";
-import voiceLog from "discourse/plugins/voice/discourse/lib/voice/logger";
-import { confirmMeshPrivacy } from "../../components/modal/voice-mesh-privacy-warning.gjs";
-import { reportMicAcquisitionFailure } from "../../components/modal/voice-mic-permission.gjs";
-import AudioMonitor from "../../lib/voice/audio-monitor.js";
-import { RING_SECONDS } from "../../lib/voice/call-constants.js";
-import HeartbeatManager from "../../lib/voice/heartbeat-manager.js";
-import IdleTracker, { idleThresholds } from "../../lib/voice/idle-tracker.js";
-import { consumePendingInviteRef } from "../../lib/voice/invite-ref.js";
-import LivekitCoordinator from "../../lib/voice/livekit-coordinator.js";
-import LocalAudioPipeline from "../../lib/voice/local-audio-pipeline.js";
-import LocalVideoManager from "../../lib/voice/local-video-manager.js";
+import liveLog from "discourse/plugins/live/discourse/lib/live/logger";
+import { confirmMeshPrivacy } from "../../components/modal/live-mesh-privacy-warning.gjs";
+import { reportMicAcquisitionFailure } from "../../components/modal/live-mic-permission.gjs";
+import AudioMonitor from "../../lib/live/audio-monitor.js";
+import { RING_SECONDS } from "../../lib/live/call-constants.js";
+import HeartbeatManager from "../../lib/live/heartbeat-manager.js";
+import IdleTracker, { idleThresholds } from "../../lib/live/idle-tracker.js";
+import { consumePendingInviteRef } from "../../lib/live/invite-ref.js";
+import LivekitCoordinator from "../../lib/live/livekit-coordinator.js";
+import LocalAudioPipeline from "../../lib/live/local-audio-pipeline.js";
+import LocalVideoManager from "../../lib/live/local-video-manager.js";
import {
applyOutputDevice,
preferredOutputDeviceId,
setPreferredOutputDeviceId,
-} from "../../lib/voice/media-devices.js";
-import MeshSignalHandler from "../../lib/voice/mesh-signal-handler.js";
-import ParticipantAudio from "../../lib/voice/participant-audio.js";
-import PeerManager from "../../lib/voice/peer-manager.js";
-import PresencePendingPeers from "../../lib/voice/presence-pending-peers.js";
-import PttManager from "../../lib/voice/ptt-manager.js";
+} from "../../lib/live/media-devices.js";
+import MeshSignalHandler from "../../lib/live/mesh-signal-handler.js";
+import ParticipantAudio from "../../lib/live/participant-audio.js";
+import PeerManager from "../../lib/live/peer-manager.js";
+import PresencePendingPeers from "../../lib/live/presence-pending-peers.js";
+import PttManager from "../../lib/live/ptt-manager.js";
import {
allowedQualityTiers,
clampQuality,
@@ -39,12 +39,12 @@ import {
setPreferredScreenContent,
setPreferredScreenQuality,
setPreferredVoiceQuality,
-} from "../../lib/voice/quality-preferences.js";
-import RemoteStreamRegistry from "../../lib/voice/remote-stream-registry.js";
-import { activeRingingEntries } from "../../lib/voice/ringing.js";
-import RoomMessageQueue from "../../lib/voice/room-message-queue.js";
-import RosterHandler from "../../lib/voice/roster-handler.js";
-import SignalingManager from "../../lib/voice/signaling.js";
+} from "../../lib/live/quality-preferences.js";
+import RemoteStreamRegistry from "../../lib/live/remote-stream-registry.js";
+import { activeRingingEntries } from "../../lib/live/ringing.js";
+import RoomMessageQueue from "../../lib/live/room-message-queue.js";
+import RosterHandler from "../../lib/live/roster-handler.js";
+import SignalingManager from "../../lib/live/signaling.js";
import {
playConnectedSound,
playDeafenSound,
@@ -55,23 +55,24 @@ import {
schedulePlaybackResume,
startWaitingSound,
stopCallSounds,
-} from "../../lib/voice/sound-effects.js";
+} from "../../lib/live/sound-effects.js";
import {
participantCanSpeak,
remoteTrackAllowed,
-} from "../../lib/voice/stage-roles.js";
-import TranscriptionCoordinator from "../../lib/voice/transcription-coordinator.js";
-import { applyVoiceQuality } from "../../lib/voice/video-quality.js";
+} from "../../lib/live/stage-roles.js";
+import TranscriptionCoordinator from "../../lib/live/transcription-coordinator.js";
+import { applyVoiceQuality } from "../../lib/live/video-quality.js";
+// Pre-rename key, kept so saved preferences survive.
const CAMERA_ENABLED_KEY_PREFIX = "voice-camera-enabled";
-export default class VoiceWebrtcService extends Service {
+export default class LiveWebrtcService extends Service {
@service currentUser;
@service keyValueStore;
@service messageBus;
@service modal;
@service siteSettings;
- @service("voice-rooms") voiceRooms;
+ @service("live-rooms") liveRooms;
@service toasts;
@tracked activeRoomId = null;
@@ -188,7 +189,7 @@ export default class VoiceWebrtcService extends Service {
this.#audioMonitor = new AudioMonitor({
onSpeakingChange: (roomId, userId, speaking) =>
- this.voiceRooms?.setParticipantSpeaking(roomId, userId, speaking),
+ this.liveRooms?.setParticipantSpeaking(roomId, userId, speaking),
onVoiceActivity: () => this.#idleTracker?.onVoiceActivity(),
});
@@ -206,7 +207,7 @@ export default class VoiceWebrtcService extends Service {
this.toasts.error({
duration: 5000,
data: {
- message: i18n("voice.voice_settings.noise_suppression_failed"),
+ message: i18n("live.voice_settings.noise_suppression_failed"),
},
});
},
@@ -229,7 +230,7 @@ export default class VoiceWebrtcService extends Service {
siteSettings: this.siteSettings,
getParticipantSessionId: (roomId) => this.#roomSessions.get(roomId),
getCurrentUserId: () => this.currentUser?.id,
- getRoom: (roomId) => this.voiceRooms?.roomById(roomId),
+ getRoom: (roomId) => this.liveRooms?.roomById(roomId),
isActiveRoom: (roomId) => this.#activeRoomIds.has(roomId),
getActiveRoomIds: () => this.#activeRoomIds,
getRemoteUserIds: (roomId) =>
@@ -238,11 +239,9 @@ export default class VoiceWebrtcService extends Service {
this.#remoteStreamRegistry.streamFor(roomId, userId),
getLocalStream: () => this.localStream,
setParticipantTranscribing: (roomId, transcribing) =>
- this.voiceRooms?.setParticipantVideoState(
- roomId,
- this.currentUser?.id,
- { is_transcribing: transcribing }
- ),
+ this.liveRooms?.setParticipantVideoState(roomId, this.currentUser?.id, {
+ is_transcribing: transcribing,
+ }),
saveDraft: (key, sequence, data) =>
Draft.save(key, sequence, data, this.messageBus.clientId),
openComposer: (opts) =>
@@ -281,14 +280,14 @@ export default class VoiceWebrtcService extends Service {
isConnectingRoom: (roomId) => this.#connectingRoomIds.has(roomId),
getFirstActiveRoomId: () => this.#firstActiveRoomId(),
getActiveRoomId: () => this.activeRoomId,
- getRoom: (roomId) => this.voiceRooms?.roomById(roomId),
+ getRoom: (roomId) => this.liveRooms?.roomById(roomId),
canPublish: (kind, roomId) => this.canPublish(kind, roomId),
getCameraQuality: (roomId) => this.effectiveCameraQuality(roomId),
getScreenQuality: (roomId) => this.effectiveScreenQuality(roomId),
getScreenContent: () => this.screenContent,
isBlurAllowed: () => this.videoBlurAvailable,
setParticipantVideoState: (roomId, state) =>
- this.voiceRooms?.setParticipantVideoState(
+ this.liveRooms?.setParticipantVideoState(
roomId,
this.currentUser?.id,
state
@@ -311,11 +310,11 @@ export default class VoiceWebrtcService extends Service {
presencePending: this.#presencePending,
getCurrentUserId: () => this.currentUser?.id,
isActiveRoom: (roomId) => this.#activeRoomIds.has(roomId),
- getRoom: (roomId) => this.voiceRooms?.roomById(roomId),
+ getRoom: (roomId) => this.liveRooms?.roomById(roomId),
isRoleChangeInProgress: (roomId) =>
this.#roster.isRoleChangeInProgress(roomId),
addProvisionalParticipant: (roomId, participant) =>
- this.voiceRooms?.addParticipant(roomId, participant),
+ this.liveRooms?.addParticipant(roomId, participant),
onOfferHandled: async (roomId) => {
if (this.localVideoKind) {
await this.#localVideo.syncSenders(roomId);
@@ -337,12 +336,12 @@ export default class VoiceWebrtcService extends Service {
getLocalVideoKind: () => this.localVideoKind,
getVideoPublisherCount: (roomId) => this.videoPublisherCount(roomId),
getQualityTiers: (roomId) => ({
- voice: this.effectiveVoiceQuality(roomId),
+ live: this.effectiveVoiceQuality(roomId),
camera: this.effectiveCameraQuality(roomId),
screen: this.effectiveScreenQuality(roomId),
}),
onTrack: (roomId, userId, track, streams) => {
- const room = this.voiceRooms.roomById(roomId);
+ const room = this.liveRooms.roomById(roomId);
if (userId < 0 && (!room || !participantCanSpeak(room, userId))) {
return;
}
@@ -383,7 +382,7 @@ export default class VoiceWebrtcService extends Service {
toasts: this.toasts,
getCurrentUserId: () => this.currentUser?.id,
getChatSound: () => this.currentUser?.chat_sound,
- getRoom: (roomId) => this.voiceRooms?.roomById(roomId),
+ getRoom: (roomId) => this.liveRooms?.roomById(roomId),
isActiveRoom: (roomId) => this.#activeRoomIds.has(roomId),
isConnectingRoom: (roomId) => this.#connectingRoomIds.has(roomId),
isMeshRoom: (roomId) => this.#isMeshRoom(roomId),
@@ -446,7 +445,7 @@ export default class VoiceWebrtcService extends Service {
this.#transcription.destroy();
this.#roomHandlerCallbacks.forEach((callback, roomId) => {
- this.voiceRooms?.unregisterRoomHandler(roomId, callback);
+ this.liveRooms?.unregisterRoomHandler(roomId, callback);
});
this.#roomHandlerCallbacks.clear();
this.#heartbeat.stopAll();
@@ -565,7 +564,7 @@ export default class VoiceWebrtcService extends Service {
get activeRoom() {
return this.activeRoomId
- ? this.voiceRooms?.roomById(this.activeRoomId)
+ ? this.liveRooms?.roomById(this.activeRoomId)
: null;
}
@@ -598,7 +597,7 @@ export default class VoiceWebrtcService extends Service {
// Whether the site allows background blur; distinct from browser support
// so the UI can tell "turned off by admin" apart from "can't run here".
get videoBlurAvailable() {
- return !!this.siteSettings.voice_video_background_blur_enabled;
+ return !!this.siteSettings.live_video_background_blur_enabled;
}
get videoBlurSupported() {
@@ -745,7 +744,7 @@ export default class VoiceWebrtcService extends Service {
}
}
- voiceLog.info(`[voice] joining room ${room.id}`);
+ liveLog.info(`[live] joining room ${room.id}`);
this.#registerRoomHandler(room.id);
@@ -755,7 +754,7 @@ export default class VoiceWebrtcService extends Service {
const joinData = {};
if (
!this.autoStatusEnabled ||
- !this.siteSettings.voice_auto_status_enabled
+ !this.siteSettings.live_auto_status_enabled
) {
joinData.skip_status = true;
}
@@ -769,25 +768,25 @@ export default class VoiceWebrtcService extends Service {
if (existingSessionId) {
joinData.participant_session_id = existingSessionId;
}
- response = await ajax(`/voice/rooms/${room.id}/join`, {
+ response = await ajax(`/live/rooms/${room.id}/join`, {
type: "POST",
data: joinData,
});
} catch {
- voiceLog.warn("[voice] failed to join room");
+ liveLog.warn("[live] failed to join room");
this.#handleJoinFailure(room.id);
return;
}
if (this.#joinRevision !== revision) {
- ajax(`/voice/rooms/${room.id}/leave`, {
+ ajax(`/live/rooms/${room.id}/leave`, {
type: "DELETE",
data: { participant_session_id: response?.participant_session_id },
});
return;
}
- voiceLog.info("[voice] join response received");
+ liveLog.info("[live] join response received");
this.#roomTransports.set(room.id, response?.transport ?? "mesh");
if (response?.participant_session_id) {
@@ -800,7 +799,7 @@ export default class VoiceWebrtcService extends Service {
// The join response is serialized as the (now participating) user, so
// it carries the per-user chat fields the directory payloads gate off —
// fold it in so the room page sees them.
- this.voiceRooms?.upsertRoom?.(joinedRoom);
+ this.liveRooms?.upsertRoom?.(joinedRoom);
}
const isStageListener =
joinedRoom?.room_type === "stage" && !this.#canSpeakInRoom(joinedRoom);
@@ -808,7 +807,7 @@ export default class VoiceWebrtcService extends Service {
if (!isStageListener && !this.localStream) {
const acquired = await this.#acquireMicrophoneWithFeedback();
if (!acquired) {
- ajax(`/voice/rooms/${room.id}/leave`, {
+ ajax(`/live/rooms/${room.id}/leave`, {
type: "DELETE",
data: { participant_session_id: this.#roomSessions.get(room.id) },
});
@@ -818,7 +817,7 @@ export default class VoiceWebrtcService extends Service {
}
if (this.#joinRevision !== revision) {
- ajax(`/voice/rooms/${room.id}/leave`, {
+ ajax(`/live/rooms/${room.id}/leave`, {
type: "DELETE",
data: { participant_session_id: this.#roomSessions.get(room.id) },
});
@@ -832,7 +831,7 @@ export default class VoiceWebrtcService extends Service {
// Only mark the room as active after the microphone is ready.
// This prevents incoming MessageBus signals from creating peer
// connections before localStream is available (race condition that
- // caused voice to fail on first join).
+ // caused audio to fail on first join).
this.#activeRoomIds.add(room.id);
this.#setActiveRoomId(room.id);
@@ -941,7 +940,7 @@ export default class VoiceWebrtcService extends Service {
if (!skipServer) {
// The session id lets the server drop a leave from a stale tab whose
// session a newer join has already superseded.
- ajax(`/voice/rooms/${room.id}/leave`, {
+ ajax(`/live/rooms/${room.id}/leave`, {
type: "DELETE",
data: { participant_session_id: this.#roomSessions.get(room.id) },
});
@@ -1008,7 +1007,7 @@ export default class VoiceWebrtcService extends Service {
roomId,
userId,
element,
- screenAudio ? "screen" : "voice"
+ screenAudio ? "screen" : "live"
);
this.#participantAudio.apply(roomId, userId);
}
@@ -1022,14 +1021,14 @@ export default class VoiceWebrtcService extends Service {
if (error?.name === "NotAllowedError") {
schedulePlaybackResume(element, this.#pendingPlaybackElements);
} else {
- voiceLog.warn("[voice] audio element failed to play");
+ liveLog.warn("[live] audio element failed to play");
}
});
} catch (error) {
if (error?.name === "NotAllowedError") {
schedulePlaybackResume(element, this.#pendingPlaybackElements);
} else {
- voiceLog.warn("[voice] audio element failed to play");
+ liveLog.warn("[live] audio element failed to play");
}
}
}
@@ -1045,7 +1044,7 @@ export default class VoiceWebrtcService extends Service {
toggleParticipantMute(roomId, userId) {
const newMutedState = this.#participantAudio.toggleMuted(roomId, userId);
- this.voiceRooms?.setParticipantMuted(roomId, userId, newMutedState);
+ this.liveRooms?.setParticipantMuted(roomId, userId, newMutedState);
return newMutedState;
}
@@ -1104,7 +1103,7 @@ export default class VoiceWebrtcService extends Service {
return clampQuality(
this.voiceQuality,
this.#roomQualityCap(roomId),
- this.siteSettings.voice_max_voice_quality
+ this.siteSettings.live_max_voice_quality
);
}
@@ -1112,7 +1111,7 @@ export default class VoiceWebrtcService extends Service {
return clampQuality(
this.cameraQuality,
this.#roomQualityCap(roomId),
- this.siteSettings.voice_max_camera_quality
+ this.siteSettings.live_max_camera_quality
);
}
@@ -1120,28 +1119,28 @@ export default class VoiceWebrtcService extends Service {
return clampQuality(
this.screenQuality,
this.#roomQualityCap(roomId),
- this.siteSettings.voice_max_screen_share_quality
+ this.siteSettings.live_max_screen_share_quality
);
}
allowedVoiceQualityTiers(roomId = this.activeRoomId) {
return allowedQualityTiers(
this.#roomQualityCap(roomId),
- this.siteSettings.voice_max_voice_quality
+ this.siteSettings.live_max_voice_quality
);
}
allowedCameraQualityTiers(roomId = this.activeRoomId) {
return allowedQualityTiers(
this.#roomQualityCap(roomId),
- this.siteSettings.voice_max_camera_quality
+ this.siteSettings.live_max_camera_quality
);
}
allowedScreenQualityTiers(roomId = this.activeRoomId) {
return allowedQualityTiers(
this.#roomQualityCap(roomId),
- this.siteSettings.voice_max_screen_share_quality
+ this.siteSettings.live_max_screen_share_quality
);
}
@@ -1190,7 +1189,7 @@ export default class VoiceWebrtcService extends Service {
}
videoPublisherCount(roomId) {
- const room = this.voiceRooms?.roomById(roomId);
+ const room = this.liveRooms?.roomById(roomId);
return (room?.active_participants || []).filter(
(participant) =>
participant?.is_video_on || participant?.is_screen_sharing
@@ -1281,7 +1280,7 @@ export default class VoiceWebrtcService extends Service {
const stoppingVideo = !watching && !keepVideo && !!this.localVideoKind;
if (stoppingVideo) {
this.#localVideo.stop({ broadcast: false }).catch(() => {
- voiceLog.warn("[voice] failed to stop video on page leave");
+ liveLog.warn("[live] failed to stop video on page leave");
});
}
@@ -1294,14 +1293,14 @@ export default class VoiceWebrtcService extends Service {
data.screen = false;
}
- this.voiceRooms?.setParticipantVideoState(
+ this.liveRooms?.setParticipantVideoState(
roomId,
this.currentUser?.id,
localState
);
data.participant_session_id = this.#roomSessions.get(roomId);
- ajax(`/voice/rooms/${roomId}/state`, {
+ ajax(`/live/rooms/${roomId}/state`, {
type: "POST",
data,
}).catch(() => {});
@@ -1436,7 +1435,7 @@ export default class VoiceWebrtcService extends Service {
}
#canPublishIn(roomId, allowedIn) {
- const room = this.voiceRooms?.roomById(roomId);
+ const room = this.liveRooms?.roomById(roomId);
if (!room || !allowedIn(room)) {
return false;
}
@@ -1448,7 +1447,7 @@ export default class VoiceWebrtcService extends Service {
}
return (
this.videoPublisherCount(roomId) <
- this.siteSettings.voice_video_max_publishers
+ this.siteSettings.live_video_max_publishers
);
}
@@ -1516,7 +1515,7 @@ export default class VoiceWebrtcService extends Service {
this.canPublishCamera(roomId),
})
.catch(() => {
- voiceLog.warn("[voice] failed to restore preferred camera state");
+ liveLog.warn("[live] failed to restore preferred camera state");
});
this.#cameraRestorePromise = restorePromise;
@@ -1554,7 +1553,7 @@ export default class VoiceWebrtcService extends Service {
}
#roomQualityCap(roomId) {
- return this.voiceRooms?.roomById(roomId)?.max_quality_profile;
+ return this.liveRooms?.roomById(roomId)?.max_quality_profile;
}
async #applyVoiceQualityToPeers() {
@@ -1573,7 +1572,7 @@ export default class VoiceWebrtcService extends Service {
return null;
}
- // Room state updates in voiceRooms; this only surfaces the change to
+ // Room state updates in liveRooms; this only surfaces the change to
// people in the call. The moderator who pressed the button gets no toast —
// their button state already changed under their pointer.
#handleRecordingChanged(payload) {
@@ -1586,14 +1585,14 @@ export default class VoiceWebrtcService extends Service {
duration: 8000,
data: {
icon: "record-vinyl",
- message: i18n("voice.room.recording_started_toast"),
+ message: i18n("live.room.recording_started_toast"),
},
});
}
} else {
this.toasts.default({
duration: 5000,
- data: { message: i18n("voice.room.recording_stopped_toast") },
+ data: { message: i18n("live.room.recording_stopped_toast") },
});
}
}
@@ -1603,7 +1602,7 @@ export default class VoiceWebrtcService extends Service {
return;
}
- const room = this.voiceRooms?.roomById(roomId);
+ const room = this.liveRooms?.roomById(roomId);
const stillAllowed =
this.localVideoKind === "screen"
? this.screenShareAllowedIn(room)
@@ -1613,7 +1612,7 @@ export default class VoiceWebrtcService extends Service {
this.#localVideo.stop().catch(() => {});
this.toasts.default({
duration: 5000,
- data: { message: i18n("voice.video.room_disabled") },
+ data: { message: i18n("live.video.room_disabled") },
});
}
}
@@ -1622,18 +1621,18 @@ export default class VoiceWebrtcService extends Service {
#broadcastMuteState() {
for (const roomId of this.#activeRoomIds) {
- this.voiceRooms?.setParticipantMuted(
+ this.liveRooms?.setParticipantMuted(
roomId,
this.currentUser?.id,
!this.audioEnabled
);
- this.voiceRooms?.setParticipantDeafened(
+ this.liveRooms?.setParticipantDeafened(
roomId,
this.currentUser?.id,
this.deafened
);
- ajax(`/voice/rooms/${roomId}/toggle_mute`, {
+ ajax(`/live/rooms/${roomId}/toggle_mute`, {
type: "POST",
data: {
muted: !this.audioEnabled,
@@ -1650,7 +1649,7 @@ export default class VoiceWebrtcService extends Service {
}
const callback = (payload) => this.#handleRoomMessage(roomId, payload);
- this.voiceRooms.registerRoomHandler(roomId, callback);
+ this.liveRooms.registerRoomHandler(roomId, callback);
this.#roomHandlerCallbacks.set(roomId, callback);
}
@@ -1664,7 +1663,7 @@ export default class VoiceWebrtcService extends Service {
const callback = this.#roomHandlerCallbacks.get(roomId);
if (callback) {
- this.voiceRooms?.unregisterRoomHandler(roomId, callback);
+ this.liveRooms?.unregisterRoomHandler(roomId, callback);
this.#roomHandlerCallbacks.delete(roomId);
}
@@ -1693,13 +1692,13 @@ export default class VoiceWebrtcService extends Service {
return this.#processRoomMessage(roomId, payload);
})
.catch(() => {
- voiceLog.warn("[voice] failed to process room message");
+ liveLog.warn("[live] failed to process room message");
});
}
async #processRoomMessage(roomId, payload) {
- voiceLog.info(
- `[voice] 📨 MessageBus message: room=${roomId}, active=${this.#activeRoomIds.has(roomId)}`
+ liveLog.info(
+ `[live] 📨 MessageBus message: room=${roomId}, active=${this.#activeRoomIds.has(roomId)}`
);
if (!this.#activeRoomIds.has(roomId)) {
@@ -1748,7 +1747,7 @@ export default class VoiceWebrtcService extends Service {
}
#handleKicked(roomId) {
- voiceLog.info(`[voice] kicked from room ${roomId}`);
+ liveLog.info(`[live] kicked from room ${roomId}`);
this.leave({ id: roomId });
}
@@ -1777,12 +1776,12 @@ export default class VoiceWebrtcService extends Service {
participant.is_screen_sharing = this.localVideoKind === "screen";
participant.watching_video = this.watchingRoomId === roomId;
- const room = this.voiceRooms?.roomById(roomId);
+ const room = this.liveRooms?.roomById(roomId);
if (room?.membership?.role_name) {
participant.role = room.membership.role_name;
}
- this.voiceRooms?.addParticipant(roomId, participant);
+ this.liveRooms?.addParticipant(roomId, participant);
}
#removeLocalParticipant(roomId) {
@@ -1790,7 +1789,7 @@ export default class VoiceWebrtcService extends Service {
return;
}
- this.voiceRooms?.removeParticipant(roomId, this.currentUser.id);
+ this.liveRooms?.removeParticipant(roomId, this.currentUser.id);
}
// Mesh receive-side media boundary: only register (and therefore play) a
@@ -1798,11 +1797,11 @@ export default class VoiceWebrtcService extends Service {
// room's media policy allow. On LiveKit the SFU enforces publish
// permissions instead.
#registerRemoteTrack(roomId, userId, track, streams) {
- const room = this.voiceRooms?.roomById(roomId);
+ const room = this.liveRooms?.roomById(roomId);
const mesh = this.#isMeshRoom(roomId);
if (!remoteTrackAllowed(room, userId, track, streams, { mesh })) {
- voiceLog.warn(
- `[voice] dropping ${track?.kind} track from peer: not allowed to publish in room ${roomId}`
+ liveLog.warn(
+ `[live] dropping ${track?.kind} track from peer: not allowed to publish in room ${roomId}`
);
// A pre-negotiated video or screen-audio receiver keeps one track for
// the connection's lifetime, so stopping it would leave the sender dark
@@ -1824,7 +1823,7 @@ export default class VoiceWebrtcService extends Service {
// stage listeners keep their pre-negotiated transceivers receive-only;
// the receiving side's #registerRemoteTrack is the actual boundary.
#canPublishMediaIn(roomId) {
- const room = this.voiceRooms?.roomById(roomId);
+ const room = this.liveRooms?.roomById(roomId);
return !room || this.#canSpeakInRoom(room);
}
@@ -1920,7 +1919,7 @@ export default class VoiceWebrtcService extends Service {
this.#idleTracker.lastBroadcastedIdleState = null;
for (const roomId of this.#activeRoomIds) {
- this.voiceRooms?.setParticipantIdleState(
+ this.liveRooms?.setParticipantIdleState(
roomId,
this.currentUser?.id,
"active"
@@ -1931,10 +1930,10 @@ export default class VoiceWebrtcService extends Service {
this.toasts.success({
duration: 5000,
data: {
- message: i18n("voice.idle.auto_muted"),
+ message: i18n("live.idle.auto_muted"),
actions: [
{
- label: i18n("voice.idle.click_to_unmute"),
+ label: i18n("live.idle.click_to_unmute"),
class: "btn-primary",
action: () => this.toggleMute(),
},
@@ -1947,7 +1946,7 @@ export default class VoiceWebrtcService extends Service {
this.#idleTracker.lastBroadcastedIdleState = null;
for (const roomId of this.#activeRoomIds) {
- this.voiceRooms?.setParticipantIdleState(
+ this.liveRooms?.setParticipantIdleState(
roomId,
this.currentUser?.id,
"idle"
@@ -1967,7 +1966,7 @@ export default class VoiceWebrtcService extends Service {
}
for (const roomId of this.#activeRoomIds) {
- this.voiceRooms?.setParticipantIdleState(
+ this.liveRooms?.setParticipantIdleState(
roomId,
this.currentUser?.id,
"afk"
@@ -1979,7 +1978,7 @@ export default class VoiceWebrtcService extends Service {
#handleIdleDisconnect() {
const roomNames = [];
for (const roomId of this.#activeRoomIds) {
- const room = this.voiceRooms?.roomById(roomId);
+ const room = this.liveRooms?.roomById(roomId);
if (room) {
roomNames.push(room.name);
}
@@ -1992,7 +1991,7 @@ export default class VoiceWebrtcService extends Service {
const name = roomNames[0] || "the room";
this.toasts.default({
duration: 8000,
- data: { message: i18n("voice.idle.disconnected", { room: name }) },
+ data: { message: i18n("live.idle.disconnected", { room: name }) },
});
}
diff --git a/plugins/voice/assets/javascripts/discourse/components/voice-back-to-voice-room-button.gjs b/plugins/live/assets/javascripts/discourse/components/live-back-to-live-room-button.gjs
similarity index 81%
rename from plugins/voice/assets/javascripts/discourse/components/voice-back-to-voice-room-button.gjs
rename to plugins/live/assets/javascripts/discourse/components/live-back-to-live-room-button.gjs
index 7943a1ac9fc..9976c6d82f6 100644
--- a/plugins/voice/assets/javascripts/discourse/components/voice-back-to-voice-room-button.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/live-back-to-live-room-button.gjs
@@ -18,7 +18,7 @@ function roomForThread(threadId) {
if (!roomByThread.has(threadId)) {
roomByThread.set(
threadId,
- ajax(`/voice/chat_threads/${threadId}.json`).catch((error) => {
+ ajax(`/live/chat_threads/${threadId}.json`).catch((error) => {
if (error?.jqXHR?.status !== 404) {
roomByThread.delete(threadId);
}
@@ -29,7 +29,7 @@ function roomForThread(threadId) {
return roomByThread.get(threadId);
}
-export default class VoiceBackToVoiceRoomButton extends Component {
+export default class LiveBackToLiveRoomButton extends Component {
@service router;
@service siteSettings;
@@ -39,8 +39,8 @@ export default class VoiceBackToVoiceRoomButton extends Component {
get shouldLookup() {
return (
- this.siteSettings.voice_enabled &&
- this.siteSettings.voice_chat_enabled &&
+ this.siteSettings.live_enabled &&
+ this.siteSettings.live_chat_enabled &&
this.siteSettings.chat_enabled &&
this.thread?.id &&
!this.thread.staged
@@ -55,13 +55,13 @@ export default class VoiceBackToVoiceRoomButton extends Component {
@action
async openRoom(room) {
const chatActive = await ajax(
- `/voice/chat_threads/${this.thread.id}.json`
+ `/live/chat_threads/${this.thread.id}.json`
).then(
(fresh) => !!fresh.chat_active,
() => false // If the lookup fails, assume the chat is inactive and let the room page handle it.
);
- this.router.transitionTo("voice-room", room.slug, {
+ this.router.transitionTo("live-room", room.slug, {
queryParams: { join: true, chat: chatActive },
});
}
@@ -73,10 +73,10 @@ export default class VoiceBackToVoiceRoomButton extends Component {
<:content as |room|>
{{#if room}}
<DButton
- class="btn-transparent no-text c-navbar__back-to-voice-room"
+ class="btn-transparent no-text c-navbar__back-to-live-room"
@action={{fn this.openRoom room}}
@icon="microphone-lines"
- @translatedTitle={{i18n "voice.chat.back_to_voice_room"}}
+ @translatedTitle={{i18n "live.chat.back_to_live_room"}}
/>
{{/if}}
</:content>
diff --git a/plugins/voice/assets/javascripts/discourse/components/voice-invite-agent-button.gjs b/plugins/live/assets/javascripts/discourse/components/live-invite-agent-button.gjs
similarity index 69%
rename from plugins/voice/assets/javascripts/discourse/components/voice-invite-agent-button.gjs
rename to plugins/live/assets/javascripts/discourse/components/live-invite-agent-button.gjs
index 9adc9c4c31e..78c744001fb 100644
--- a/plugins/voice/assets/javascripts/discourse/components/voice-invite-agent-button.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/live-invite-agent-button.gjs
@@ -2,15 +2,15 @@ import Component from "@glimmer/component";
import { action } from "@ember/object";
import { service } from "@ember/service";
import DButton from "discourse/ui-kit/d-button";
-import VoiceInviteAgentModal from "./modal/voice-invite-agent.gjs";
+import LiveInviteAgentModal from "./modal/live-invite-agent.gjs";
-export default class VoiceInviteAgentButton extends Component {
+export default class LiveInviteAgentButton extends Component {
@service site;
@service modal;
get available() {
const room = this.args.room;
- const botId = this.site.voice_livekit_agent_bot_id;
+ const botId = this.site.live_livekit_agent_bot_id;
const participants = room.active_participants ?? [];
return (
botId &&
@@ -24,17 +24,17 @@ export default class VoiceInviteAgentButton extends Component {
@action
invite() {
this.args.closeMenu?.();
- this.modal.show(VoiceInviteAgentModal, { model: { room: this.args.room } });
+ this.modal.show(LiveInviteAgentModal, { model: { room: this.args.room } });
}
<template>
{{#if this.available}}
<@item>
<DButton
- class="btn-transparent voice-invite-agent"
+ class="btn-transparent live-invite-agent"
@action={{this.invite}}
@icon="robot"
- @label="voice.agent.invite"
+ @label="live.agent.invite"
/>
</@item>
{{/if}}
diff --git a/plugins/voice/assets/javascripts/discourse/components/voice-participant-sidebar-context-menu.gjs b/plugins/live/assets/javascripts/discourse/components/live-participant-sidebar-context-menu.gjs
similarity index 68%
rename from plugins/voice/assets/javascripts/discourse/components/voice-participant-sidebar-context-menu.gjs
rename to plugins/live/assets/javascripts/discourse/components/live-participant-sidebar-context-menu.gjs
index 7c65439ba07..44d60538075 100644
--- a/plugins/voice/assets/javascripts/discourse/components/voice-participant-sidebar-context-menu.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/live-participant-sidebar-context-menu.gjs
@@ -10,15 +10,15 @@ import { not } from "discourse/truth-helpers";
import DButton from "discourse/ui-kit/d-button";
import DDropdownMenu from "discourse/ui-kit/d-dropdown-menu";
import { i18n } from "discourse-i18n";
-import { humanKeyName } from "../lib/voice/ptt-utils.js";
-import VoiceFlag from "../lib/voice-flag.js";
-import VoiceVoiceSettingsModal from "./modal/voice-voice-settings.gjs";
-import VoicePttKeyCapture from "./voice-ptt-key-capture.gjs";
+import { humanKeyName } from "../lib/live/ptt-utils.js";
+import LiveFlag from "../lib/live-flag.js";
+import LivePttKeyCapture from "./live-ptt-key-capture.gjs";
+import LiveVoiceSettingsModal from "./modal/live-voice-settings.gjs";
-export default class VoiceParticipantSidebarContextMenu extends Component {
+export default class LiveParticipantSidebarContextMenu extends Component {
@service currentUser;
@service modal;
- @service voiceWebrtc;
+ @service liveWebrtc;
@service siteSettings;
@tracked volume = 100;
@@ -29,9 +29,9 @@ export default class VoiceParticipantSidebarContextMenu extends Component {
super(...arguments);
const { room, participant } = this.args.data;
this.volume = Math.round(
- this.voiceWebrtc.getParticipantVolume(room.id, participant.id) * 100
+ this.liveWebrtc.getParticipantVolume(room.id, participant.id) * 100
);
- this.isMuted = this.voiceWebrtc.isParticipantMuted(room.id, participant.id);
+ this.isMuted = this.liveWebrtc.isParticipantMuted(room.id, participant.id);
}
get room() {
@@ -60,8 +60,8 @@ export default class VoiceParticipantSidebarContextMenu extends Component {
get spotlightLabel() {
return this.isSpotlighted
- ? i18n("voice.participant.remove_spotlight")
- : i18n("voice.participant.spotlight");
+ ? i18n("live.participant.remove_spotlight")
+ : i18n("live.participant.spotlight");
}
get canKick() {
@@ -124,14 +124,14 @@ export default class VoiceParticipantSidebarContextMenu extends Component {
get raiseHandLabel() {
return this.handRaised
- ? i18n("voice.stage.lower_hand")
- : i18n("voice.stage.raise_hand");
+ ? i18n("live.stage.lower_hand")
+ : i18n("live.stage.raise_hand");
}
get muteLabel() {
return this.isMuted
- ? i18n("voice.participant.unmute")
- : i18n("voice.participant.mute");
+ ? i18n("live.participant.unmute")
+ : i18n("live.participant.mute");
}
get muteIcon() {
@@ -139,38 +139,38 @@ export default class VoiceParticipantSidebarContextMenu extends Component {
}
get micIcon() {
- return this.voiceWebrtc.audioEnabled ? "microphone" : "microphone-slash";
+ return this.liveWebrtc.audioEnabled ? "microphone" : "microphone-slash";
}
get micLabel() {
- return this.voiceWebrtc.audioEnabled
- ? i18n("voice.room.mic_on")
- : i18n("voice.room.mic_off");
+ return this.liveWebrtc.audioEnabled
+ ? i18n("live.room.mic_on")
+ : i18n("live.room.mic_off");
}
get deafenIcon() {
- return this.voiceWebrtc.deafened ? "volume-xmark" : "volume-high";
+ return this.liveWebrtc.deafened ? "volume-xmark" : "volume-high";
}
get deafenLabel() {
- return this.voiceWebrtc.deafened
- ? i18n("voice.room.deafen_off")
- : i18n("voice.room.deafen_on");
+ return this.liveWebrtc.deafened
+ ? i18n("live.room.deafen_off")
+ : i18n("live.room.deafen_on");
}
get isPttEnabled() {
- return this.voiceWebrtc.pttEnabled;
+ return this.liveWebrtc.pttEnabled;
}
get pttToggleLabel() {
return this.isPttEnabled
- ? i18n("voice.ptt.disable")
- : i18n("voice.ptt.enable");
+ ? i18n("live.ptt.disable")
+ : i18n("live.ptt.enable");
}
get pttKeyLabel() {
- return i18n("voice.ptt.configure_key", {
- key: humanKeyName(this.voiceWebrtc.pttKey),
+ return i18n("live.ptt.configure_key", {
+ key: humanKeyName(this.liveWebrtc.pttKey),
});
}
@@ -179,19 +179,19 @@ export default class VoiceParticipantSidebarContextMenu extends Component {
}
get showAutoStatusToggle() {
- return this.isCurrentUser && this.siteSettings.voice_auto_status_enabled;
+ return this.isCurrentUser && this.siteSettings.live_auto_status_enabled;
}
get autoStatusLabel() {
- return this.voiceWebrtc.autoStatusEnabled
- ? i18n("voice.status.auto_update_on")
- : i18n("voice.status.auto_update_off");
+ return this.liveWebrtc.autoStatusEnabled
+ ? i18n("live.status.auto_update_on")
+ : i18n("live.status.auto_update_off");
}
@action
onVolumeChange(event) {
this.volume = parseInt(event.target.value, 10);
- this.voiceWebrtc.setParticipantVolume(
+ this.liveWebrtc.setParticipantVolume(
this.room.id,
this.participant.id,
this.volume / 100
@@ -200,7 +200,7 @@ export default class VoiceParticipantSidebarContextMenu extends Component {
@action
toggleMute() {
- this.isMuted = this.voiceWebrtc.toggleParticipantMute(
+ this.isMuted = this.liveWebrtc.toggleParticipantMute(
this.room.id,
this.participant.id
);
@@ -215,7 +215,7 @@ export default class VoiceParticipantSidebarContextMenu extends Component {
@action
async kick() {
try {
- await ajax(`/voice/rooms/${this.room.id}/kick`, {
+ await ajax(`/live/rooms/${this.room.id}/kick`, {
type: "DELETE",
data: { user_id: this.participant.id },
});
@@ -230,7 +230,7 @@ export default class VoiceParticipantSidebarContextMenu extends Component {
this.args.close();
this.modal.show(FlagModal, {
model: {
- flagTarget: new VoiceFlag(this.room),
+ flagTarget: new LiveFlag(this.room),
flagModel: {
id: this.participant.id,
user_id: this.participant.id,
@@ -243,31 +243,31 @@ export default class VoiceParticipantSidebarContextMenu extends Component {
@action
toggleMic() {
- this.voiceWebrtc.toggleMute();
+ this.liveWebrtc.toggleMute();
}
@action
toggleDeafen() {
- this.voiceWebrtc.toggleDeafen();
+ this.liveWebrtc.toggleDeafen();
}
@action
toggleAutoStatus() {
- this.voiceWebrtc.toggleAutoStatus();
+ this.liveWebrtc.toggleAutoStatus();
}
@action
openVoiceSettings() {
this.args.close();
- this.modal.show(VoiceVoiceSettingsModal);
+ this.modal.show(LiveVoiceSettingsModal);
}
@action
togglePtt() {
if (this.isPttEnabled) {
- this.voiceWebrtc.disablePtt();
+ this.liveWebrtc.disablePtt();
} else {
- this.voiceWebrtc.enablePtt();
+ this.liveWebrtc.enablePtt();
}
}
@@ -278,7 +278,7 @@ export default class VoiceParticipantSidebarContextMenu extends Component {
@action
onKeyCaptureConfirm(keyCode) {
- this.voiceWebrtc.setPttKey(keyCode);
+ this.liveWebrtc.setPttKey(keyCode);
this.showKeyCapture = false;
}
@@ -290,10 +290,10 @@ export default class VoiceParticipantSidebarContextMenu extends Component {
@action
async toggleRaiseHand() {
try {
- await ajax(`/voice/rooms/${this.room.id}/request_to_speak`, {
+ await ajax(`/live/rooms/${this.room.id}/request_to_speak`, {
type: this.handRaised ? "DELETE" : "POST",
data: {
- participant_session_id: this.voiceWebrtc.participantSessionIdFor(
+ participant_session_id: this.liveWebrtc.participantSessionIdFor(
this.room.id
),
},
@@ -307,7 +307,7 @@ export default class VoiceParticipantSidebarContextMenu extends Component {
@action
async dismissRequest() {
try {
- await ajax(`/voice/rooms/${this.room.id}/request_to_speak`, {
+ await ajax(`/live/rooms/${this.room.id}/request_to_speak`, {
type: "DELETE",
data: { user_id: this.participant.id },
});
@@ -329,7 +329,7 @@ export default class VoiceParticipantSidebarContextMenu extends Component {
async #changeParticipantRole(newRole) {
try {
- await ajax(`/voice/rooms/${this.room.id}/memberships`, {
+ await ajax(`/live/rooms/${this.room.id}/memberships`, {
type: "POST",
data: { user_id: this.participant.id, role: newRole },
});
@@ -340,11 +340,11 @@ export default class VoiceParticipantSidebarContextMenu extends Component {
}
<template>
- <DDropdownMenu class="voice-participant-sidebar-context-menu" as |dropdown|>
+ <DDropdownMenu class="live-participant-sidebar-context-menu" as |dropdown|>
{{#if this.canSpotlight}}
<dropdown.item>
<DButton
- class="voice-participant-sidebar-context-menu__spotlight-btn"
+ class="live-participant-sidebar-context-menu__spotlight-btn"
@action={{this.toggleSpotlight}}
@ariaPressed={{this.isSpotlighted}}
@icon="person-chalkboard"
@@ -357,7 +357,7 @@ export default class VoiceParticipantSidebarContextMenu extends Component {
{{#unless this.isListenerInStage}}
<dropdown.item>
<DButton
- class="voice-participant-sidebar-context-menu__mic-btn
+ class="live-participant-sidebar-context-menu__mic-btn
{{if this.micDisabledByPtt '--disabled-by-ptt'}}"
@action={{this.toggleMic}}
@disabled={{this.micDisabledByPtt}}
@@ -365,20 +365,20 @@ export default class VoiceParticipantSidebarContextMenu extends Component {
@translatedLabel={{this.micLabel}}
@translatedTitle={{if
this.micDisabledByPtt
- (i18n "voice.ptt.controlled_by_ptt")
+ (i18n "live.ptt.controlled_by_ptt")
this.micLabel
}}
/>
{{#if this.micDisabledByPtt}}
<span
- class="voice-participant-sidebar-context-menu__ptt-hint"
- >{{i18n "voice.ptt.controlled_by_ptt"}}</span>
+ class="live-participant-sidebar-context-menu__ptt-hint"
+ >{{i18n "live.ptt.controlled_by_ptt"}}</span>
{{/if}}
</dropdown.item>
{{/unless}}
<dropdown.item>
<DButton
- class="voice-participant-sidebar-context-menu__deafen-btn"
+ class="live-participant-sidebar-context-menu__deafen-btn"
@action={{this.toggleDeafen}}
@icon={{this.deafenIcon}}
@translatedLabel={{this.deafenLabel}}
@@ -388,7 +388,7 @@ export default class VoiceParticipantSidebarContextMenu extends Component {
{{#unless this.isListenerInStage}}
<dropdown.item>
<DButton
- class="voice-participant-sidebar-context-menu__ptt-btn
+ class="live-participant-sidebar-context-menu__ptt-btn
{{if this.isPttEnabled '--active'}}"
@action={{this.togglePtt}}
@icon={{if this.isPttEnabled "walkie-talkie" "walkie-talkie"}}
@@ -399,13 +399,13 @@ export default class VoiceParticipantSidebarContextMenu extends Component {
{{#if this.isPttEnabled}}
<dropdown.item>
{{#if this.showKeyCapture}}
- <VoicePttKeyCapture
+ <LivePttKeyCapture
@onCancel={{this.onKeyCaptureCancel}}
@onConfirm={{this.onKeyCaptureConfirm}}
/>
{{else}}
<DButton
- class="voice-participant-sidebar-context-menu__ptt-key-btn"
+ class="live-participant-sidebar-context-menu__ptt-key-btn"
@action={{this.openKeyCapture}}
@icon="keyboard"
@translatedLabel={{this.pttKeyLabel}}
@@ -417,20 +417,20 @@ export default class VoiceParticipantSidebarContextMenu extends Component {
{{/unless}}
<dropdown.item>
<DButton
- class="voice-participant-sidebar-context-menu__voice-settings-btn"
+ class="live-participant-sidebar-context-menu__voice-settings-btn"
@action={{this.openVoiceSettings}}
@icon="gear"
- @label="voice.voice_settings.open"
- @title="voice.voice_settings.open"
+ @label="live.voice_settings.open"
+ @title="live.voice_settings.open"
/>
</dropdown.item>
{{#if this.showAutoStatusToggle}}
<dropdown.item>
<DButton
- class="voice-participant-sidebar-context-menu__auto-status-btn"
+ class="live-participant-sidebar-context-menu__auto-status-btn"
@action={{this.toggleAutoStatus}}
@icon={{if
- this.voiceWebrtc.autoStatusEnabled
+ this.liveWebrtc.autoStatusEnabled
"square-check"
"far-square"
}}
@@ -442,7 +442,7 @@ export default class VoiceParticipantSidebarContextMenu extends Component {
{{#if this.isListenerInStage}}
<dropdown.item>
<DButton
- class="voice-participant-sidebar-context-menu__raise-hand-btn
+ class="live-participant-sidebar-context-menu__raise-hand-btn
{{if this.handRaised '--active'}}"
@action={{this.toggleRaiseHand}}
@icon="hand"
@@ -452,18 +452,18 @@ export default class VoiceParticipantSidebarContextMenu extends Component {
</dropdown.item>
<dropdown.item>
<span
- class="voice-participant-sidebar-context-menu__stage-hint"
- >{{i18n "voice.room.listeners_cannot_unmute"}}</span>
+ class="live-participant-sidebar-context-menu__stage-hint"
+ >{{i18n "live.room.listeners_cannot_unmute"}}</span>
</dropdown.item>
{{/if}}
{{else}}
{{#if this.participantIsSpeakerOrMod}}
- <dropdown.item class="voice-participant-sidebar-context-menu__volume">
- <label class="voice-participant-sidebar-context-menu__volume-label">
- {{i18n "voice.participant.volume"}}
+ <dropdown.item class="live-participant-sidebar-context-menu__volume">
+ <label class="live-participant-sidebar-context-menu__volume-label">
+ {{i18n "live.participant.volume"}}
</label>
<input
- class="voice-participant-sidebar-context-menu__volume-slider"
+ class="live-participant-sidebar-context-menu__volume-slider"
max="100"
min="0"
type="range"
@@ -473,7 +473,7 @@ export default class VoiceParticipantSidebarContextMenu extends Component {
</dropdown.item>
<dropdown.item>
<DButton
- class="voice-participant-sidebar-context-menu__mute-btn"
+ class="live-participant-sidebar-context-menu__mute-btn"
@action={{this.toggleMute}}
@icon={{this.muteIcon}}
@translatedLabel={{this.muteLabel}}
@@ -481,12 +481,12 @@ export default class VoiceParticipantSidebarContextMenu extends Component {
/>
</dropdown.item>
{{else if (not this.isStageRoom)}}
- <dropdown.item class="voice-participant-sidebar-context-menu__volume">
- <label class="voice-participant-sidebar-context-menu__volume-label">
- {{i18n "voice.participant.volume"}}
+ <dropdown.item class="live-participant-sidebar-context-menu__volume">
+ <label class="live-participant-sidebar-context-menu__volume-label">
+ {{i18n "live.participant.volume"}}
</label>
<input
- class="voice-participant-sidebar-context-menu__volume-slider"
+ class="live-participant-sidebar-context-menu__volume-slider"
max="100"
min="0"
type="range"
@@ -496,7 +496,7 @@ export default class VoiceParticipantSidebarContextMenu extends Component {
</dropdown.item>
<dropdown.item>
<DButton
- class="voice-participant-sidebar-context-menu__mute-btn"
+ class="live-participant-sidebar-context-menu__mute-btn"
@action={{this.toggleMute}}
@icon={{this.muteIcon}}
@translatedLabel={{this.muteLabel}}
@@ -507,55 +507,55 @@ export default class VoiceParticipantSidebarContextMenu extends Component {
{{#if this.canPromoteToSpeaker}}
<dropdown.item>
<DButton
- class="voice-participant-sidebar-context-menu__promote-btn"
+ class="live-participant-sidebar-context-menu__promote-btn"
@action={{this.promoteToSpeaker}}
@icon="microphone"
- @label="voice.stage.make_speaker"
- @title="voice.stage.make_speaker"
+ @label="live.stage.make_speaker"
+ @title="live.stage.make_speaker"
/>
</dropdown.item>
{{/if}}
{{#if this.canDemoteToListener}}
<dropdown.item>
<DButton
- class="voice-participant-sidebar-context-menu__demote-btn"
+ class="live-participant-sidebar-context-menu__demote-btn"
@action={{this.demoteToListener}}
@icon="volume-xmark"
- @label="voice.stage.move_to_listeners"
- @title="voice.stage.move_to_listeners"
+ @label="live.stage.move_to_listeners"
+ @title="live.stage.move_to_listeners"
/>
</dropdown.item>
{{/if}}
{{#if this.canDismissRequest}}
<dropdown.item>
<DButton
- class="voice-participant-sidebar-context-menu__dismiss-request-btn"
+ class="live-participant-sidebar-context-menu__dismiss-request-btn"
@action={{this.dismissRequest}}
@icon="xmark"
- @label="voice.stage.dismiss_request_menu"
- @title="voice.stage.dismiss_request_menu"
+ @label="live.stage.dismiss_request_menu"
+ @title="live.stage.dismiss_request_menu"
/>
</dropdown.item>
{{/if}}
{{#if this.canFlag}}
<dropdown.item>
<DButton
- class="voice-participant-sidebar-context-menu__flag-btn"
+ class="live-participant-sidebar-context-menu__flag-btn"
@action={{this.flag}}
@icon="flag"
- @label="voice.participant.flag"
- @title="voice.participant.flag"
+ @label="live.participant.flag"
+ @title="live.participant.flag"
/>
</dropdown.item>
{{/if}}
{{#if this.canKick}}
<dropdown.item>
<DButton
- class="voice-participant-sidebar-context-menu__kick-btn btn-danger"
+ class="live-participant-sidebar-context-menu__kick-btn btn-danger"
@action={{this.kick}}
@icon="right-from-bracket"
- @label="voice.participant.kick"
- @title="voice.participant.kick"
+ @label="live.participant.kick"
+ @title="live.participant.kick"
/>
</dropdown.item>
{{/if}}
diff --git a/plugins/live/assets/javascripts/discourse/components/live-participant-sidebar-suffix.gjs b/plugins/live/assets/javascripts/discourse/components/live-participant-sidebar-suffix.gjs
new file mode 100644
index 00000000000..4b4c086090e
--- /dev/null
+++ b/plugins/live/assets/javascripts/discourse/components/live-participant-sidebar-suffix.gjs
@@ -0,0 +1,28 @@
+import dIcon from "discourse/ui-kit/helpers/d-icon";
+
+const LiveParticipantSidebarSuffix = <template>
+ {{! Always rendered, even with no icons — this is the element that pushes
+ itself and the hover menu button to the right edge of the row. }}
+ <span class="live-participant-suffix">
+ {{#if @suffixArgs.isHandRaised}}
+ {{dIcon "hand" title="live.participant.status_hand_raised"}}
+ {{/if}}
+ {{#if @suffixArgs.isScreenSharing}}
+ {{dIcon "display" title="live.participant.status_screen_sharing"}}
+ {{/if}}
+ {{#if @suffixArgs.isVideoOn}}
+ {{dIcon "video" title="live.participant.status_video"}}
+ {{/if}}
+ {{#if @suffixArgs.isPtt}}
+ {{dIcon "walkie-talkie" title="live.participant.status_ptt"}}
+ {{/if}}
+ {{#if @suffixArgs.isMuted}}
+ {{dIcon "microphone-slash" title="live.participant.status_muted"}}
+ {{/if}}
+ {{#if @suffixArgs.isDeafened}}
+ {{dIcon "volume-xmark" title="live.participant.status_deafened"}}
+ {{/if}}
+ </span>
+</template>;
+
+export default LiveParticipantSidebarSuffix;
diff --git a/plugins/voice/assets/javascripts/discourse/components/voice-ptt-key-capture.gjs b/plugins/live/assets/javascripts/discourse/components/live-ptt-key-capture.gjs
similarity index 71%
rename from plugins/voice/assets/javascripts/discourse/components/voice-ptt-key-capture.gjs
rename to plugins/live/assets/javascripts/discourse/components/live-ptt-key-capture.gjs
index 13a106bfca1..05ae5358929 100644
--- a/plugins/voice/assets/javascripts/discourse/components/voice-ptt-key-capture.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/live-ptt-key-capture.gjs
@@ -5,11 +5,11 @@ import { action } from "@ember/object";
import { modifier as modifierFn } from "ember-modifier";
import DButton from "discourse/ui-kit/d-button";
import { i18n } from "discourse-i18n";
-import { humanKeyName } from "../lib/voice/ptt-utils.js";
+import { humanKeyName } from "../lib/live/ptt-utils.js";
const RESERVED_KEYS = new Set(["Escape", "Tab", "Enter"]);
-export default class VoicePttKeyCapture extends Component {
+export default class LivePttKeyCapture extends Component {
@tracked capturedKey = null;
@tracked isReserved = false;
@@ -19,12 +19,12 @@ export default class VoicePttKeyCapture extends Component {
get displayText() {
if (this.isReserved) {
- return i18n("voice.ptt.reserved_key");
+ return i18n("live.ptt.reserved_key");
}
if (this.capturedKey) {
return humanKeyName(this.capturedKey);
}
- return i18n("voice.ptt.press_key");
+ return i18n("live.ptt.press_key");
}
@action
@@ -56,27 +56,27 @@ export default class VoicePttKeyCapture extends Component {
<template>
<div
- class="voice-ptt-key-capture"
+ class="live-ptt-key-capture"
tabindex="0"
{{on "keydown" this.onKeyDown}}
{{this.autoFocus}}
>
<span
- class="voice-ptt-key-capture__display
- {{if this.isReserved 'voice-ptt-key-capture__display--error'}}
- {{if this.capturedKey 'voice-ptt-key-capture__display--captured'}}"
+ class="live-ptt-key-capture__display
+ {{if this.isReserved 'live-ptt-key-capture__display--error'}}
+ {{if this.capturedKey 'live-ptt-key-capture__display--captured'}}"
>
{{this.displayText}}
</span>
- <div class="voice-ptt-key-capture__actions">
+ <div class="live-ptt-key-capture__actions">
<DButton
- class="btn-flat btn-small voice-ptt-key-capture__confirm"
+ class="btn-flat btn-small live-ptt-key-capture__confirm"
@action={{this.confirm}}
@disabled={{if this.capturedKey false true}}
@icon="check"
/>
<DButton
- class="btn-flat btn-small voice-ptt-key-capture__cancel"
+ class="btn-flat btn-small live-ptt-key-capture__cancel"
@action={{this.cancel}}
@icon="xmark"
/>
diff --git a/plugins/voice/assets/javascripts/discourse/components/voice-room-form.gjs b/plugins/live/assets/javascripts/discourse/components/live-room-form.gjs
similarity index 69%
rename from plugins/voice/assets/javascripts/discourse/components/voice-room-form.gjs
rename to plugins/live/assets/javascripts/discourse/components/live-room-form.gjs
index 5fd7d57c275..df5662fe151 100644
--- a/plugins/voice/assets/javascripts/discourse/components/voice-room-form.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/live-room-form.gjs
@@ -9,7 +9,7 @@ import { popupAjaxError } from "discourse/lib/ajax-error";
import DButton from "discourse/ui-kit/d-button";
import { i18n } from "discourse-i18n";
-export default class VoiceRoomForm extends Component {
+export default class LiveRoomForm extends Component {
@service site;
@service siteSettings;
@service chatApi;
@@ -39,16 +39,16 @@ export default class VoiceRoomForm extends Component {
}
get showVideoToggle() {
- return this.site.voice_video_available;
+ return this.site.live_video_available;
}
get showLivekitToggle() {
- return this.site.voice_livekit_per_room_available;
+ return this.site.live_livekit_per_room_available;
}
get showChatSettings() {
return (
- this.siteSettings.chat_enabled && this.siteSettings.voice_chat_enabled
+ this.siteSettings.chat_enabled && this.siteSettings.live_chat_enabled
);
}
@@ -60,13 +60,13 @@ export default class VoiceRoomForm extends Component {
return [
{
id: "open",
- name: i18n("voice.room.type_open"),
- description: i18n("voice.room.type_open_description"),
+ name: i18n("live.room.type_open"),
+ description: i18n("live.room.type_open_description"),
},
{
id: "stage",
- name: i18n("voice.room.type_stage"),
- description: i18n("voice.room.type_stage_description"),
+ name: i18n("live.room.type_stage"),
+ description: i18n("live.room.type_stage_description"),
},
];
}
@@ -76,16 +76,16 @@ export default class VoiceRoomForm extends Component {
id: profile,
name:
profile === "site_default"
- ? i18n("voice.admin.room.quality_site_default")
- : i18n(`voice.quality.${profile}`),
+ ? i18n("live.admin.room.quality_site_default")
+ : i18n(`live.quality.${profile}`),
}));
}
get submitLabel() {
if (this.isAdminContext) {
- return this.args.room?.id ? "voice.admin.update" : "voice.admin.create";
+ return this.args.room?.id ? "live.admin.update" : "live.admin.create";
}
- return "voice.room.save";
+ return "live.room.save";
}
@action
@@ -129,17 +129,17 @@ export default class VoiceRoomForm extends Component {
}
<template>
- <div class="voice-room-form {{if this.isAdminContext 'admin-detail'}}">
+ <div class="live-room-form {{if this.isAdminContext 'admin-detail'}}">
{{#if this.isAdminContext}}
<BackButton
- class="voice-admin-back"
- @label="voice.admin.back"
- @route="adminPlugins.show.voice-rooms.index"
+ class="live-admin-back"
+ @label="live.admin.back"
+ @route="adminPlugins.show.live-rooms.index"
/>
{{/if}}
<Form
- class="voice-room-form__form"
+ class="live-room-form__form"
@data={{this.formData}}
@onSubmit={{this.handleSubmit}}
as |form data|
@@ -147,8 +147,8 @@ export default class VoiceRoomForm extends Component {
<form.Field
@format="full"
@name="name"
- @placeholder={{i18n "voice.admin.room.name_placeholder"}}
- @title={{i18n "voice.admin.room.name"}}
+ @placeholder={{i18n "live.admin.room.name_placeholder"}}
+ @title={{i18n "live.admin.room.name"}}
@type="input"
@validation="required|length:1,80"
as |field|
@@ -157,11 +157,11 @@ export default class VoiceRoomForm extends Component {
</form.Field>
<form.Field
- @description={{i18n "voice.admin.room.slug_help"}}
+ @description={{i18n "live.admin.room.slug_help"}}
@format="full"
@name="slug"
- @placeholder={{i18n "voice.admin.room.slug_placeholder"}}
- @title={{i18n "voice.admin.room.slug"}}
+ @placeholder={{i18n "live.admin.room.slug_placeholder"}}
+ @title={{i18n "live.admin.room.slug"}}
@type="input"
as |field|
>
@@ -171,7 +171,7 @@ export default class VoiceRoomForm extends Component {
<form.Field
@format="full"
@name="description"
- @title={{i18n "voice.admin.room.description"}}
+ @title={{i18n "live.admin.room.description"}}
@type="textarea"
as |field|
>
@@ -181,7 +181,7 @@ export default class VoiceRoomForm extends Component {
<form.Field
@format="full"
@name="room_type"
- @title={{i18n "voice.admin.room.room_type"}}
+ @title={{i18n "live.admin.room.room_type"}}
@type="radio-group"
as |field|
>
@@ -197,27 +197,27 @@ export default class VoiceRoomForm extends Component {
</form.Field>
{{#if (this.isStageType data.room_type)}}
- <div class="voice-room-form__stage-hint">
- {{i18n "voice.room.type_stage_hint"}}
+ <div class="live-room-form__stage-hint">
+ {{i18n "live.room.type_stage_hint"}}
</div>
{{/if}}
<form.Field
- @description={{i18n "voice.admin.room.public_help"}}
+ @description={{i18n "live.admin.room.public_help"}}
@format="full"
@name="public"
- @title={{i18n "voice.admin.room.public"}}
+ @title={{i18n "live.admin.room.public"}}
@type="toggle"
as |field|
>
<field.Control />
{{#if @onManageMembers}}
<DButton
- class="btn-link voice-room-form__manage-members
+ class="btn-link live-room-form__manage-members
{{if data.public '--hidden'}}"
@action={{@onManageMembers}}
@icon="users"
- @label="voice.admin.room.manage_members"
+ @label="live.admin.room.manage_members"
/>
{{/if}}
</form.Field>
@@ -226,12 +226,12 @@ export default class VoiceRoomForm extends Component {
<form.Field
@description={{if
(this.isStageType data.room_type)
- (i18n "voice.admin.room.video_enabled_stage_help")
- (i18n "voice.admin.room.video_enabled_help")
+ (i18n "live.admin.room.video_enabled_stage_help")
+ (i18n "live.admin.room.video_enabled_help")
}}
@format="full"
@name="video_enabled"
- @title={{i18n "voice.admin.room.video_enabled"}}
+ @title={{i18n "live.admin.room.video_enabled"}}
@type="toggle"
as |field|
>
@@ -241,10 +241,10 @@ export default class VoiceRoomForm extends Component {
{{#if this.showLivekitToggle}}
<form.Field
- @description={{i18n "voice.admin.room.livekit_enabled_help"}}
+ @description={{i18n "live.admin.room.livekit_enabled_help"}}
@format="full"
@name="livekit_enabled"
- @title={{i18n "voice.admin.room.livekit_enabled"}}
+ @title={{i18n "live.admin.room.livekit_enabled"}}
@type="toggle"
as |field|
>
@@ -253,9 +253,9 @@ export default class VoiceRoomForm extends Component {
{{/if}}
<form.Field
- @description={{i18n "voice.admin.room.max_participants_help"}}
+ @description={{i18n "live.admin.room.max_participants_help"}}
@name="max_participants"
- @title={{i18n "voice.admin.room.max_participants"}}
+ @title={{i18n "live.admin.room.max_participants"}}
@type="input-number"
@validation={{this.maxParticipantsValidation}}
as |field|
@@ -263,14 +263,14 @@ export default class VoiceRoomForm extends Component {
<field.Control />
</form.Field>
- <details class="voice-room-form__quality">
- <summary>{{i18n "voice.admin.room.quality_section"}}</summary>
+ <details class="live-room-form__quality">
+ <summary>{{i18n "live.admin.room.quality_section"}}</summary>
<form.Field
- @description={{i18n "voice.admin.room.max_quality_profile_help"}}
+ @description={{i18n "live.admin.room.max_quality_profile_help"}}
@format="full"
@name="max_quality_profile"
- @title={{i18n "voice.admin.room.max_quality_profile"}}
+ @title={{i18n "live.admin.room.max_quality_profile"}}
@type="select"
as |field|
>
@@ -285,15 +285,12 @@ export default class VoiceRoomForm extends Component {
</details>
{{#if this.showChatSettings}}
- <div
- class="voice-room-form__chat"
- {{didInsert this.loadChatChannels}}
- >
+ <div class="live-room-form__chat" {{didInsert this.loadChatChannels}}>
<form.Field
- @description={{i18n "voice.admin.room.chat_channel_help"}}
+ @description={{i18n "live.admin.room.chat_channel_help"}}
@format="full"
@name="chat_channel_id"
- @title={{i18n "voice.admin.room.chat_channel"}}
+ @title={{i18n "live.admin.room.chat_channel"}}
@type="select"
as |field|
>
@@ -307,16 +304,16 @@ export default class VoiceRoomForm extends Component {
</form.Field>
{{#unless this.chatChannels.length}}
- <div class="voice-room-form__chat-empty">
- {{i18n "voice.admin.room.chat_channel_none"}}
+ <div class="live-room-form__chat-empty">
+ {{i18n "live.admin.room.chat_channel_none"}}
</div>
{{/unless}}
{{#if data.chat_channel_id}}
<form.Field
- @description={{i18n "voice.admin.room.chat_idle_minutes_help"}}
+ @description={{i18n "live.admin.room.chat_idle_minutes_help"}}
@name="chat_idle_minutes"
- @title={{i18n "voice.admin.room.chat_idle_minutes"}}
+ @title={{i18n "live.admin.room.chat_idle_minutes"}}
@type="input-number"
@validation="integer|number:2,1440"
as |field|
@@ -324,15 +321,15 @@ export default class VoiceRoomForm extends Component {
<field.Control />
</form.Field>
- <div class="voice-room-form__chat-preview">
- {{i18n "voice.admin.room.chat_thread_hint"}}
+ <div class="live-room-form__chat-preview">
+ {{i18n "live.admin.room.chat_thread_hint"}}
</div>
{{/if}}
</div>
{{/if}}
<form.Submit
- class="voice-room-form__submit"
+ class="live-room-form__submit"
@disabled={{this.isSaving}}
@label={{this.submitLabel}}
/>
diff --git a/plugins/voice/assets/javascripts/discourse/components/voice-room-sidebar-context-menu.gjs b/plugins/live/assets/javascripts/discourse/components/live-room-sidebar-context-menu.gjs
similarity index 53%
rename from plugins/voice/assets/javascripts/discourse/components/voice-room-sidebar-context-menu.gjs
rename to plugins/live/assets/javascripts/discourse/components/live-room-sidebar-context-menu.gjs
index 0e2b4a5d84b..40d4cd5d2a5 100644
--- a/plugins/voice/assets/javascripts/discourse/components/voice-room-sidebar-context-menu.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/live-room-sidebar-context-menu.gjs
@@ -5,13 +5,13 @@ import { clipboardCopy } from "discourse/lib/utilities";
import DButton from "discourse/ui-kit/d-button";
import DDropdownMenu from "discourse/ui-kit/d-dropdown-menu";
import { i18n } from "discourse-i18n";
-import VoiceInviteUsersModal from "./modal/voice-invite-users.gjs";
-import VoiceRoomInfoModal from "./modal/voice-room-info.gjs";
-import VoiceInviteAgentButton from "./voice-invite-agent-button.gjs";
+import LiveInviteAgentButton from "./live-invite-agent-button.gjs";
+import LiveInviteUsersModal from "./modal/live-invite-users.gjs";
+import LiveRoomInfoModal from "./modal/live-room-info.gjs";
-export default class VoiceRoomSidebarContextMenu extends Component {
+export default class LiveRoomSidebarContextMenu extends Component {
@service modal;
- @service voiceWebrtc;
+ @service liveWebrtc;
@service router;
@service toasts;
@@ -20,41 +20,41 @@ export default class VoiceRoomSidebarContextMenu extends Component {
}
get isConnected() {
- return this.voiceWebrtc.connectionStateFor(this.room.id) === "connected";
+ return this.liveWebrtc.connectionStateFor(this.room.id) === "connected";
}
@action
openRoomPage() {
- this.router.transitionTo("voice-room", this.room.slug);
+ this.router.transitionTo("live-room", this.room.slug);
this.args.close();
}
@action
openRoomInfo() {
- this.modal.show(VoiceRoomInfoModal, { model: { room: this.room } });
+ this.modal.show(LiveRoomInfoModal, { model: { room: this.room } });
this.args.close();
}
@action
openInviteModal() {
- this.modal.show(VoiceInviteUsersModal, { model: { room: this.room } });
+ this.modal.show(LiveInviteUsersModal, { model: { room: this.room } });
this.args.close();
}
@action
copyRoomLink() {
- const url = this.router.urlFor("voice-room", this.room.slug);
+ const url = this.router.urlFor("live-room", this.room.slug);
clipboardCopy(new URL(url, window.location.origin).href);
this.toasts.success({
duration: "short",
- data: { message: i18n("voice.room.link_copied") },
+ data: { message: i18n("live.room.link_copied") },
});
this.args.close();
}
@action
editRoom() {
- this.modal.show(VoiceRoomInfoModal, {
+ this.modal.show(LiveRoomInfoModal, {
model: { room: this.room, isEditing: true },
});
this.args.close();
@@ -62,97 +62,97 @@ export default class VoiceRoomSidebarContextMenu extends Component {
@action
toggleCallWidget() {
- this.voiceWebrtc.toggleCallWidgetHidden();
+ this.liveWebrtc.toggleCallWidgetHidden();
this.args.close();
}
@action
leaveRoom() {
- this.voiceWebrtc.leave(this.room);
+ this.liveWebrtc.leave(this.room);
this.args.close();
}
<template>
- <DDropdownMenu class="voice-room-sidebar-context-menu" as |dropdown|>
- <VoiceInviteAgentButton
+ <DDropdownMenu class="live-room-sidebar-context-menu" as |dropdown|>
+ <LiveInviteAgentButton
@closeMenu={{@close}}
@item={{dropdown.item}}
@room={{this.room}}
/>
<dropdown.item>
<DButton
- class="voice-room-sidebar-context-menu__open-page"
+ class="live-room-sidebar-context-menu__open-page"
@action={{this.openRoomPage}}
@icon="expand"
- @label="voice.room.open_page"
- @title="voice.room.open_page"
+ @label="live.room.open_page"
+ @title="live.room.open_page"
/>
</dropdown.item>
<dropdown.item>
<DButton
- class="voice-room-sidebar-context-menu__room-info"
+ class="live-room-sidebar-context-menu__room-info"
@action={{this.openRoomInfo}}
@icon="circle-info"
- @label="voice.room.info"
- @title="voice.room.info"
+ @label="live.room.info"
+ @title="live.room.info"
/>
</dropdown.item>
{{#if this.room.can_invite}}
<dropdown.item>
<DButton
- class="voice-room-sidebar-context-menu__invite"
+ class="live-room-sidebar-context-menu__invite"
@action={{this.openInviteModal}}
@icon="user-plus"
- @label="voice.invite.menu"
- @title="voice.invite.menu"
+ @label="live.invite.menu"
+ @title="live.invite.menu"
/>
</dropdown.item>
{{/if}}
<dropdown.item>
<DButton
- class="voice-room-sidebar-context-menu__copy-link"
+ class="live-room-sidebar-context-menu__copy-link"
@action={{this.copyRoomLink}}
@icon="link"
- @label="voice.room.copy_link"
- @title="voice.room.copy_link"
+ @label="live.room.copy_link"
+ @title="live.room.copy_link"
/>
</dropdown.item>
{{#if this.room.can_manage}}
<dropdown.item>
<DButton
- class="voice-room-sidebar-context-menu__edit-room"
+ class="live-room-sidebar-context-menu__edit-room"
@action={{this.editRoom}}
@icon="pencil"
- @label="voice.room.edit"
- @title="voice.room.edit"
+ @label="live.room.edit"
+ @title="live.room.edit"
/>
</dropdown.item>
{{/if}}
{{#if this.isConnected}}
<dropdown.item>
<DButton
- class="voice-room-sidebar-context-menu__toggle-widget"
+ class="live-room-sidebar-context-menu__toggle-widget"
@action={{this.toggleCallWidget}}
- @icon={{if this.voiceWebrtc.callWidgetHidden "eye" "eye-slash"}}
+ @icon={{if this.liveWebrtc.callWidgetHidden "eye" "eye-slash"}}
@label={{if
- this.voiceWebrtc.callWidgetHidden
- "voice.widget.show"
- "voice.widget.hide"
+ this.liveWebrtc.callWidgetHidden
+ "live.widget.show"
+ "live.widget.hide"
}}
@title={{if
- this.voiceWebrtc.callWidgetHidden
- "voice.widget.show"
- "voice.widget.hide"
+ this.liveWebrtc.callWidgetHidden
+ "live.widget.show"
+ "live.widget.hide"
}}
/>
</dropdown.item>
<dropdown.item>
<DButton
- class="voice-room-sidebar-context-menu__leave-room --danger"
+ class="live-room-sidebar-context-menu__leave-room --danger"
@action={{this.leaveRoom}}
@icon="phone-slash"
- @label="voice.room.leave"
- @title="voice.room.leave"
+ @label="live.room.leave"
+ @title="live.room.leave"
/>
</dropdown.item>
{{/if}}
diff --git a/plugins/voice/assets/javascripts/discourse/components/voice/call-button.gjs b/plugins/live/assets/javascripts/discourse/components/live/call-button.gjs
similarity index 68%
rename from plugins/voice/assets/javascripts/discourse/components/voice/call-button.gjs
rename to plugins/live/assets/javascripts/discourse/components/live/call-button.gjs
index d9fb6e9a601..94266c1acff 100644
--- a/plugins/voice/assets/javascripts/discourse/components/voice/call-button.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/live/call-button.gjs
@@ -5,10 +5,10 @@ import { service } from "@ember/service";
import { popupAjaxError } from "discourse/lib/ajax-error";
import icon from "discourse/ui-kit/helpers/d-icon";
import { i18n } from "discourse-i18n";
-import { unlockAudio } from "../../lib/voice/sound-effects.js";
+import { unlockAudio } from "../../lib/live/sound-effects.js";
-export default class VoiceCallButton extends Component {
- @service("voice-calls") voiceCalls;
+export default class LiveCallButton extends Component {
+ @service("live-calls") liveCalls;
// A plain button: the click must synchronously unlock the AudioContext so
// the waiting tone can play once the call request round-trips, and deferred
@@ -17,7 +17,7 @@ export default class VoiceCallButton extends Component {
async call() {
unlockAudio();
try {
- await this.voiceCalls.callUser(this.args.user.username);
+ await this.liveCalls.callUser(this.args.user.username);
} catch (error) {
popupAjaxError(error);
}
@@ -25,12 +25,12 @@ export default class VoiceCallButton extends Component {
<template>
<button
- class="btn btn-icon-text btn-primary voice-call-button__button"
+ class="btn btn-icon-text btn-primary live-call-button__button"
type="button"
{{on "click" this.call}}
>
{{icon "phone"}}
- <span class="d-button-label">{{i18n "voice.call.button"}}</span>
+ <span class="d-button-label">{{i18n "live.call.button"}}</span>
</button>
</template>
}
diff --git a/plugins/voice/assets/javascripts/discourse/components/voice/call-controls.gjs b/plugins/live/assets/javascripts/discourse/components/live/call-controls.gjs
similarity index 69%
rename from plugins/voice/assets/javascripts/discourse/components/voice/call-controls.gjs
rename to plugins/live/assets/javascripts/discourse/components/live/call-controls.gjs
index 2655f31d0ca..b493959527d 100644
--- a/plugins/voice/assets/javascripts/discourse/components/voice/call-controls.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/live/call-controls.gjs
@@ -15,26 +15,26 @@ import { i18n } from "discourse-i18n";
import {
isAiMode,
NOISE_SUPPRESSION_MODES,
-} from "../../lib/voice/audio-processing.js";
+} from "../../lib/live/audio-processing.js";
import {
enumerateAudioDevices,
enumerateVideoDevices,
outputSelectionSupported,
SYSTEM_DEFAULT_DEVICE_ID,
-} from "../../lib/voice/media-devices.js";
-import { prefetchEngineAssets } from "../../lib/voice/noise-suppression.js";
+} from "../../lib/live/media-devices.js";
+import { prefetchEngineAssets } from "../../lib/live/noise-suppression.js";
import {
engineForMode,
noiseSuppressionModeLabel,
-} from "../../lib/voice/ns-engines.js";
-import { queuePosition } from "../../lib/voice/speak-queue.js";
-import VoiceVideoSettingsModal from "../modal/voice-video-settings.gjs";
-import VoiceVoiceSettingsModal from "../modal/voice-voice-settings.gjs";
-import VoiceCallSubmenu from "./call-submenu.gjs";
+} from "../../lib/live/ns-engines.js";
+import { queuePosition } from "../../lib/live/speak-queue.js";
+import LiveVideoSettingsModal from "../modal/live-video-settings.gjs";
+import LiveVoiceSettingsModal from "../modal/live-voice-settings.gjs";
+import LiveCallSubmenu from "./call-submenu.gjs";
-const AUDIO_MENU = "voice-audio-menu";
-const VIDEO_MENU = "voice-video-menu";
-const SUBMENU = "voice-call-submenu";
+const AUDIO_MENU = "live-audio-menu";
+const VIDEO_MENU = "live-video-menu";
+const SUBMENU = "live-call-submenu";
// The audio/video capture controls shared by the room page and the persistent
// call widget: mic and camera "combo" buttons (a toggle plus a caret opening
@@ -42,12 +42,12 @@ const SUBMENU = "voice-call-submenu";
//
// Hosts render this inside their own `__controls` footer and append their
// context-specific tail (overflow menu, leave button, etc.) as siblings.
-export default class VoiceCallControls extends Component {
+export default class LiveCallControls extends Component {
@service currentUser;
@service dialog;
@service menu;
@service modal;
- @service voiceWebrtc;
+ @service liveWebrtc;
@service siteSettings;
@tracked audioInputDevices = [];
@@ -60,36 +60,36 @@ export default class VoiceCallControls extends Component {
}
get videoAllowed() {
- return this.voiceWebrtc.videoAllowedIn(this.room);
+ return this.liveWebrtc.videoAllowedIn(this.room);
}
get screenShareAllowed() {
- return this.voiceWebrtc.screenShareAllowedIn(this.room);
+ return this.liveWebrtc.screenShareAllowedIn(this.room);
}
get cameraActive() {
- return this.voiceWebrtc.localVideoKind === "camera";
+ return this.liveWebrtc.localVideoKind === "camera";
}
get screenShareActive() {
- return this.voiceWebrtc.localVideoKind === "screen";
+ return this.liveWebrtc.localVideoKind === "screen";
}
get cameraDisabled() {
return (
- !this.cameraActive && !this.voiceWebrtc.canPublishCamera(this.room?.id)
+ !this.cameraActive && !this.liveWebrtc.canPublishCamera(this.room?.id)
);
}
get screenShareDisabled() {
return (
!this.screenShareActive &&
- !this.voiceWebrtc.canPublishScreen(this.room?.id)
+ !this.liveWebrtc.canPublishScreen(this.room?.id)
);
}
get showScreenShare() {
- return this.screenShareAllowed && this.voiceWebrtc.screenShareSupported;
+ return this.screenShareAllowed && this.liveWebrtc.screenShareSupported;
}
get #ownParticipant() {
@@ -112,67 +112,67 @@ export default class VoiceCallControls extends Component {
get raiseHandTitle() {
if (!this.handRaisedAt) {
- return i18n("voice.stage.raise_hand");
+ return i18n("live.stage.raise_hand");
}
const position = queuePosition(this.room, this.currentUser?.id);
- const lowerHand = i18n("voice.stage.lower_hand");
+ const lowerHand = i18n("live.stage.lower_hand");
return position
- ? `${lowerHand} — ${i18n("voice.stage.queue_position", { position })}`
+ ? `${lowerHand} — ${i18n("live.stage.queue_position", { position })}`
: lowerHand;
}
get noiseSuppressionOn() {
- return this.voiceWebrtc.noiseSuppressionState === "on";
+ return this.liveWebrtc.noiseSuppressionState === "on";
}
get noiseSuppressionStarting() {
- return this.voiceWebrtc.noiseSuppressionState === "starting";
+ return this.liveWebrtc.noiseSuppressionState === "starting";
}
// Standard (native) suppression is the browser default everywhere, so
// only the AI mode earns an indicator.
get showNoiseSuppressionBadge() {
return (
- this.voiceWebrtc.audioEnabled &&
- isAiMode(this.voiceWebrtc.noiseSuppressionMode) &&
- this.voiceWebrtc.noiseSuppressionState !== "off"
+ this.liveWebrtc.audioEnabled &&
+ isAiMode(this.liveWebrtc.noiseSuppressionMode) &&
+ this.liveWebrtc.noiseSuppressionState !== "off"
);
}
get currentNoiseSuppressionModeName() {
- return noiseSuppressionModeLabel(this.voiceWebrtc.noiseSuppressionMode);
+ return noiseSuppressionModeLabel(this.liveWebrtc.noiseSuppressionMode);
}
get micTitle() {
- if (this.voiceWebrtc.pttEnabled) {
- return i18n("voice.ptt.controlled_by_ptt");
+ if (this.liveWebrtc.pttEnabled) {
+ return i18n("live.ptt.controlled_by_ptt");
}
- const title = this.voiceWebrtc.audioEnabled
- ? i18n("voice.room.mic_on")
- : i18n("voice.room.mic_off");
+ const title = this.liveWebrtc.audioEnabled
+ ? i18n("live.room.mic_on")
+ : i18n("live.room.mic_off");
if (this.showNoiseSuppressionBadge && this.noiseSuppressionOn) {
- return `${title} — ${i18n("voice.room.noise_suppression_active")}`;
+ return `${title} — ${i18n("live.room.noise_suppression_active")}`;
}
return title;
}
get cameraTitle() {
return this.cameraActive
- ? i18n("voice.video.camera_off")
- : i18n("voice.video.camera_on");
+ ? i18n("live.video.camera_off")
+ : i18n("live.video.camera_on");
}
get screenShareTitle() {
return this.screenShareActive
- ? i18n("voice.video.screen_share_stop")
- : i18n("voice.video.screen_share_start");
+ ? i18n("live.video.screen_share_stop")
+ : i18n("live.video.screen_share_start");
}
get deafenTitle() {
- return this.voiceWebrtc.deafened
- ? i18n("voice.room.deafen_off")
- : i18n("voice.room.deafen_on");
+ return this.liveWebrtc.deafened
+ ? i18n("live.room.deafen_off")
+ : i18n("live.room.deafen_on");
}
get audioOutputSupported() {
@@ -182,8 +182,8 @@ export default class VoiceCallControls extends Component {
get canRecord() {
return (
this.room?.can_manage &&
- this.siteSettings.voice_livekit_recording_enabled &&
- this.voiceWebrtc.isLivekitRoom(this.room?.id)
+ this.siteSettings.live_livekit_recording_enabled &&
+ this.liveWebrtc.isLivekitRoom(this.room?.id)
);
}
@@ -193,55 +193,55 @@ export default class VoiceCallControls extends Component {
get recordTitle() {
return this.recordingActive
- ? i18n("voice.room.recording_stop")
- : i18n("voice.room.recording_start");
+ ? i18n("live.room.recording_stop")
+ : i18n("live.room.recording_start");
}
get currentInputDeviceName() {
return this.audioInputDevices.find(
- (device) => device.id === this.voiceWebrtc.inputDeviceId
+ (device) => device.id === this.liveWebrtc.inputDeviceId
)?.name;
}
get currentOutputDeviceName() {
return this.audioOutputDevices.find(
- (device) => device.id === this.voiceWebrtc.outputDeviceId
+ (device) => device.id === this.liveWebrtc.outputDeviceId
)?.name;
}
get currentVideoDeviceName() {
return this.videoInputDevices.find(
- (device) => device.id === this.voiceWebrtc.videoInputDeviceId
+ (device) => device.id === this.liveWebrtc.videoInputDeviceId
)?.name;
}
@action
toggleMute() {
- this.voiceWebrtc.toggleMute();
+ this.liveWebrtc.toggleMute();
}
@action
toggleDeafen() {
- this.voiceWebrtc.toggleDeafen();
+ this.liveWebrtc.toggleDeafen();
}
@action
toggleCamera() {
- this.voiceWebrtc.toggleCamera();
+ this.liveWebrtc.toggleCamera();
}
@action
toggleScreenShare() {
- this.voiceWebrtc.toggleScreenShare();
+ this.liveWebrtc.toggleScreenShare();
}
@action
async toggleRaiseHand() {
try {
- await ajax(`/voice/rooms/${this.room.id}/request_to_speak`, {
+ await ajax(`/live/rooms/${this.room.id}/request_to_speak`, {
type: this.handRaisedAt ? "DELETE" : "POST",
data: {
- participant_session_id: this.voiceWebrtc.participantSessionIdFor(
+ participant_session_id: this.liveWebrtc.participantSessionIdFor(
this.room.id
),
},
@@ -257,14 +257,14 @@ export default class VoiceCallControls extends Component {
this.dialog.yesNoConfirm({
message: stopping
- ? i18n("voice.room.recording_stop_confirm")
- : i18n("voice.room.recording_confirm"),
+ ? i18n("live.room.recording_stop_confirm")
+ : i18n("live.room.recording_confirm"),
didConfirm: async () => {
this.recordingPending = true;
try {
// The room-wide "recording" broadcast flips the button and shows
// the indicator; no local state to update here.
- await ajax(`/voice/rooms/${this.room.id}/recording`, {
+ await ajax(`/live/rooms/${this.room.id}/recording`, {
type: stopping ? "DELETE" : "POST",
});
} catch (error) {
@@ -279,13 +279,13 @@ export default class VoiceCallControls extends Component {
@action
openVoiceSettings(closeMenu) {
closeMenu?.();
- this.modal.show(VoiceVoiceSettingsModal);
+ this.modal.show(LiveVoiceSettingsModal);
}
@action
openVideoSettings(closeMenu) {
closeMenu?.();
- this.modal.show(VoiceVideoSettingsModal);
+ this.modal.show(LiveVideoSettingsModal);
}
@action
@@ -296,9 +296,9 @@ export default class VoiceCallControls extends Component {
NOISE_SUPPRESSION_MODES.map((mode) => ({
id: mode,
label: noiseSuppressionModeLabel(mode),
- selected: mode === this.voiceWebrtc.noiseSuppressionMode,
+ selected: mode === this.liveWebrtc.noiseSuppressionMode,
})),
- (mode) => this.voiceWebrtc.setNoiseSuppressionMode(mode)
+ (mode) => this.liveWebrtc.setNoiseSuppressionMode(mode)
);
}
@@ -306,7 +306,7 @@ export default class VoiceCallControls extends Component {
async loadAudioDevices() {
// If the persisted mode is an AI engine, warming its assets makes the
// next enable (rejoin, unmute) near-instant.
- const engine = engineForMode(this.voiceWebrtc.noiseSuppressionMode);
+ const engine = engineForMode(this.liveWebrtc.noiseSuppressionMode);
if (engine) {
prefetchEngineAssets(engine).catch(() => {});
}
@@ -333,8 +333,8 @@ export default class VoiceCallControls extends Component {
this.#openSubmenu(
event,
AUDIO_MENU,
- this.#deviceItems(this.audioInputDevices, this.voiceWebrtc.inputDeviceId),
- (id) => this.voiceWebrtc.setInputDevice(id)
+ this.#deviceItems(this.audioInputDevices, this.liveWebrtc.inputDeviceId),
+ (id) => this.liveWebrtc.setInputDevice(id)
);
}
@@ -345,9 +345,9 @@ export default class VoiceCallControls extends Component {
AUDIO_MENU,
this.#deviceItems(
this.audioOutputDevices,
- this.voiceWebrtc.outputDeviceId
+ this.liveWebrtc.outputDeviceId
),
- (id) => this.voiceWebrtc.setOutputDevice(id)
+ (id) => this.liveWebrtc.setOutputDevice(id)
);
}
@@ -358,16 +358,16 @@ export default class VoiceCallControls extends Component {
VIDEO_MENU,
this.#deviceItems(
this.videoInputDevices,
- this.voiceWebrtc.videoInputDeviceId
+ this.liveWebrtc.videoInputDeviceId
),
- (id) => this.voiceWebrtc.setVideoInputDevice(id)
+ (id) => this.liveWebrtc.setVideoInputDevice(id)
);
}
#systemDefaultDevice() {
return {
id: SYSTEM_DEFAULT_DEVICE_ID,
- name: i18n("voice.devices.system_default"),
+ name: i18n("live.devices.system_default"),
};
}
@@ -380,7 +380,7 @@ export default class VoiceCallControls extends Component {
this.menu.show(anchor, {
identifier: SUBMENU,
groupIdentifier: SUBMENU,
- component: VoiceCallSubmenu,
+ component: LiveCallSubmenu,
placement: "right-start",
offset: { mainAxis: 8, crossAxis: -5 },
modalForMobile: true,
@@ -403,16 +403,16 @@ export default class VoiceCallControls extends Component {
}
<template>
- <div class="voice-call-controls__combo">
+ <div class="live-call-controls__combo">
<DButton
class={{dConcatClass
- "btn-default voice-call-controls__combo-main"
- (if this.voiceWebrtc.audioEnabled "" "--off")
+ "btn-default live-call-controls__combo-main"
+ (if this.liveWebrtc.audioEnabled "" "--off")
}}
@action={{this.toggleMute}}
- @disabled={{this.voiceWebrtc.pttEnabled}}
+ @disabled={{this.liveWebrtc.pttEnabled}}
@icon={{if
- this.voiceWebrtc.audioEnabled
+ this.liveWebrtc.audioEnabled
"microphone"
"microphone-slash"
}}
@@ -422,7 +422,7 @@ export default class VoiceCallControls extends Component {
<span
aria-hidden="true"
class={{dConcatClass
- "voice-call-controls__ns-badge"
+ "live-call-controls__ns-badge"
(if this.noiseSuppressionStarting "--starting")
}}
>
@@ -431,27 +431,27 @@ export default class VoiceCallControls extends Component {
{{/if}}
</DButton>
<DMenu
- @ariaLabel={{i18n "voice.room.audio_options"}}
+ @ariaLabel={{i18n "live.room.audio_options"}}
@icon="angle-down"
- @identifier="voice-audio-menu"
+ @identifier="live-audio-menu"
@onShow={{this.loadAudioDevices}}
@placement="top-end"
- @title={{i18n "voice.room.audio_options"}}
- @triggerClass="btn-default voice-call-controls__combo-caret"
+ @title={{i18n "live.room.audio_options"}}
+ @triggerClass="btn-default live-call-controls__combo-caret"
>
<:content as |audioMenu|>
<DDropdownMenu as |dropdown|>
<dropdown.item>
<DButton
- class="btn-transparent voice-call-menu__device-row"
+ class="btn-transparent live-call-menu__device-row"
@action={{this.openInputDeviceMenu}}
@forwardEvent={{true}}
@icon="microphone"
- @label="voice.voice_settings.input_audio"
+ @label="live.voice_settings.input_audio"
@suffixIcon="angle-right"
>
{{#if this.currentInputDeviceName}}
- <span class="voice-call-menu__current-device">
+ <span class="live-call-menu__current-device">
{{this.currentInputDeviceName}}
</span>
{{/if}}
@@ -460,15 +460,15 @@ export default class VoiceCallControls extends Component {
{{#if this.audioOutputSupported}}
<dropdown.item>
<DButton
- class="btn-transparent voice-call-menu__device-row"
+ class="btn-transparent live-call-menu__device-row"
@action={{this.openOutputDeviceMenu}}
@forwardEvent={{true}}
@icon="volume-high"
- @label="voice.voice_settings.output_audio"
+ @label="live.voice_settings.output_audio"
@suffixIcon="angle-right"
>
{{#if this.currentOutputDeviceName}}
- <span class="voice-call-menu__current-device">
+ <span class="live-call-menu__current-device">
{{this.currentOutputDeviceName}}
</span>
{{/if}}
@@ -478,15 +478,15 @@ export default class VoiceCallControls extends Component {
<dropdown.divider />
<dropdown.item>
<DButton
- class="btn-transparent voice-call-menu__device-row voice-call-menu__noise-suppression"
+ class="btn-transparent live-call-menu__device-row live-call-menu__noise-suppression"
@action={{this.openNoiseSuppressionMenu}}
@disabled={{this.noiseSuppressionStarting}}
@forwardEvent={{true}}
@icon="discourse-sparkles"
- @label="voice.voice_settings.noise_suppression"
+ @label="live.voice_settings.noise_suppression"
@suffixIcon="angle-right"
>
- <span class="voice-call-menu__current-device">
+ <span class="live-call-menu__current-device">
{{this.currentNoiseSuppressionModeName}}
</span>
</DButton>
@@ -496,7 +496,7 @@ export default class VoiceCallControls extends Component {
class="btn-transparent"
@action={{fn this.openVoiceSettings audioMenu.close}}
@icon="sliders"
- @label="voice.voice_settings.audio_settings"
+ @label="live.voice_settings.audio_settings"
/>
</dropdown.item>
</DDropdownMenu>
@@ -506,7 +506,7 @@ export default class VoiceCallControls extends Component {
{{#if this.isStageListener}}
<DButton
class={{dConcatClass
- "btn-default voice-call-controls__raise-hand"
+ "btn-default live-call-controls__raise-hand"
(if this.handRaisedAt "--active")
}}
@action={{this.toggleRaiseHand}}
@@ -519,11 +519,11 @@ export default class VoiceCallControls extends Component {
only allows getDisplayMedia during the actual dispatch, so a deferred call
throws NotAllowedError. }}
{{#if this.videoAllowed}}
- <div class="voice-call-controls__combo">
+ <div class="live-call-controls__combo">
<button
aria-label={{this.cameraTitle}}
class={{dConcatClass
- "btn btn-icon no-text btn-default voice-call-controls__combo-main"
+ "btn btn-icon no-text btn-default live-call-controls__combo-main"
(if this.cameraActive "--active")
}}
disabled={{this.cameraDisabled}}
@@ -537,27 +537,27 @@ export default class VoiceCallControls extends Component {
<span aria-hidden="true">&#8203;</span>
</button>
<DMenu
- @ariaLabel={{i18n "voice.room.video_options"}}
+ @ariaLabel={{i18n "live.room.video_options"}}
@icon="angle-down"
- @identifier="voice-video-menu"
+ @identifier="live-video-menu"
@onShow={{this.loadVideoDevices}}
@placement="top-end"
- @title={{i18n "voice.room.video_options"}}
- @triggerClass="btn-default voice-call-controls__combo-caret"
+ @title={{i18n "live.room.video_options"}}
+ @triggerClass="btn-default live-call-controls__combo-caret"
>
<:content as |videoMenu|>
<DDropdownMenu as |dropdown|>
<dropdown.item>
<DButton
- class="btn-transparent voice-call-menu__device-row"
+ class="btn-transparent live-call-menu__device-row"
@action={{this.openCameraMenu}}
@forwardEvent={{true}}
@icon="video"
- @label="voice.video_settings.camera"
+ @label="live.video_settings.camera"
@suffixIcon="angle-right"
>
{{#if this.currentVideoDeviceName}}
- <span class="voice-call-menu__current-device">
+ <span class="live-call-menu__current-device">
{{this.currentVideoDeviceName}}
</span>
{{/if}}
@@ -569,7 +569,7 @@ export default class VoiceCallControls extends Component {
class="btn-transparent"
@action={{fn this.openVideoSettings videoMenu.close}}
@icon="sliders"
- @label="voice.video_settings.title"
+ @label="live.video_settings.title"
/>
</dropdown.item>
</DDropdownMenu>
@@ -580,16 +580,16 @@ export default class VoiceCallControls extends Component {
<DButton
class={{dConcatClass
"btn-default"
- (if this.voiceWebrtc.deafened "--off" "")
+ (if this.liveWebrtc.deafened "--off" "")
}}
@action={{this.toggleDeafen}}
- @icon={{if this.voiceWebrtc.deafened "volume-xmark" "ear-listen"}}
+ @icon={{if this.liveWebrtc.deafened "volume-xmark" "ear-listen"}}
@translatedTitle={{this.deafenTitle}}
/>
{{#if this.canRecord}}
<DButton
class={{dConcatClass
- "btn-default voice-call-controls__record"
+ "btn-default live-call-controls__record"
(if this.recordingActive "--recording")
}}
@action={{this.toggleRecording}}
diff --git a/plugins/voice/assets/javascripts/discourse/components/voice/call-submenu.gjs b/plugins/live/assets/javascripts/discourse/components/live/call-submenu.gjs
similarity index 89%
rename from plugins/voice/assets/javascripts/discourse/components/voice/call-submenu.gjs
rename to plugins/live/assets/javascripts/discourse/components/live/call-submenu.gjs
index 6911024e76a..8685869246c 100644
--- a/plugins/voice/assets/javascripts/discourse/components/voice/call-submenu.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/live/call-submenu.gjs
@@ -6,8 +6,8 @@ import DDropdownMenu from "discourse/ui-kit/d-dropdown-menu";
import dConcatClass from "discourse/ui-kit/helpers/d-concat-class";
// Side submenu for the call menus (device pickers, layout switcher), opened
-// via the `menu` service — see VoiceRoomPage.
-export default class VoiceCallSubmenu extends Component {
+// via the `menu` service — see LiveRoomPage.
+export default class LiveCallSubmenu extends Component {
@action
select(id) {
this.args.data.onSelect(id);
diff --git a/plugins/voice/assets/javascripts/discourse/components/voice/call-widget.gjs b/plugins/live/assets/javascripts/discourse/components/live/call-widget.gjs
similarity index 87%
rename from plugins/voice/assets/javascripts/discourse/components/voice/call-widget.gjs
rename to plugins/live/assets/javascripts/discourse/components/live/call-widget.gjs
index 6ff3c904ccf..6e611465411 100644
--- a/plugins/voice/assets/javascripts/discourse/components/voice/call-widget.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/live/call-widget.gjs
@@ -13,19 +13,19 @@ import DButton from "discourse/ui-kit/d-button";
import DDropdownMenu from "discourse/ui-kit/d-dropdown-menu";
import dConcatClass from "discourse/ui-kit/helpers/d-concat-class";
import { i18n } from "discourse-i18n";
-import { activeRingingEntries } from "../../lib/voice/ringing.js";
+import { activeRingingEntries } from "../../lib/live/ringing.js";
import {
computeWidgetGrid,
trackGridSize,
-} from "../../lib/voice/video-grid-layout.js";
-import VoiceInviteUsersModal from "../modal/voice-invite-users.gjs";
-import VoiceRoomInfoModal from "../modal/voice-room-info.gjs";
-import VoiceInviteAgentButton from "../voice-invite-agent-button.gjs";
-import VoiceCallControls from "./call-controls.gjs";
-import VoiceRecordingBadge from "./recording-badge.gjs";
-import VoiceRingingTile from "./ringing-tile.gjs";
-import VoiceTranscriptBadge from "./transcript-badge.gjs";
-import VoiceVideoTile from "./video-tile.gjs";
+} from "../../lib/live/video-grid-layout.js";
+import LiveInviteAgentButton from "../live-invite-agent-button.gjs";
+import LiveInviteUsersModal from "../modal/live-invite-users.gjs";
+import LiveRoomInfoModal from "../modal/live-room-info.gjs";
+import LiveCallControls from "./call-controls.gjs";
+import LiveRecordingBadge from "./recording-badge.gjs";
+import LiveRingingTile from "./ringing-tile.gjs";
+import LiveTranscriptBadge from "./transcript-badge.gjs";
+import LiveVideoTile from "./video-tile.gjs";
const WIDGET_VIDEO_TILE_BUDGET = 4;
const WIDGET_VIEWPORT_MARGIN = 16;
@@ -35,6 +35,7 @@ const WIDGET_EXTRA_MINIMIZED_WIDTH = 118;
const WIDGET_EXTRA_MINIMIZED_HEIGHT = 52;
const WIDGET_MAX_WIDTH_RATIO = 0.5;
const WIDGET_MAX_HEIGHT_RATIO = 0.5;
+// Pre-rename key, kept so saved preferences survive.
const WIDGET_SIZE_KEY = "voice-widget-size";
const DRAG_THRESHOLD = 3;
const RESIZE_CORNERS = ["nw", "ne", "sw", "se"];
@@ -46,13 +47,13 @@ function clamp(value, min, max) {
return Math.min(Math.max(value, min), max);
}
-export default class VoiceCallWidget extends Component {
+export default class LiveCallWidget extends Component {
@service capabilities;
@service currentUser;
@service modal;
@service router;
- @service voiceRooms;
- @service voiceWebrtc;
+ @service liveRooms;
+ @service liveWebrtc;
@service keyValueStore;
@tracked widgetWidth = null;
@@ -100,30 +101,28 @@ export default class VoiceCallWidget extends Component {
}
get room() {
- const activeRoomId = this.voiceWebrtc.activeRoomId;
+ const activeRoomId = this.liveWebrtc.activeRoomId;
if (!activeRoomId) {
return null;
}
return (
- this.voiceRooms.rooms.find(
+ this.liveRooms.rooms.find(
(room) => Number(room.id) === Number(activeRoomId)
- ) ?? this.voiceWebrtc.activeRoom
+ ) ?? this.liveWebrtc.activeRoom
);
}
get shouldRender() {
return (
- !!this.room &&
- !this.onActiveRoomPage &&
- !this.voiceWebrtc.callWidgetHidden
+ !!this.room && !this.onActiveRoomPage && !this.liveWebrtc.callWidgetHidden
);
}
get onActiveRoomPage() {
const currentRoute = this.router.currentRoute;
return (
- currentRoute?.name === "voice-room" &&
+ currentRoute?.name === "live-room" &&
currentRoute?.params?.slug === this.room?.slug
);
}
@@ -215,11 +214,11 @@ export default class VoiceCallWidget extends Component {
}
get overflowTitle() {
- return i18n("voice.widget.overflow_tile", { count: this.overflowCount });
+ return i18n("live.widget.overflow_tile", { count: this.overflowCount });
}
get overflowLabel() {
- return i18n("voice.widget.overflow_count", { count: this.overflowCount });
+ return i18n("live.widget.overflow_count", { count: this.overflowCount });
}
get tilesStyle() {
@@ -228,12 +227,12 @@ export default class VoiceCallWidget extends Component {
return null;
}
return trustHTML(
- `--voice-tile-width: ${grid.tileWidth}px; --voice-tile-height: ${grid.tileHeight}px;`
+ `--live-tile-width: ${grid.tileWidth}px; --live-tile-height: ${grid.tileHeight}px;`
);
}
get openRoomTitle() {
- return i18n("voice.room.open_page");
+ return i18n("live.room.open_page");
}
get chatAvailable() {
@@ -241,11 +240,11 @@ export default class VoiceCallWidget extends Component {
}
get chatTitle() {
- return i18n("voice.widget.open_chat");
+ return i18n("live.widget.open_chat");
}
get expandWidgetTitle() {
- return i18n("voice.widget.expand");
+ return i18n("live.widget.expand");
}
get widgetStyle() {
@@ -314,7 +313,7 @@ export default class VoiceCallWidget extends Component {
@action
openRoom() {
if (this.room?.slug) {
- this.router.transitionTo("voice-room", this.room.slug);
+ this.router.transitionTo("live-room", this.room.slug);
}
}
@@ -503,7 +502,7 @@ export default class VoiceCallWidget extends Component {
@action
leaveRoom() {
- this.voiceWebrtc.leave(this.room);
+ this.liveWebrtc.leave(this.room);
}
@action
@@ -519,7 +518,7 @@ export default class VoiceCallWidget extends Component {
@action
openChat() {
if (this.room?.slug) {
- this.router.transitionTo("voice-room", this.room.slug, {
+ this.router.transitionTo("live-room", this.room.slug, {
queryParams: { chat: true },
});
}
@@ -534,13 +533,13 @@ export default class VoiceCallWidget extends Component {
@action
openRoomInfo(closeMenu) {
closeMenu?.();
- this.modal.show(VoiceRoomInfoModal, { model: { room: this.room } });
+ this.modal.show(LiveRoomInfoModal, { model: { room: this.room } });
}
@action
openInviteModal(closeMenu) {
closeMenu?.();
- this.modal.show(VoiceInviteUsersModal, { model: { room: this.room } });
+ this.modal.show(LiveInviteUsersModal, { model: { room: this.room } });
}
@action
@@ -571,14 +570,14 @@ export default class VoiceCallWidget extends Component {
return;
}
- this.voiceWebrtc.setWatching(roomId, true);
+ this.liveWebrtc.setWatching(roomId, true);
});
}
stopWatchingWidgetRoom() {
const roomId = this.room?.id;
if (roomId) {
- this.voiceWebrtc.setWatching(roomId, false, { keepVideo: true });
+ this.liveWebrtc.setWatching(roomId, false, { keepVideo: true });
}
}
@@ -642,7 +641,7 @@ export default class VoiceCallWidget extends Component {
#tileRank(participant) {
if (participant.id === this.currentUser?.id) {
- const kind = this.voiceWebrtc.localVideoKind;
+ const kind = this.liveWebrtc.localVideoKind;
return kind === "screen" ? 0 : kind ? 1 : 2;
}
if (participant.is_screen_sharing) {
@@ -653,7 +652,7 @@ export default class VoiceCallWidget extends Component {
#isPublishing(participant) {
if (participant.id === this.currentUser?.id) {
- return !!this.voiceWebrtc.localVideoKind;
+ return !!this.liveWebrtc.localVideoKind;
}
return participant.is_video_on || participant.is_screen_sharing;
}
@@ -684,9 +683,9 @@ export default class VoiceCallWidget extends Component {
{{! eslint-disable ember/template-no-pointer-down-event-binding, ember/template-no-invalid-interactive }}
{{#if this.shouldRender}}
<section
- aria-label={{i18n "voice.widget.title" room=this.room.name}}
+ aria-label={{i18n "live.widget.title" room=this.room.name}}
class={{dConcatClass
- "voice-call-widget"
+ "live-call-widget"
(if this.resizing "--resizing")
(if this.dragging "--dragging")
(if this.extraMinimized "--extra-minimized")
@@ -700,29 +699,29 @@ export default class VoiceCallWidget extends Component {
{{on "pointercancel" this.stopDrag}}
>
{{#unless this.extraMinimized}}
- <header class="voice-call-widget__header">
+ <header class="live-call-widget__header">
<div
aria-level="2"
- class="voice-call-widget__room"
+ class="live-call-widget__room"
role="heading"
{{on "mousedown" this.startDrag}}
{{on "touchstart" this.startDrag}}
>
<span
- class="voice-call-widget__room-name"
+ class="live-call-widget__room-name"
>{{this.room.name}}</span>
- <VoiceRecordingBadge @room={{this.room}} />
- <VoiceTranscriptBadge @room={{this.room}} />
+ <LiveRecordingBadge @room={{this.room}} />
+ <LiveTranscriptBadge @room={{this.room}} />
</div>
</header>
<div
- class="voice-call-widget__tiles"
+ class="live-call-widget__tiles"
style={{this.tilesStyle}}
{{trackGridSize this.updateTileAreaSize}}
>
{{#each this.tiles key="participant.id" as |tile|}}
- <VoiceVideoTile
+ <LiveVideoTile
@isSelf={{tile.isSelf}}
@onAspect={{this.noopAspect}}
@participant={{tile.participant}}
@@ -732,20 +731,20 @@ export default class VoiceCallWidget extends Component {
{{/each}}
{{#each this.ringingEntries key="user.id" as |entry|}}
- <VoiceRingingTile @user={{entry.user}} />
+ <LiveRingingTile @user={{entry.user}} />
{{/each}}
{{#if this.overflowCount}}
<button
aria-label={{this.overflowTitle}}
- class="voice-call-widget__overflow-tile"
+ class="live-call-widget__overflow-tile"
title={{this.overflowTitle}}
type="button"
{{on "click" this.openRoom}}
>
<span
aria-hidden="true"
- class="voice-call-widget__overflow-avatars"
+ class="live-call-widget__overflow-avatars"
>
{{#each this.overflowAvatars key="id" as |avatar|}}
<img alt="" src={{avatar.src}} />
@@ -753,23 +752,23 @@ export default class VoiceCallWidget extends Component {
</span>
<span
aria-hidden="true"
- class="voice-call-widget__overflow-count"
+ class="live-call-widget__overflow-count"
>{{this.overflowLabel}}</span>
</button>
{{/if}}
</div>
{{/unless}}
- <footer class="voice-call-widget__controls">
+ <footer class="live-call-widget__controls">
{{#if this.extraMinimized}}
<DButton
- class="voice-call-widget__expand"
+ class="live-call-widget__expand"
@action={{this.expandWidget}}
@icon="expand"
@translatedTitle={{this.expandWidgetTitle}}
/>
{{else}}
- <VoiceCallControls @room={{this.room}} />
+ <LiveCallControls @room={{this.room}} />
<DButton
class="btn-default"
@action={{this.openRoom}}
@@ -777,17 +776,17 @@ export default class VoiceCallWidget extends Component {
@translatedTitle={{this.openRoomTitle}}
/>
<DMenu
- @ariaLabel={{i18n "voice.room.more"}}
+ @ariaLabel={{i18n "live.room.more"}}
@icon="ellipsis-vertical"
- @identifier="voice-widget-room-menu"
+ @identifier="live-widget-room-menu"
@modalForMobile={{true}}
@placement="top-end"
- @title={{i18n "voice.room.more"}}
+ @title={{i18n "live.room.more"}}
@triggerClass="btn-default"
>
<:content as |roomMenu|>
<DDropdownMenu as |dropdown|>
- <VoiceInviteAgentButton
+ <LiveInviteAgentButton
@closeMenu={{roomMenu.close}}
@item={{dropdown.item}}
@room={{this.room}}
@@ -808,7 +807,7 @@ export default class VoiceCallWidget extends Component {
class="btn-transparent"
@action={{fn this.openInviteModal roomMenu.close}}
@icon="user-plus"
- @label="voice.invite.menu"
+ @label="live.invite.menu"
/>
</dropdown.item>
{{/if}}
@@ -817,7 +816,7 @@ export default class VoiceCallWidget extends Component {
class="btn-transparent"
@action={{fn this.openRoomInfo roomMenu.close}}
@icon="circle-info"
- @label="voice.room.info"
+ @label="live.room.info"
/>
</dropdown.item>
</DDropdownMenu>
@@ -825,9 +824,9 @@ export default class VoiceCallWidget extends Component {
</DMenu>
{{/if}}
<DButton
- class="btn-danger voice-call-widget__leave"
+ class="btn-danger live-call-widget__leave"
@action={{this.leaveRoom}}
- @ariaLabel="voice.room.leave"
+ @ariaLabel="live.room.leave"
@icon="phone-slash"
/>
</footer>
@@ -838,7 +837,7 @@ export default class VoiceCallWidget extends Component {
<div
aria-hidden="true"
class={{dConcatClass
- "voice-call-widget__resize"
+ "live-call-widget__resize"
(concat "--" corner)
}}
{{on "mousedown" (fn this.startResize corner)}}
diff --git a/plugins/voice/assets/javascripts/discourse/components/voice/caption-overlay.gjs b/plugins/live/assets/javascripts/discourse/components/live/caption-overlay.gjs
similarity index 63%
rename from plugins/voice/assets/javascripts/discourse/components/voice/caption-overlay.gjs
rename to plugins/live/assets/javascripts/discourse/components/live/caption-overlay.gjs
index 7aea2ad716d..a85b63c78b6 100644
--- a/plugins/voice/assets/javascripts/discourse/components/voice/caption-overlay.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/live/caption-overlay.gjs
@@ -7,8 +7,8 @@ const MAX_VISIBLE_LINES = 3;
const LINE_TTL_MS = 10000;
const PRUNE_INTERVAL_MS = 1000;
-export default class VoiceCaptionOverlay extends Component {
- @service voiceWebrtc;
+export default class LiveCaptionOverlay extends Component {
+ @service liveWebrtc;
// Bumped on a timer so lines fall off the overlay once they go stale,
// not only when a newer caption pushes them out.
@@ -25,38 +25,36 @@ export default class VoiceCaptionOverlay extends Component {
get visibleCaptions() {
const cutoff = this.now - LINE_TTL_MS;
- return this.voiceWebrtc
+ return this.liveWebrtc
.captionsFor(this.args.room.id)
.filter((caption) => caption.at > cutoff)
.slice(-MAX_VISIBLE_LINES);
}
get showLoading() {
- return this.voiceWebrtc.subtitlesLoading && !this.visibleCaptions.length;
+ return this.liveWebrtc.subtitlesLoading && !this.visibleCaptions.length;
}
get loadingLabel() {
- const percent = this.voiceWebrtc.subtitlesProgress;
+ const percent = this.liveWebrtc.subtitlesProgress;
if (percent !== null) {
- return i18n("voice.subtitles.downloading", { percent });
+ return i18n("live.subtitles.downloading", { percent });
}
- return i18n("voice.subtitles.loading");
+ return i18n("live.subtitles.loading");
}
<template>
- {{#if this.voiceWebrtc.subtitlesEnabled}}
- <div aria-live="polite" class="voice-captions">
+ {{#if this.liveWebrtc.subtitlesEnabled}}
+ <div aria-live="polite" class="live-captions">
{{#if this.showLoading}}
- <p class="voice-captions__line --loading">
+ <p class="live-captions__line --loading">
{{this.loadingLabel}}
</p>
{{else}}
{{#each this.visibleCaptions key="id" as |caption|}}
- <p class="voice-captions__line {{if caption.interim '--interim'}}">
+ <p class="live-captions__line {{if caption.interim '--interim'}}">
{{#if caption.username}}
- <span
- class="voice-captions__speaker"
- >{{caption.username}}</span>
+ <span class="live-captions__speaker">{{caption.username}}</span>
{{/if}}
{{caption.text}}
</p>
diff --git a/plugins/voice/assets/javascripts/discourse/components/voice/chat-panel.gjs b/plugins/live/assets/javascripts/discourse/components/live/chat-panel.gjs
similarity index 82%
rename from plugins/voice/assets/javascripts/discourse/components/voice/chat-panel.gjs
rename to plugins/live/assets/javascripts/discourse/components/live/chat-panel.gjs
index 940e6cdd88b..e151d026f8c 100644
--- a/plugins/voice/assets/javascripts/discourse/components/voice/chat-panel.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/live/chat-panel.gjs
@@ -14,7 +14,7 @@ import DConditionalLoadingSpinner from "discourse/ui-kit/d-conditional-loading-s
import dIcon from "discourse/ui-kit/helpers/d-icon";
import { i18n } from "discourse-i18n";
-export default class VoiceChatPanel extends Component {
+export default class LiveChatPanel extends Component {
@service chat;
@service chatChannelsManager;
@service messageBus;
@@ -70,7 +70,7 @@ export default class VoiceChatPanel extends Component {
// POST prepares the session: it rolls a stale session over and follows
// us on the channel so chat's own message endpoints accept our posts.
// The thread itself only comes into existence with the first message.
- const data = await ajax(`/voice/rooms/${this.room.id}/chat_session`, {
+ const data = await ajax(`/live/rooms/${this.room.id}/chat_session`, {
type: "POST",
});
await this.#applyState(data);
@@ -85,7 +85,7 @@ export default class VoiceChatPanel extends Component {
@action
async onSessionMessage() {
try {
- const data = await ajax(`/voice/rooms/${this.room.id}/chat_session`);
+ const data = await ajax(`/live/rooms/${this.room.id}/chat_session`);
await this.#applyState(data);
} catch {
// A transient refresh failure only delays the panel following a session
@@ -172,7 +172,7 @@ export default class VoiceChatPanel extends Component {
// of this swap so it doesn't flash.
this.hideSkeleton = true;
try {
- const data = await ajax(`/voice/rooms/${this.room.id}/chat_message`, {
+ const data = await ajax(`/live/rooms/${this.room.id}/chat_message`, {
type: "POST",
data: { message: this.draft },
});
@@ -233,7 +233,7 @@ export default class VoiceChatPanel extends Component {
if (this.#sessionPath) {
return;
}
- this.#sessionPath = `/voice/rooms/${this.room.id}/chat`;
+ this.#sessionPath = `/live/rooms/${this.room.id}/chat`;
this.messageBus.subscribe(this.#sessionPath, this.onSessionMessage);
}
@@ -255,19 +255,19 @@ export default class VoiceChatPanel extends Component {
<template>
<section
- aria-label={{i18n "voice.chat.title"}}
- class="voice-chat"
+ aria-label={{i18n "live.chat.title"}}
+ class="live-chat"
{{didInsert this.loadSession}}
>
- <header class="voice-chat__header">
- <h2 class="voice-chat__title">
- {{i18n "voice.chat.title"}}
+ <header class="live-chat__header">
+ <h2 class="live-chat__title">
+ {{i18n "live.chat.title"}}
</h2>
{{#if this.canOpenInChat}}
<button
- aria-label={{i18n "voice.chat.open_in_chat"}}
- class="btn btn-transparent btn-icon no-text voice-chat__open-in-chat"
- title={{i18n "voice.chat.open_in_chat"}}
+ aria-label={{i18n "live.chat.open_in_chat"}}
+ class="btn btn-transparent btn-icon no-text live-chat__open-in-chat"
+ title={{i18n "live.chat.open_in_chat"}}
type="button"
{{on "click" this.openInChat}}
>
@@ -276,9 +276,9 @@ export default class VoiceChatPanel extends Component {
{{/if}}
{{#if @onClose}}
<button
- aria-label={{i18n "voice.chat.close"}}
- class="btn btn-icon no-text voice-chat__close"
- title={{i18n "voice.chat.close"}}
+ aria-label={{i18n "live.chat.close"}}
+ class="btn btn-icon no-text live-chat__close"
+ title={{i18n "live.chat.close"}}
type="button"
{{on "click" @onClose}}
>
@@ -289,7 +289,7 @@ export default class VoiceChatPanel extends Component {
{{! eslint-disable ember/template-no-invalid-interactive }}
<div
- class="voice-chat__body {{if this.hideSkeleton '--hide-skeleton'}}"
+ class="live-chat__body {{if this.hideSkeleton '--hide-skeleton'}}"
{{on "keydown" this.interceptEscape capture=true}}
>
{{#if this.loading}}
@@ -303,43 +303,43 @@ export default class VoiceChatPanel extends Component {
<this.chatThread @thread={{thread}} />
{{/each}}
{{else if this.unavailable}}
- <div class="voice-chat__empty">
+ <div class="live-chat__empty">
{{dIcon "far-comment"}}
- <p class="voice-chat__empty-title">
- {{i18n "voice.chat.unavailable"}}
+ <p class="live-chat__empty-title">
+ {{i18n "live.chat.unavailable"}}
</p>
</div>
{{else}}
- <div class="voice-chat__empty">
+ <div class="live-chat__empty">
{{dIcon "far-comment"}}
- <p class="voice-chat__empty-title">
- {{i18n "voice.chat.empty_title"}}
+ <p class="live-chat__empty-title">
+ {{i18n "live.chat.empty_title"}}
</p>
- <p class="voice-chat__empty-body">
- {{i18n "voice.chat.empty_body"}}
+ <p class="live-chat__empty-body">
+ {{i18n "live.chat.empty_body"}}
</p>
</div>
- <footer class="voice-chat__composer">
- <div class="voice-chat__composer-inner">
+ <footer class="live-chat__composer">
+ <div class="live-chat__composer-inner">
<EmojiPicker
- @btnClass="btn-transparent voice-chat__emoji"
- @context="voice-chat"
+ @btnClass="btn-transparent live-chat__emoji"
+ @context="live-chat"
@didSelectEmoji={{this.insertEmoji}}
/>
<textarea
- aria-label={{i18n "voice.chat.composer_placeholder"}}
- class="voice-chat__input"
- placeholder={{i18n "voice.chat.composer_placeholder"}}
+ aria-label={{i18n "live.chat.composer_placeholder"}}
+ class="live-chat__input"
+ placeholder={{i18n "live.chat.composer_placeholder"}}
rows="1"
{{didInsert this.registerTextarea}}
{{on "input" this.updateDraft}}
{{on "keydown" this.onKeydown}}
></textarea>
<button
- aria-label={{i18n "voice.chat.send"}}
- class="btn btn-transparent btn-icon no-text voice-chat__send"
+ aria-label={{i18n "live.chat.send"}}
+ class="btn btn-transparent btn-icon no-text live-chat__send"
disabled={{this.sendDisabled}}
- title={{i18n "voice.chat.send"}}
+ title={{i18n "live.chat.send"}}
type="button"
{{on "click" this.sendFirstMessage}}
>
diff --git a/plugins/live/assets/javascripts/discourse/components/live/global-call-layer.gjs b/plugins/live/assets/javascripts/discourse/components/live/global-call-layer.gjs
new file mode 100644
index 00000000000..cb706a7ec0b
--- /dev/null
+++ b/plugins/live/assets/javascripts/discourse/components/live/global-call-layer.gjs
@@ -0,0 +1,7 @@
+import LiveCallWidget from "./call-widget.gjs";
+import LiveVoiceCanvas from "./voice-canvas.gjs";
+
+export default <template>
+ <LiveVoiceCanvas />
+ <LiveCallWidget />
+</template>
diff --git a/plugins/voice/assets/javascripts/discourse/components/voice/recording-badge.gjs b/plugins/live/assets/javascripts/discourse/components/live/recording-badge.gjs
similarity index 65%
rename from plugins/voice/assets/javascripts/discourse/components/voice/recording-badge.gjs
rename to plugins/live/assets/javascripts/discourse/components/live/recording-badge.gjs
index 278e2bc0f35..81e9e25df56 100644
--- a/plugins/voice/assets/javascripts/discourse/components/voice/recording-badge.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/live/recording-badge.gjs
@@ -4,21 +4,21 @@ import { i18n } from "discourse-i18n";
// The room-wide "this call is being recorded" indicator. Rendered wherever a
// room's call is shown (full page, floating widget) so nobody can be in a
// recorded call without seeing it.
-const VoiceRecordingBadge = <template>
+const LiveRecordingBadge = <template>
{{#if @room.recording}}
<span
- class="voice-recording-badge"
+ class="live-recording-badge"
title={{i18n
- "voice.room.recording_indicator_title"
+ "live.room.recording_indicator_title"
[email protected]_by.username
}}
>
{{dIcon "record-vinyl"}}
- <span class="voice-recording-badge__label">
- {{i18n "voice.room.recording_indicator"}}
+ <span class="live-recording-badge__label">
+ {{i18n "live.room.recording_indicator"}}
</span>
</span>
{{/if}}
</template>;
-export default VoiceRecordingBadge;
+export default LiveRecordingBadge;
diff --git a/plugins/voice/assets/javascripts/discourse/components/voice/ringing-tile.gjs b/plugins/live/assets/javascripts/discourse/components/live/ringing-tile.gjs
similarity index 55%
rename from plugins/voice/assets/javascripts/discourse/components/voice/ringing-tile.gjs
rename to plugins/live/assets/javascripts/discourse/components/live/ringing-tile.gjs
index d440a990098..d7125bfb658 100644
--- a/plugins/voice/assets/javascripts/discourse/components/voice/ringing-tile.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/live/ringing-tile.gjs
@@ -3,18 +3,18 @@ import { i18n } from "discourse-i18n";
// A grid tile for someone who is being rung but hasn't picked up: styled
// apart from real participant tiles so nobody mistakes them for present.
-const VoiceRingingTile = <template>
- <div class="voice-video-tile voice-ringing-tile" ...attributes>
- <div class="voice-ringing-tile__animation">
+const LiveRingingTile = <template>
+ <div class="live-video-tile live-ringing-tile" ...attributes>
+ <div class="live-ringing-tile__animation">
{{! Placeholder — a bespoke ringing SVG animation will replace this icon }}
{{dIcon "phone-volume"}}
</div>
- <div class="voice-video-tile__info">
- <span class="voice-video-tile__name">
- {{i18n "voice.call.calling" [email protected]}}
+ <div class="live-video-tile__info">
+ <span class="live-video-tile__name">
+ {{i18n "live.call.calling" [email protected]}}
</span>
</div>
</div>
</template>;
-export default VoiceRingingTile;
+export default LiveRingingTile;
diff --git a/plugins/voice/assets/javascripts/discourse/components/voice/room-page.gjs b/plugins/live/assets/javascripts/discourse/components/live/room-page.gjs
similarity index 79%
rename from plugins/voice/assets/javascripts/discourse/components/voice/room-page.gjs
rename to plugins/live/assets/javascripts/discourse/components/live/room-page.gjs
index 9e3abedb2ca..6907449dde0 100644
--- a/plugins/voice/assets/javascripts/discourse/components/voice/room-page.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/live/room-page.gjs
@@ -21,45 +21,45 @@ import { i18n } from "discourse-i18n";
import {
toggleFullscreen,
trackFullscreen,
-} from "../../lib/voice/fullscreen.js";
-import { activeRingingEntries } from "../../lib/voice/ringing.js";
-import { speakQueue } from "../../lib/voice/speak-queue.js";
+} from "../../lib/live/fullscreen.js";
+import { activeRingingEntries } from "../../lib/live/ringing.js";
+import { speakQueue } from "../../lib/live/speak-queue.js";
import {
bestRowHeight,
DEFAULT_TILE_ASPECT,
trackGridSize,
-} from "../../lib/voice/video-grid-layout.js";
-import VoiceInviteUsersModal from "../modal/voice-invite-users.gjs";
-import VoiceRoomInfoModal from "../modal/voice-room-info.gjs";
-import VoiceInviteAgentButton from "../voice-invite-agent-button.gjs";
-import VoiceCallControls from "./call-controls.gjs";
-import VoiceCallSubmenu from "./call-submenu.gjs";
-import VoiceCaptionOverlay from "./caption-overlay.gjs";
-import VoiceChatPanel from "./chat-panel.gjs";
-import VoiceRecordingBadge from "./recording-badge.gjs";
-import VoiceRingingTile from "./ringing-tile.gjs";
-import VoiceSpeakQueue from "./speak-queue.gjs";
-import VoiceTranscriptBadge from "./transcript-badge.gjs";
-import VoiceVideoTile from "./video-tile.gjs";
-
-const ROOM_MENU = "voice-room-menu";
-const SUBMENU = "voice-call-submenu";
-// Keep in sync with the `voice-room` path in voice-route-map.js
-const ROOM_PATH_PREFIX = "/voice/r/";
+} from "../../lib/live/video-grid-layout.js";
+import LiveInviteAgentButton from "../live-invite-agent-button.gjs";
+import LiveInviteUsersModal from "../modal/live-invite-users.gjs";
+import LiveRoomInfoModal from "../modal/live-room-info.gjs";
+import LiveCallControls from "./call-controls.gjs";
+import LiveCallSubmenu from "./call-submenu.gjs";
+import LiveCaptionOverlay from "./caption-overlay.gjs";
+import LiveChatPanel from "./chat-panel.gjs";
+import LiveRecordingBadge from "./recording-badge.gjs";
+import LiveRingingTile from "./ringing-tile.gjs";
+import LiveSpeakQueue from "./speak-queue.gjs";
+import LiveTranscriptBadge from "./transcript-badge.gjs";
+import LiveVideoTile from "./video-tile.gjs";
+
+const ROOM_MENU = "live-room-menu";
+const SUBMENU = "live-call-submenu";
+// Keep in sync with the `live-room` path in live-route-map.js
+const ROOM_PATH_PREFIX = "/live/r/";
const MOBILE_VIDEO_TILE_BUDGET = 4;
const LAYOUT_PRESENTATION = "presentation";
const LAYOUT_TILED = "tiled";
-export default class VoiceRoomPage extends Component {
+export default class LiveRoomPage extends Component {
@service capabilities;
@service currentUser;
@service menu;
@service modal;
@service routeHistory;
@service router;
- @service voiceRooms;
- @service voiceWebrtc;
+ @service liveRooms;
+ @service liveWebrtc;
@tracked gridWidth = 0;
@tracked gridHeight = 0;
@@ -95,12 +95,12 @@ export default class VoiceRoomPage extends Component {
super.willDestroy(...arguments);
clearInterval(this.#ringingTicker);
cancel(this.#chatCloseFallback);
- const voiceWebrtc = this.voiceWebrtc;
+ const liveWebrtc = this.liveWebrtc;
const roomId = this.args.room.id;
- const keepVideo = voiceWebrtc.isActiveRoom(roomId);
+ const keepVideo = liveWebrtc.isActiveRoom(roomId);
next(() => {
- voiceWebrtc.setWatching(roomId, false, { keepVideo });
+ liveWebrtc.setWatching(roomId, false, { keepVideo });
});
}
@@ -118,13 +118,13 @@ export default class VoiceRoomPage extends Component {
get room() {
return (
- this.voiceRooms.rooms.find((room) => room.id === this.args.room.id) ??
+ this.liveRooms.rooms.find((room) => room.id === this.args.room.id) ??
this.args.room
);
}
get connectionState() {
- return this.voiceWebrtc.connectionStateFor(this.room.id);
+ return this.liveWebrtc.connectionStateFor(this.room.id);
}
get joined() {
@@ -208,8 +208,8 @@ export default class VoiceRoomPage extends Component {
get gridFullscreenTitle() {
return this.gridFullscreen
- ? i18n("voice.video.exit_fullscreen")
- : i18n("voice.video.fullscreen_all");
+ ? i18n("live.video.exit_fullscreen")
+ : i18n("live.video.fullscreen_all");
}
get gridStyle() {
@@ -241,7 +241,7 @@ export default class VoiceRoomPage extends Component {
return null;
}
- return trustHTML(`--voice-tile-height: ${rowHeight}px;`);
+ return trustHTML(`--live-tile-height: ${rowHeight}px;`);
}
get chatAvailable() {
@@ -253,7 +253,7 @@ export default class VoiceRoomPage extends Component {
}
get chatToggleTitle() {
- return this.chatOpen ? i18n("voice.chat.close") : i18n("voice.chat.open");
+ return this.chatOpen ? i18n("live.chat.close") : i18n("live.chat.open");
}
get chatRendered() {
@@ -261,30 +261,30 @@ export default class VoiceRoomPage extends Component {
}
get transcriptAvailable() {
- return this.voiceWebrtc.subtitlesAvailable;
+ return this.liveWebrtc.subtitlesAvailable;
}
get transcribing() {
- return this.voiceWebrtc.isTranscribingRoom(this.room.id);
+ return this.liveWebrtc.isTranscribingRoom(this.room.id);
}
get transcriptToggleTitle() {
return this.transcribing
- ? i18n("voice.transcript.stop")
- : i18n("voice.transcript.start");
+ ? i18n("live.transcript.stop")
+ : i18n("live.transcript.start");
}
get transcriptDraftable() {
return (
- this.voiceWebrtc.transcriptEntries.length > 0 &&
- Number(this.voiceWebrtc.transcriptEntriesRoomId) === Number(this.room.id)
+ this.liveWebrtc.transcriptEntries.length > 0 &&
+ Number(this.liveWebrtc.transcriptEntriesRoomId) === Number(this.room.id)
);
}
get transcriptDraftLabel() {
return this.transcribing
- ? i18n("voice.transcript.stop_and_open")
- : i18n("voice.transcript.draft_topic");
+ ? i18n("live.transcript.stop_and_open")
+ : i18n("live.transcript.draft_topic");
}
@action
@@ -352,7 +352,7 @@ export default class VoiceRoomPage extends Component {
return;
}
- this.voiceWebrtc.setWatching(this.args.room.id, true);
+ this.liveWebrtc.setWatching(this.args.room.id, true);
});
}
@@ -388,19 +388,19 @@ export default class VoiceRoomPage extends Component {
getOwner(this).lookup("route:application").send("showLogin");
return;
}
- this.voiceWebrtc.join(this.room);
+ this.liveWebrtc.join(this.room);
// `?widget` asks for the call to live in the floating widget, which is a
// preference the join consumes, the same way `?chat` opens the chat panel.
if (this.args.dockOnJoin) {
- this.voiceWebrtc.setCallWidgetHidden(false);
+ this.liveWebrtc.setCallWidgetHidden(false);
this.dockRoom();
}
}
@action
leaveRoom() {
- this.voiceWebrtc.leave(this.room);
+ this.liveWebrtc.leave(this.room);
}
@action
@@ -467,13 +467,13 @@ export default class VoiceRoomPage extends Component {
@action
openRoomInfo(closeMenu) {
closeMenu?.();
- this.modal.show(VoiceRoomInfoModal, { model: { room: this.room } });
+ this.modal.show(LiveRoomInfoModal, { model: { room: this.room } });
}
@action
openInviteModal(closeMenu) {
closeMenu?.();
- this.modal.show(VoiceInviteUsersModal, { model: { room: this.room } });
+ this.modal.show(LiveInviteUsersModal, { model: { room: this.room } });
}
@action
@@ -491,13 +491,13 @@ export default class VoiceRoomPage extends Component {
@action
toggleTranscriptFromMenu(closeMenu) {
closeMenu?.();
- this.voiceWebrtc.toggleTranscriptRecording(this.room.id);
+ this.liveWebrtc.toggleTranscriptRecording(this.room.id);
}
@action
draftTranscriptTopic(closeMenu) {
closeMenu?.();
- this.voiceWebrtc.openTranscriptDraft();
+ this.liveWebrtc.openTranscriptDraft();
}
@action
@@ -508,13 +508,13 @@ export default class VoiceRoomPage extends Component {
[
{
id: LAYOUT_PRESENTATION,
- label: i18n("voice.video.layout_presentation"),
+ label: i18n("live.video.layout_presentation"),
icon: "person-chalkboard",
selected: this.presentationLayout,
},
{
id: LAYOUT_TILED,
- label: i18n("voice.video.layout_tiled"),
+ label: i18n("live.video.layout_tiled"),
icon: "table-cells",
selected: this.tiledLayout,
},
@@ -525,7 +525,7 @@ export default class VoiceRoomPage extends Component {
#isPublishing(participant) {
if (participant.id === this.currentUser?.id) {
- return !!this.voiceWebrtc.localVideoKind;
+ return !!this.liveWebrtc.localVideoKind;
}
return participant.is_video_on || participant.is_screen_sharing;
}
@@ -539,7 +539,7 @@ export default class VoiceRoomPage extends Component {
this.menu.show(anchor, {
identifier: SUBMENU,
groupIdentifier: SUBMENU,
- component: VoiceCallSubmenu,
+ component: LiveCallSubmenu,
placement: "right-start",
offset: { mainAxis: 8, crossAxis: -5 },
modalForMobile: true,
@@ -556,7 +556,7 @@ export default class VoiceRoomPage extends Component {
<template>
<section
class={{dConcatClass
- "voice-room-page"
+ "live-room-page"
(if this.chatVisible "--chat-open")
(if this.presentationLayout "--presentation")
(if this.tiledLayout "--tiled")
@@ -565,27 +565,27 @@ export default class VoiceRoomPage extends Component {
{{didInsert this.autoJoinIfRequested}}
{{didUpdate this.reconcileSpotlight this.participants}}
>
- <div class="voice-room-page__body">
- <div class="voice-room-page__main">
- <header class="voice-room-page__header">
- <div class="voice-room-page__title-row">
- <h1 class="voice-room-page__title">{{this.room.name}}</h1>
- <VoiceRecordingBadge @room={{this.room}} />
- <VoiceTranscriptBadge @room={{this.room}} />
+ <div class="live-room-page__body">
+ <div class="live-room-page__main">
+ <header class="live-room-page__header">
+ <div class="live-room-page__title-row">
+ <h1 class="live-room-page__title">{{this.room.name}}</h1>
+ <LiveRecordingBadge @room={{this.room}} />
+ <LiveTranscriptBadge @room={{this.room}} />
</div>
{{#if this.room.description_excerpt}}
- <p class="voice-room-page__description">
+ <p class="live-room-page__description">
{{this.room.description_excerpt}}
</p>
{{/if}}
</header>
- <div class="voice-room-page__stage">
+ <div class="live-room-page__stage">
{{#if this.tiles.length}}
{{#if this.presentationLayout}}
- <div class="voice-room-page__presentation">
- <div class="voice-room-page__presentation-main">
- <VoiceVideoTile
+ <div class="live-room-page__presentation">
+ <div class="live-room-page__presentation-main">
+ <LiveVideoTile
@isSelf={{this.presentationTile.isSelf}}
@onAspect={{this.reportTileAspect}}
@onSpotlight={{this.toggleSpotlight}}
@@ -602,12 +602,12 @@ export default class VoiceRoomPage extends Component {
this.ringingEntries.length
)
}}
- <div class="voice-room-page__presentation-rail">
+ <div class="live-room-page__presentation-rail">
{{#each
this.presentationRailTiles key="participant.id"
as |tile|
}}
- <VoiceVideoTile
+ <LiveVideoTile
@isSelf={{tile.isSelf}}
@onAspect={{this.reportTileAspect}}
@onSpotlight={{this.toggleSpotlight}}
@@ -618,14 +618,14 @@ export default class VoiceRoomPage extends Component {
/>
{{/each}}
{{#each this.ringingEntries key="user.id" as |entry|}}
- <VoiceRingingTile @user={{entry.user}} />
+ <LiveRingingTile @user={{entry.user}} />
{{/each}}
</div>
{{/if}}
</div>
{{else}}
<div
- class="voice-room-page__grid"
+ class="live-room-page__grid"
style={{this.gridStyle}}
{{didInsert this.registerGrid}}
{{this.trackGridSize this.updateGridSize}}
@@ -633,7 +633,7 @@ export default class VoiceRoomPage extends Component {
>
<button
aria-label={{this.gridFullscreenTitle}}
- class="btn btn-icon no-text voice-room-page__fullscreen"
+ class="btn btn-icon no-text live-room-page__fullscreen"
title={{this.gridFullscreenTitle}}
type="button"
{{on "click" this.toggleGridFullscreen}}
@@ -642,7 +642,7 @@ export default class VoiceRoomPage extends Component {
</button>
{{#each this.tiles key="participant.id" as |tile|}}
- <VoiceVideoTile
+ <LiveVideoTile
@isSelf={{tile.isSelf}}
@onAspect={{this.reportTileAspect}}
@onSpotlight={{this.toggleSpotlight}}
@@ -653,56 +653,56 @@ export default class VoiceRoomPage extends Component {
/>
{{/each}}
{{#each this.ringingEntries key="user.id" as |entry|}}
- <VoiceRingingTile @user={{entry.user}} />
+ <LiveRingingTile @user={{entry.user}} />
{{/each}}
</div>
{{/if}}
{{else}}
- <div class="voice-room-page__empty">
- {{i18n "voice.room_page.empty"}}
+ <div class="live-room-page__empty">
+ {{i18n "live.room_page.empty"}}
</div>
{{/if}}
{{#if this.joined}}
- <VoiceCaptionOverlay @room={{this.room}} />
+ <LiveCaptionOverlay @room={{this.room}} />
{{/if}}
- <footer class="voice-room-page__controls">
+ <footer class="live-room-page__controls">
{{#if this.joined}}
- <VoiceCallControls @room={{this.room}} />
+ <LiveCallControls @room={{this.room}} />
{{#if this.isStageRoom}}
<DMenu
- @ariaLabel={{i18n "voice.stage.queue_title"}}
- @identifier="voice-speak-queue-menu"
+ @ariaLabel={{i18n "live.stage.queue_title"}}
+ @identifier="live-speak-queue-menu"
@modalForMobile={{true}}
@placement="top-end"
- @title={{i18n "voice.stage.queue_title"}}
- @triggerClass="btn-default voice-speak-queue-trigger"
+ @title={{i18n "live.stage.queue_title"}}
+ @triggerClass="btn-default live-speak-queue-trigger"
>
<:trigger>
{{dIcon "list-ol"}}
{{#if this.speakQueueCount}}
<span
- class="voice-speak-queue-trigger__count"
+ class="live-speak-queue-trigger__count"
>{{this.speakQueueCount}}</span>
{{/if}}
</:trigger>
<:content>
- <VoiceSpeakQueue @room={{this.room}} />
+ <LiveSpeakQueue @room={{this.room}} />
</:content>
</DMenu>
{{/if}}
<DMenu
- @ariaLabel={{i18n "voice.room.more"}}
+ @ariaLabel={{i18n "live.room.more"}}
@icon="ellipsis-vertical"
- @identifier="voice-room-menu"
+ @identifier="live-room-menu"
@modalForMobile={{true}}
@placement="top-end"
- @title={{i18n "voice.room.more"}}
+ @title={{i18n "live.room.more"}}
@triggerClass="btn-default"
>
<:content as |roomMenu|>
<DDropdownMenu as |dropdown|>
- <VoiceInviteAgentButton
+ <LiveInviteAgentButton
@closeMenu={{roomMenu.close}}
@item={{dropdown.item}}
@room={{this.room}}
@@ -726,11 +726,11 @@ export default class VoiceRoomPage extends Component {
{{/if}}
<dropdown.item>
<DButton
- class="btn-transparent voice-room-page__layout-trigger"
+ class="btn-transparent live-room-page__layout-trigger"
@action={{this.openLayoutMenu}}
@forwardEvent={{true}}
@icon={{this.layoutIcon}}
- @label="voice.room.layout"
+ @label="live.room.layout"
@suffixIcon="angle-right"
/>
</dropdown.item>
@@ -739,7 +739,7 @@ export default class VoiceRoomPage extends Component {
class="btn-transparent"
@action={{fn this.dockAndClose roomMenu.close}}
@icon="compress"
- @label="voice.room.widget_mode"
+ @label="live.room.widget_mode"
/>
</dropdown.item>
{{#if this.room.can_invite}}
@@ -748,7 +748,7 @@ export default class VoiceRoomPage extends Component {
class="btn-transparent"
@action={{fn this.openInviteModal roomMenu.close}}
@icon="user-plus"
- @label="voice.invite.menu"
+ @label="live.invite.menu"
/>
</dropdown.item>
{{/if}}
@@ -756,7 +756,7 @@ export default class VoiceRoomPage extends Component {
<dropdown.item>
<DButton
class={{dConcatClass
- "btn-transparent voice-room-page__transcript-toggle"
+ "btn-transparent live-room-page__transcript-toggle"
(if this.transcribing "--recording")
}}
@action={{fn
@@ -774,7 +774,7 @@ export default class VoiceRoomPage extends Component {
{{#if this.transcriptDraftable}}
<dropdown.item>
<DButton
- class="btn-transparent voice-room-page__transcript-draft"
+ class="btn-transparent live-room-page__transcript-draft"
@action={{fn
this.draftTranscriptTopic
roomMenu.close
@@ -790,26 +790,26 @@ export default class VoiceRoomPage extends Component {
class="btn-transparent"
@action={{fn this.openRoomInfo roomMenu.close}}
@icon="circle-info"
- @label="voice.room.info"
+ @label="live.room.info"
/>
</dropdown.item>
</DDropdownMenu>
</:content>
</DMenu>
<DButton
- class="btn-danger voice-room-page__leave"
+ class="btn-danger live-room-page__leave"
@action={{this.leaveRoom}}
@icon="phone-slash"
- @label="voice.room.leave"
+ @label="live.room.leave"
/>
{{else}}
<DButton
- class="btn-primary voice-room-page__join"
+ class="btn-primary live-room-page__join"
@action={{this.joinRoom}}
@disabled={{this.connecting}}
@icon="phone"
@isLoading={{this.connecting}}
- @label="voice.room.join"
+ @label="live.room.join"
/>
{{/if}}
</footer>
@@ -819,12 +819,12 @@ export default class VoiceRoomPage extends Component {
{{#if this.chatRendered}}
<aside
class={{dConcatClass
- "voice-room-page__sidebar"
+ "live-room-page__sidebar"
(if this.chatClosing "--closing")
}}
{{on "animationend" this.chatAnimationEnded}}
>
- <VoiceChatPanel @onClose={{this.closeChat}} @room={{this.room}} />
+ <LiveChatPanel @onClose={{this.closeChat}} @room={{this.room}} />
</aside>
{{/if}}
</div>
diff --git a/plugins/voice/assets/javascripts/discourse/components/voice/speak-queue.gjs b/plugins/live/assets/javascripts/discourse/components/live/speak-queue.gjs
similarity index 67%
rename from plugins/voice/assets/javascripts/discourse/components/voice/speak-queue.gjs
rename to plugins/live/assets/javascripts/discourse/components/live/speak-queue.gjs
index 784144ab770..d6f2821e282 100644
--- a/plugins/voice/assets/javascripts/discourse/components/voice/speak-queue.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/live/speak-queue.gjs
@@ -9,14 +9,14 @@ import DButton from "discourse/ui-kit/d-button";
import dAvatar from "discourse/ui-kit/helpers/d-avatar";
import dConcatClass from "discourse/ui-kit/helpers/d-concat-class";
import { i18n } from "discourse-i18n";
-import { speakQueue } from "../../lib/voice/speak-queue.js";
+import { speakQueue } from "../../lib/live/speak-queue.js";
// The ordered request-to-speak queue of a stage room. Everyone sees the
// order; moderators get approve/dismiss controls, a queued viewer can lower
// their own hand.
-export default class VoiceSpeakQueue extends Component {
+export default class LiveSpeakQueue extends Component {
@service currentUser;
- @service voiceWebrtc;
+ @service liveWebrtc;
get room() {
return this.args.room;
@@ -40,7 +40,7 @@ export default class VoiceSpeakQueue extends Component {
@action
async approve(participant) {
try {
- await ajax(`/voice/rooms/${this.room.id}/memberships`, {
+ await ajax(`/live/rooms/${this.room.id}/memberships`, {
type: "POST",
data: { user_id: participant.id, role: "speaker" },
});
@@ -52,7 +52,7 @@ export default class VoiceSpeakQueue extends Component {
@action
async dismiss(participant) {
try {
- await ajax(`/voice/rooms/${this.room.id}/request_to_speak`, {
+ await ajax(`/live/rooms/${this.room.id}/request_to_speak`, {
type: "DELETE",
data: { user_id: participant.id },
});
@@ -64,10 +64,10 @@ export default class VoiceSpeakQueue extends Component {
@action
async lowerHand() {
try {
- await ajax(`/voice/rooms/${this.room.id}/request_to_speak`, {
+ await ajax(`/live/rooms/${this.room.id}/request_to_speak`, {
type: "DELETE",
data: {
- participant_session_id: this.voiceWebrtc.participantSessionIdFor(
+ participant_session_id: this.liveWebrtc.participantSessionIdFor(
this.room.id
),
},
@@ -78,44 +78,42 @@ export default class VoiceSpeakQueue extends Component {
}
<template>
- <div class="voice-speak-queue">
- <h3 class="voice-speak-queue__title">
- {{i18n "voice.stage.queue_title"}}
+ <div class="live-speak-queue">
+ <h3 class="live-speak-queue__title">
+ {{i18n "live.stage.queue_title"}}
</h3>
{{#if this.entries.length}}
- <ul class="voice-speak-queue__list">
+ <ul class="live-speak-queue__list">
{{#each this.entries key="participant.id" as |entry|}}
<li
class={{dConcatClass
- "voice-speak-queue__item"
+ "live-speak-queue__item"
(if entry.isSelf "--self")
}}
>
- <span
- class="voice-speak-queue__position"
- >{{entry.position}}</span>
+ <span class="live-speak-queue__position">{{entry.position}}</span>
{{dAvatar entry.participant imageSize="small"}}
- <span class="voice-speak-queue__name">{{entry.name}}</span>
- <span class="voice-speak-queue__actions">
+ <span class="live-speak-queue__name">{{entry.name}}</span>
+ <span class="live-speak-queue__actions">
{{#if this.canManage}}
<DButton
- class="btn-transparent voice-speak-queue__approve"
+ class="btn-transparent live-speak-queue__approve"
@action={{fn this.approve entry.participant}}
@icon="check"
- @title="voice.stage.approve_request"
+ @title="live.stage.approve_request"
/>
<DButton
- class="btn-transparent voice-speak-queue__dismiss"
+ class="btn-transparent live-speak-queue__dismiss"
@action={{fn this.dismiss entry.participant}}
@icon="xmark"
- @title="voice.stage.dismiss_request"
+ @title="live.stage.dismiss_request"
/>
{{else if entry.isSelf}}
<DButton
- class="btn-transparent voice-speak-queue__lower"
+ class="btn-transparent live-speak-queue__lower"
@action={{this.lowerHand}}
@icon="xmark"
- @title="voice.stage.lower_hand"
+ @title="live.stage.lower_hand"
/>
{{/if}}
</span>
@@ -123,8 +121,8 @@ export default class VoiceSpeakQueue extends Component {
{{/each}}
</ul>
{{else}}
- <div class="voice-speak-queue__empty">
- {{i18n "voice.stage.queue_empty"}}
+ <div class="live-speak-queue__empty">
+ {{i18n "live.stage.queue_empty"}}
</div>
{{/if}}
</div>
diff --git a/plugins/voice/assets/javascripts/discourse/components/voice/transcript-badge.gjs b/plugins/live/assets/javascripts/discourse/components/live/transcript-badge.gjs
similarity index 70%
rename from plugins/voice/assets/javascripts/discourse/components/voice/transcript-badge.gjs
rename to plugins/live/assets/javascripts/discourse/components/live/transcript-badge.gjs
index 4b3bd7f0b2d..8d79ffa31f1 100644
--- a/plugins/voice/assets/javascripts/discourse/components/voice/transcript-badge.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/live/transcript-badge.gjs
@@ -8,12 +8,12 @@ import { i18n } from "discourse-i18n";
// call is shown, so nobody can be transcribed without a way of noticing.
// Deliberately calmer than the recording badge — the transcript never
// leaves the recorder's browser.
-export default class VoiceTranscriptBadge extends Component {
+export default class LiveTranscriptBadge extends Component {
@service currentUser;
- @service voiceWebrtc;
+ @service liveWebrtc;
get selfTranscribing() {
- return this.voiceWebrtc.isTranscribingRoom(this.args.room.id);
+ return this.liveWebrtc.isTranscribingRoom(this.args.room.id);
}
get otherTranscribers() {
@@ -33,7 +33,7 @@ export default class VoiceTranscriptBadge extends Component {
get transcriberNames() {
const names = this.otherTranscribers;
if (this.selfTranscribing) {
- names.unshift(i18n("voice.transcript.transcriber_you"));
+ names.unshift(i18n("live.transcript.transcriber_you"));
}
return names;
}
@@ -41,9 +41,9 @@ export default class VoiceTranscriptBadge extends Component {
get tooltip() {
const names = this.transcriberNames;
if (this.selfTranscribing && names.length === 1) {
- return i18n("voice.transcript.indicator_tooltip_self");
+ return i18n("live.transcript.indicator_tooltip_self");
}
- return i18n("voice.transcript.indicator_tooltip", {
+ return i18n("live.transcript.indicator_tooltip", {
count: names.length,
usernames: names.join(", "),
});
@@ -52,25 +52,25 @@ export default class VoiceTranscriptBadge extends Component {
// While the model is still loading/downloading there would otherwise be no
// feedback at all when captions are off, so the badge doubles as progress.
get label() {
- if (this.selfTranscribing && this.voiceWebrtc.subtitlesLoading) {
- const percent = this.voiceWebrtc.subtitlesProgress;
+ if (this.selfTranscribing && this.liveWebrtc.subtitlesLoading) {
+ const percent = this.liveWebrtc.subtitlesProgress;
return percent !== null
- ? i18n("voice.subtitles.downloading", { percent })
- : i18n("voice.subtitles.loading");
+ ? i18n("live.subtitles.downloading", { percent })
+ : i18n("live.subtitles.loading");
}
- return i18n("voice.transcript.indicator");
+ return i18n("live.transcript.indicator");
}
<template>
{{#if this.visible}}
<DTooltip
- class="voice-transcript-badge"
- @identifier="voice-transcript-badge"
+ class="live-transcript-badge"
+ @identifier="live-transcript-badge"
@placement="bottom"
>
<:trigger>
{{dIcon "closed-captioning"}}
- <span class="voice-transcript-badge__label">
+ <span class="live-transcript-badge__label">
{{this.label}}
</span>
</:trigger>
diff --git a/plugins/voice/assets/javascripts/discourse/components/voice/video-tile.gjs b/plugins/live/assets/javascripts/discourse/components/live/video-tile.gjs
similarity index 77%
rename from plugins/voice/assets/javascripts/discourse/components/voice/video-tile.gjs
rename to plugins/live/assets/javascripts/discourse/components/live/video-tile.gjs
index 54c91dd3af1..ffb4df60172 100644
--- a/plugins/voice/assets/javascripts/discourse/components/voice/video-tile.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/live/video-tile.gjs
@@ -17,17 +17,17 @@ import { i18n } from "discourse-i18n";
import {
toggleTileFullscreen,
trackFullscreen,
-} from "../../lib/voice/fullscreen.js";
+} from "../../lib/live/fullscreen.js";
import {
DEFAULT_TILE_ASPECT,
trackVideoAspect,
-} from "../../lib/voice/video-grid-layout.js";
-import VoiceParticipantSidebarContextMenu from "../voice-participant-sidebar-context-menu.gjs";
+} from "../../lib/live/video-grid-layout.js";
+import LiveParticipantSidebarContextMenu from "../live-participant-sidebar-context-menu.gjs";
-export default class VoiceVideoTile extends Component {
+export default class LiveVideoTile extends Component {
@service menu;
- @service voiceRooms;
- @service voiceWebrtc;
+ @service liveRooms;
+ @service liveWebrtc;
@tracked aspect = null;
@tracked isFullscreen = false;
@@ -40,7 +40,7 @@ export default class VoiceVideoTile extends Component {
}
get isSpeaking() {
- return this.voiceRooms.isParticipantSpeaking(
+ return this.liveRooms.isParticipantSpeaking(
this.args.room?.id,
this.participant.id
);
@@ -54,22 +54,22 @@ export default class VoiceVideoTile extends Component {
// page visitors who haven't joined the room don't get one.
get canShowMenu() {
return (
- this.voiceWebrtc.connectionStateFor(this.args.room?.id) === "connected"
+ this.liveWebrtc.connectionStateFor(this.args.room?.id) === "connected"
);
}
get fullscreenTitle() {
return this.isFullscreen
- ? i18n("voice.video.exit_fullscreen")
- : i18n("voice.video.fullscreen");
+ ? i18n("live.video.exit_fullscreen")
+ : i18n("live.video.fullscreen");
}
get stream() {
if (this.args.isSelf) {
- return this.voiceWebrtc.localVideoStream;
+ return this.liveWebrtc.localVideoStream;
}
- return this.voiceWebrtc.remoteStreamFor(
+ return this.liveWebrtc.remoteStreamFor(
this.args.room.id,
this.participant.id
);
@@ -77,7 +77,7 @@ export default class VoiceVideoTile extends Component {
get publishingKind() {
if (this.args.isSelf) {
- return this.voiceWebrtc.localVideoKind;
+ return this.liveWebrtc.localVideoKind;
}
if (this.participant.is_screen_sharing) {
@@ -118,7 +118,7 @@ export default class VoiceVideoTile extends Component {
@action
toggleFullscreen(event) {
- toggleTileFullscreen(event.currentTarget.closest(".voice-video-tile"));
+ toggleTileFullscreen(event.currentTarget.closest(".live-video-tile"));
}
@action
@@ -143,8 +143,8 @@ export default class VoiceVideoTile extends Component {
#showParticipantMenu(anchor, placement) {
this.menu.show(anchor, {
- identifier: "voice-participant-menu",
- component: VoiceParticipantSidebarContextMenu,
+ identifier: "live-participant-menu",
+ component: LiveParticipantSidebarContextMenu,
placement,
modalForMobile: true,
data: {
@@ -161,7 +161,7 @@ export default class VoiceVideoTile extends Component {
<template>
<div
class={{dConcatClass
- "voice-video-tile"
+ "live-video-tile"
(if this.showVideo "--video" "--avatar")
(if (eq this.publishingKind "screen") "--screen")
(if @isSelf "--self")
@@ -175,24 +175,24 @@ export default class VoiceVideoTile extends Component {
{{#if this.showVideo}}
<video
autoplay
- class="voice-video-tile__video"
+ class="live-video-tile__video"
muted
playsinline
- {{didInsert (fn this.voiceWebrtc.attachVideoStream this.stream)}}
+ {{didInsert (fn this.liveWebrtc.attachVideoStream this.stream)}}
{{didUpdate
- (fn this.voiceWebrtc.attachVideoStream this.stream)
+ (fn this.liveWebrtc.attachVideoStream this.stream)
this.stream
}}
{{this.trackVideoAspect this.handleAspect}}
></video>
{{else}}
- <div class="voice-video-tile__avatar">
+ <div class="live-video-tile__avatar">
<img alt={{this.displayName}} src={{this.avatarSrc}} />
</div>
{{/if}}
- <div class="voice-video-tile__info">
- <span class="voice-video-tile__name">{{this.displayName}}</span>
+ <div class="live-video-tile__info">
+ <span class="live-video-tile__name">{{this.displayName}}</span>
{{#if this.participant.is_muted}}
{{dIcon "microphone-slash"}}
{{/if}}
@@ -206,9 +206,9 @@ export default class VoiceVideoTile extends Component {
{{#if this.canShowMenu}}
<button
- aria-label={{i18n "voice.participant.menu_title"}}
- class="btn btn-icon no-text voice-video-tile__menu"
- title={{i18n "voice.participant.menu_title"}}
+ aria-label={{i18n "live.participant.menu_title"}}
+ class="btn btn-icon no-text live-video-tile__menu"
+ title={{i18n "live.participant.menu_title"}}
type="button"
{{on "click" this.openTileMenu}}
>
@@ -219,7 +219,7 @@ export default class VoiceVideoTile extends Component {
{{#if this.showVideo}}
<button
aria-label={{this.fullscreenTitle}}
- class="btn btn-icon no-text voice-video-tile__fullscreen"
+ class="btn btn-icon no-text live-video-tile__fullscreen"
title={{this.fullscreenTitle}}
type="button"
{{on "click" this.toggleFullscreen}}
diff --git a/plugins/voice/assets/javascripts/discourse/components/voice/voice-canvas.gjs b/plugins/live/assets/javascripts/discourse/components/live/voice-canvas.gjs
similarity index 56%
rename from plugins/voice/assets/javascripts/discourse/components/voice/voice-canvas.gjs
rename to plugins/live/assets/javascripts/discourse/components/live/voice-canvas.gjs
index 083ad7d32cd..de35f5b5943 100644
--- a/plugins/voice/assets/javascripts/discourse/components/voice/voice-canvas.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/live/voice-canvas.gjs
@@ -4,31 +4,31 @@ import didInsert from "@ember/render-modifiers/modifiers/did-insert";
import didUpdate from "@ember/render-modifiers/modifiers/did-update";
import { service } from "@ember/service";
-export default class VoiceVoiceCanvas extends Component {
- @service voiceWebrtc;
+export default class LiveVoiceCanvas extends Component {
+ @service liveWebrtc;
get localStream() {
- return this.voiceWebrtc.localStream;
+ return this.liveWebrtc.localStream;
}
get remoteStreams() {
- return this.voiceWebrtc.remoteStreams;
+ return this.liveWebrtc.remoteStreams;
}
get remoteScreenAudioStreams() {
- return this.voiceWebrtc.remoteScreenAudioStreams;
+ return this.liveWebrtc.remoteScreenAudioStreams;
}
<template>
- <section class="voice-voice-canvas">
+ <section class="live-voice-canvas">
{{#if this.localStream}}
<audio
autoplay
muted
playsinline
- {{didInsert (fn this.voiceWebrtc.attachStream this.localStream)}}
+ {{didInsert (fn this.liveWebrtc.attachStream this.localStream)}}
{{didUpdate
- (fn this.voiceWebrtc.attachStream this.localStream)
+ (fn this.liveWebrtc.attachStream this.localStream)
this.localStream
}}
/>
@@ -38,8 +38,8 @@ export default class VoiceVoiceCanvas extends Component {
<audio
autoplay
playsinline
- {{didInsert (fn this.voiceWebrtc.attachStream stream)}}
- {{didUpdate (fn this.voiceWebrtc.attachStream stream) stream}}
+ {{didInsert (fn this.liveWebrtc.attachStream stream)}}
+ {{didUpdate (fn this.liveWebrtc.attachStream stream) stream}}
/>
{{/each}}
@@ -47,8 +47,8 @@ export default class VoiceVoiceCanvas extends Component {
<audio
autoplay
playsinline
- {{didInsert (fn this.voiceWebrtc.attachStream stream)}}
- {{didUpdate (fn this.voiceWebrtc.attachStream stream) stream}}
+ {{didInsert (fn this.liveWebrtc.attachStream stream)}}
+ {{didUpdate (fn this.liveWebrtc.attachStream stream) stream}}
/>
{{/each}}
</section>
diff --git a/plugins/voice/assets/javascripts/discourse/components/modal/voice-create-room.gjs b/plugins/live/assets/javascripts/discourse/components/modal/live-create-room.gjs
similarity index 59%
rename from plugins/voice/assets/javascripts/discourse/components/modal/voice-create-room.gjs
rename to plugins/live/assets/javascripts/discourse/components/modal/live-create-room.gjs
index e616439f54e..7f0c06191ff 100644
--- a/plugins/voice/assets/javascripts/discourse/components/modal/voice-create-room.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/modal/live-create-room.gjs
@@ -5,24 +5,24 @@ import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
import DModal from "discourse/ui-kit/d-modal";
import { i18n } from "discourse-i18n";
-import VoiceRoomForm from "discourse/plugins/voice/discourse/components/voice-room-form";
+import LiveRoomForm from "discourse/plugins/live/discourse/components/live-room-form";
-export default class VoiceCreateRoomModal extends Component {
- @service voiceRooms;
+export default class LiveCreateRoomModal extends Component {
+ @service liveRooms;
@service toasts;
@action
async handleSubmit(data) {
try {
- const result = await ajax("/voice/rooms", {
+ const result = await ajax("/live/rooms", {
type: "POST",
data: { room: data },
});
- this.voiceRooms.handleDirectoryEvent({
+ this.liveRooms.handleDirectoryEvent({
type: "created",
room: result.room,
});
- this.toasts.success({ data: { message: i18n("voice.room.created") } });
+ this.toasts.success({ data: { message: i18n("live.room.created") } });
this.args.closeModal();
} catch (e) {
popupAjaxError(e);
@@ -31,12 +31,12 @@ export default class VoiceCreateRoomModal extends Component {
<template>
<DModal
- class="voice-create-room-modal"
+ class="live-create-room-modal"
@closeModal={{@closeModal}}
- @title={{i18n "voice.sidebar.create"}}
+ @title={{i18n "live.sidebar.create"}}
>
<:body>
- <VoiceRoomForm @onSubmit={{this.handleSubmit}} />
+ <LiveRoomForm @onSubmit={{this.handleSubmit}} />
</:body>
</DModal>
</template>
diff --git a/plugins/voice/assets/javascripts/discourse/components/modal/voice-incoming-call.gjs b/plugins/live/assets/javascripts/discourse/components/modal/live-incoming-call.gjs
similarity index 73%
rename from plugins/voice/assets/javascripts/discourse/components/modal/voice-incoming-call.gjs
rename to plugins/live/assets/javascripts/discourse/components/modal/live-incoming-call.gjs
index 5886fcf6df2..13ba4224a0f 100644
--- a/plugins/voice/assets/javascripts/discourse/components/modal/voice-incoming-call.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/modal/live-incoming-call.gjs
@@ -6,7 +6,7 @@ import DModal from "discourse/ui-kit/d-modal";
import dAvatar from "discourse/ui-kit/helpers/d-avatar";
import { i18n } from "discourse-i18n";
-export default class VoiceIncomingCallModal extends Component {
+export default class LiveIncomingCallModal extends Component {
#expiryTimer;
constructor() {
@@ -55,35 +55,35 @@ export default class VoiceIncomingCallModal extends Component {
<template>
<DModal
- class="voice-incoming-call-modal"
+ class="live-incoming-call-modal"
@closeModal={{@closeModal}}
- @title={{i18n "voice.call.incoming_title"}}
+ @title={{i18n "live.call.incoming_title"}}
>
<:body>
- <div class="voice-incoming-call-modal__caller">
- <div class="voice-incoming-call-modal__avatar">
+ <div class="live-incoming-call-modal__caller">
+ <div class="live-incoming-call-modal__avatar">
{{dAvatar this.caller imageSize="huge"}}
</div>
<span
- class="voice-incoming-call-modal__name"
+ class="live-incoming-call-modal__name"
>{{this.displayName}}</span>
- <span class="voice-incoming-call-modal__state">
- {{i18n "voice.call.incoming_state"}}
+ <span class="live-incoming-call-modal__state">
+ {{i18n "live.call.incoming_state"}}
</span>
</div>
</:body>
<:footer>
<DButton
- class="btn-primary voice-incoming-call-modal__answer"
+ class="btn-primary live-incoming-call-modal__answer"
@action={{this.answer}}
@icon="phone"
- @label="voice.call.answer"
+ @label="live.call.answer"
/>
<DButton
- class="btn-danger voice-incoming-call-modal__decline"
+ class="btn-danger live-incoming-call-modal__decline"
@action={{this.decline}}
@icon="phone-slash"
- @label="voice.call.decline"
+ @label="live.call.decline"
/>
</:footer>
</DModal>
diff --git a/plugins/voice/assets/javascripts/discourse/components/modal/voice-invite-agent.gjs b/plugins/live/assets/javascripts/discourse/components/modal/live-invite-agent.gjs
similarity index 76%
rename from plugins/voice/assets/javascripts/discourse/components/modal/voice-invite-agent.gjs
rename to plugins/live/assets/javascripts/discourse/components/modal/live-invite-agent.gjs
index 9955d366767..ac6042faee8 100644
--- a/plugins/voice/assets/javascripts/discourse/components/modal/voice-invite-agent.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/modal/live-invite-agent.gjs
@@ -11,7 +11,7 @@ import DConditionalLoadingSpinner from "discourse/ui-kit/d-conditional-loading-s
import DModal from "discourse/ui-kit/d-modal";
import { i18n } from "discourse-i18n";
-export default class VoiceInviteAgentModal extends Component {
+export default class LiveInviteAgentModal extends Component {
@service toasts;
@tracked agents = [];
@@ -46,11 +46,11 @@ export default class VoiceInviteAgentModal extends Component {
@action
async invite(data) {
try {
- await ajax(`/voice/rooms/${this.args.model.room.id}/invite_agent`, {
+ await ajax(`/live/rooms/${this.args.model.room.id}/invite_agent`, {
type: "POST",
data: { agent_name: data.agent_name.trim() },
});
- this.toasts.success({ data: { message: i18n("voice.agent.invited") } });
+ this.toasts.success({ data: { message: i18n("live.agent.invited") } });
this.args.closeModal();
} catch (error) {
popupAjaxError(error);
@@ -62,7 +62,7 @@ export default class VoiceInviteAgentModal extends Component {
// explicit refresh surfaces the failure.
async #loadAgents({ refresh = false } = {}) {
try {
- const result = await ajax("/voice/agents", {
+ const result = await ajax("/live/agents", {
data: refresh ? { refresh: true } : {},
});
this.agents = result.agents ?? [];
@@ -78,14 +78,14 @@ export default class VoiceInviteAgentModal extends Component {
<template>
<DModal
- class="voice-invite-agent-modal"
+ class="live-invite-agent-modal"
@closeModal={{@closeModal}}
@inline={{@inline}}
- @title={{i18n "voice.agent.invite"}}
+ @title={{i18n "live.agent.invite"}}
>
<:body>
- <p class="voice-invite-agent-modal__hint">
- {{i18n "voice.agent.deploy_hint"}}
+ <p class="live-invite-agent-modal__hint">
+ {{i18n "live.agent.deploy_hint"}}
</p>
<DConditionalLoadingSpinner @condition={{this.loading}}>
<Form
@@ -97,12 +97,12 @@ export default class VoiceInviteAgentModal extends Component {
<form.Field
@format="large"
@name="agent_name"
- @title={{i18n "voice.agent.name"}}
+ @title={{i18n "live.agent.name"}}
@type="select"
@validation="required"
as |field|
>
- <div class="voice-invite-agent-modal__picker">
+ <div class="live-invite-agent-modal__picker">
<field.Control as |select|>
{{#each this.agents as |agent|}}
<select.Option @value={{agent.name}}>
@@ -111,17 +111,17 @@ export default class VoiceInviteAgentModal extends Component {
{{/each}}
</field.Control>
<DButton
- class="btn-flat voice-invite-agent-modal__toggle"
+ class="btn-flat live-invite-agent-modal__toggle"
@action={{this.toggleTyping}}
@icon="pencil"
- @title="voice.agent.type_name"
+ @title="live.agent.type_name"
/>
<DButton
- class="btn-flat voice-invite-agent-modal__refresh"
+ class="btn-flat live-invite-agent-modal__refresh"
@action={{this.refresh}}
@icon="arrows-rotate"
@isLoading={{this.refreshing}}
- @title="voice.agent.refresh"
+ @title="live.agent.refresh"
/>
</div>
</form.Field>
@@ -129,32 +129,32 @@ export default class VoiceInviteAgentModal extends Component {
<form.Field
@format="large"
@name="agent_name"
- @title={{i18n "voice.agent.name"}}
+ @title={{i18n "live.agent.name"}}
@type="input"
@validation="required"
as |field|
>
- <div class="voice-invite-agent-modal__picker">
+ <div class="live-invite-agent-modal__picker">
<field.Control maxlength="256" />
{{#if this.agents.length}}
<DButton
- class="btn-flat voice-invite-agent-modal__toggle"
+ class="btn-flat live-invite-agent-modal__toggle"
@action={{this.toggleTyping}}
@icon="list"
- @title="voice.agent.pick_name"
+ @title="live.agent.pick_name"
/>
{{/if}}
<DButton
- class="btn-flat voice-invite-agent-modal__refresh"
+ class="btn-flat live-invite-agent-modal__refresh"
@action={{this.refresh}}
@icon="arrows-rotate"
@isLoading={{this.refreshing}}
- @title="voice.agent.refresh"
+ @title="live.agent.refresh"
/>
</div>
</form.Field>
{{/if}}
- <form.Submit @label="voice.agent.invite" />
+ <form.Submit @label="live.agent.invite" />
</Form>
</DConditionalLoadingSpinner>
</:body>
diff --git a/plugins/voice/assets/javascripts/discourse/components/modal/voice-invite-users.gjs b/plugins/live/assets/javascripts/discourse/components/modal/live-invite-users.gjs
similarity index 69%
rename from plugins/voice/assets/javascripts/discourse/components/modal/voice-invite-users.gjs
rename to plugins/live/assets/javascripts/discourse/components/modal/live-invite-users.gjs
index fb056dc3a81..50c9a3f9a2f 100644
--- a/plugins/voice/assets/javascripts/discourse/components/modal/voice-invite-users.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/modal/live-invite-users.gjs
@@ -14,7 +14,7 @@ import dAvatar from "discourse/ui-kit/helpers/d-avatar";
import dIcon from "discourse/ui-kit/helpers/d-icon";
import { i18n } from "discourse-i18n";
-export default class VoiceInviteUsersModal extends Component {
+export default class LiveInviteUsersModal extends Component {
@service currentUser;
@service router;
@service toasts;
@@ -36,7 +36,7 @@ export default class VoiceInviteUsersModal extends Component {
get inviteUrl() {
const url = this.router.urlFor(
- "voice-room-invite",
+ "live-room-invite",
this.room.slug,
this.currentUser.username_lower
);
@@ -54,7 +54,7 @@ export default class VoiceInviteUsersModal extends Component {
async loadSuggestions() {
try {
const result = await ajax(
- `/voice/rooms/${this.room.id}/invites/suggestions`
+ `/live/rooms/${this.room.id}/invites/suggestions`
);
this.suggestions = result.suggestions;
} catch (error) {
@@ -88,14 +88,14 @@ export default class VoiceInviteUsersModal extends Component {
clipboardCopy(this.inviteUrl);
this.toasts.success({
duration: "short",
- data: { message: i18n("voice.room.link_copied") },
+ data: { message: i18n("live.room.link_copied") },
});
}
async #invite(usernames) {
this.inviting = true;
try {
- const result = await ajax(`/voice/rooms/${this.room.id}/invites`, {
+ const result = await ajax(`/live/rooms/${this.room.id}/invites`, {
type: "POST",
data: { usernames },
});
@@ -107,7 +107,7 @@ export default class VoiceInviteUsersModal extends Component {
this.toasts.success({
duration: "short",
data: {
- message: i18n("voice.invite.sent", {
+ message: i18n("live.invite.sent", {
count: result.invited_usernames.length,
}),
},
@@ -116,7 +116,7 @@ export default class VoiceInviteUsersModal extends Component {
if (result.skipped_usernames.length) {
this.toasts.warning({
data: {
- message: i18n("voice.invite.skipped", {
+ message: i18n("live.invite.skipped", {
usernames: result.skipped_usernames
.map((username) => `@${username}`)
.join(", "),
@@ -133,74 +133,74 @@ export default class VoiceInviteUsersModal extends Component {
<template>
<DModal
- class="voice-invite-modal"
+ class="live-invite-modal"
@closeModal={{@closeModal}}
- @title={{i18n "voice.invite.title" room_name=this.room.name}}
+ @title={{i18n "live.invite.title" room_name=this.room.name}}
>
<:body>
- <div class="voice-invite-modal__search">
- <span class="voice-invite-modal__label">
- {{i18n "voice.invite.search_label"}}
+ <div class="live-invite-modal__search">
+ <span class="live-invite-modal__label">
+ {{i18n "live.invite.search_label"}}
</span>
- <div class="voice-invite-modal__search-row">
+ <div class="live-invite-modal__search-row">
<UserChooser
- class="voice-invite-modal__user-chooser"
+ class="live-invite-modal__user-chooser"
@onChange={{this.setSelectedUsernames}}
@options={{hash
excludeCurrentUser=true
- filterPlaceholder="voice.invite.search_placeholder"
+ filterPlaceholder="live.invite.search_placeholder"
}}
@value={{this.selectedUsernames}}
/>
<DButton
- class="btn-primary voice-invite-modal__send"
+ class="btn-primary live-invite-modal__send"
@action={{this.inviteSelected}}
@disabled={{this.inviting}}
@icon="paper-plane"
- @label="voice.invite.send"
+ @label="live.invite.send"
/>
</div>
</div>
{{#if this.loadingSuggestions}}
- <div class="voice-invite-modal__loading">
+ <div class="live-invite-modal__loading">
<div class="spinner small"></div>
{{i18n "loading"}}
</div>
{{else if this.suggestionRows.length}}
- <div class="voice-invite-modal__suggestions">
- <h3 class="voice-invite-modal__section-title">
- {{i18n "voice.invite.suggestions_title"}}
+ <div class="live-invite-modal__suggestions">
+ <h3 class="live-invite-modal__section-title">
+ {{i18n "live.invite.suggestions_title"}}
</h3>
- <div class="voice-invite-modal__suggestion-list">
+ <div class="live-invite-modal__suggestion-list">
{{#each this.suggestionRows as |suggestion|}}
- <div class="voice-invite-modal__suggestion">
- <div class="voice-invite-modal__suggestion-avatar">
+ <div class="live-invite-modal__suggestion">
+ <div class="live-invite-modal__suggestion-avatar">
{{dAvatar suggestion imageSize="medium"}}
</div>
- <div class="voice-invite-modal__suggestion-details">
+ <div class="live-invite-modal__suggestion-details">
<span
- class="voice-invite-modal__suggestion-username"
+ class="live-invite-modal__suggestion-username"
>{{suggestion.username}}</span>
- <span class="voice-invite-modal__suggestion-time">
+ <span class="live-invite-modal__suggestion-time">
{{i18n
- "voice.invite.time_together"
+ "live.invite.time_together"
duration=suggestion.timeTogether
}}
</span>
</div>
{{#if suggestion.invited}}
- <span class="voice-invite-modal__suggestion-invited">
+ <span class="live-invite-modal__suggestion-invited">
{{dIcon "check"}}
- {{i18n "voice.invite.invited"}}
+ {{i18n "live.invite.invited"}}
</span>
{{else}}
<DButton
- class="btn-small voice-invite-modal__suggestion-invite"
+ class="btn-small live-invite-modal__suggestion-invite"
@action={{fn this.inviteSuggestion suggestion}}
@disabled={{this.inviting}}
@icon="user-plus"
- @label="voice.invite.invite"
+ @label="live.invite.invite"
/>
{{/if}}
</div>
@@ -209,23 +209,23 @@ export default class VoiceInviteUsersModal extends Component {
</div>
{{/if}}
- <div class="voice-invite-modal__link">
- <label class="voice-invite-modal__label" for="voice-invite-link">
- {{i18n "voice.invite.link_label"}}
+ <div class="live-invite-modal__link">
+ <label class="live-invite-modal__label" for="live-invite-link">
+ {{i18n "live.invite.link_label"}}
</label>
- <div class="voice-invite-modal__link-row">
+ <div class="live-invite-modal__link-row">
<input
- class="voice-invite-modal__link-input"
- id="voice-invite-link"
+ class="live-invite-modal__link-input"
+ id="live-invite-link"
readonly
type="text"
value={{this.inviteUrl}}
/>
<DButton
- class="voice-invite-modal__copy"
+ class="live-invite-modal__copy"
@action={{this.copyLink}}
@icon="copy"
- @label="voice.invite.copy"
+ @label="live.invite.copy"
/>
</div>
</div>
diff --git a/plugins/voice/assets/javascripts/discourse/components/modal/voice-mesh-privacy-warning.gjs b/plugins/live/assets/javascripts/discourse/components/modal/live-mesh-privacy-warning.gjs
similarity index 74%
rename from plugins/voice/assets/javascripts/discourse/components/modal/voice-mesh-privacy-warning.gjs
rename to plugins/live/assets/javascripts/discourse/components/modal/live-mesh-privacy-warning.gjs
index 99ccdec4adc..3581cefb38e 100644
--- a/plugins/voice/assets/javascripts/discourse/components/modal/voice-mesh-privacy-warning.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/modal/live-mesh-privacy-warning.gjs
@@ -6,6 +6,7 @@ import DButton from "discourse/ui-kit/d-button";
import DModal from "discourse/ui-kit/d-modal";
import { i18n } from "discourse-i18n";
+// Pre-rename key, kept so saved preferences survive.
const MESH_PRIVACY_ACK_KEY = "voice_mesh_privacy_ack";
// Guards against a repeat join request (double click, sidebar plus room
@@ -37,7 +38,7 @@ export async function confirmMeshPrivacy(
{ currentUser, modal, siteSettings }
) {
if (
- !siteSettings.voice_mesh_privacy_warning_enabled ||
+ !siteSettings.live_mesh_privacy_warning_enabled ||
!currentUser ||
room.expected_transport !== "mesh"
) {
@@ -54,7 +55,7 @@ export async function confirmMeshPrivacy(
warningOpen = true;
try {
- const result = await modal.show(VoiceMeshPrivacyWarningModal);
+ const result = await modal.show(LiveMeshPrivacyWarningModal);
if (!result?.join) {
return false;
}
@@ -69,7 +70,7 @@ export async function confirmMeshPrivacy(
// Resolves through `closeModal` with `{ join: true, dontShowAgain }` when the
// user accepts; cancel/escape/backdrop resolve with nothing.
-export default class VoiceMeshPrivacyWarningModal extends Component {
+export default class LiveMeshPrivacyWarningModal extends Component {
@tracked dontShowAgain = false;
@action
@@ -84,34 +85,34 @@ export default class VoiceMeshPrivacyWarningModal extends Component {
<template>
<DModal
- class="voice-mesh-privacy-warning-modal"
+ class="live-mesh-privacy-warning-modal"
@closeModal={{@closeModal}}
- @title={{i18n "voice.mesh_privacy_warning.title"}}
+ @title={{i18n "live.mesh_privacy_warning.title"}}
>
<:body>
- <p class="voice-mesh-privacy-warning-modal__body">
- {{i18n "voice.mesh_privacy_warning.body"}}
+ <p class="live-mesh-privacy-warning-modal__body">
+ {{i18n "live.mesh_privacy_warning.body"}}
</p>
- <label class="voice-mesh-privacy-warning-modal__dont-show-again">
+ <label class="live-mesh-privacy-warning-modal__dont-show-again">
<input
checked={{this.dontShowAgain}}
type="checkbox"
{{on "change" this.updateDontShowAgain}}
/>
- {{i18n "voice.mesh_privacy_warning.dont_show_again"}}
+ {{i18n "live.mesh_privacy_warning.dont_show_again"}}
</label>
</:body>
<:footer>
<DButton
- class="btn-primary voice-mesh-privacy-warning-modal__join"
+ class="btn-primary live-mesh-privacy-warning-modal__join"
@action={{this.join}}
@icon="phone"
- @label="voice.mesh_privacy_warning.join"
+ @label="live.mesh_privacy_warning.join"
/>
<DButton
- class="btn-flat voice-mesh-privacy-warning-modal__cancel"
+ class="btn-flat live-mesh-privacy-warning-modal__cancel"
@action={{@closeModal}}
- @label="voice.mesh_privacy_warning.cancel"
+ @label="live.mesh_privacy_warning.cancel"
/>
</:footer>
</DModal>
diff --git a/plugins/voice/assets/javascripts/discourse/components/modal/voice-mic-permission.gjs b/plugins/live/assets/javascripts/discourse/components/modal/live-mic-permission.gjs
similarity index 69%
rename from plugins/voice/assets/javascripts/discourse/components/modal/voice-mic-permission.gjs
rename to plugins/live/assets/javascripts/discourse/components/modal/live-mic-permission.gjs
index 82d67c85f9d..188e2b902a3 100644
--- a/plugins/voice/assets/javascripts/discourse/components/modal/voice-mic-permission.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/modal/live-mic-permission.gjs
@@ -23,7 +23,7 @@ export function reportMicAcquisitionFailure(error, { modal, toasts }) {
} else {
toasts.error({
duration: 8000,
- data: { message: i18n("voice.room.mic_unavailable") },
+ data: { message: i18n("live.room.mic_unavailable") },
});
}
}
@@ -36,34 +36,34 @@ async function showMicPermissionHelp(modal) {
helpOpen = true;
try {
- await modal.show(VoiceMicPermissionModal);
+ await modal.show(LiveMicPermissionModal);
} finally {
helpOpen = false;
}
}
-const VoiceMicPermissionModal = <template>
+const LiveMicPermissionModal = <template>
<DModal
- class="voice-mic-permission-modal"
+ class="live-mic-permission-modal"
@closeModal={{@closeModal}}
- @title={{i18n "voice.mic_permission.title"}}
+ @title={{i18n "live.mic_permission.title"}}
>
<:body>
- <p class="voice-mic-permission-modal__body">
- {{i18n "voice.mic_permission.body"}}
+ <p class="live-mic-permission-modal__body">
+ {{i18n "live.mic_permission.body"}}
</p>
- <p class="voice-mic-permission-modal__instructions">
- {{i18n "voice.mic_permission.instructions"}}
+ <p class="live-mic-permission-modal__instructions">
+ {{i18n "live.mic_permission.instructions"}}
</p>
</:body>
<:footer>
<DButton
- class="btn-primary voice-mic-permission-modal__ok"
+ class="btn-primary live-mic-permission-modal__ok"
@action={{@closeModal}}
- @label="voice.mic_permission.ok"
+ @label="live.mic_permission.ok"
/>
</:footer>
</DModal>
</template>;
-export default VoiceMicPermissionModal;
+export default LiveMicPermissionModal;
diff --git a/plugins/voice/assets/javascripts/discourse/components/modal/voice-room-info.gjs b/plugins/live/assets/javascripts/discourse/components/modal/live-room-info.gjs
similarity index 65%
rename from plugins/voice/assets/javascripts/discourse/components/modal/voice-room-info.gjs
rename to plugins/live/assets/javascripts/discourse/components/modal/live-room-info.gjs
index ad6c91cc049..a7da33e289e 100644
--- a/plugins/voice/assets/javascripts/discourse/components/modal/voice-room-info.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/modal/live-room-info.gjs
@@ -14,11 +14,11 @@ import DModal from "discourse/ui-kit/d-modal";
import dAvatar from "discourse/ui-kit/helpers/d-avatar";
import dIcon from "discourse/ui-kit/helpers/d-icon";
import { i18n } from "discourse-i18n";
-import VoiceRoomForm from "discourse/plugins/voice/discourse/components/voice-room-form";
-import roomIcon from "discourse/plugins/voice/discourse/lib/voice/room-icon";
+import LiveRoomForm from "discourse/plugins/live/discourse/components/live-room-form";
+import roomIcon from "discourse/plugins/live/discourse/lib/live/room-icon";
-export default class VoiceRoomInfoModal extends Component {
- @service voiceRooms;
+export default class LiveRoomInfoModal extends Component {
+ @service liveRooms;
@service toasts;
@tracked memberships = [];
@@ -51,20 +51,20 @@ export default class VoiceRoomInfoModal extends Component {
const options = [
{
id: "participant",
- name: i18n("voice.room_info.members.participant"),
+ name: i18n("live.room_info.members.participant"),
},
];
if (this.room.room_type === "stage") {
options.push({
id: "speaker",
- name: i18n("voice.room_info.members.speaker"),
+ name: i18n("live.room_info.members.speaker"),
});
}
options.push({
id: "moderator",
- name: i18n("voice.room_info.members.moderator"),
+ name: i18n("live.room_info.members.moderator"),
});
return options;
@@ -73,7 +73,7 @@ export default class VoiceRoomInfoModal extends Component {
async loadMemberships() {
this.loading = true;
try {
- const result = await ajax(`/voice/rooms/${this.room.id}/memberships`);
+ const result = await ajax(`/live/rooms/${this.room.id}/memberships`);
this.memberships = result.memberships;
} catch (error) {
popupAjaxError(error);
@@ -98,15 +98,15 @@ export default class VoiceRoomInfoModal extends Component {
@action
async handleEdit(data) {
try {
- const result = await ajax(`/voice/rooms/${this.room.id}`, {
+ const result = await ajax(`/live/rooms/${this.room.id}`, {
type: "PUT",
data: { room: data },
});
- this.voiceRooms.handleDirectoryEvent({
+ this.liveRooms.handleDirectoryEvent({
type: "updated",
room: result.room,
});
- this.toasts.success({ data: { message: i18n("voice.room.updated") } });
+ this.toasts.success({ data: { message: i18n("live.room.updated") } });
this.args.closeModal();
} catch (e) {
popupAjaxError(e);
@@ -132,7 +132,7 @@ export default class VoiceRoomInfoModal extends Component {
this.addingMember = true;
try {
for (const username of this.selectedUsernames) {
- await ajax(`/voice/rooms/${this.room.id}/memberships`, {
+ await ajax(`/live/rooms/${this.room.id}/memberships`, {
type: "POST",
data: { username, role: this.selectedRole },
});
@@ -150,7 +150,7 @@ export default class VoiceRoomInfoModal extends Component {
@action
async updateMemberRole(membership, role) {
try {
- await ajax(`/voice/rooms/${this.room.id}/memberships/${membership.id}`, {
+ await ajax(`/live/rooms/${this.room.id}/memberships/${membership.id}`, {
type: "PUT",
data: { role },
});
@@ -163,7 +163,7 @@ export default class VoiceRoomInfoModal extends Component {
@action
async removeMember(membership) {
try {
- await ajax(`/voice/rooms/${this.room.id}/memberships/${membership.id}`, {
+ await ajax(`/live/rooms/${this.room.id}/memberships/${membership.id}`, {
type: "DELETE",
});
await this.loadMemberships();
@@ -174,125 +174,125 @@ export default class VoiceRoomInfoModal extends Component {
<template>
<DModal
- class="voice-room-info-modal"
+ class="live-room-info-modal"
@closeModal={{@closeModal}}
- @title={{if this.isEditing (i18n "voice.room.edit")}}
+ @title={{if this.isEditing (i18n "live.room.edit")}}
>
<:body>
{{#if this.isEditing}}
- <div class="voice-room-info-modal__edit-form">
- <VoiceRoomForm
+ <div class="live-room-info-modal__edit-form">
+ <LiveRoomForm
@onManageMembers={{this.stopEditing}}
@onSubmit={{this.handleEdit}}
@room={{this.room}}
/>
</div>
{{else}}
- <div class="voice-room-info-modal__header">
- <div class="voice-room-info-modal__icon">
+ <div class="live-room-info-modal__header">
+ <div class="live-room-info-modal__icon">
{{dIcon (roomIcon this.room)}}
{{#unless this.room.public}}
- {{dIcon "lock" class="voice-room-info-modal__icon-badge"}}
+ {{dIcon "lock" class="live-room-info-modal__icon-badge"}}
{{/unless}}
</div>
- <div class="voice-room-info-modal__header-content">
+ <div class="live-room-info-modal__header-content">
<h2
- class="voice-room-info-modal__room-name"
+ class="live-room-info-modal__room-name"
>{{this.room.name}}</h2>
{{#if this.room.cooked_description}}
<div
- class="voice-room-info-modal__description cooked"
+ class="live-room-info-modal__description cooked"
>{{trustHTML this.room.cooked_description}}</div>
{{/if}}
</div>
{{#if this.room.can_manage}}
<DButton
- class="btn-flat voice-room-info-modal__edit-btn"
+ class="btn-flat live-room-info-modal__edit-btn"
@action={{this.startEditing}}
@icon="pencil"
- @title="voice.room.edit"
+ @title="live.room.edit"
/>
{{/if}}
</div>
- <div class="voice-room-info-modal__stats">
- <div class="voice-room-info-modal__stat">
- <span class="voice-room-info-modal__stat-value">
+ <div class="live-room-info-modal__stats">
+ <div class="live-room-info-modal__stat">
+ <span class="live-room-info-modal__stat-value">
{{#if this.room.public}}
{{dIcon "globe"}}
{{else}}
{{dIcon "lock"}}
{{/if}}
</span>
- <span class="voice-room-info-modal__stat-label">
+ <span class="live-room-info-modal__stat-label">
{{if
this.room.public
- (i18n "voice.room_info.public")
- (i18n "voice.room_info.private")
+ (i18n "live.room_info.public")
+ (i18n "live.room_info.private")
}}
</span>
</div>
- <div class="voice-room-info-modal__stat">
+ <div class="live-room-info-modal__stat">
<span
- class="voice-room-info-modal__stat-value"
+ class="live-room-info-modal__stat-value"
>{{this.room.member_count}}</span>
- <span class="voice-room-info-modal__stat-label">{{i18n
- "voice.room_info.member_count"
+ <span class="live-room-info-modal__stat-label">{{i18n
+ "live.room_info.member_count"
}}</span>
</div>
{{#if this.room.max_participants}}
- <div class="voice-room-info-modal__stat">
+ <div class="live-room-info-modal__stat">
<span
- class="voice-room-info-modal__stat-value"
+ class="live-room-info-modal__stat-value"
>{{this.room.max_participants}}</span>
- <span class="voice-room-info-modal__stat-label">{{i18n
- "voice.room_info.max_participants"
+ <span class="live-room-info-modal__stat-label">{{i18n
+ "live.room_info.max_participants"
}}</span>
</div>
{{/if}}
</div>
{{#if this.showMembershipManagement}}
- <div class="voice-room-info-modal__members">
- <div class="voice-room-info-modal__section-header">
+ <div class="live-room-info-modal__members">
+ <div class="live-room-info-modal__section-header">
{{dIcon "users"}}
- <h3>{{i18n "voice.room_info.members.title"}}</h3>
+ <h3>{{i18n "live.room_info.members.title"}}</h3>
</div>
{{#if this.loading}}
- <div class="voice-room-info-modal__loading">
+ <div class="live-room-info-modal__loading">
<div class="spinner small"></div>
{{i18n "loading"}}
</div>
{{else}}
- <div class="voice-room-info-modal__member-list">
+ <div class="live-room-info-modal__member-list">
{{#each this.memberships as |membership|}}
<div
- class="voice-room-info-modal__member
+ class="live-room-info-modal__member
{{if
(eq membership.user_id this.room.creator_id)
'--creator'
}}"
>
- <div class="voice-room-info-modal__member-avatar">
+ <div class="live-room-info-modal__member-avatar">
{{dAvatar membership.user imageSize="medium"}}
</div>
- <div class="voice-room-info-modal__member-details">
+ <div class="live-room-info-modal__member-details">
<span
- class="voice-room-info-modal__member-username"
+ class="live-room-info-modal__member-username"
>{{membership.user.username}}</span>
{{#if (eq membership.user_id this.room.creator_id)}}
<span
- class="voice-room-info-modal__member-role --creator"
+ class="live-room-info-modal__member-role --creator"
>
{{dIcon "crown"}}
- {{i18n "voice.room_info.members.creator"}}
+ {{i18n "live.room_info.members.creator"}}
</span>
{{else}}
<span
- class="voice-room-info-modal__member-role --{{membership.role_name}}"
+ class="live-room-info-modal__member-role --{{membership.role_name}}"
>
{{membership.role_name}}
</span>
@@ -300,19 +300,19 @@ export default class VoiceRoomInfoModal extends Component {
</div>
{{#if (notEq membership.user_id this.room.creator_id)}}
- <div class="voice-room-info-modal__member-actions">
+ <div class="live-room-info-modal__member-actions">
<ComboBox
- class="voice-room-info-modal__role-select"
+ class="live-room-info-modal__role-select"
@content={{this.roleOptions}}
@onChange={{fn this.updateMemberRole membership}}
@options={{hash none=false}}
@value={{membership.role_name}}
/>
<DButton
- class="btn-flat btn-small voice-room-info-modal__remove-btn"
+ class="btn-flat btn-small live-room-info-modal__remove-btn"
@action={{fn this.removeMember membership}}
@icon="xmark"
- @title="voice.room_info.members.remove"
+ @title="live.room_info.members.remove"
/>
</div>
{{/if}}
@@ -320,30 +320,30 @@ export default class VoiceRoomInfoModal extends Component {
{{/each}}
</div>
- <div class="voice-room-info-modal__add-member">
- <div class="voice-room-info-modal__add-row">
+ <div class="live-room-info-modal__add-member">
+ <div class="live-room-info-modal__add-row">
<UserChooser
- class="voice-room-info-modal__user-chooser"
+ class="live-room-info-modal__user-chooser"
@onChange={{this.setSelectedUsernames}}
@options={{hash
excludeCurrentUser=false
- filterPlaceholder="voice.room_info.members.add_placeholder"
+ filterPlaceholder="live.room_info.members.add_placeholder"
}}
@value={{this.selectedUsernames}}
/>
<ComboBox
- class="voice-room-info-modal__role-chooser"
+ class="live-room-info-modal__role-chooser"
@content={{this.roleOptions}}
@onChange={{this.setSelectedRole}}
@options={{hash none=false}}
@value={{this.selectedRole}}
/>
<DButton
- class="btn-primary voice-room-info-modal__add-btn"
+ class="btn-primary live-room-info-modal__add-btn"
@action={{this.addMember}}
@disabled={{this.addingMember}}
@icon="plus"
- @title="voice.room_info.members.add_button"
+ @title="live.room_info.members.add_button"
/>
</div>
</div>
diff --git a/plugins/voice/assets/javascripts/discourse/components/modal/voice-video-settings.gjs b/plugins/live/assets/javascripts/discourse/components/modal/live-video-settings.gjs
similarity index 64%
rename from plugins/voice/assets/javascripts/discourse/components/modal/voice-video-settings.gjs
rename to plugins/live/assets/javascripts/discourse/components/modal/live-video-settings.gjs
index 4c433092cf4..9bf560bd371 100644
--- a/plugins/voice/assets/javascripts/discourse/components/modal/voice-video-settings.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/modal/live-video-settings.gjs
@@ -11,15 +11,15 @@ import { and, not, or } from "discourse/truth-helpers";
import DModal from "discourse/ui-kit/d-modal";
import DToggleSwitch from "discourse/ui-kit/d-toggle-switch";
import { i18n } from "discourse-i18n";
-import BackgroundBlurManager from "../../lib/voice/background-blur.js";
+import BackgroundBlurManager from "../../lib/live/background-blur.js";
import {
cameraConstraints,
enumerateVideoDevices,
SYSTEM_DEFAULT_DEVICE_ID,
-} from "../../lib/voice/media-devices.js";
+} from "../../lib/live/media-devices.js";
-export default class VoiceVideoSettingsModal extends Component {
- @service voiceWebrtc;
+export default class LiveVideoSettingsModal extends Component {
+ @service liveWebrtc;
@tracked videoDevices = [];
@tracked previewStream = null;
@@ -54,11 +54,11 @@ export default class VoiceVideoSettingsModal extends Component {
}
get blurAvailable() {
- return this.voiceWebrtc.videoBlurAvailable;
+ return this.liveWebrtc.videoBlurAvailable;
}
get blurSupported() {
- return this.voiceWebrtc.videoBlurSupported;
+ return this.liveWebrtc.videoBlurSupported;
}
get blurUsable() {
@@ -66,35 +66,35 @@ export default class VoiceVideoSettingsModal extends Component {
}
get blurEnabled() {
- return this.voiceWebrtc.videoBlurEnabled;
+ return this.liveWebrtc.videoBlurEnabled;
}
get blurAmount() {
- return this.voiceWebrtc.videoBlurAmount;
+ return this.liveWebrtc.videoBlurAmount;
}
get usingLiveStream() {
- return this.voiceWebrtc.localVideoKind === "camera";
+ return this.liveWebrtc.localVideoKind === "camera";
}
get cameraQualityOptions() {
- return this.voiceWebrtc.allowedCameraQualityTiers().map((tier) => ({
+ return this.liveWebrtc.allowedCameraQualityTiers().map((tier) => ({
id: tier,
- name: i18n(`voice.quality.${tier}`),
+ name: i18n(`live.quality.${tier}`),
}));
}
get screenQualityOptions() {
- return this.voiceWebrtc.allowedScreenQualityTiers().map((tier) => ({
+ return this.liveWebrtc.allowedScreenQualityTiers().map((tier) => ({
id: tier,
- name: i18n(`voice.quality.${tier}`),
+ name: i18n(`live.quality.${tier}`),
}));
}
get screenContentOptions() {
return ["text", "motion"].map((content) => ({
id: content,
- name: i18n(`voice.video_settings.screen_content_${content}`),
+ name: i18n(`live.video_settings.screen_content_${content}`),
}));
}
@@ -108,7 +108,7 @@ export default class VoiceVideoSettingsModal extends Component {
get stream() {
return this.usingLiveStream
- ? this.voiceWebrtc.localVideoStream
+ ? this.liveWebrtc.localVideoStream
: this.previewStream;
}
@@ -121,8 +121,8 @@ export default class VoiceVideoSettingsModal extends Component {
try {
stream = await navigator.mediaDevices.getUserMedia({
video: cameraConstraints(
- this.voiceWebrtc.videoInputDeviceId,
- this.voiceWebrtc.effectiveCameraQuality()
+ this.liveWebrtc.videoInputDeviceId,
+ this.liveWebrtc.effectiveCameraQuality()
),
});
} catch {
@@ -151,7 +151,7 @@ export default class VoiceVideoSettingsModal extends Component {
this.videoDevices = [
{
id: SYSTEM_DEFAULT_DEVICE_ID,
- name: i18n("voice.devices.system_default"),
+ name: i18n("live.devices.system_default"),
},
...inputs,
];
@@ -159,7 +159,7 @@ export default class VoiceVideoSettingsModal extends Component {
@action
async onCameraChange(deviceId) {
- await this.voiceWebrtc.setVideoInputDevice(deviceId);
+ await this.liveWebrtc.setVideoInputDevice(deviceId);
if (!this.usingLiveStream) {
await this.startPreview();
}
@@ -167,7 +167,7 @@ export default class VoiceVideoSettingsModal extends Component {
@action
async onCameraQualityChange(tier) {
- this.voiceWebrtc.setCameraQuality(tier);
+ this.liveWebrtc.setCameraQuality(tier);
if (!this.usingLiveStream) {
await this.startPreview();
}
@@ -181,7 +181,7 @@ export default class VoiceVideoSettingsModal extends Component {
this.busy = true;
try {
- await this.voiceWebrtc.toggleVideoBlur();
+ await this.liveWebrtc.toggleVideoBlur();
if (!this.usingLiveStream) {
await this.#applyPreviewEffect();
}
@@ -195,7 +195,7 @@ export default class VoiceVideoSettingsModal extends Component {
@action
onAmountChange(event) {
const value = parseInt(event.target.value, 10);
- this.voiceWebrtc.setVideoBlurAmount(value);
+ this.liveWebrtc.setVideoBlurAmount(value);
this.#previewBlur?.setAmount(value);
}
@@ -246,124 +246,122 @@ export default class VoiceVideoSettingsModal extends Component {
<template>
<DModal
- class="voice-video-settings-modal"
+ class="live-video-settings-modal"
@closeModal={{@closeModal}}
- @title={{i18n "voice.video_settings.title"}}
+ @title={{i18n "live.video_settings.title"}}
>
<:body>
- <div class="voice-video-settings">
- <div class="voice-video-settings__preview">
+ <div class="live-video-settings">
+ <div class="live-video-settings__preview">
{{#if this.previewError}}
- <p class="voice-video-settings__camera-error">
- {{i18n "voice.video_settings.camera_error"}}
+ <p class="live-video-settings__camera-error">
+ {{i18n "live.video_settings.camera_error"}}
</p>
{{else if this.stream}}
<video
autoplay
muted
playsinline
- {{didInsert
- (fn this.voiceWebrtc.attachVideoStream this.stream)
- }}
+ {{didInsert (fn this.liveWebrtc.attachVideoStream this.stream)}}
{{didUpdate
- (fn this.voiceWebrtc.attachVideoStream this.stream)
+ (fn this.liveWebrtc.attachVideoStream this.stream)
this.stream
}}
></video>
{{/if}}
</div>
- <div class="voice-video-settings__field">
- <label class="voice-video-settings__label">
- {{i18n "voice.video_settings.camera"}}
+ <div class="live-video-settings__field">
+ <label class="live-video-settings__label">
+ {{i18n "live.video_settings.camera"}}
</label>
<ComboBox
- class="voice-video-settings__camera-select"
+ class="live-video-settings__camera-select"
@content={{this.videoDevices}}
@onChange={{this.onCameraChange}}
@options={{hash none=false}}
- @value={{this.voiceWebrtc.videoInputDeviceId}}
+ @value={{this.liveWebrtc.videoInputDeviceId}}
/>
</div>
{{#if this.showCameraQuality}}
- <div class="voice-video-settings__field">
- <label class="voice-video-settings__label">
- {{i18n "voice.video_settings.camera_quality"}}
+ <div class="live-video-settings__field">
+ <label class="live-video-settings__label">
+ {{i18n "live.video_settings.camera_quality"}}
</label>
<ComboBox
- class="voice-video-settings__camera-quality-select"
+ class="live-video-settings__camera-quality-select"
@content={{this.cameraQualityOptions}}
@onChange={{this.onCameraQualityChange}}
@options={{hash none=false}}
- @value={{this.voiceWebrtc.cameraQuality}}
+ @value={{this.liveWebrtc.cameraQuality}}
/>
- <p class="voice-video-settings__hint">
- {{i18n "voice.video_settings.camera_quality_hint"}}
+ <p class="live-video-settings__hint">
+ {{i18n "live.video_settings.camera_quality_hint"}}
</p>
</div>
{{/if}}
{{#if this.showScreenQuality}}
- <div class="voice-video-settings__field">
- <label class="voice-video-settings__label">
- {{i18n "voice.video_settings.screen_quality"}}
+ <div class="live-video-settings__field">
+ <label class="live-video-settings__label">
+ {{i18n "live.video_settings.screen_quality"}}
</label>
<ComboBox
- class="voice-video-settings__screen-quality-select"
+ class="live-video-settings__screen-quality-select"
@content={{this.screenQualityOptions}}
- @onChange={{this.voiceWebrtc.setScreenQuality}}
+ @onChange={{this.liveWebrtc.setScreenQuality}}
@options={{hash none=false}}
- @value={{this.voiceWebrtc.screenQuality}}
+ @value={{this.liveWebrtc.screenQuality}}
/>
- <p class="voice-video-settings__hint">
- {{i18n "voice.video_settings.screen_quality_hint"}}
+ <p class="live-video-settings__hint">
+ {{i18n "live.video_settings.screen_quality_hint"}}
</p>
</div>
{{/if}}
- <div class="voice-video-settings__field">
- <label class="voice-video-settings__label">
- {{i18n "voice.video_settings.screen_content"}}
+ <div class="live-video-settings__field">
+ <label class="live-video-settings__label">
+ {{i18n "live.video_settings.screen_content"}}
</label>
<ComboBox
- class="voice-video-settings__screen-content-select"
+ class="live-video-settings__screen-content-select"
@content={{this.screenContentOptions}}
- @onChange={{this.voiceWebrtc.setScreenContent}}
+ @onChange={{this.liveWebrtc.setScreenContent}}
@options={{hash none=false}}
- @value={{this.voiceWebrtc.screenContent}}
+ @value={{this.liveWebrtc.screenContent}}
/>
- <p class="voice-video-settings__hint">
- {{i18n "voice.video_settings.screen_content_hint"}}
+ <p class="live-video-settings__hint">
+ {{i18n "live.video_settings.screen_content_hint"}}
</p>
</div>
{{#if this.blurAvailable}}
- <div class="voice-video-settings__field">
+ <div class="live-video-settings__field">
<DToggleSwitch
disabled={{or this.busy (not this.blurSupported)}}
- @label="voice.video_settings.background_blur"
+ @label="live.video_settings.background_blur"
@state={{this.blurEnabled}}
{{on "click" this.toggleBlur}}
/>
{{#unless this.blurSupported}}
- <p class="voice-video-settings__hint">
- {{i18n "voice.video_settings.not_supported"}}
+ <p class="live-video-settings__hint">
+ {{i18n "live.video_settings.not_supported"}}
</p>
{{/unless}}
</div>
{{#if (and this.blurEnabled this.blurSupported)}}
- <div class="voice-video-settings__field">
+ <div class="live-video-settings__field">
<label
- class="voice-video-settings__label"
- for="voice-video-settings-blur-amount"
+ class="live-video-settings__label"
+ for="live-video-settings-blur-amount"
>
- {{i18n "voice.video_settings.blur_amount"}}
+ {{i18n "live.video_settings.blur_amount"}}
</label>
<input
- class="voice-video-settings__blur-slider"
- id="voice-video-settings-blur-amount"
+ class="live-video-settings__blur-slider"
+ id="live-video-settings-blur-amount"
max="100"
min="0"
type="range"
diff --git a/plugins/voice/assets/javascripts/discourse/components/modal/voice-voice-settings.gjs b/plugins/live/assets/javascripts/discourse/components/modal/live-voice-settings.gjs
similarity index 61%
rename from plugins/voice/assets/javascripts/discourse/components/modal/voice-voice-settings.gjs
rename to plugins/live/assets/javascripts/discourse/components/modal/live-voice-settings.gjs
index 4984303263b..c920dc95de4 100644
--- a/plugins/voice/assets/javascripts/discourse/components/modal/voice-voice-settings.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/modal/live-voice-settings.gjs
@@ -10,26 +10,26 @@ import DButton from "discourse/ui-kit/d-button";
import DModal from "discourse/ui-kit/d-modal";
import DToggleSwitch from "discourse/ui-kit/d-toggle-switch";
import { i18n } from "discourse-i18n";
-import { NOISE_SUPPRESSION_MODES } from "../../lib/voice/audio-processing.js";
-import { rmsToPercent, sampleRms } from "../../lib/voice/input-gate.js";
+import { NOISE_SUPPRESSION_MODES } from "../../lib/live/audio-processing.js";
+import { rmsToPercent, sampleRms } from "../../lib/live/input-gate.js";
import {
applyOutputDevice,
audioConstraints,
enumerateAudioDevices,
outputSelectionSupported,
SYSTEM_DEFAULT_DEVICE_ID,
-} from "../../lib/voice/media-devices.js";
-import { prefetchEngineAssets } from "../../lib/voice/noise-suppression.js";
+} from "../../lib/live/media-devices.js";
+import { prefetchEngineAssets } from "../../lib/live/noise-suppression.js";
import {
engineForMode,
noiseSuppressionModeLabel,
-} from "../../lib/voice/ns-engines.js";
-import { STT_MODELS, sttModelLabel } from "../../lib/voice/stt-models.js";
+} from "../../lib/live/ns-engines.js";
+import { STT_MODELS, sttModelLabel } from "../../lib/live/stt-models.js";
const METER_INTERVAL_MS = 50;
-export default class VoiceVoiceSettingsModal extends Component {
- @service voiceWebrtc;
+export default class LiveVoiceSettingsModal extends Component {
+ @service liveWebrtc;
@tracked inputDevices = [];
@tracked outputDevices = [];
@@ -47,7 +47,7 @@ export default class VoiceVoiceSettingsModal extends Component {
this.startPreview();
// Someone opening voice settings may be about to enable suppression;
// warming the model bytes makes that toggle near-instant.
- const engine = engineForMode(this.voiceWebrtc.noiseSuppressionMode);
+ const engine = engineForMode(this.liveWebrtc.noiseSuppressionMode);
if (engine) {
prefetchEngineAssets(engine).catch(() => {});
}
@@ -79,11 +79,11 @@ export default class VoiceVoiceSettingsModal extends Component {
}
get gateThreshold() {
- return this.voiceWebrtc.gateThreshold;
+ return this.liveWebrtc.gateThreshold;
}
get busy() {
- return this.voiceWebrtc.noiseSuppressionState === "starting";
+ return this.liveWebrtc.noiseSuppressionState === "starting";
}
get noiseSuppressionModeOptions() {
@@ -101,9 +101,9 @@ export default class VoiceVoiceSettingsModal extends Component {
}
get qualityOptions() {
- return this.voiceWebrtc.allowedVoiceQualityTiers().map((tier) => ({
+ return this.liveWebrtc.allowedVoiceQualityTiers().map((tier) => ({
id: tier,
- name: i18n(`voice.quality.${tier}`),
+ name: i18n(`live.quality.${tier}`),
}));
}
@@ -124,7 +124,7 @@ export default class VoiceVoiceSettingsModal extends Component {
}
get subtitlesAvailable() {
- return this.voiceWebrtc.subtitlesAvailable;
+ return this.liveWebrtc.subtitlesAvailable;
}
async startPreview() {
@@ -134,7 +134,7 @@ export default class VoiceVoiceSettingsModal extends Component {
let stream;
try {
stream = await navigator.mediaDevices.getUserMedia({
- audio: audioConstraints(this.voiceWebrtc.inputDeviceId),
+ audio: audioConstraints(this.liveWebrtc.inputDeviceId),
});
} catch {
if (!this.isDestroying) {
@@ -183,7 +183,7 @@ export default class VoiceVoiceSettingsModal extends Component {
const defaultOption = {
id: SYSTEM_DEFAULT_DEVICE_ID,
- name: i18n("voice.devices.system_default"),
+ name: i18n("live.devices.system_default"),
};
this.inputDevices = [defaultOption, ...inputs];
this.outputDevices = [defaultOption, ...outputs];
@@ -191,27 +191,27 @@ export default class VoiceVoiceSettingsModal extends Component {
@action
async onInputChange(deviceId) {
- await this.voiceWebrtc.setInputDevice(deviceId);
+ await this.liveWebrtc.setInputDevice(deviceId);
await this.startPreview();
}
@action
onOutputChange(deviceId) {
- this.voiceWebrtc.setOutputDevice(deviceId);
+ this.liveWebrtc.setOutputDevice(deviceId);
}
@action
async chooseOutputDevice() {
try {
const device = await navigator.mediaDevices.selectAudioOutput();
- this.voiceWebrtc.setOutputDevice(device.deviceId);
+ this.liveWebrtc.setOutputDevice(device.deviceId);
await this.refreshDevices();
} catch {}
}
@action
onThresholdChange(event) {
- this.voiceWebrtc.setGateThreshold(parseInt(event.target.value, 10));
+ this.liveWebrtc.setGateThreshold(parseInt(event.target.value, 10));
}
@action
@@ -221,13 +221,13 @@ export default class VoiceVoiceSettingsModal extends Component {
}
// Serialization and state live in the audio pipeline; "starting" flows
// back through noiseSuppressionState.
- this.voiceWebrtc.setNoiseSuppressionMode(mode);
+ this.liveWebrtc.setNoiseSuppressionMode(mode);
}
@action
async toggleEchoCancellation() {
- await this.voiceWebrtc.setEchoCancellation(
- !this.voiceWebrtc.echoCancellation
+ await this.liveWebrtc.setEchoCancellation(
+ !this.liveWebrtc.echoCancellation
);
// Processing changes swap the capture out from under the level meter.
await this.startPreview();
@@ -235,14 +235,12 @@ export default class VoiceVoiceSettingsModal extends Component {
@action
toggleSubtitles() {
- this.voiceWebrtc.toggleSubtitles();
+ this.liveWebrtc.toggleSubtitles();
}
@action
async toggleAutoGainControl() {
- await this.voiceWebrtc.setAutoGainControl(
- !this.voiceWebrtc.autoGainControl
- );
+ await this.liveWebrtc.setAutoGainControl(!this.liveWebrtc.autoGainControl);
await this.startPreview();
}
@@ -272,7 +270,7 @@ export default class VoiceVoiceSettingsModal extends Component {
const element = new Audio();
element.srcObject = destination.stream;
- applyOutputDevice(element, this.voiceWebrtc.outputDeviceId);
+ applyOutputDevice(element, this.liveWebrtc.outputDeviceId);
await element.play();
setTimeout(() => {
@@ -309,193 +307,192 @@ export default class VoiceVoiceSettingsModal extends Component {
<template>
<DModal
- class="voice-voice-settings-modal"
+ class="live-voice-settings-modal"
@closeModal={{@closeModal}}
- @title={{i18n "voice.voice_settings.title"}}
+ @title={{i18n "live.voice_settings.title"}}
>
<:body>
- <div class="voice-voice-settings">
- <div class="voice-voice-settings__field">
- <label class="voice-voice-settings__label">
- {{i18n "voice.voice_settings.input_device"}}
+ <div class="live-voice-settings">
+ <div class="live-voice-settings__field">
+ <label class="live-voice-settings__label">
+ {{i18n "live.voice_settings.input_device"}}
</label>
<ComboBox
- class="voice-voice-settings__input-select"
+ class="live-voice-settings__input-select"
@content={{this.inputDevices}}
@onChange={{this.onInputChange}}
@options={{hash none=false}}
- @value={{this.voiceWebrtc.inputDeviceId}}
+ @value={{this.liveWebrtc.inputDeviceId}}
/>
</div>
{{#if this.outputSupported}}
- <div class="voice-voice-settings__field">
- <label class="voice-voice-settings__label">
- {{i18n "voice.voice_settings.output_device"}}
+ <div class="live-voice-settings__field">
+ <label class="live-voice-settings__label">
+ {{i18n "live.voice_settings.output_device"}}
</label>
- <div class="voice-voice-settings__output-row">
+ <div class="live-voice-settings__output-row">
{{#if this.showOutputPrompt}}
<DButton
- class="voice-voice-settings__choose-output-btn"
+ class="live-voice-settings__choose-output-btn"
@action={{this.chooseOutputDevice}}
@icon="headphones"
- @label="voice.voice_settings.choose_output"
+ @label="live.voice_settings.choose_output"
/>
{{else}}
<ComboBox
- class="voice-voice-settings__output-select"
+ class="live-voice-settings__output-select"
@content={{this.outputDevices}}
@onChange={{this.onOutputChange}}
@options={{hash none=false}}
- @value={{this.voiceWebrtc.outputDeviceId}}
+ @value={{this.liveWebrtc.outputDeviceId}}
/>
{{/if}}
<DButton
- class="voice-voice-settings__test-output-btn"
+ class="live-voice-settings__test-output-btn"
@action={{this.playOutputTest}}
@disabled={{this.testingOutput}}
@icon="play"
- @label="voice.voice_settings.test_output"
+ @label="live.voice_settings.test_output"
/>
</div>
</div>
{{/if}}
- <div class="voice-voice-settings__field">
- <label class="voice-voice-settings__label">
- {{i18n "voice.voice_settings.mic_test"}}
+ <div class="live-voice-settings__field">
+ <label class="live-voice-settings__label">
+ {{i18n "live.voice_settings.mic_test"}}
</label>
{{#if this.micError}}
- <p class="voice-voice-settings__mic-error">
- {{i18n "voice.voice_settings.mic_error"}}
+ <p class="live-voice-settings__mic-error">
+ {{i18n "live.voice_settings.mic_error"}}
</p>
{{else}}
<div
- class="voice-voice-settings__meter
- {{if this.gateOpen '--open'}}"
+ class="live-voice-settings__meter {{if this.gateOpen '--open'}}"
>
<span
- class="voice-voice-settings__meter-fill"
+ class="live-voice-settings__meter-fill"
style={{this.meterFillStyle}}
></span>
{{#if this.gateThreshold}}
<span
- class="voice-voice-settings__meter-threshold"
+ class="live-voice-settings__meter-threshold"
style={{this.thresholdMarkerStyle}}
></span>
{{/if}}
</div>
- <p class="voice-voice-settings__hint">
- {{i18n "voice.voice_settings.mic_test_hint"}}
+ <p class="live-voice-settings__hint">
+ {{i18n "live.voice_settings.mic_test_hint"}}
</p>
{{/if}}
</div>
- <div class="voice-voice-settings__field">
+ <div class="live-voice-settings__field">
<label
- class="voice-voice-settings__label"
- for="voice-voice-settings-sensitivity"
+ class="live-voice-settings__label"
+ for="live-voice-settings-sensitivity"
>
- {{i18n "voice.voice_settings.input_sensitivity"}}
+ {{i18n "live.voice_settings.input_sensitivity"}}
</label>
<input
- class="voice-voice-settings__sensitivity-slider"
- id="voice-voice-settings-sensitivity"
+ class="live-voice-settings__sensitivity-slider"
+ id="live-voice-settings-sensitivity"
max="100"
min="0"
type="range"
value={{this.gateThreshold}}
{{on "input" this.onThresholdChange}}
/>
- <p class="voice-voice-settings__hint">
- {{i18n "voice.voice_settings.input_sensitivity_hint"}}
+ <p class="live-voice-settings__hint">
+ {{i18n "live.voice_settings.input_sensitivity_hint"}}
</p>
</div>
- <div class="voice-voice-settings__field">
- <label class="voice-voice-settings__label">
- {{i18n "voice.voice_settings.noise_suppression"}}
+ <div class="live-voice-settings__field">
+ <label class="live-voice-settings__label">
+ {{i18n "live.voice_settings.noise_suppression"}}
</label>
<ComboBox
- class="voice-voice-settings__noise-suppression-select"
+ class="live-voice-settings__noise-suppression-select"
@content={{this.noiseSuppressionModeOptions}}
@onChange={{this.onNoiseSuppressionModeChange}}
@options={{hash none=false disabled=this.busy}}
- @value={{this.voiceWebrtc.noiseSuppressionMode}}
+ @value={{this.liveWebrtc.noiseSuppressionMode}}
/>
- <p class="voice-voice-settings__hint">
- {{i18n "voice.voice_settings.noise_suppression_hint"}}
+ <p class="live-voice-settings__hint">
+ {{i18n "live.voice_settings.noise_suppression_hint"}}
</p>
</div>
- <div class="voice-voice-settings__field">
+ <div class="live-voice-settings__field">
<DToggleSwitch
- class="voice-voice-settings__echo-cancellation-toggle"
- @label="voice.voice_settings.echo_cancellation"
- @state={{this.voiceWebrtc.echoCancellation}}
+ class="live-voice-settings__echo-cancellation-toggle"
+ @label="live.voice_settings.echo_cancellation"
+ @state={{this.liveWebrtc.echoCancellation}}
{{on "click" this.toggleEchoCancellation}}
/>
- <p class="voice-voice-settings__hint">
- {{i18n "voice.voice_settings.echo_cancellation_hint"}}
+ <p class="live-voice-settings__hint">
+ {{i18n "live.voice_settings.echo_cancellation_hint"}}
</p>
</div>
- <div class="voice-voice-settings__field">
+ <div class="live-voice-settings__field">
<DToggleSwitch
- class="voice-voice-settings__auto-gain-toggle"
- @label="voice.voice_settings.auto_gain_control"
- @state={{this.voiceWebrtc.autoGainControl}}
+ class="live-voice-settings__auto-gain-toggle"
+ @label="live.voice_settings.auto_gain_control"
+ @state={{this.liveWebrtc.autoGainControl}}
{{on "click" this.toggleAutoGainControl}}
/>
- <p class="voice-voice-settings__hint">
- {{i18n "voice.voice_settings.auto_gain_control_hint"}}
+ <p class="live-voice-settings__hint">
+ {{i18n "live.voice_settings.auto_gain_control_hint"}}
</p>
</div>
{{#if this.subtitlesAvailable}}
- <div class="voice-voice-settings__field">
+ <div class="live-voice-settings__field">
<DToggleSwitch
- class="voice-voice-settings__subtitles-toggle"
- @label="voice.voice_settings.subtitles"
- @state={{this.voiceWebrtc.subtitlesEnabled}}
+ class="live-voice-settings__subtitles-toggle"
+ @label="live.voice_settings.subtitles"
+ @state={{this.liveWebrtc.subtitlesEnabled}}
{{on "click" this.toggleSubtitles}}
/>
- <p class="voice-voice-settings__hint">
- {{i18n "voice.voice_settings.subtitles_hint"}}
+ <p class="live-voice-settings__hint">
+ {{i18n "live.voice_settings.subtitles_hint"}}
</p>
</div>
- <div class="voice-voice-settings__field">
- <label class="voice-voice-settings__label">
- {{i18n "voice.voice_settings.subtitles_model"}}
+ <div class="live-voice-settings__field">
+ <label class="live-voice-settings__label">
+ {{i18n "live.voice_settings.subtitles_model"}}
</label>
<ComboBox
- class="voice-voice-settings__subtitles-model-select"
+ class="live-voice-settings__subtitles-model-select"
@content={{this.sttModelOptions}}
- @onChange={{this.voiceWebrtc.setSttModel}}
+ @onChange={{this.liveWebrtc.setSttModel}}
@options={{hash none=false}}
- @value={{this.voiceWebrtc.sttModel}}
+ @value={{this.liveWebrtc.sttModel}}
/>
- <p class="voice-voice-settings__hint">
- {{i18n "voice.voice_settings.subtitles_model_hint"}}
+ <p class="live-voice-settings__hint">
+ {{i18n "live.voice_settings.subtitles_model_hint"}}
</p>
</div>
{{/if}}
{{#if this.showQuality}}
- <div class="voice-voice-settings__field">
- <label class="voice-voice-settings__label">
- {{i18n "voice.voice_settings.quality"}}
+ <div class="live-voice-settings__field">
+ <label class="live-voice-settings__label">
+ {{i18n "live.voice_settings.quality"}}
</label>
<ComboBox
- class="voice-voice-settings__quality-select"
+ class="live-voice-settings__quality-select"
@content={{this.qualityOptions}}
- @onChange={{this.voiceWebrtc.setVoiceQuality}}
+ @onChange={{this.liveWebrtc.setVoiceQuality}}
@options={{hash none=false}}
- @value={{this.voiceWebrtc.voiceQuality}}
+ @value={{this.liveWebrtc.voiceQuality}}
/>
- <p class="voice-voice-settings__hint">
- {{i18n "voice.voice_settings.quality_hint"}}
+ <p class="live-voice-settings__hint">
+ {{i18n "live.voice_settings.quality_hint"}}
</p>
</div>
{{/if}}
diff --git a/plugins/voice/assets/javascripts/discourse/components/reviewable/voice-user.gjs b/plugins/live/assets/javascripts/discourse/components/reviewable/live-user.gjs
similarity index 90%
rename from plugins/voice/assets/javascripts/discourse/components/reviewable/voice-user.gjs
rename to plugins/live/assets/javascripts/discourse/components/reviewable/live-user.gjs
index 6514f47c520..2b6c54c45d5 100644
--- a/plugins/voice/assets/javascripts/discourse/components/reviewable/voice-user.gjs
+++ b/plugins/live/assets/javascripts/discourse/components/reviewable/live-user.gjs
@@ -4,9 +4,7 @@ import { i18n } from "discourse-i18n";
export default <template>
<div class="review-item__meta-content">
- <div class="review-item__meta-label">{{i18n
- "voice.review.flagged_in"
- }}</div>
+ <div class="review-item__meta-label">{{i18n "live.review.flagged_in"}}</div>
<div class="review-item__meta-topic-title">
<a href={{getURL @reviewable.room_url}}>{{@reviewable.room_name}}</a>
diff --git a/plugins/live/assets/javascripts/discourse/connectors/user-card-below-message-button/live-call-button.gjs b/plugins/live/assets/javascripts/discourse/connectors/user-card-below-message-button/live-call-button.gjs
new file mode 100644
index 00000000000..2ce5d726b51
--- /dev/null
+++ b/plugins/live/assets/javascripts/discourse/connectors/user-card-below-message-button/live-call-button.gjs
@@ -0,0 +1,11 @@
+import LiveCallButton from "../../components/live/call-button.gjs";
+
+const LiveCardCallButton = <template>
+ {{#if @outletArgs.user.live_can_call}}
+ <li class="user-card-below-message-button live-call-button">
+ <LiveCallButton @user={{@outletArgs.user}} />
+ </li>
+ {{/if}}
+</template>;
+
+export default LiveCardCallButton;
diff --git a/plugins/live/assets/javascripts/discourse/connectors/user-profile-controls/live-call-button.gjs b/plugins/live/assets/javascripts/discourse/connectors/user-profile-controls/live-call-button.gjs
new file mode 100644
index 00000000000..d1ae4cc7b5c
--- /dev/null
+++ b/plugins/live/assets/javascripts/discourse/connectors/user-profile-controls/live-call-button.gjs
@@ -0,0 +1,11 @@
+import LiveCallButton from "../../components/live/call-button.gjs";
+
+const LiveProfileCallButton = <template>
+ {{#if @outletArgs.model.live_can_call}}
+ <li class="live-call-button">
+ <LiveCallButton @user={{@outletArgs.model}} />
+ </li>
+ {{/if}}
+</template>;
+
+export default LiveProfileCallButton;
diff --git a/plugins/voice/assets/javascripts/discourse/controllers/voice-room.js b/plugins/live/assets/javascripts/discourse/controllers/live-room.js
similarity index 71%
rename from plugins/voice/assets/javascripts/discourse/controllers/voice-room.js
rename to plugins/live/assets/javascripts/discourse/controllers/live-room.js
index 97a043074e4..538ad89915d 100644
--- a/plugins/voice/assets/javascripts/discourse/controllers/voice-room.js
+++ b/plugins/live/assets/javascripts/discourse/controllers/live-room.js
@@ -1,7 +1,7 @@
import Controller from "@ember/controller";
-import urlFlagSet from "discourse/plugins/voice/discourse/lib/voice/url-flag";
+import urlFlagSet from "discourse/plugins/live/discourse/lib/live/url-flag";
-export default class VoiceRoomController extends Controller {
+export default class LiveRoomController extends Controller {
queryParams = ["chat", "join", "widget"];
chat = false;
join = false;
diff --git a/plugins/voice/assets/javascripts/discourse/initializers/voice-about.js b/plugins/live/assets/javascripts/discourse/initializers/live-about.js
similarity index 65%
rename from plugins/voice/assets/javascripts/discourse/initializers/voice-about.js
rename to plugins/live/assets/javascripts/discourse/initializers/live-about.js
index 3f3c9f0dfb6..64d29223672 100644
--- a/plugins/voice/assets/javascripts/discourse/initializers/voice-about.js
+++ b/plugins/live/assets/javascripts/discourse/initializers/live-about.js
@@ -3,13 +3,13 @@ import { number } from "discourse/lib/formatter";
import { i18n } from "discourse-i18n";
export default apiInitializer((api) => {
- api.addAboutPageActivity("voice_users", (periods) => {
+ api.addAboutPageActivity("live_users", (periods) => {
const count = periods["7_days"];
- if (api.container.lookup("service:site-settings").voice_enabled && count) {
+ if (api.container.lookup("service:site-settings").live_enabled && count) {
return {
icon: "microphone",
- class: "voice-users",
- activityText: i18n("voice.about.participants", {
+ class: "live-users",
+ activityText: i18n("live.about.participants", {
count,
formatted_number: number(count),
}),
diff --git a/plugins/voice/assets/javascripts/discourse/initializers/voice-admin-plugin-configuration-nav.js b/plugins/live/assets/javascripts/discourse/initializers/live-admin-plugin-configuration-nav.js
similarity index 54%
rename from plugins/voice/assets/javascripts/discourse/initializers/voice-admin-plugin-configuration-nav.js
rename to plugins/live/assets/javascripts/discourse/initializers/live-admin-plugin-configuration-nav.js
index e59d05b607d..841628a9772 100644
--- a/plugins/voice/assets/javascripts/discourse/initializers/voice-admin-plugin-configuration-nav.js
+++ b/plugins/live/assets/javascripts/discourse/initializers/live-admin-plugin-configuration-nav.js
@@ -1,9 +1,9 @@
import { withPluginApi } from "discourse/lib/plugin-api";
-const PLUGIN_ID = "voice";
+const PLUGIN_ID = "live";
export default {
- name: "voice-admin-plugin-configuration-nav",
+ name: "live-admin-plugin-configuration-nav",
initialize(container) {
const currentUser = container.lookup("service:current-user");
@@ -15,16 +15,16 @@ export default {
api.setAdminPluginIcon(PLUGIN_ID, "microphone-lines");
api.addAdminPluginConfigurationNav(PLUGIN_ID, [
{
- label: "voice.admin.dashboard_title",
- route: "adminPlugins.show.voice-dashboard",
+ label: "live.admin.dashboard_title",
+ route: "adminPlugins.show.live-dashboard",
},
{
- label: "voice.admin.rooms_title",
- route: "adminPlugins.show.voice-rooms",
+ label: "live.admin.rooms_title",
+ route: "adminPlugins.show.live-rooms",
},
{
- label: "voice.admin.recordings_title",
- route: "adminPlugins.show.voice-recordings",
+ label: "live.admin.recordings_title",
+ route: "adminPlugins.show.live-recordings",
},
]);
});
diff --git a/plugins/voice/assets/javascripts/discourse/initializers/voice-call-ring.js b/plugins/live/assets/javascripts/discourse/initializers/live-call-ring.js
similarity index 60%
rename from plugins/voice/assets/javascripts/discourse/initializers/voice-call-ring.js
rename to plugins/live/assets/javascripts/discourse/initializers/live-call-ring.js
index 7e403e9d79a..cfbfa10de94 100644
--- a/plugins/voice/assets/javascripts/discourse/initializers/voice-call-ring.js
+++ b/plugins/live/assets/javascripts/discourse/initializers/live-call-ring.js
@@ -1,9 +1,9 @@
import { apiInitializer } from "discourse/lib/api";
export default apiInitializer((api) => {
- // Rings arrive over MessageBus whether or not any voice UI is on screen,
+ // Rings arrive over MessageBus whether or not any live UI is on screen,
// so the calls service starts listening as soon as the app boots.
if (api.getCurrentUser()) {
- api.container.lookup("service:voice-calls").listen();
+ api.container.lookup("service:live-calls").listen();
}
});
diff --git a/plugins/live/assets/javascripts/discourse/initializers/live-chat-thread-navbar.js b/plugins/live/assets/javascripts/discourse/initializers/live-chat-thread-navbar.js
new file mode 100644
index 00000000000..c1177fa9a38
--- /dev/null
+++ b/plugins/live/assets/javascripts/discourse/initializers/live-chat-thread-navbar.js
@@ -0,0 +1,6 @@
+import { apiInitializer } from "discourse/lib/api";
+import LiveBackToLiveRoomButton from "discourse/plugins/live/discourse/components/live-back-to-live-room-button";
+
+export default apiInitializer((api) => {
+ api.renderInOutlet("chat-thread-navbar-actions", LiveBackToLiveRoomButton);
+});
diff --git a/plugins/voice/assets/javascripts/discourse/initializers/voice-defer-refresh-in-call.js b/plugins/live/assets/javascripts/discourse/initializers/live-defer-refresh-in-call.js
similarity index 84%
rename from plugins/voice/assets/javascripts/discourse/initializers/voice-defer-refresh-in-call.js
rename to plugins/live/assets/javascripts/discourse/initializers/live-defer-refresh-in-call.js
index 21e54e52d91..b4a45c5d6d7 100644
--- a/plugins/voice/assets/javascripts/discourse/initializers/voice-defer-refresh-in-call.js
+++ b/plugins/live/assets/javascripts/discourse/initializers/live-defer-refresh-in-call.js
@@ -2,12 +2,12 @@ import { apiInitializer } from "discourse/lib/api";
export default apiInitializer((api) => {
// When a new client version is deployed, core turns the next navigation
- // into a full page load. That would drop the user from their voice room,
+ // into a full page load. That would drop the user from their live room,
// so hold the refresh until the call is over.
api.registerValueTransformer(
"full-page-refresh-on-navigation",
({ value }) => {
- const webrtc = api.container.lookup("service:voice-webrtc");
+ const webrtc = api.container.lookup("service:live-webrtc");
return webrtc?.hasActiveRoom ? false : value;
}
);
diff --git a/plugins/voice/assets/javascripts/discourse/initializers/voice-hashtag-type.js b/plugins/live/assets/javascripts/discourse/initializers/live-hashtag-type.js
similarity index 91%
rename from plugins/voice/assets/javascripts/discourse/initializers/voice-hashtag-type.js
rename to plugins/live/assets/javascripts/discourse/initializers/live-hashtag-type.js
index b6bf31b0a44..d97f4d9587f 100644
--- a/plugins/voice/assets/javascripts/discourse/initializers/voice-hashtag-type.js
+++ b/plugins/live/assets/javascripts/discourse/initializers/live-hashtag-type.js
@@ -2,7 +2,7 @@ import { withPluginApi } from "discourse/lib/plugin-api";
import RoomHashtagType from "../lib/hashtag-types/room.js";
export default {
- name: "voice-hashtag-type",
+ name: "live-hashtag-type",
before: "hashtag-css-generator",
initialize(owner) {
diff --git a/plugins/voice/assets/javascripts/discourse/initializers/voice-notifications.js b/plugins/live/assets/javascripts/discourse/initializers/live-notifications.js
similarity index 77%
rename from plugins/voice/assets/javascripts/discourse/initializers/voice-notifications.js
rename to plugins/live/assets/javascripts/discourse/initializers/live-notifications.js
index 2d75fe96df0..70b06231308 100644
--- a/plugins/voice/assets/javascripts/discourse/initializers/voice-notifications.js
+++ b/plugins/live/assets/javascripts/discourse/initializers/live-notifications.js
@@ -3,12 +3,12 @@ import { withPluginApi } from "discourse/lib/plugin-api";
import { i18n } from "discourse-i18n";
export default {
- name: "voice-notifications",
+ name: "live-notifications",
initialize() {
withPluginApi((api) => {
api.registerNotificationTypeRenderer(
- "voice_invitation",
+ "live_invitation",
(NotificationTypeBase) => {
return class extends NotificationTypeBase {
// An invitation into an ephemeral room is a call.
@@ -19,8 +19,8 @@ export default {
get linkTitle() {
return i18n(
this.isCall
- ? "notifications.titles.voice_call"
- : "notifications.titles.voice_invitation"
+ ? "notifications.titles.live_call"
+ : "notifications.titles.live_invitation"
);
}
@@ -33,7 +33,7 @@ export default {
// Carries the inviter so joining from the notification credits
// them, the same as a shared invite link.
return getURL(
- `/voice/r/${data.room_slug}/invited-by/${encodeURIComponent(
+ `/live/r/${data.room_slug}/invited-by/${encodeURIComponent(
data.display_username.toLowerCase()
)}`
);
@@ -41,10 +41,10 @@ export default {
get description() {
if (this.isCall) {
- return i18n("notifications.voice_call");
+ return i18n("notifications.live_call");
}
- return i18n("notifications.voice_invitation", {
+ return i18n("notifications.live_invitation", {
room_name: this.notification.data.room_name,
});
}
diff --git a/plugins/voice/assets/javascripts/discourse/initializers/voice-sidebar.js b/plugins/live/assets/javascripts/discourse/initializers/live-sidebar.js
similarity index 78%
rename from plugins/voice/assets/javascripts/discourse/initializers/voice-sidebar.js
rename to plugins/live/assets/javascripts/discourse/initializers/live-sidebar.js
index 81939ce35d3..fa0407a843e 100644
--- a/plugins/voice/assets/javascripts/discourse/initializers/voice-sidebar.js
+++ b/plugins/live/assets/javascripts/discourse/initializers/live-sidebar.js
@@ -6,38 +6,38 @@ import { withPluginApi } from "discourse/lib/plugin-api";
import { prioritizeNameInUx } from "discourse/lib/settings";
import virtualElementFromPoint from "discourse/lib/virtual-element-from-point";
import { i18n } from "discourse-i18n";
-import VoiceCreateRoomModal from "discourse/plugins/voice/discourse/components/modal/voice-create-room";
-import VoiceParticipantSidebarContextMenu from "discourse/plugins/voice/discourse/components/voice-participant-sidebar-context-menu";
-import VoiceParticipantSidebarSuffix from "discourse/plugins/voice/discourse/components/voice-participant-sidebar-suffix";
-import VoiceRoomSidebarContextMenu from "discourse/plugins/voice/discourse/components/voice-room-sidebar-context-menu";
-import buildAnonRoomsSection from "../lib/voice/anon-rooms-section.js";
-import { humanKeyName } from "../lib/voice/ptt-utils.js";
-import roomIcon, { roomBadge } from "../lib/voice/room-icon.js";
-
-const LINK_NAME_PREFIX = "voice-room-";
+import LiveParticipantSidebarContextMenu from "discourse/plugins/live/discourse/components/live-participant-sidebar-context-menu";
+import LiveParticipantSidebarSuffix from "discourse/plugins/live/discourse/components/live-participant-sidebar-suffix";
+import LiveRoomSidebarContextMenu from "discourse/plugins/live/discourse/components/live-room-sidebar-context-menu";
+import LiveCreateRoomModal from "discourse/plugins/live/discourse/components/modal/live-create-room";
+import buildAnonRoomsSection from "../lib/live/anon-rooms-section.js";
+import { humanKeyName } from "../lib/live/ptt-utils.js";
+import roomIcon, { roomBadge } from "../lib/live/room-icon.js";
+
+const LINK_NAME_PREFIX = "live-room-";
const CHAT_PANEL = "chat";
let sidebarClickHandler;
let sidebarContextMenuHandler;
export default {
- name: "voice-sidebar",
+ name: "live-sidebar",
initialize(owner) {
withPluginApi((api) => {
const currentUser = api.getCurrentUser();
const siteSettings = owner.lookup("service:site-settings");
const site = owner.lookup("service:site");
- if (!siteSettings.voice_enabled) {
+ if (!siteSettings.live_enabled) {
return;
}
- // Anonymous visitors only see the sidebar when Voice is open to
+ // Anonymous visitors only see the sidebar when Live is open to
// everyone. They can browse public rooms but are sent to log in on click.
- if (!currentUser && !site.voice_public_access) {
+ if (!currentUser && !site.live_public_access) {
return;
}
- const roomsService = owner.lookup("service:voice-rooms");
+ const roomsService = owner.lookup("service:live-rooms");
if (!currentUser) {
// API sections render after Discourse's normal navigation sections,
@@ -56,11 +56,11 @@ export default {
(node) =>
node instanceof HTMLElement &&
node.matches?.(
- ".sidebar-section-link[data-link-name^='voice-']"
+ ".sidebar-section-link[data-link-name^='live-']"
)
) ||
event.target?.closest?.(
- ".sidebar-section-link[data-link-name^='voice-']"
+ ".sidebar-section-link[data-link-name^='live-']"
);
if (!anchor) {
@@ -76,7 +76,7 @@ export default {
return;
}
- const voiceWebrtc = owner.lookup("service:voice-webrtc");
+ const liveWebrtc = owner.lookup("service:live-webrtc");
const routerService = owner.lookup("service:router");
const menuService = owner.lookup("service:menu");
const modalService = owner.lookup("service:modal");
@@ -90,7 +90,7 @@ export default {
constructor({ room, webrtcService, user, menu }) {
super(...arguments);
this.room = room;
- this.voiceWebrtc = webrtcService;
+ this.liveWebrtc = webrtcService;
this.currentUser = user;
this.menuService = menu;
}
@@ -107,7 +107,7 @@ export default {
}
get hoverTitle() {
- return i18n("voice.room.menu_title");
+ return i18n("live.room.menu_title");
}
get hoverAction() {
@@ -123,8 +123,8 @@ export default {
event.target.closest(".sidebar-section-link") || event.target;
this.menuService.show(anchor, {
- identifier: "voice-room-menu",
- component: VoiceRoomSidebarContextMenu,
+ identifier: "live-room-menu",
+ component: LiveRoomSidebarContextMenu,
placement: "right",
data: { room: this.room },
onClose: onMenuClose,
@@ -133,17 +133,17 @@ export default {
}
get name() {
- return `voice-room-${this.room.id}`;
+ return `live-room-${this.room.id}`;
}
get classNames() {
- const classes = ["voice-sidebar-link"];
- const state = this.voiceWebrtc.connectionStateFor(this.room.id);
+ const classes = ["live-sidebar-link"];
+ const state = this.liveWebrtc.connectionStateFor(this.room.id);
if (state === "connected") {
classes.push("sidebar-section-link--active");
} else if (state === "connecting") {
- classes.push("voice-sidebar-link--connecting");
+ classes.push("live-sidebar-link--connecting");
}
return classes.join(" ");
@@ -154,20 +154,20 @@ export default {
}
get title() {
- const state = this.voiceWebrtc.connectionStateFor(this.room.id);
+ const state = this.liveWebrtc.connectionStateFor(this.room.id);
if (state === "connecting") {
- return i18n("voice.room.connecting");
+ return i18n("live.room.connecting");
}
if (state === "connected") {
- return i18n("voice.room.open_page");
+ return i18n("live.room.open_page");
}
return (
this.room.description_excerpt ||
this.room.name ||
- i18n("voice.room.join")
+ i18n("live.room.join")
);
}
@@ -196,7 +196,7 @@ export default {
get suffixType() {
if (
- this.voiceWebrtc.connectionStateFor(this.room.id) ===
+ this.liveWebrtc.connectionStateFor(this.room.id) ===
"connecting" ||
this.#hasActiveVideo
) {
@@ -207,7 +207,7 @@ export default {
get suffixValue() {
if (
- this.voiceWebrtc.connectionStateFor(this.room.id) ===
+ this.liveWebrtc.connectionStateFor(this.room.id) ===
"connecting"
) {
return "spinner";
@@ -226,8 +226,7 @@ export default {
}
if (
- this.voiceWebrtc.connectionStateFor(this.room.id) !==
- "connected"
+ this.liveWebrtc.connectionStateFor(this.room.id) !== "connected"
) {
return participants;
}
@@ -266,7 +265,7 @@ export default {
super(...arguments);
this.room = room;
this.participant = participant;
- this.voiceWebrtc = webrtcService;
+ this.liveWebrtc = webrtcService;
this.currentUser = user;
this.menuService = menu;
this.canManageRoom = canManageRoom;
@@ -282,8 +281,7 @@ export default {
return (
!capabilities.isIpadOS &&
!!this.currentUser &&
- this.voiceWebrtc.connectionStateFor(this.room.id) ===
- "connected"
+ this.liveWebrtc.connectionStateFor(this.room.id) === "connected"
);
}
@@ -314,7 +312,7 @@ export default {
}
get hoverTitle() {
- return i18n("voice.participant.menu_title");
+ return i18n("live.participant.menu_title");
}
get hoverAction() {
@@ -330,8 +328,8 @@ export default {
event.target.closest(".sidebar-section-link") || event.target;
this.menuService.show(anchor, {
- identifier: "voice-participant-menu",
- component: VoiceParticipantSidebarContextMenu,
+ identifier: "live-participant-menu",
+ component: LiveParticipantSidebarContextMenu,
placement: "right",
data: {
room: this.room,
@@ -345,40 +343,40 @@ export default {
}
get name() {
- return `voice-participant-${this.room.id}-${this.participant.id}`;
+ return `live-participant-${this.room.id}-${this.participant.id}`;
}
get classNames() {
- const classes = ["voice-sidebar-participant"];
+ const classes = ["live-sidebar-participant"];
if (this.isStageListener) {
- classes.push("voice-sidebar-participant--listener");
+ classes.push("live-sidebar-participant--listener");
}
if (this.isFirstListener) {
- classes.push("voice-sidebar-participant--listeners-start");
+ classes.push("live-sidebar-participant--listeners-start");
}
if (this.#isAudiblySpeaking) {
- classes.push("voice-sidebar-participant--speaking");
+ classes.push("live-sidebar-participant--speaking");
}
if (this.participant.is_muted) {
- classes.push("voice-sidebar-participant--muted");
+ classes.push("live-sidebar-participant--muted");
}
if (this.participant.is_deafened) {
- classes.push("voice-sidebar-participant--deafened");
+ classes.push("live-sidebar-participant--deafened");
}
if (this.#isHandRaised) {
- classes.push("voice-sidebar-participant--hand-raised");
+ classes.push("live-sidebar-participant--hand-raised");
}
if (this.participant.idle_state === "idle") {
- classes.push("voice-sidebar-participant--idle");
+ classes.push("live-sidebar-participant--idle");
} else if (this.participant.idle_state === "afk") {
- classes.push("voice-sidebar-participant--afk");
+ classes.push("live-sidebar-participant--afk");
}
return classes.join(" ");
@@ -396,13 +394,13 @@ export default {
get title() {
let title = this.#displayName;
- if (this.#isCurrentUser && this.voiceWebrtc.pttEnabled) {
- title = `${title} — ${i18n("voice.ptt.badge", { key: humanKeyName(this.voiceWebrtc.pttKey) })}`;
+ if (this.#isCurrentUser && this.liveWebrtc.pttEnabled) {
+ title = `${title} — ${i18n("live.ptt.badge", { key: humanKeyName(this.liveWebrtc.pttKey) })}`;
}
// The speaking wave is a CSS pseudo-element and can't carry
// its own accessible label, so surface the state here instead.
if (this.#isAudiblySpeaking) {
- title = `${title} — ${i18n("voice.participant.status_speaking")}`;
+ title = `${title} — ${i18n("live.participant.status_speaking")}`;
}
return title;
}
@@ -416,7 +414,7 @@ export default {
// edge. The speaking wave renders over the avatar via the
// `--speaking` class.
get suffixComponent() {
- return VoiceParticipantSidebarSuffix;
+ return LiveParticipantSidebarSuffix;
}
get suffixArgs() {
@@ -424,7 +422,7 @@ export default {
isHandRaised: this.#isHandRaised,
isScreenSharing: this.participant.is_screen_sharing,
isVideoOn: this.participant.is_video_on,
- isPtt: this.#isCurrentUser && this.voiceWebrtc.pttEnabled,
+ isPtt: this.#isCurrentUser && this.liveWebrtc.pttEnabled,
isMuted: this.participant.is_muted,
isDeafened: this.participant.is_deafened,
};
@@ -447,11 +445,11 @@ export default {
}
get name() {
- return `voice-listener-count-${this.room.id}`;
+ return `live-listener-count-${this.room.id}`;
}
get classNames() {
- return "voice-sidebar-participant voice-sidebar-participant--listener-count";
+ return "live-sidebar-participant live-sidebar-participant--listener-count";
}
get href() {
@@ -459,7 +457,7 @@ export default {
}
get text() {
- return i18n("voice.stage.more_listeners", {
+ return i18n("live.stage.more_listeners", {
count: this.count,
});
}
@@ -475,21 +473,21 @@ export default {
const RoomsSection = class extends BaseSection {
name = sectionName;
- text = i18n("voice.sidebar.title");
- title = i18n("voice.sidebar.title");
+ text = i18n("live.sidebar.title");
+ title = i18n("live.sidebar.title");
constructor() {
super(...arguments);
- this.voiceRooms = roomsService;
+ this.liveRooms = roomsService;
}
get actions() {
- if (this.voiceRooms?.canCreateRoom) {
+ if (this.liveRooms?.canCreateRoom) {
return [
{
- id: "createVoiceRoom",
- title: i18n("voice.sidebar.create"),
- action: () => modalService.show(VoiceCreateRoomModal),
+ id: "createLiveRoom",
+ title: i18n("live.sidebar.create"),
+ action: () => modalService.show(LiveCreateRoomModal),
},
];
}
@@ -507,18 +505,18 @@ export default {
}
return (
- (this.voiceRooms?.rooms?.length || 0) > 0 ||
- this.voiceRooms?.canCreateRoom
+ (this.liveRooms?.rooms?.length || 0) > 0 ||
+ this.liveRooms?.canCreateRoom
);
}
get links() {
const result = [];
- for (const room of this.voiceRooms?.rooms || []) {
+ for (const room of this.liveRooms?.rooms || []) {
const roomLink = new RoomsLink({
room,
- webrtcService: voiceWebrtc,
+ webrtcService: liveWebrtc,
user: currentUser,
menu: menuService,
});
@@ -542,7 +540,7 @@ export default {
new ParticipantLink({
room,
participant,
- webrtcService: voiceWebrtc,
+ webrtcService: liveWebrtc,
user: currentUser,
menu: menuService,
canManageRoom,
@@ -561,7 +559,7 @@ export default {
new ParticipantLink({
room,
participant,
- webrtcService: voiceWebrtc,
+ webrtcService: liveWebrtc,
user: currentUser,
menu: menuService,
canManageRoom,
@@ -585,7 +583,7 @@ export default {
new ParticipantLink({
room,
participant,
- webrtcService: voiceWebrtc,
+ webrtcService: liveWebrtc,
user: currentUser,
menu: menuService,
canManageRoom,
@@ -602,7 +600,7 @@ export default {
return RoomsSection;
};
- api.addSidebarSection(buildRoomsSection({ sectionName: "voice-rooms" }));
+ api.addSidebarSection(buildRoomsSection({ sectionName: "live-rooms" }));
// Mirror the section into the chat panel so rooms stay visible in the
// full-screen chat separate sidebar. The chat panel is registered by the
@@ -621,7 +619,7 @@ export default {
api.addSidebarSection(
buildRoomsSection({
- sectionName: "voice-rooms-chat",
+ sectionName: "live-rooms-chat",
chatPanel: true,
}),
CHAT_PANEL
@@ -656,11 +654,11 @@ export default {
) || event.target?.closest?.(selector);
const participantAnchor = findAnchor(
- ".sidebar-section-link[data-link-name^='voice-participant-']"
+ ".sidebar-section-link[data-link-name^='live-participant-']"
);
const roomAnchor = findAnchor(
- ".sidebar-section-link[data-link-name^='voice-room-']"
+ ".sidebar-section-link[data-link-name^='live-room-']"
);
if (participantAnchor) {
@@ -693,16 +691,16 @@ export default {
return;
}
- const connectionState = voiceWebrtc.connectionStateFor(room.id);
+ const connectionState = liveWebrtc.connectionStateFor(room.id);
if (event.shiftKey) {
// Hand the call over cleanly: two windows joined as the same user
// would fight over presence.
if (connectionState === "connected") {
- voiceWebrtc.leave(room);
+ liveWebrtc.leave(room);
}
- window.open(getURL(`/voice/r/${room.slug}?join`));
+ window.open(getURL(`/live/r/${room.slug}?join`));
return;
}
@@ -713,14 +711,14 @@ export default {
if (connectionState === "connected") {
const currentRoute = routerService.currentRoute;
const onRoomPage =
- currentRoute?.name === "voice-room" &&
+ currentRoute?.name === "live-room" &&
currentRoute?.params?.slug === room.slug;
if (!onRoomPage) {
- routerService.transitionTo("voice-room", room.slug);
+ routerService.transitionTo("live-room", room.slug);
}
} else {
- await voiceWebrtc.join(room);
+ await liveWebrtc.join(room);
}
};
@@ -739,7 +737,7 @@ export default {
) || event.target?.closest?.(selector);
const participantAnchor = findAnchor(
- ".sidebar-section-link[data-link-name^='voice-participant-']"
+ ".sidebar-section-link[data-link-name^='live-participant-']"
);
if (participantAnchor) {
@@ -747,7 +745,7 @@ export default {
event.stopPropagation();
const linkName = participantAnchor.dataset?.linkName;
- const suffix = linkName?.replace("voice-participant-", "");
+ const suffix = linkName?.replace("live-participant-", "");
const dashIdx = suffix?.indexOf("-");
if (!suffix || dashIdx < 1) {
return;
@@ -768,15 +766,15 @@ export default {
}
// The menu only offers audio controls for a call the user is in.
- if (voiceWebrtc.connectionStateFor(room.id) !== "connected") {
+ if (liveWebrtc.connectionStateFor(room.id) !== "connected") {
return;
}
menuService.show(
virtualElementFromPoint(event.clientX, event.clientY),
{
- identifier: "voice-participant-menu",
- component: VoiceParticipantSidebarContextMenu,
+ identifier: "live-participant-menu",
+ component: LiveParticipantSidebarContextMenu,
placement: "bottom-start",
data: {
room,
@@ -790,7 +788,7 @@ export default {
}
const roomAnchor = findAnchor(
- ".sidebar-section-link[data-link-name^='voice-room-']"
+ ".sidebar-section-link[data-link-name^='live-room-']"
);
if (!roomAnchor) {
@@ -820,8 +818,8 @@ export default {
menuService.show(
virtualElementFromPoint(event.clientX, event.clientY),
{
- identifier: "voice-room-menu",
- component: VoiceRoomSidebarContextMenu,
+ identifier: "live-room-menu",
+ component: LiveRoomSidebarContextMenu,
placement: "bottom-start",
data: { room },
}
diff --git a/plugins/voice/assets/javascripts/discourse/initializers/voice-transcript-draft-icon.js b/plugins/live/assets/javascripts/discourse/initializers/live-transcript-draft-icon.js
similarity index 74%
rename from plugins/voice/assets/javascripts/discourse/initializers/voice-transcript-draft-icon.js
rename to plugins/live/assets/javascripts/discourse/initializers/live-transcript-draft-icon.js
index 3cf5af94a75..eb10697b659 100644
--- a/plugins/voice/assets/javascripts/discourse/initializers/voice-transcript-draft-icon.js
+++ b/plugins/live/assets/javascripts/discourse/initializers/live-transcript-draft-icon.js
@@ -1,8 +1,8 @@
import { withPluginApi } from "discourse/lib/plugin-api";
-import { TRANSCRIPT_DRAFT_KEY_PREFIX } from "../lib/voice/transcript-draft-sync.js";
+import { TRANSCRIPT_DRAFT_KEY_PREFIX } from "../lib/live/transcript-draft-sync.js";
export default {
- name: "voice-transcript-draft-icon",
+ name: "live-transcript-draft-icon",
initialize() {
withPluginApi((api) => {
diff --git a/plugins/voice/assets/javascripts/discourse/initializers/voice-transcript-source.js b/plugins/live/assets/javascripts/discourse/initializers/live-transcript-source.js
similarity index 65%
rename from plugins/voice/assets/javascripts/discourse/initializers/voice-transcript-source.js
rename to plugins/live/assets/javascripts/discourse/initializers/live-transcript-source.js
index 5802c26a710..b33a7048cdb 100644
--- a/plugins/voice/assets/javascripts/discourse/initializers/voice-transcript-source.js
+++ b/plugins/live/assets/javascripts/discourse/initializers/live-transcript-source.js
@@ -1,15 +1,15 @@
import { withPluginApi } from "discourse/lib/plugin-api";
-import { TRANSCRIPT_SOURCE_TYPE } from "../lib/voice/transcript-markdown.js";
+import { TRANSCRIPT_SOURCE_TYPE } from "../lib/live/transcript-markdown.js";
export default {
- name: "voice-transcript-source",
+ name: "live-transcript-source",
initialize() {
withPluginApi((api) => {
// absent when the chat plugin isn't installed
api.registerChatTranscriptSourceType?.(TRANSCRIPT_SOURCE_TYPE, {
icon: "microphone-lines",
- label: "voice.transcript.source_label",
+ label: "live.transcript.source_label",
});
});
},
diff --git a/plugins/voice/assets/javascripts/discourse/initializers/voice-voice-canvas.js b/plugins/live/assets/javascripts/discourse/initializers/live-voice-canvas.js
similarity index 52%
rename from plugins/voice/assets/javascripts/discourse/initializers/voice-voice-canvas.js
rename to plugins/live/assets/javascripts/discourse/initializers/live-voice-canvas.js
index c89fd33495c..46604ced811 100644
--- a/plugins/voice/assets/javascripts/discourse/initializers/voice-voice-canvas.js
+++ b/plugins/live/assets/javascripts/discourse/initializers/live-voice-canvas.js
@@ -1,19 +1,19 @@
import { withPluginApi } from "discourse/lib/plugin-api";
-import VoiceGlobalCallLayer from "discourse/plugins/voice/discourse/components/voice/global-call-layer";
+import LiveGlobalCallLayer from "discourse/plugins/live/discourse/components/live/global-call-layer";
export default {
- name: "voice-voice-canvas",
+ name: "live-voice-canvas",
initialize(owner) {
withPluginApi((api) => {
const currentUser = api.getCurrentUser();
const siteSettings = owner.lookup("service:site-settings");
- if (!currentUser || !siteSettings.voice_enabled) {
+ if (!currentUser || !siteSettings.live_enabled) {
return;
}
- api.renderInOutlet("below-site-header", VoiceGlobalCallLayer);
+ api.renderInOutlet("below-site-header", LiveGlobalCallLayer);
});
},
};
diff --git a/plugins/voice/assets/javascripts/discourse/lib/hashtag-types/room.js b/plugins/live/assets/javascripts/discourse/lib/hashtag-types/room.js
similarity index 100%
rename from plugins/voice/assets/javascripts/discourse/lib/hashtag-types/room.js
rename to plugins/live/assets/javascripts/discourse/lib/hashtag-types/room.js
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice-flag.js b/plugins/live/assets/javascripts/discourse/lib/live-flag.js
similarity index 89%
rename from plugins/voice/assets/javascripts/discourse/lib/voice-flag.js
rename to plugins/live/assets/javascripts/discourse/lib/live-flag.js
index 836f0ccf65c..54312f112da 100644
--- a/plugins/voice/assets/javascripts/discourse/lib/voice-flag.js
+++ b/plugins/live/assets/javascripts/discourse/lib/live-flag.js
@@ -2,7 +2,7 @@ import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
import { i18n } from "discourse-i18n";
-export default class VoiceFlag {
+export default class LiveFlag {
constructor(room) {
this.room = room;
}
@@ -36,7 +36,7 @@ export default class VoiceFlag {
.map((flagType) => {
flagType.set(
"description",
- i18n("voice.flagging.notify_moderators_description", {
+ i18n("live.flagging.notify_moderators_description", {
defaultValue: flagType.description,
})
);
@@ -48,7 +48,7 @@ export default class VoiceFlag {
flagModal.args.closeModal();
try {
- await ajax(`/voice/rooms/${this.room.id}/flag`, {
+ await ajax(`/live/rooms/${this.room.id}/flag`, {
type: "POST",
data: {
user_id: flagModal.args.model.flagModel.user_id,
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/anon-rooms-section.js b/plugins/live/assets/javascripts/discourse/lib/live/anon-rooms-section.js
similarity index 82%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/anon-rooms-section.js
rename to plugins/live/assets/javascripts/discourse/lib/live/anon-rooms-section.js
index 0160a46943b..0ca3b20f3be 100644
--- a/plugins/voice/assets/javascripts/discourse/lib/voice/anon-rooms-section.js
+++ b/plugins/live/assets/javascripts/discourse/lib/live/anon-rooms-section.js
@@ -12,11 +12,11 @@ export default function buildAnonRoomsSection(roomsService) {
}
get name() {
- return `voice-room-${this.room.id}`;
+ return `live-room-${this.room.id}`;
}
get classNames() {
- return "voice-sidebar-link";
+ return "live-sidebar-link";
}
get href() {
@@ -27,7 +27,7 @@ export default function buildAnonRoomsSection(roomsService) {
return (
this.room.description_excerpt ||
this.room.name ||
- i18n("voice.room.join")
+ i18n("live.room.join")
);
}
@@ -58,34 +58,34 @@ export default function buildAnonRoomsSection(roomsService) {
}
get name() {
- return `voice-participant-${this.room.id}-${this.participant.id}`;
+ return `live-participant-${this.room.id}-${this.participant.id}`;
}
get classNames() {
- const classes = ["voice-sidebar-participant"];
+ const classes = ["live-sidebar-participant"];
if (this.isStageListener) {
- classes.push("voice-sidebar-participant--listener");
+ classes.push("live-sidebar-participant--listener");
}
if (this.isFirstListener) {
- classes.push("voice-sidebar-participant--listeners-start");
+ classes.push("live-sidebar-participant--listeners-start");
}
// Speaking is detected client-side from live media streams, which
// anonymous visitors never hold.
if (this.participant.is_muted) {
- classes.push("voice-sidebar-participant--muted");
+ classes.push("live-sidebar-participant--muted");
}
if (this.participant.is_deafened) {
- classes.push("voice-sidebar-participant--deafened");
+ classes.push("live-sidebar-participant--deafened");
}
if (this.participant.idle_state === "idle") {
- classes.push("voice-sidebar-participant--idle");
+ classes.push("live-sidebar-participant--idle");
} else if (this.participant.idle_state === "afk") {
- classes.push("voice-sidebar-participant--afk");
+ classes.push("live-sidebar-participant--afk");
}
return classes.join(" ");
@@ -126,11 +126,11 @@ export default function buildAnonRoomsSection(roomsService) {
}
get name() {
- return `voice-listener-count-${this.room.id}`;
+ return `live-listener-count-${this.room.id}`;
}
get classNames() {
- return "voice-sidebar-participant voice-sidebar-participant--listener-count";
+ return "live-sidebar-participant live-sidebar-participant--listener-count";
}
get href() {
@@ -142,7 +142,7 @@ export default function buildAnonRoomsSection(roomsService) {
}
get text() {
- return i18n("voice.stage.more_listeners", { count: this.count });
+ return i18n("live.stage.more_listeners", { count: this.count });
}
get prefixType() {
@@ -155,9 +155,9 @@ export default function buildAnonRoomsSection(roomsService) {
}
return class AnonRoomsSection extends BaseSection {
- name = "voice-rooms";
- text = i18n("voice.sidebar.title");
- title = i18n("voice.sidebar.title");
+ name = "live-rooms";
+ text = i18n("live.sidebar.title");
+ title = i18n("live.sidebar.title");
get displaySection() {
return (roomsService.rooms?.length || 0) > 0;
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/audio-monitor.js b/plugins/live/assets/javascripts/discourse/lib/live/audio-monitor.js
similarity index 97%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/audio-monitor.js
rename to plugins/live/assets/javascripts/discourse/lib/live/audio-monitor.js
index 3473d84d8b3..749c4c716e7 100644
--- a/plugins/voice/assets/javascripts/discourse/lib/voice/audio-monitor.js
+++ b/plugins/live/assets/javascripts/discourse/lib/live/audio-monitor.js
@@ -1,4 +1,4 @@
-import voiceLog from "discourse/plugins/voice/discourse/lib/voice/logger";
+import liveLog from "discourse/plugins/live/discourse/lib/live/logger";
const SAMPLE_INTERVAL_MS = 100;
const FFT_SIZE = 2048;
@@ -86,7 +86,7 @@ export default class AudioMonitor {
this.#startSampling();
} catch {
- voiceLog.warn("[voice] failed to initialize audio monitor");
+ liveLog.warn("[live] failed to initialize audio monitor");
}
}
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/audio-processing.js b/plugins/live/assets/javascripts/discourse/lib/live/audio-processing.js
similarity index 98%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/audio-processing.js
rename to plugins/live/assets/javascripts/discourse/lib/live/audio-processing.js
index cd669c53cfb..3134080319f 100644
--- a/plugins/voice/assets/javascripts/discourse/lib/voice/audio-processing.js
+++ b/plugins/live/assets/javascripts/discourse/lib/live/audio-processing.js
@@ -13,6 +13,7 @@ import { NS_ENGINES } from "./ns-engines.js";
// stack (stacked suppressors produce the classic
// underwater/musical artifacts)
+// Pre-rename key, kept so saved preferences survive.
const EC_STORAGE_KEY = "voice:echo-cancellation";
const AGC_STORAGE_KEY = "voice:auto-gain-control";
const NS_MODE_STORAGE_KEY = "voice:noise-suppression-mode";
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/background-blur.js b/plugins/live/assets/javascripts/discourse/lib/live/background-blur.js
similarity index 97%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/background-blur.js
rename to plugins/live/assets/javascripts/discourse/lib/live/background-blur.js
index 71bc7bcd2fe..753a7b91f37 100644
--- a/plugins/voice/assets/javascripts/discourse/lib/voice/background-blur.js
+++ b/plugins/live/assets/javascripts/discourse/lib/live/background-blur.js
@@ -1,4 +1,4 @@
-import voiceLog from "discourse/plugins/voice/discourse/lib/voice/logger";
+import liveLog from "discourse/plugins/live/discourse/lib/live/logger";
// Camera background blur.
//
// Runs the raw camera stream through MediaPipe selfie segmentation and
@@ -6,8 +6,9 @@ import voiceLog from "discourse/plugins/voice/discourse/lib/voice/logger";
// cutout in front — then captures the canvas as the outgoing stream.
// Mirrors the NoiseSuppressionManager contract: setup(raw stream) returns
// the processed stream; the caller keeps ownership of the raw stream.
-import { voiceAssetUrl } from "./voice-assets.js";
+import { liveAssetUrl } from "./live-assets.js";
+// Pre-rename key, kept so saved preferences survive.
const ENABLED_KEY = "voice_video_blur_enabled";
const AMOUNT_KEY = "voice_video_blur_amount";
@@ -33,7 +34,7 @@ let segmenterPromise = null;
let lastTimestamp = 0;
function mediapipeBase() {
- return voiceAssetUrl("mediapipe");
+ return liveAssetUrl("mediapipe");
}
async function loadSegmenter() {
@@ -257,7 +258,7 @@ export default class BackgroundBlurManager {
try {
this.#renderFrame();
} catch {
- voiceLog.warn("[voice] background blur frame failed");
+ liveLog.warn("[live] background blur frame failed");
}
this.#scheduleRender();
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/call-alert-dedup.js b/plugins/live/assets/javascripts/discourse/lib/live/call-alert-dedup.js
similarity index 95%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/call-alert-dedup.js
rename to plugins/live/assets/javascripts/discourse/lib/live/call-alert-dedup.js
index a511a1b16fa..ffd46f15ce8 100644
--- a/plugins/voice/assets/javascripts/discourse/lib/voice/call-alert-dedup.js
+++ b/plugins/live/assets/javascripts/discourse/lib/live/call-alert-dedup.js
@@ -1,6 +1,6 @@
import KeyValueStore from "discourse/lib/key-value-store";
-const STORE_CONTEXT = "discourse_voice_call_alerts_";
+const STORE_CONTEXT = "discourse_live_call_alerts_";
const STORE_KEY = "handled";
const EXPIRY_MS = 5 * 60 * 1000;
const MAX_ENTRIES = 50;
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/call-constants.js b/plugins/live/assets/javascripts/discourse/lib/live/call-constants.js
similarity index 68%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/call-constants.js
rename to plugins/live/assets/javascripts/discourse/lib/live/call-constants.js
index fbc3e47cc2c..3c25d73058e 100644
--- a/plugins/voice/assets/javascripts/discourse/lib/voice/call-constants.js
+++ b/plugins/live/assets/javascripts/discourse/lib/live/call-constants.js
@@ -1,4 +1,4 @@
// How long a call rings before giving up, mirrored server-side by
-// Voice::RoomInviter::RING_SECONDS. Payloads carry their own ring_seconds;
+// Live::RoomInviter::RING_SECONDS. Payloads carry their own ring_seconds;
// this is the fallback and the cap for locally started loops.
export const RING_SECONDS = 60;
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/fullscreen.js b/plugins/live/assets/javascripts/discourse/lib/live/fullscreen.js
similarity index 100%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/fullscreen.js
rename to plugins/live/assets/javascripts/discourse/lib/live/fullscreen.js
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/heartbeat-manager.js b/plugins/live/assets/javascripts/discourse/lib/live/heartbeat-manager.js
similarity index 83%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/heartbeat-manager.js
rename to plugins/live/assets/javascripts/discourse/lib/live/heartbeat-manager.js
index 026781ada2e..ea0bde9fced 100644
--- a/plugins/voice/assets/javascripts/discourse/lib/voice/heartbeat-manager.js
+++ b/plugins/live/assets/javascripts/discourse/lib/live/heartbeat-manager.js
@@ -1,5 +1,5 @@
import { ajax } from "discourse/lib/ajax";
-import voiceLog from "discourse/plugins/voice/discourse/lib/voice/logger";
+import liveLog from "discourse/plugins/live/discourse/lib/live/logger";
const HEARTBEAT_INTERVAL_MS = 10000;
@@ -36,7 +36,7 @@ export default class HeartbeatManager {
this.#timers.delete(roomId);
this.#inFlight.delete(roomId);
- voiceLog.info(`[voice] heartbeat stopped for room ${roomId}`);
+ liveLog.info(`[live] heartbeat stopped for room ${roomId}`);
}
}
@@ -59,16 +59,16 @@ export default class HeartbeatManager {
this.#inFlight.add(roomId);
try {
- await ajax(`/voice/rooms/${roomId}/heartbeat`, {
+ await ajax(`/live/rooms/${roomId}/heartbeat`, {
type: "POST",
data: this.#buildPayload(roomId),
});
- voiceLog.info(`[voice] heartbeat sent for room ${roomId}`);
+ liveLog.info(`[live] heartbeat sent for room ${roomId}`);
} catch (error) {
const status = error?.jqXHR?.status || error?.status;
- voiceLog.warn(`[voice] heartbeat failed for room ${roomId}`);
+ liveLog.warn(`[live] heartbeat failed for room ${roomId}`);
if (status === 403 || status === 404 || status === 410) {
this.#onExpelled(roomId);
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/idle-tracker.js b/plugins/live/assets/javascripts/discourse/lib/live/idle-tracker.js
similarity index 94%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/idle-tracker.js
rename to plugins/live/assets/javascripts/discourse/lib/live/idle-tracker.js
index d717d889c89..ac06674a23a 100644
--- a/plugins/voice/assets/javascripts/discourse/lib/voice/idle-tracker.js
+++ b/plugins/live/assets/javascripts/discourse/lib/live/idle-tracker.js
@@ -2,10 +2,10 @@
// below an earlier one disables the earlier stage rather than firing out of
// order.
export function idleThresholds(siteSettings) {
- let idleMs = siteSettings.voice_idle_threshold_minutes * 60 * 1000;
- let afkMs = siteSettings.voice_afk_auto_mute_threshold_minutes * 60 * 1000;
+ let idleMs = siteSettings.live_idle_threshold_minutes * 60 * 1000;
+ let afkMs = siteSettings.live_afk_auto_mute_threshold_minutes * 60 * 1000;
let disconnectMs =
- siteSettings.voice_afk_disconnect_threshold_minutes * 60 * 1000;
+ siteSettings.live_afk_disconnect_threshold_minutes * 60 * 1000;
if (afkMs > 0 && idleMs > 0 && idleMs >= afkMs) {
idleMs = 0;
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/input-gate.js b/plugins/live/assets/javascripts/discourse/lib/live/input-gate.js
similarity index 98%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/input-gate.js
rename to plugins/live/assets/javascripts/discourse/lib/live/input-gate.js
index 1065db3afad..10ebfa6ae65 100644
--- a/plugins/voice/assets/javascripts/discourse/lib/voice/input-gate.js
+++ b/plugins/live/assets/javascripts/discourse/lib/live/input-gate.js
@@ -1,5 +1,6 @@
const SAMPLE_INTERVAL_MS = 50;
const RELEASE_HOLD_MS = 400;
+// Pre-rename key, kept so saved preferences survive.
const THRESHOLD_STORAGE_KEY = "voice_gate_threshold";
// Full scale for the sensitivity slider and the settings meter, in byte
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/invite-ref.js b/plugins/live/assets/javascripts/discourse/lib/live/invite-ref.js
similarity index 89%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/invite-ref.js
rename to plugins/live/assets/javascripts/discourse/lib/live/invite-ref.js
index e0a65d92d9b..29fd9ec665c 100644
--- a/plugins/voice/assets/javascripts/discourse/lib/voice/invite-ref.js
+++ b/plugins/live/assets/javascripts/discourse/lib/live/invite-ref.js
@@ -1,5 +1,5 @@
// The inviter username carried by an invite URL the user arrived through
-// (/voice/r/:slug/invited-by/:username), held until they actually join that
+// (/live/r/:slug/invited-by/:username), held until they actually join that
// room so the server credits the inviter on a real join, not a page view.
let pendingInviteRef = null;
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/voice-assets.js b/plugins/live/assets/javascripts/discourse/lib/live/live-assets.js
similarity index 85%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/voice-assets.js
rename to plugins/live/assets/javascripts/discourse/lib/live/live-assets.js
index 6a1ddf6f950..dd6dec25437 100644
--- a/plugins/voice/assets/javascripts/discourse/lib/voice/voice-assets.js
+++ b/plugins/live/assets/javascripts/discourse/lib/live/live-assets.js
@@ -7,7 +7,7 @@ import Site from "discourse/models/site";
// (versioned URLs bust the immutable /plugins/ caches on a gem bump, so
// nothing client-side changes when the gem does).
function basePath() {
- return Site.current().voice_assets_path;
+ return Site.current().live_assets_path;
}
// Assets ride the app-proxying CDN (getURLWithCDN's cdn), which serves the
@@ -15,12 +15,12 @@ function basePath() {
// chunk calling this may itself be served from a CDN origin, and a dynamic
// import() of a bare path would resolve against the chunk's origin, not the
// site's.
-export function voiceAssetUrl(file) {
+export function liveAssetUrl(file) {
return new URL(getURLWithCDN(`${basePath()}/${file}`), window.location).href;
}
// Same-origin variant: workers must load from the app origin (everything
-// they fetch afterwards can still use voiceAssetUrl).
-export function voiceAssetAppUrl(file) {
+// they fetch afterwards can still use liveAssetUrl).
+export function liveAssetAppUrl(file) {
return new URL(getURL(`${basePath()}/${file}`), window.location).href;
}
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/livekit-coordinator.js b/plugins/live/assets/javascripts/discourse/lib/live/livekit-coordinator.js
similarity index 90%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/livekit-coordinator.js
rename to plugins/live/assets/javascripts/discourse/lib/live/livekit-coordinator.js
index 3d17bfc728e..e5bb0484136 100644
--- a/plugins/voice/assets/javascripts/discourse/lib/voice/livekit-coordinator.js
+++ b/plugins/live/assets/javascripts/discourse/lib/live/livekit-coordinator.js
@@ -1,5 +1,5 @@
import { ajax } from "discourse/lib/ajax";
-import voiceLog from "discourse/plugins/voice/discourse/lib/voice/logger";
+import liveLog from "discourse/plugins/live/discourse/lib/live/logger";
import LivekitRoomSession from "./livekit-session.js";
// Owns the livekit sessions for SFU-transport rooms: connecting on join,
@@ -106,9 +106,9 @@ export default class LivekitCoordinator {
let failureMessage = null;
if (!LivekitRoomSession.isBrowserSupported()) {
- failureMessage = "voice.livekit.browser_unsupported";
+ failureMessage = "live.livekit.browser_unsupported";
} else if (!livekit?.url || !livekit?.token) {
- failureMessage = "voice.livekit.connect_failed";
+ failureMessage = "live.livekit.connect_failed";
} else {
const session = this.#buildSession(room.id);
this.#sessions.set(room.id, session);
@@ -116,12 +116,12 @@ export default class LivekitCoordinator {
try {
await session.connect(livekit.url, livekit.token);
} catch (error) {
- voiceLog.warn(
- `[voice-livekit] failed to connect to the media server for room ${room.id}`
+ liveLog.warn(
+ `[live-livekit] failed to connect to the media server for room ${room.id}`
);
failureMessage = error?.unsupportedBrowser
- ? "voice.livekit.browser_unsupported"
- : "voice.livekit.connect_failed";
+ ? "live.livekit.browser_unsupported"
+ : "live.livekit.connect_failed";
if (this.#sessions.get(room.id) === session) {
this.#sessions.delete(room.id);
@@ -131,7 +131,7 @@ export default class LivekitCoordinator {
}
if (failureMessage) {
- ajax(`/voice/rooms/${room.id}/leave`, {
+ ajax(`/live/rooms/${room.id}/leave`, {
type: "DELETE",
data: {
participant_session_id: this.#getParticipantSessionId(room.id),
@@ -146,7 +146,7 @@ export default class LivekitCoordinator {
// Superseded while connecting; the superseding join already tore this
// room down (disconnecting the session), so only the server needs
// telling.
- ajax(`/voice/rooms/${room.id}/leave`, {
+ ajax(`/live/rooms/${room.id}/leave`, {
type: "DELETE",
data: {
participant_session_id: this.#getParticipantSessionId(room.id),
@@ -231,8 +231,8 @@ export default class LivekitCoordinator {
try {
await session.replaceAudioTrack(newTrack);
} catch {
- voiceLog.warn(
- `[voice-livekit] failed to replace the published audio track for room ${roomId}`
+ liveLog.warn(
+ `[live-livekit] failed to replace the published audio track for room ${roomId}`
);
}
}
@@ -254,7 +254,7 @@ export default class LivekitCoordinator {
this.#handleDisconnected(roomId, kind, reason),
onConnectionChange: () => this.#bumpConnectionRevision(),
mintToken: async () => {
- const response = await ajax(`/voice/rooms/${roomId}/livekit_token`, {
+ const response = await ajax(`/live/rooms/${roomId}/livekit_token`, {
type: "POST",
});
// The token endpoint re-establishes presence, so it rotates the
@@ -275,8 +275,8 @@ export default class LivekitCoordinator {
return;
}
- voiceLog.warn(
- `[voice-livekit] disconnected from the media server for room ${roomId} (${reason})`
+ liveLog.warn(
+ `[live-livekit] disconnected from the media server for room ${roomId} (${reason})`
);
if (kind === "duplicate_identity") {
@@ -285,7 +285,7 @@ export default class LivekitCoordinator {
// the new tab's session row and drop the user from the roster —
// tear down locally only.
this.#leave(roomId, { skipServer: true });
- this.#showNotice("voice.livekit.duplicate_tab");
+ this.#showNotice("live.livekit.duplicate_tab");
return;
}
@@ -298,10 +298,10 @@ export default class LivekitCoordinator {
// The room instance ended while we were disconnected; leave cleanly
// and offer a rejoin.
this.#leave(roomId);
- this.#showNotice("voice.livekit.room_ended");
+ this.#showNotice("live.livekit.room_ended");
} else if (outcome === "failed") {
this.#leave(roomId);
- this.#showError("voice.livekit.reconnect_failed");
+ this.#showError("live.livekit.reconnect_failed");
}
// "aborted": the session was torn down (leave, new join) mid-ladder.
}
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/livekit-session.js b/plugins/live/assets/javascripts/discourse/lib/live/livekit-session.js
similarity index 95%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/livekit-session.js
rename to plugins/live/assets/javascripts/discourse/lib/live/livekit-session.js
index 9353fd088ea..c7abea632da 100644
--- a/plugins/voice/assets/javascripts/discourse/lib/voice/livekit-session.js
+++ b/plugins/live/assets/javascripts/discourse/lib/live/livekit-session.js
@@ -1,8 +1,9 @@
-import voiceLog from "discourse/plugins/voice/discourse/lib/voice/logger";
+import liveLog from "discourse/plugins/live/discourse/lib/live/logger";
+import { liveAssetAppUrl } from "./live-assets.js";
// LiveKit room session.
//
// One instance per active room on the "livekit" transport, owned by the
-// voice-webrtc service. Bridges the vendored livekit-client SDK to the
+// live-webrtc service. Bridges the vendored livekit-client SDK to the
// same callbacks PeerManager uses, so the remote-media registry and every
// UI component work unchanged on both transports. Callback-injected in the
// same style as PeerManager; a fake SDK module can be injected via `loadSdk`
@@ -13,7 +14,6 @@ import {
screenEncodingFor,
voiceBitrateFor,
} from "./video-quality.js";
-import { voiceAssetAppUrl } from "./voice-assets.js";
// The SDK bundle sits in the plugin's public dir, which static asset CDNs
// never receive. Anchor to the page URL because this compiled chunk may
@@ -31,7 +31,7 @@ let reconnectDelaysMs = [0, 1000, 2000];
async function defaultLoadSdk() {
sdkPromise ||= import(
- /* @vite-ignore */ voiceAssetAppUrl("livekit/livekit-client.js")
+ /* @vite-ignore */ liveAssetAppUrl("livekit/livekit-client.js")
);
try {
@@ -408,8 +408,8 @@ export default class LivekitRoomSession {
await this.connect(minted.url, minted.token);
return this.#closed ? "aborted" : "reconnected";
} catch (error) {
- voiceLog.warn(
- `[voice-livekit] reconnect attempt failed for room ${this.#roomId}`,
+ liveLog.warn(
+ `[live-livekit] reconnect attempt failed for room ${this.#roomId}`,
error
);
}
@@ -484,8 +484,8 @@ export default class LivekitRoomSession {
);
this.#videoKind = kind;
} catch (error) {
- voiceLog.warn(
- `[voice-livekit] failed to publish ${kind} video for room ${this.#roomId}`,
+ liveLog.warn(
+ `[live-livekit] failed to publish ${kind} video for room ${this.#roomId}`,
error
);
}
@@ -530,8 +530,8 @@ export default class LivekitRoomSession {
audioBitrate: SCREEN_AUDIO_BITRATE,
});
} catch (error) {
- voiceLog.warn(
- `[voice-livekit] failed to publish screen audio for room ${this.#roomId}`,
+ liveLog.warn(
+ `[live-livekit] failed to publish screen audio for room ${this.#roomId}`,
error
);
}
@@ -550,8 +550,8 @@ export default class LivekitRoomSession {
false
);
} catch (error) {
- voiceLog.warn(
- `[voice-livekit] failed to unpublish a track for room ${this.#roomId}`,
+ liveLog.warn(
+ `[live-livekit] failed to unpublish a track for room ${this.#roomId}`,
error
);
}
@@ -677,8 +677,8 @@ export default class LivekitRoomSession {
// A server-side permission update (e.g. a promotion synced by the
// backend) lets the mic publish without a reconnect.
this.refreshPublications().catch((error) => {
- voiceLog.warn(
- `[voice-livekit] failed to refresh publications for room ${this.#roomId}`,
+ liveLog.warn(
+ `[live-livekit] failed to refresh publications for room ${this.#roomId}`,
error
);
});
@@ -730,15 +730,15 @@ export default class LivekitRoomSession {
});
room.on(RoomEvent.Reconnecting, () => {
- voiceLog.info(
- `[voice-livekit] connection interrupted for room ${this.#roomId}; SDK is resuming`
+ liveLog.info(
+ `[live-livekit] connection interrupted for room ${this.#roomId}; SDK is resuming`
);
this.#onConnectionChange("reconnecting");
});
room.on(RoomEvent.Reconnected, () => {
- voiceLog.info(
- `[voice-livekit] connection resumed for room ${this.#roomId}`
+ liveLog.info(
+ `[live-livekit] connection resumed for room ${this.#roomId}`
);
this.#onConnectionChange("connected");
});
@@ -759,7 +759,7 @@ export default class LivekitRoomSession {
dtx: true,
red: true,
};
- const voiceBitrate = voiceBitrateFor(this.#qualityTiers().voice);
+ const voiceBitrate = voiceBitrateFor(this.#qualityTiers().live);
if (voiceBitrate) {
micOptions.audioBitrate = voiceBitrate;
}
@@ -771,8 +771,8 @@ export default class LivekitRoomSession {
// A rejected publish (e.g. a stale token after a role change) must
// not fail the join — the user can still listen.
- voiceLog.warn(
- `[voice-livekit] failed to publish microphone for room ${this.#roomId}`,
+ liveLog.warn(
+ `[live-livekit] failed to publish microphone for room ${this.#roomId}`,
error
);
}
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/local-audio-pipeline.js b/plugins/live/assets/javascripts/discourse/lib/live/local-audio-pipeline.js
similarity index 93%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/local-audio-pipeline.js
rename to plugins/live/assets/javascripts/discourse/lib/live/local-audio-pipeline.js
index cbb41304c39..830e1a07347 100644
--- a/plugins/voice/assets/javascripts/discourse/lib/voice/local-audio-pipeline.js
+++ b/plugins/live/assets/javascripts/discourse/lib/live/local-audio-pipeline.js
@@ -1,5 +1,5 @@
import { tracked } from "@glimmer/tracking";
-import voiceLog from "discourse/plugins/voice/discourse/lib/voice/logger";
+import liveLog from "discourse/plugins/live/discourse/lib/live/logger";
import {
autoGainControlPreferred,
echoCancellationPreferred,
@@ -165,7 +165,7 @@ export default class LocalAudioPipeline {
});
this.lastAcquisitionError = null;
- voiceLog.info("[voice] local stream obtained");
+ liveLog.info("[live] local stream obtained");
this.#rawStream = rawStream;
@@ -186,7 +186,7 @@ export default class LocalAudioPipeline {
} catch (error) {
this.lastAcquisitionError = error;
- voiceLog.warn("[voice] failed to obtain local stream");
+ liveLog.warn("[live] failed to obtain local stream");
return false;
}
}
@@ -217,14 +217,14 @@ export default class LocalAudioPipeline {
// Capture failed: the current stream is untouched, so just undo the
// preference.
- voiceLog.warn("[voice] failed to apply noise suppression mode");
+ liveLog.warn("[live] failed to apply noise suppression mode");
this.noiseSuppressionMode = previousMode;
setPreferredNoiseSuppressionMode(previousMode);
return;
}
if (reacquired) {
- voiceLog.info(`[voice] noise suppression mode: ${mode}`);
+ liveLog.info(`[live] noise suppression mode: ${mode}`);
return;
}
@@ -237,7 +237,7 @@ export default class LocalAudioPipeline {
await this.#reacquire({ userGesture: true });
} catch (error) {
if (!(error instanceof SupersededError)) {
- voiceLog.warn("[voice] failed to restore previous mode");
+ liveLog.warn("[live] failed to restore previous mode");
}
}
}
@@ -259,7 +259,7 @@ export default class LocalAudioPipeline {
return true;
}
- voiceLog.warn("[voice] failed to switch input device");
+ liveLog.warn("[live] failed to switch input device");
this.inputDeviceId = previousDeviceId;
setPreferredInputDeviceId(previousDeviceId);
return false;
@@ -310,7 +310,7 @@ export default class LocalAudioPipeline {
return;
}
- voiceLog.warn("[voice] failed to apply audio processing change");
+ liveLog.warn("[live] failed to apply audio processing change");
}
}
@@ -335,14 +335,14 @@ export default class LocalAudioPipeline {
this.noiseSuppressionState = "on";
this.#setOutgoingStream(suppressed);
- voiceLog.info("[voice] AI noise suppression enabled");
+ liveLog.info("[live] AI noise suppression enabled");
return true;
} catch (error) {
if (error instanceof SupersededError) {
throw error;
}
- voiceLog.warn("[voice] AI noise suppression setup failed");
+ liveLog.warn("[live] AI noise suppression setup failed");
this.noiseSuppressionState = "off";
this.#setOutgoingStream(rawStream);
return false;
@@ -368,9 +368,7 @@ export default class LocalAudioPipeline {
}
// Capture failed: publish what we still have rather than nothing.
- voiceLog.warn(
- "[voice] failed to reacquire after suppression breakdown"
- );
+ liveLog.warn("[live] failed to reacquire after suppression breakdown");
this.#noiseSuppression.teardown();
this.noiseSuppressionState = "off";
this.#setOutgoingStream(this.#rawStream);
@@ -393,7 +391,7 @@ export default class LocalAudioPipeline {
sliderToRms(this.gateThreshold)
);
} catch {
- voiceLog.warn("[voice] failed to set up input gate");
+ liveLog.warn("[live] failed to set up input gate");
stream = upstream;
}
}
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/local-video-manager.js b/plugins/live/assets/javascripts/discourse/lib/live/local-video-manager.js
similarity index 95%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/local-video-manager.js
rename to plugins/live/assets/javascripts/discourse/lib/live/local-video-manager.js
index 82d779e2d9b..bbc36971b91 100644
--- a/plugins/voice/assets/javascripts/discourse/lib/voice/local-video-manager.js
+++ b/plugins/live/assets/javascripts/discourse/lib/live/local-video-manager.js
@@ -1,7 +1,7 @@
import { tracked } from "@glimmer/tracking";
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
-import voiceLog from "discourse/plugins/voice/discourse/lib/voice/logger";
+import liveLog from "discourse/plugins/live/discourse/lib/live/logger";
import BackgroundBlurManager from "./background-blur.js";
import {
cameraConstraints,
@@ -164,7 +164,7 @@ export default class LocalVideoManager {
if (!this.#canPublish(kind, roomId)) {
if (!silent) {
- this.#showError("voice.video.publisher_limit");
+ this.#showError("live.video.publisher_limit");
}
return;
}
@@ -203,13 +203,13 @@ export default class LocalVideoManager {
});
}
} catch (error) {
- voiceLog.warn(`[voice] failed to obtain ${kind} stream`);
+ liveLog.warn(`[live] failed to obtain ${kind} stream`);
if (
!silent &&
error?.name !== "NotAllowedError" &&
error?.name !== "AbortError"
) {
- this.#showError("voice.video.capture_failed");
+ this.#showError("live.video.capture_failed");
}
return;
}
@@ -365,7 +365,7 @@ export default class LocalVideoManager {
)
);
} catch {
- voiceLog.warn("[voice] failed to re-apply camera constraints");
+ liveLog.warn("[live] failed to re-apply camera constraints");
}
}
}
@@ -402,7 +402,7 @@ export default class LocalVideoManager {
try {
await transceiver.sender.replaceTrack(desired);
} catch {
- voiceLog.warn("[voice] failed to sync video sender for peer");
+ liveLog.warn("[live] failed to sync video sender for peer");
}
}
@@ -417,7 +417,7 @@ export default class LocalVideoManager {
await applyScreenAudioQuality(audioTransceiver.sender);
}
} catch {
- voiceLog.warn("[voice] failed to sync screen audio sender for peer");
+ liveLog.warn("[live] failed to sync screen audio sender for peer");
}
}
}
@@ -494,7 +494,7 @@ export default class LocalVideoManager {
this.blurEnabled = false;
BackgroundBlurManager.setPreference(false);
if (!silent) {
- this.#showError("voice.video_settings.blur_failed");
+ this.#showError("live.video_settings.blur_failed");
}
}
@@ -519,7 +519,7 @@ export default class LocalVideoManager {
newStream = await navigator.mediaDevices.getUserMedia(constraints);
} catch (error) {
if (!this.#cameraBusyError(error)) {
- voiceLog.warn("[voice] failed to switch camera");
+ liveLog.warn("[live] failed to switch camera");
this.inputDeviceId = previousDeviceId;
this.#showSwitchError(error);
return false;
@@ -559,8 +559,8 @@ export default class LocalVideoManager {
#showSwitchError(error) {
this.#showError(
error?.name === "NotAllowedError"
- ? "voice.video.camera_switch_denied"
- : "voice.video.camera_switch_failed"
+ ? "live.video.camera_switch_denied"
+ : "live.video.camera_switch_failed"
);
}
@@ -568,7 +568,7 @@ export default class LocalVideoManager {
// can't silently keep the previous stream: reacquire it, and if even that
// fails treat the camera as gone.
async #rollbackSwitch(previousDeviceId, epoch, error) {
- voiceLog.warn("[voice] failed to switch camera");
+ liveLog.warn("[live] failed to switch camera");
this.inputDeviceId = previousDeviceId;
if (epoch === this.#epoch && this.kind === "camera") {
@@ -671,7 +671,7 @@ export default class LocalVideoManager {
});
return { manager, processed };
} catch {
- voiceLog.warn("[voice] failed to start background blur");
+ liveLog.warn("[live] failed to start background blur");
manager.teardown();
return null;
}
@@ -706,7 +706,7 @@ export default class LocalVideoManager {
}
})
.catch(() => {
- voiceLog.warn("[voice] failed to stop local video");
+ liveLog.warn("[live] failed to stop local video");
});
}
@@ -755,7 +755,7 @@ export default class LocalVideoManager {
is_screen_sharing: screen,
});
- return ajax(`/voice/rooms/${roomId}/state`, {
+ return ajax(`/live/rooms/${roomId}/state`, {
type: "POST",
data: {
video,
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/logger.js b/plugins/live/assets/javascripts/discourse/lib/live/logger.js
similarity index 91%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/logger.js
rename to plugins/live/assets/javascripts/discourse/lib/live/logger.js
index 252f7bf95b3..4005486f7f1 100644
--- a/plugins/voice/assets/javascripts/discourse/lib/voice/logger.js
+++ b/plugins/live/assets/javascripts/discourse/lib/live/logger.js
@@ -7,7 +7,7 @@ export default {
info(message) {
if (
getOwnerWithFallback()?.lookup("service:site-settings")
- ?.voice_verbose_logging
+ ?.live_verbose_logging
) {
// eslint-disable-next-line no-console
console.info(message);
@@ -17,7 +17,7 @@ export default {
warn(message, error) {
if (
getOwnerWithFallback()?.lookup("service:site-settings")
- ?.voice_verbose_logging
+ ?.live_verbose_logging
) {
const details = sanitizeError(error);
// eslint-disable-next-line no-console
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/media-devices.js b/plugins/live/assets/javascripts/discourse/lib/live/media-devices.js
similarity index 95%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/media-devices.js
rename to plugins/live/assets/javascripts/discourse/lib/live/media-devices.js
index 5afdc3ff1b0..3be79c080f5 100644
--- a/plugins/voice/assets/javascripts/discourse/lib/voice/media-devices.js
+++ b/plugins/live/assets/javascripts/discourse/lib/live/media-devices.js
@@ -1,7 +1,8 @@
import { i18n } from "discourse-i18n";
-import voiceLog from "discourse/plugins/voice/discourse/lib/voice/logger";
+import liveLog from "discourse/plugins/live/discourse/lib/live/logger";
import { processingConstraints } from "./audio-processing.js";
+// Pre-rename key, kept so saved preferences survive.
const INPUT_STORAGE_KEY = "voice_audio_input_device";
const OUTPUT_STORAGE_KEY = "voice_audio_output_device";
const VIDEO_INPUT_STORAGE_KEY = "voice_video_input_device";
@@ -151,7 +152,7 @@ export async function enumerateAudioDevices() {
id: device.deviceId,
name:
device.label ||
- i18n("voice.devices.unknown_device", {
+ i18n("live.devices.unknown_device", {
index: list.length + 1,
}),
});
@@ -183,7 +184,7 @@ export async function enumerateVideoDevices() {
id: device.deviceId,
name:
device.label ||
- i18n("voice.devices.unknown_device", {
+ i18n("live.devices.unknown_device", {
index: inputs.length + 1,
}),
});
@@ -205,6 +206,6 @@ export function applyOutputDevice(element, deviceId) {
}
element.setSinkId(sinkId).catch(() => {
- voiceLog.warn("[voice] failed to set audio output device");
+ liveLog.warn("[live] failed to set audio output device");
});
}
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/mesh-signal-handler.js b/plugins/live/assets/javascripts/discourse/lib/live/mesh-signal-handler.js
similarity index 90%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/mesh-signal-handler.js
rename to plugins/live/assets/javascripts/discourse/lib/live/mesh-signal-handler.js
index 96a82b2c4f9..fd08637eae3 100644
--- a/plugins/voice/assets/javascripts/discourse/lib/voice/mesh-signal-handler.js
+++ b/plugins/live/assets/javascripts/discourse/lib/live/mesh-signal-handler.js
@@ -1,4 +1,4 @@
-import voiceLog from "discourse/plugins/voice/discourse/lib/voice/logger";
+import liveLog from "discourse/plugins/live/discourse/lib/live/logger";
import PeerManager from "./peer-manager.js";
import { iceUfrag } from "./sdp-utils.js";
import { participantCanSpeak } from "./stage-roles.js";
@@ -146,7 +146,7 @@ export default class MeshSignalHandler {
return;
}
- voiceLog.info(`[voice] 📥 received signal from peer in room ${roomId}`);
+ liveLog.info(`[live] 📥 received signal from peer in room ${roomId}`);
let pc = await this.#peerManager.create(roomId, remoteUserId);
if (!pc) {
return;
@@ -180,9 +180,7 @@ export default class MeshSignalHandler {
const priorUfrag = iceUfrag(pc.remoteDescription?.sdp);
const incomingUfrag = iceUfrag(data.sdp);
if (priorUfrag && incomingUfrag && priorUfrag !== incomingUfrag) {
- voiceLog.info(
- "[voice] remote ICE restart from peer; recreating peer"
- );
+ liveLog.info("[live] remote ICE restart from peer; recreating peer");
this.#peerManager.destroy(roomId, remoteUserId);
pc = await this.#peerManager.create(roomId, remoteUserId);
if (!pc) {
@@ -193,13 +191,13 @@ export default class MeshSignalHandler {
if (pc.signalingState === "have-local-offer") {
if (this.#getCurrentUserId() < remoteUserId) {
- voiceLog.info(
- "[voice] glare detected, rolling back local offer for peer"
+ liveLog.info(
+ "[live] glare detected, rolling back local offer for peer"
);
await pc.setLocalDescription({ type: "rollback" });
} else {
- voiceLog.info(
- "[voice] glare detected, ignoring remote offer from peer"
+ liveLog.info(
+ "[live] glare detected, ignoring remote offer from peer"
);
return;
}
@@ -220,19 +218,19 @@ export default class MeshSignalHandler {
const answer = await pc.createAnswer();
await pc.setLocalDescription(answer);
this.#signaling.send(roomId, remoteUserId, answer).catch(() => {
- voiceLog.warn("[voice] failed to send answer");
+ liveLog.warn("[live] failed to send answer");
});
await this.#onOfferHandled(roomId);
} catch {
- voiceLog.warn("[voice] failed to handle offer from peer");
+ liveLog.warn("[live] failed to handle offer from peer");
}
} else if (data.type === "answer") {
this.#peerManager.clearOfferRetry(roomId, remoteUserId);
if (pc.signalingState !== "have-local-offer") {
- voiceLog.warn(
- `[voice] ignoring answer in state ${pc.signalingState} from peer`
+ liveLog.warn(
+ `[live] ignoring answer in state ${pc.signalingState} from peer`
);
return;
}
@@ -245,7 +243,7 @@ export default class MeshSignalHandler {
pc
);
} catch {
- voiceLog.warn("[voice] failed to handle answer from peer");
+ liveLog.warn("[live] failed to handle answer from peer");
}
} else if (data.type === "candidate") {
this.#peerManager.clearOfferRetry(roomId, remoteUserId);
@@ -262,7 +260,7 @@ export default class MeshSignalHandler {
try {
await pc.addIceCandidate(new RTCIceCandidate(data.candidate));
} catch {
- voiceLog.warn("[voice] failed to add ICE candidate from peer");
+ liveLog.warn("[live] failed to add ICE candidate from peer");
}
}
}
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/noise-suppression.js b/plugins/live/assets/javascripts/discourse/lib/live/noise-suppression.js
similarity index 100%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/noise-suppression.js
rename to plugins/live/assets/javascripts/discourse/lib/live/noise-suppression.js
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/ns-engines.js b/plugins/live/assets/javascripts/discourse/lib/live/ns-engines.js
similarity index 89%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/ns-engines.js
rename to plugins/live/assets/javascripts/discourse/lib/live/ns-engines.js
index bca5b9a3a0f..cc109e225e6 100644
--- a/plugins/voice/assets/javascripts/discourse/lib/voice/ns-engines.js
+++ b/plugins/live/assets/javascripts/discourse/lib/live/ns-engines.js
@@ -1,6 +1,6 @@
import { i18n } from "discourse-i18n";
-export { voiceAssetUrl as nsUrl } from "./voice-assets.js";
+export { liveAssetUrl as nsUrl } from "./live-assets.js";
// The selectable AI noise-suppression engines. Every engine ships a worklet
// bundle speaking the same protocol (src/ns-worklet/runtime.js in the
@@ -37,6 +37,6 @@ export function engineForMode(mode) {
// itself stays the stored/mode value; colons just make poor YAML keys).
export function noiseSuppressionModeLabel(mode) {
return i18n(
- `voice.voice_settings.noise_suppression_modes.${mode.replace(":", "_")}`
+ `live.voice_settings.noise_suppression_modes.${mode.replace(":", "_")}`
);
}
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/participant-audio.js b/plugins/live/assets/javascripts/discourse/lib/live/participant-audio.js
similarity index 97%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/participant-audio.js
rename to plugins/live/assets/javascripts/discourse/lib/live/participant-audio.js
index 69016ff0e78..be19cb4ec83 100644
--- a/plugins/voice/assets/javascripts/discourse/lib/voice/participant-audio.js
+++ b/plugins/live/assets/javascripts/discourse/lib/live/participant-audio.js
@@ -15,7 +15,7 @@ export default class ParticipantAudio {
this.#isDeafened = isDeafened;
}
- trackElement(roomId, userId, element, role = "voice") {
+ trackElement(roomId, userId, element, role = "live") {
const key = this.#key(roomId, userId);
const elements = this.#elements.get(key) || {};
elements[role] = element;
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/peer-manager.js b/plugins/live/assets/javascripts/discourse/lib/live/peer-manager.js
similarity index 91%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/peer-manager.js
rename to plugins/live/assets/javascripts/discourse/lib/live/peer-manager.js
index 8102c68398e..ce388feeabc 100644
--- a/plugins/voice/assets/javascripts/discourse/lib/voice/peer-manager.js
+++ b/plugins/live/assets/javascripts/discourse/lib/live/peer-manager.js
@@ -1,4 +1,4 @@
-import voiceLog from "discourse/plugins/voice/discourse/lib/voice/logger";
+import liveLog from "discourse/plugins/live/discourse/lib/live/logger";
// The screen-share audio m-line is pre-negotiated like the video one, but
// both audio transceivers on a connection report kind "audio", so the screen
@@ -105,7 +105,7 @@ export default class PeerManager {
const orphanTrack = orphan?.sender?.track;
if (orphanTrack && !associated.sender.track) {
associated.sender.replaceTrack(orphanTrack).catch(() => {
- voiceLog.warn("[voice] failed to migrate video track");
+ liveLog.warn("[live] failed to migrate video track");
});
orphan.sender.replaceTrack(null).catch(() => {});
}
@@ -144,7 +144,7 @@ export default class PeerManager {
const orphanTrack = orphan.sender?.track;
if (orphanTrack && !screenTransceiver.sender.track) {
screenTransceiver.sender.replaceTrack(orphanTrack).catch(() => {
- voiceLog.warn("[voice] failed to migrate screen audio track");
+ liveLog.warn("[live] failed to migrate screen audio track");
});
orphan.sender.replaceTrack(null).catch(() => {});
}
@@ -260,7 +260,7 @@ export default class PeerManager {
try {
await sender.replaceTrack(newTrack);
} catch {
- voiceLog.warn("[voice] failed to replace track on peer");
+ liveLog.warn("[live] failed to replace track on peer");
}
}
}
@@ -308,7 +308,7 @@ export default class PeerManager {
const videoTrack = this.#getLocalVideoTrack(roomId, remoteUserId);
if (videoTrack) {
videoTransceiver.sender.replaceTrack(videoTrack).catch(() => {
- voiceLog.warn("[voice] failed to attach video track");
+ liveLog.warn("[live] failed to attach video track");
});
}
@@ -326,7 +326,7 @@ export default class PeerManager {
);
if (screenAudioTrack) {
screenAudioTransceiver.sender.replaceTrack(screenAudioTrack).catch(() => {
- voiceLog.warn("[voice] failed to attach screen audio track");
+ liveLog.warn("[live] failed to attach screen audio track");
});
}
@@ -350,11 +350,11 @@ export default class PeerManager {
type: "candidate",
candidate: candidatePayload,
}).catch(() => {
- voiceLog.warn("[voice] failed to send candidate");
+ liveLog.warn("[live] failed to send candidate");
});
} else {
this.#flushQueuedSignals(roomId, remoteUserId).catch(() => {
- voiceLog.warn("[voice] failed to flush signal queue");
+ liveLog.warn("[live] failed to flush signal queue");
});
}
};
@@ -362,17 +362,17 @@ export default class PeerManager {
pc.onicegatheringstatechange = () => {
if (pc.iceGatheringState === "complete") {
this.#flushQueuedSignals(roomId, remoteUserId).catch(() => {
- voiceLog.warn("[voice] failed to flush signal queue");
+ liveLog.warn("[live] failed to flush signal queue");
});
}
};
pc.onicecandidateerror = () => {
- voiceLog.warn("[voice] ICE candidate error for peer");
+ liveLog.warn("[live] ICE candidate error for peer");
};
pc.onconnectionstatechange = () => {
- voiceLog.info(`[voice] connectionState ${pc.connectionState} for peer`);
+ liveLog.info(`[live] connectionState ${pc.connectionState} for peer`);
if (pc.connectionState === "connected") {
this.#clearOfferRetry(roomId, remoteUserId);
this.#clearPeerRestart(roomId, remoteUserId);
@@ -399,8 +399,8 @@ export default class PeerManager {
};
pc.oniceconnectionstatechange = () => {
- voiceLog.info(
- `[voice] iceConnectionState ${pc.iceConnectionState} for peer`
+ liveLog.info(
+ `[live] iceConnectionState ${pc.iceConnectionState} for peer`
);
if (pc.iceConnectionState === "failed") {
this.#schedulePeerRestart(roomId, remoteUserId, { immediate: true });
@@ -476,8 +476,8 @@ export default class PeerManager {
// inbound handler will drive negotiation. The connection timeout in
// #startConnectionTimeout is the safety net if it stalls.
- voiceLog.info(
- `[voice] skipping offer for peer: signalingState=${pc.signalingState}`
+ liveLog.info(
+ `[live] skipping offer for peer: signalingState=${pc.signalingState}`
);
return;
}
@@ -486,10 +486,10 @@ export default class PeerManager {
const offer = await pc.createOffer();
await pc.setLocalDescription(offer);
this.#sendSignal(roomId, remoteUserId, offer).catch(() => {
- voiceLog.warn("[voice] failed to send offer");
+ liveLog.warn("[live] failed to send offer");
});
} catch {
- voiceLog.warn("[voice] failed to create offer");
+ liveLog.warn("[live] failed to create offer");
}
}
@@ -505,8 +505,8 @@ export default class PeerManager {
const attempts = this.#offerRetryAttempts.get(key) || 0;
if (attempts >= PeerManager.#maxOfferRetries) {
- voiceLog.warn(
- `[voice] max offer retries (${PeerManager.#maxOfferRetries}) reached for peer`
+ liveLog.warn(
+ `[live] max offer retries (${PeerManager.#maxOfferRetries}) reached for peer`
);
return;
}
@@ -516,8 +516,8 @@ export default class PeerManager {
timing.maxOfferRetryDelayMs
);
- voiceLog.info(
- `[voice] scheduling offer retry for peer (attempt ${attempts + 1}/${PeerManager.#maxOfferRetries}, delay ${actualDelay}ms)`
+ liveLog.info(
+ `[live] scheduling offer retry for peer (attempt ${attempts + 1}/${PeerManager.#maxOfferRetries}, delay ${actualDelay}ms)`
);
const timer = setTimeout(async () => {
@@ -543,8 +543,8 @@ export default class PeerManager {
queue.push(candidate);
this.#pendingCandidates.set(key, queue);
- voiceLog.info(
- `[voice] queued ICE candidate for peer (${queue.length} pending)`
+ liveLog.info(
+ `[live] queued ICE candidate for peer (${queue.length} pending)`
);
}
@@ -558,15 +558,15 @@ export default class PeerManager {
this.#pendingCandidates.delete(key);
- voiceLog.info(
- `[voice] flushing ${candidates.length} queued ICE candidates for peer`
+ liveLog.info(
+ `[live] flushing ${candidates.length} queued ICE candidates for peer`
);
for (const candidate of candidates) {
try {
await pc.addIceCandidate(new RTCIceCandidate(candidate));
} catch {
- voiceLog.warn("[voice] failed to add queued ICE candidate for peer");
+ liveLog.warn("[live] failed to add queued ICE candidate for peer");
}
}
}
@@ -639,8 +639,8 @@ export default class PeerManager {
// and the disconnected/failed handlers restart those if checks truly
// fail, so they are covered without an app-level teardown.
if (pc.connectionState === "new") {
- voiceLog.warn(
- `[voice] connection stuck in "new" (${timing.connectionTimeoutMs}ms) for peer; restarting`
+ liveLog.warn(
+ `[live] connection stuck in "new" (${timing.connectionTimeoutMs}ms) for peer; restarting`
);
this.#schedulePeerRestart(roomId, remoteUserId, { immediate: true });
}
@@ -681,8 +681,8 @@ export default class PeerManager {
const attempts = this.#restartAttempts.get(key) || 0;
if (attempts >= PeerManager.#maxRestartAttempts) {
- voiceLog.warn(
- `[voice] max restart attempts (${PeerManager.#maxRestartAttempts}) reached for peer`
+ liveLog.warn(
+ `[live] max restart attempts (${PeerManager.#maxRestartAttempts}) reached for peer`
);
return;
}
@@ -695,15 +695,15 @@ export default class PeerManager {
timing.maxRestartDelayMs
);
- voiceLog.info(
- `[voice] scheduling peer restart for peer (attempt ${attempts + 1}/${PeerManager.#maxRestartAttempts}, delay ${delay}ms)`
+ liveLog.info(
+ `[live] scheduling peer restart for peer (attempt ${attempts + 1}/${PeerManager.#maxRestartAttempts}, delay ${delay}ms)`
);
const timer = setTimeout(() => {
this.#peerReconnectTimers.delete(key);
this.#restartAttempts.set(key, attempts + 1);
this.restart(roomId, remoteUserId).catch(() => {
- voiceLog.warn("[voice] failed to restart peer connection");
+ liveLog.warn("[live] failed to restart peer connection");
});
}, delay);
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/presence-pending-peers.js b/plugins/live/assets/javascripts/discourse/lib/live/presence-pending-peers.js
similarity index 100%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/presence-pending-peers.js
rename to plugins/live/assets/javascripts/discourse/lib/live/presence-pending-peers.js
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/ptt-manager.js b/plugins/live/assets/javascripts/discourse/lib/live/ptt-manager.js
similarity index 98%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/ptt-manager.js
rename to plugins/live/assets/javascripts/discourse/lib/live/ptt-manager.js
index c109d857ed2..f21ee58a227 100644
--- a/plugins/voice/assets/javascripts/discourse/lib/voice/ptt-manager.js
+++ b/plugins/live/assets/javascripts/discourse/lib/live/ptt-manager.js
@@ -3,6 +3,7 @@ import discourseLater from "discourse/lib/later";
const PTT_MUTE_DEBOUNCE_MS = 200;
const PTT_RESERVED_KEYS = new Set(["Escape", "Tab", "Enter"]);
+// Pre-rename key, kept so saved preferences survive.
const PTT_STORAGE_ENABLED = "voice_ptt_enabled";
const PTT_STORAGE_KEY = "voice_ptt_key";
const PTT_DEFAULT_KEY = "Space";
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/ptt-utils.js b/plugins/live/assets/javascripts/discourse/lib/live/ptt-utils.js
similarity index 100%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/ptt-utils.js
rename to plugins/live/assets/javascripts/discourse/lib/live/ptt-utils.js
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/quality-preferences.js b/plugins/live/assets/javascripts/discourse/lib/live/quality-preferences.js
similarity index 98%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/quality-preferences.js
rename to plugins/live/assets/javascripts/discourse/lib/live/quality-preferences.js
index c81c6e361cd..b44ccdf00fa 100644
--- a/plugins/voice/assets/javascripts/discourse/lib/voice/quality-preferences.js
+++ b/plugins/live/assets/javascripts/discourse/lib/live/quality-preferences.js
@@ -12,6 +12,7 @@ export const QUALITY_TIERS = [QUALITY_STANDARD, QUALITY_HIGH, QUALITY_MAXIMUM];
export const SCREEN_CONTENT_TEXT = "text";
export const SCREEN_CONTENT_MOTION = "motion";
+// Pre-rename key, kept so saved preferences survive.
const VOICE_STORAGE_KEY = "voice_voice_quality";
const CAMERA_STORAGE_KEY = "voice_camera_quality";
const SCREEN_STORAGE_KEY = "voice_screen_quality";
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/remote-stream-registry.js b/plugins/live/assets/javascripts/discourse/lib/live/remote-stream-registry.js
similarity index 100%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/remote-stream-registry.js
rename to plugins/live/assets/javascripts/discourse/lib/live/remote-stream-registry.js
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/ringing.js b/plugins/live/assets/javascripts/discourse/lib/live/ringing.js
similarity index 100%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/ringing.js
rename to plugins/live/assets/javascripts/discourse/lib/live/ringing.js
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/room-icon.js b/plugins/live/assets/javascripts/discourse/lib/live/room-icon.js
similarity index 100%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/room-icon.js
rename to plugins/live/assets/javascripts/discourse/lib/live/room-icon.js
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/room-message-queue.js b/plugins/live/assets/javascripts/discourse/lib/live/room-message-queue.js
similarity index 100%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/room-message-queue.js
rename to plugins/live/assets/javascripts/discourse/lib/live/room-message-queue.js
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/roster-handler.js b/plugins/live/assets/javascripts/discourse/lib/live/roster-handler.js
similarity index 95%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/roster-handler.js
rename to plugins/live/assets/javascripts/discourse/lib/live/roster-handler.js
index 12cd4794c41..27d7cade7c8 100644
--- a/plugins/voice/assets/javascripts/discourse/lib/voice/roster-handler.js
+++ b/plugins/live/assets/javascripts/discourse/lib/live/roster-handler.js
@@ -1,5 +1,5 @@
import { i18n } from "discourse-i18n";
-import voiceLog from "discourse/plugins/voice/discourse/lib/voice/logger";
+import liveLog from "discourse/plugins/live/discourse/lib/live/logger";
import {
playUserJoinedSound,
playUserLeftSound,
@@ -105,8 +105,8 @@ export default class RosterHandler {
);
const currentUserId = this.#getCurrentUserId();
- voiceLog.info(
- `[voice] handleParticipants room=${roomId}, count=${participantIds.size}`
+ liveLog.info(
+ `[live] handleParticipants room=${roomId}, count=${participantIds.size}`
);
if (this.#roleChangeInProgress.has(roomId)) {
@@ -163,7 +163,7 @@ export default class RosterHandler {
hasNewPeer = true;
}
- voiceLog.info("[voice] creating peer connection");
+ liveLog.info("[live] creating peer connection");
await this.#createAndOfferPeer(roomId, participantId);
} else {
@@ -221,7 +221,7 @@ export default class RosterHandler {
if (isSelf && !payload.raised && payload.reason === "dismissed") {
this.#toasts.default({
duration: 5000,
- data: { message: i18n("voice.stage.request_dismissed") },
+ data: { message: i18n("live.stage.request_dismissed") },
});
return;
}
@@ -235,7 +235,7 @@ export default class RosterHandler {
this.#toasts.default({
duration: 5000,
data: {
- message: i18n("voice.stage.hand_raised_toast", {
+ message: i18n("live.stage.hand_raised_toast", {
username: participant.username,
}),
},
@@ -363,7 +363,7 @@ export default class RosterHandler {
this.#toasts.success({
duration: 5000,
- data: { message: i18n("voice.stage.promoted_to_speaker") },
+ data: { message: i18n("live.stage.promoted_to_speaker") },
});
} else {
if (this.#getLocalVideoKind()) {
@@ -373,7 +373,7 @@ export default class RosterHandler {
this.#setMicEnabled(false);
this.#toasts.default({
duration: 5000,
- data: { message: i18n("voice.stage.demoted_to_listener") },
+ data: { message: i18n("live.stage.demoted_to_listener") },
});
}
@@ -389,8 +389,8 @@ export default class RosterHandler {
try {
await this.#livekit.sessionFor(roomId)?.refreshPublications();
} catch {
- voiceLog.warn(
- `[voice-livekit] failed to refresh publications after a role change in room ${roomId}`
+ liveLog.warn(
+ `[live-livekit] failed to refresh publications after a role change in room ${roomId}`
);
}
}
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/sanitize-error.js b/plugins/live/assets/javascripts/discourse/lib/live/sanitize-error.js
similarity index 100%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/sanitize-error.js
rename to plugins/live/assets/javascripts/discourse/lib/live/sanitize-error.js
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/sdp-utils.js b/plugins/live/assets/javascripts/discourse/lib/live/sdp-utils.js
similarity index 100%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/sdp-utils.js
rename to plugins/live/assets/javascripts/discourse/lib/live/sdp-utils.js
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/signaling.js b/plugins/live/assets/javascripts/discourse/lib/live/signaling.js
similarity index 95%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/signaling.js
rename to plugins/live/assets/javascripts/discourse/lib/live/signaling.js
index 24e20f7feb4..ed355596dd1 100644
--- a/plugins/voice/assets/javascripts/discourse/lib/voice/signaling.js
+++ b/plugins/live/assets/javascripts/discourse/lib/live/signaling.js
@@ -1,5 +1,5 @@
import { ajax } from "discourse/lib/ajax";
-import voiceLog from "discourse/plugins/voice/discourse/lib/voice/logger";
+import liveLog from "discourse/plugins/live/discourse/lib/live/logger";
export default class SignalingManager {
static peerKey(roomId, userId) {
@@ -70,7 +70,7 @@ export default class SignalingManager {
this.#requestSignals =
requestSignals ??
((roomId, payload) =>
- ajax(`/voice/rooms/${roomId}/signal`, {
+ ajax(`/live/rooms/${roomId}/signal`, {
type: "POST",
data: {
payload,
@@ -225,7 +225,7 @@ export default class SignalingManager {
if (queue.length >= this.#candidateBatchSize) {
this.flushQueued(roomId, recipientId).catch(() => {
- voiceLog.warn("[voice] failed to flush signal queue");
+ liveLog.warn("[live] failed to flush signal queue");
});
return;
}
@@ -238,7 +238,7 @@ export default class SignalingManager {
const timer = setTimeout(() => {
this.#signalFlushTimers.delete(key);
this.flushQueued(roomId, recipientId).catch(() => {
- voiceLog.warn("[voice] failed to flush signal queue");
+ liveLog.warn("[live] failed to flush signal queue");
});
}, this.#candidateBatchDelayMs);
@@ -290,7 +290,7 @@ export default class SignalingManager {
this.#httpSignalFlushTimers.delete(roomId);
}
this.#flushHttp(roomId).catch(() => {
- voiceLog.warn("[voice] failed to flush HTTP signal queue");
+ liveLog.warn("[live] failed to flush HTTP signal queue");
});
} else {
this.#scheduleHttpFlush(roomId);
@@ -307,7 +307,7 @@ export default class SignalingManager {
const timer = setTimeout(() => {
this.#httpSignalFlushTimers.delete(roomId);
this.#flushHttp(roomId).catch(() => {
- voiceLog.warn("[voice] failed to flush HTTP signal queue");
+ liveLog.warn("[live] failed to flush HTTP signal queue");
});
}, this.#httpBatchDelayMs);
@@ -371,8 +371,8 @@ export default class SignalingManager {
const payload = SignalingManager.#buildPayload(messages);
- voiceLog.info(
- `[voice] 🚀 sending ${messages.length} batched signal recipient(s) in room ${roomId}`
+ liveLog.info(
+ `[live] 🚀 sending ${messages.length} batched signal recipient(s) in room ${roomId}`
);
try {
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/sound-effects.js b/plugins/live/assets/javascripts/discourse/lib/live/sound-effects.js
similarity index 100%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/sound-effects.js
rename to plugins/live/assets/javascripts/discourse/lib/live/sound-effects.js
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/speak-queue.js b/plugins/live/assets/javascripts/discourse/lib/live/speak-queue.js
similarity index 100%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/speak-queue.js
rename to plugins/live/assets/javascripts/discourse/lib/live/speak-queue.js
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/stage-roles.js b/plugins/live/assets/javascripts/discourse/lib/live/stage-roles.js
similarity index 100%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/stage-roles.js
rename to plugins/live/assets/javascripts/discourse/lib/live/stage-roles.js
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/stt-models.js b/plugins/live/assets/javascripts/discourse/lib/live/stt-models.js
similarity index 88%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/stt-models.js
rename to plugins/live/assets/javascripts/discourse/lib/live/stt-models.js
index 127fe5b4636..f3ce323f0f9 100644
--- a/plugins/voice/assets/javascripts/discourse/lib/voice/stt-models.js
+++ b/plugins/live/assets/javascripts/discourse/lib/live/stt-models.js
@@ -3,7 +3,7 @@ import { i18n } from "discourse-i18n";
// The selectable speech-to-text models. Each is a folder holding the
// worker's fixed file layout (encoder-model.onnx,
// decoder_joint-model.int8.onnx, vocab.txt) under one model root: a site's
-// mirror (voice_stt_model_base_url) or Discourse's HuggingFace repository.
+// mirror (live_stt_model_base_url) or Discourse's HuggingFace repository.
// The default root is pinned to a commit because the worker caches by URL:
// updated weights must arrive under a new URL to ever be downloaded.
//
@@ -18,6 +18,7 @@ export const DEFAULT_STT_MODEL = "ultra";
const DEFAULT_MODEL_ROOT =
"https://huggingface.co/Discourse/Discourse-STT/resolve/0862913c8a5c08254d1082747c6443a06e062988";
+// Pre-rename key, kept so saved preferences survive.
const STORAGE_KEY = "voice:stt-model";
export function isSttModel(model) {
@@ -53,5 +54,5 @@ export function setPreferredSttModel(model) {
}
export function sttModelLabel(model) {
- return i18n(`voice.voice_settings.subtitles_models.${model}`);
+ return i18n(`live.voice_settings.subtitles_models.${model}`);
}
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/subtitles.js b/plugins/live/assets/javascripts/discourse/lib/live/subtitles.js
similarity index 97%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/subtitles.js
rename to plugins/live/assets/javascripts/discourse/lib/live/subtitles.js
index 63447c9fe3f..9b0d5480978 100644
--- a/plugins/voice/assets/javascripts/discourse/lib/voice/subtitles.js
+++ b/plugins/live/assets/javascripts/discourse/lib/live/subtitles.js
@@ -1,5 +1,5 @@
-import voiceLog from "discourse/plugins/voice/discourse/lib/voice/logger";
-import { voiceAssetAppUrl, voiceAssetUrl } from "./voice-assets.js";
+import liveLog from "discourse/plugins/live/discourse/lib/live/logger";
+import { liveAssetAppUrl, liveAssetUrl } from "./live-assets.js";
// Stable filenames in the discourse_voice_assets gem's stt/ directory.
const STT_WORKER_FILE = "subtitles-worker.js";
@@ -19,10 +19,11 @@ const VAD_ASSET_DIR = "vad/";
//
// The runtime bundles are served from the plugin's public dir and only
// fetched the first time subtitles are enabled; the model weights
-// (~200-400MB, see stt-models.js) come from the `voice_stt_model_base_url`
+// (~200-400MB, see stt-models.js) come from the `live_stt_model_base_url`
// source (Discourse's HuggingFace model repository by default), kept in a
// durable Cache API store.
+// Pre-rename key, kept so saved preferences survive.
const PREFERENCE_KEY = "voice:subtitles";
// If neither "ready" nor "error" arrives in this window, something wedged
@@ -47,13 +48,13 @@ const INTERIM_WINDOW_MAX_SAMPLES = 15 * VAD_SAMPLE_RATE;
let vadModulePromise = null;
function sttUrl(file) {
- return voiceAssetUrl(`stt/${file}`);
+ return liveAssetUrl(`stt/${file}`);
}
// The one exception: workers must be same-origin, so the (small) worker
// script always loads from the app. Everything it fetches uses sttUrl.
function workerUrl() {
- return voiceAssetAppUrl(`stt/${STT_WORKER_FILE}`);
+ return liveAssetAppUrl(`stt/${STT_WORKER_FILE}`);
}
async function loadVadModule() {
@@ -422,7 +423,7 @@ export default class SubtitlesManager {
case "job-error":
// A single bad utterance isn't fatal; keep going but surface it.
- voiceLog.warn("[voice] subtitles transcription error");
+ liveLog.warn("[live] subtitles transcription error");
break;
}
}
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/transcript-draft-sync.js b/plugins/live/assets/javascripts/discourse/lib/live/transcript-draft-sync.js
similarity index 97%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/transcript-draft-sync.js
rename to plugins/live/assets/javascripts/discourse/lib/live/transcript-draft-sync.js
index f55a739d7cc..60245af21a5 100644
--- a/plugins/voice/assets/javascripts/discourse/lib/voice/transcript-draft-sync.js
+++ b/plugins/live/assets/javascripts/discourse/lib/live/transcript-draft-sync.js
@@ -3,7 +3,7 @@ const SAVE_INTERVAL_MS = 10_000;
// new_topic-prefixed so core's drafts list and resume flow treat these as
// normal new-topic drafts; the rest marks them as ours (see the draft-icon
// transformer registration).
-export const TRANSCRIPT_DRAFT_KEY_PREFIX = "new_topic_voice_";
+export const TRANSCRIPT_DRAFT_KEY_PREFIX = "new_topic_live_";
// Mirrors an in-progress transcript into a server-side topic draft so the
// recording survives a crashed tab and shows up in the user's drafts like
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/transcript-markdown.js b/plugins/live/assets/javascripts/discourse/lib/live/transcript-markdown.js
similarity index 86%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/transcript-markdown.js
rename to plugins/live/assets/javascripts/discourse/lib/live/transcript-markdown.js
index d292f644359..1f9941359a8 100644
--- a/plugins/voice/assets/javascripts/discourse/lib/voice/transcript-markdown.js
+++ b/plugins/live/assets/javascripts/discourse/lib/live/transcript-markdown.js
@@ -1,8 +1,8 @@
import { serializeBBCodeAttr } from "discourse/lib/text";
import { i18n } from "discourse-i18n";
-// chat presents this type as registered by the voice-transcript-source initializer
-export const TRANSCRIPT_SOURCE_TYPE = "voice";
+// chat presents this type as registered by the live-transcript-source initializer
+export const TRANSCRIPT_SOURCE_TYPE = "live";
// Renders a recorded transcript as post markdown. When chat is enabled the
// entries reuse chat's transcript markup — one chained [chat] block per
@@ -18,7 +18,7 @@ export function transcriptToMarkdown(
return entries
.map((entry, index) => {
const username =
- entry.username || i18n("voice.transcript.unknown_speaker");
+ entry.username || i18n("live.transcript.unknown_speaker");
if (chatMarkup) {
const timestamp = new Date(entry.startedAt).toISOString();
const source =
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/transcript-recorder.js b/plugins/live/assets/javascripts/discourse/lib/live/transcript-recorder.js
similarity index 100%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/transcript-recorder.js
rename to plugins/live/assets/javascripts/discourse/lib/live/transcript-recorder.js
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/transcription-coordinator.js b/plugins/live/assets/javascripts/discourse/lib/live/transcription-coordinator.js
similarity index 96%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/transcription-coordinator.js
rename to plugins/live/assets/javascripts/discourse/lib/live/transcription-coordinator.js
index 6c13f3f9908..af0f54fc509 100644
--- a/plugins/voice/assets/javascripts/discourse/lib/voice/transcription-coordinator.js
+++ b/plugins/live/assets/javascripts/discourse/lib/live/transcription-coordinator.js
@@ -4,7 +4,7 @@ import { manuallyTrack } from "discourse/lib/tracked-tools";
import Composer from "discourse/models/composer";
import Draft from "discourse/models/draft";
import { i18n } from "discourse-i18n";
-import voiceLog from "discourse/plugins/voice/discourse/lib/voice/logger";
+import liveLog from "discourse/plugins/live/discourse/lib/live/logger";
import {
isSttModel,
preferredSttModel,
@@ -120,7 +120,7 @@ export default class TranscriptionCoordinator {
get available() {
return (
- !!this.#siteSettings.voice_subtitles_enabled &&
+ !!this.#siteSettings.live_subtitles_enabled &&
SubtitlesManager.isSupported()
);
}
@@ -128,7 +128,7 @@ export default class TranscriptionCoordinator {
get #modelBaseUrl() {
return sttModelUrl(
this.sttModel,
- this.#siteSettings.voice_stt_model_base_url
+ this.#siteSettings.live_stt_model_base_url
);
}
@@ -305,7 +305,7 @@ export default class TranscriptionCoordinator {
}
this.#setParticipantTranscribing(roomId, transcribing);
- ajax(`/voice/rooms/${roomId}/state`, {
+ ajax(`/live/rooms/${roomId}/state`, {
type: "POST",
data: {
transcribing,
@@ -353,7 +353,7 @@ export default class TranscriptionCoordinator {
chatMarkup: !!this.#siteSettings.chat_enabled,
roomName: room?.name,
}),
- title: i18n("voice.transcript.draft_title", {
+ title: i18n("live.transcript.draft_title", {
room: room?.name ?? "",
}),
action: Composer.CREATE_TOPIC,
@@ -416,7 +416,7 @@ export default class TranscriptionCoordinator {
// Model or runtime failures turn the toggles back off (mirroring the noise
// suppression contract) so the UI never shows an enabled-but-dead state.
#handleError() {
- voiceLog.warn("[voice] subtitles failed");
+ liveLog.warn("[live] subtitles failed");
if (!this.enabled && !this.recording) {
return;
@@ -429,6 +429,6 @@ export default class TranscriptionCoordinator {
}
this.#subtitles.setEnabled(false);
this.captions = [];
- this.#showError("voice.voice_settings.subtitles_failed");
+ this.#showError("live.voice_settings.subtitles_failed");
}
}
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/url-flag.js b/plugins/live/assets/javascripts/discourse/lib/live/url-flag.js
similarity index 100%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/url-flag.js
rename to plugins/live/assets/javascripts/discourse/lib/live/url-flag.js
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/video-grid-layout.js b/plugins/live/assets/javascripts/discourse/lib/live/video-grid-layout.js
similarity index 100%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/video-grid-layout.js
rename to plugins/live/assets/javascripts/discourse/lib/live/video-grid-layout.js
diff --git a/plugins/voice/assets/javascripts/discourse/lib/voice/video-quality.js b/plugins/live/assets/javascripts/discourse/lib/live/video-quality.js
similarity index 94%
rename from plugins/voice/assets/javascripts/discourse/lib/voice/video-quality.js
rename to plugins/live/assets/javascripts/discourse/lib/live/video-quality.js
index 0b748cca5a1..4fe2a2c7924 100644
--- a/plugins/voice/assets/javascripts/discourse/lib/voice/video-quality.js
+++ b/plugins/live/assets/javascripts/discourse/lib/live/video-quality.js
@@ -1,4 +1,4 @@
-import voiceLog from "discourse/plugins/voice/discourse/lib/voice/logger";
+import liveLog from "discourse/plugins/live/discourse/lib/live/logger";
import {
QUALITY_HIGH,
QUALITY_MAXIMUM,
@@ -125,7 +125,7 @@ export async function applyVideoQuality(
Object.assign(parameters.encodings[0], encoding);
await sender.setParameters(parameters);
} catch {
- voiceLog.warn("[voice] failed to apply video quality");
+ liveLog.warn("[live] failed to apply video quality");
}
}
}
@@ -146,7 +146,7 @@ export async function applyVoiceQuality(senders, tier = QUALITY_STANDARD) {
}
await sender.setParameters(parameters);
} catch {
- voiceLog.warn("[voice] failed to apply voice quality");
+ liveLog.warn("[live] failed to apply voice quality");
}
}
}
@@ -166,6 +166,6 @@ export async function applyScreenAudioQuality(sender) {
parameters.encodings[0].maxBitrate = 128_000;
await sender.setParameters(parameters);
} catch {
- voiceLog.warn("[voice] failed to apply screen audio quality");
+ liveLog.warn("[live] failed to apply screen audio quality");
}
}
diff --git a/plugins/live/assets/javascripts/discourse/live-route-map.js b/plugins/live/assets/javascripts/discourse/live-route-map.js
new file mode 100644
index 00000000000..408740321ab
--- /dev/null
+++ b/plugins/live/assets/javascripts/discourse/live-route-map.js
@@ -0,0 +1,12 @@
+export default function () {
+ this.route("live-room", { path: "/live/r/:slug" });
+ this.route("live-room-invite", {
+ path: "/live/r/:slug/invited-by/:username",
+ });
+
+ // Links shared before the plugin was renamed.
+ this.route("live-room-legacy", { path: "/voice/r/:slug" });
+ this.route("live-room-invite-legacy", {
+ path: "/voice/r/:slug/invited-by/:username",
+ });
+}
diff --git a/plugins/live/assets/javascripts/discourse/routes/live-room-invite-legacy.js b/plugins/live/assets/javascripts/discourse/routes/live-room-invite-legacy.js
new file mode 100644
index 00000000000..9982fa4a6ea
--- /dev/null
+++ b/plugins/live/assets/javascripts/discourse/routes/live-room-invite-legacy.js
@@ -0,0 +1 @@
+export { default } from "./live-room-invite.js";
diff --git a/plugins/voice/assets/javascripts/discourse/routes/voice-room-invite.js b/plugins/live/assets/javascripts/discourse/routes/live-room-invite.js
similarity index 59%
rename from plugins/voice/assets/javascripts/discourse/routes/voice-room-invite.js
rename to plugins/live/assets/javascripts/discourse/routes/live-room-invite.js
index f6887ac120e..79f04cdd6ef 100644
--- a/plugins/voice/assets/javascripts/discourse/routes/voice-room-invite.js
+++ b/plugins/live/assets/javascripts/discourse/routes/live-room-invite.js
@@ -1,16 +1,16 @@
import { service } from "@ember/service";
import DiscourseRoute from "discourse/routes/discourse";
-import { setPendingInviteRef } from "discourse/plugins/voice/discourse/lib/voice/invite-ref";
+import { setPendingInviteRef } from "discourse/plugins/live/discourse/lib/live/invite-ref";
-// An invite link (/voice/r/:slug/invited-by/:username) is the room page
+// An invite link (/live/r/:slug/invited-by/:username) is the room page
// with the inviter remembered: the ref is held until the user actually joins
// the call, so the server credits the inviter on a real join, not a page view.
-export default class VoiceRoomInviteRoute extends DiscourseRoute {
+export default class LiveRoomInviteRoute extends DiscourseRoute {
@service router;
model(params, transition) {
setPendingInviteRef(params.slug, params.username);
- this.router.replaceWith("voice-room", params.slug, {
+ this.router.replaceWith("live-room", params.slug, {
queryParams: transition.to.queryParams,
});
}
diff --git a/plugins/live/assets/javascripts/discourse/routes/live-room-legacy.js b/plugins/live/assets/javascripts/discourse/routes/live-room-legacy.js
new file mode 100644
index 00000000000..8859e026560
--- /dev/null
+++ b/plugins/live/assets/javascripts/discourse/routes/live-room-legacy.js
@@ -0,0 +1,12 @@
+import { service } from "@ember/service";
+import DiscourseRoute from "discourse/routes/discourse";
+
+export default class LiveRoomLegacyRoute extends DiscourseRoute {
+ @service router;
+
+ model(params, transition) {
+ this.router.replaceWith("live-room", params.slug, {
+ queryParams: transition.to.queryParams,
+ });
+ }
+}
diff --git a/plugins/voice/assets/javascripts/discourse/routes/voice-room.js b/plugins/live/assets/javascripts/discourse/routes/live-room.js
similarity index 77%
rename from plugins/voice/assets/javascripts/discourse/routes/voice-room.js
rename to plugins/live/assets/javascripts/discourse/routes/live-room.js
index 6f922a3a2d3..e8ddb46bae7 100644
--- a/plugins/voice/assets/javascripts/discourse/routes/voice-room.js
+++ b/plugins/live/assets/javascripts/discourse/routes/live-room.js
@@ -2,23 +2,23 @@ import { service } from "@ember/service";
import { ajax } from "discourse/lib/ajax";
import { homepageNavigationDestination } from "discourse/lib/homepage-router-overrides";
import DiscourseRoute from "discourse/routes/discourse";
-import urlFlagSet from "discourse/plugins/voice/discourse/lib/voice/url-flag";
+import urlFlagSet from "discourse/plugins/live/discourse/lib/live/url-flag";
-export default class VoiceRoomRoute extends DiscourseRoute {
+export default class LiveRoomRoute extends DiscourseRoute {
@service currentUser;
- @service voiceRooms;
- @service voiceWebrtc;
+ @service liveRooms;
+ @service liveWebrtc;
@service router;
async model(params) {
- await this.voiceRooms.ready;
+ await this.liveRooms.ready;
- const room = this.voiceRooms.roomBySlug(params.slug);
+ const room = this.liveRooms.roomBySlug(params.slug);
if (room) {
return room;
}
- const response = await ajax(`/voice/rooms/${params.slug}.json`);
+ const response = await ajax(`/live/rooms/${params.slug}.json`);
return response.room;
}
@@ -27,8 +27,8 @@ export default class VoiceRoomRoute extends DiscourseRoute {
return;
}
- this.voiceWebrtc.setCallWidgetHidden(false);
- this.voiceWebrtc.join(room);
+ this.liveWebrtc.setCallWidgetHidden(false);
+ this.liveWebrtc.join(room);
// The widget only renders off the room page, so the room page is never
// entered: navigating within the app stays put, and a full page load lands
diff --git a/plugins/voice/assets/javascripts/discourse/templates/voice-room.gjs b/plugins/live/assets/javascripts/discourse/templates/live-room.gjs
similarity index 62%
rename from plugins/voice/assets/javascripts/discourse/templates/voice-room.gjs
rename to plugins/live/assets/javascripts/discourse/templates/live-room.gjs
index e19d19fe16b..97691643748 100644
--- a/plugins/voice/assets/javascripts/discourse/templates/voice-room.gjs
+++ b/plugins/live/assets/javascripts/discourse/templates/live-room.gjs
@@ -1,7 +1,7 @@
-import VoiceRoomPage from "discourse/plugins/voice/discourse/components/voice/room-page";
+import LiveRoomPage from "discourse/plugins/live/discourse/components/live/room-page";
export default <template>
- <VoiceRoomPage
+ <LiveRoomPage
@autoJoin={{@controller.join}}
@dockOnJoin={{@controller.dockOnJoin}}
@openChat={{@controller.chat}}
diff --git a/plugins/voice/assets/stylesheets/common/voice-admin.scss b/plugins/live/assets/stylesheets/common/live-admin.scss
similarity index 96%
rename from plugins/voice/assets/stylesheets/common/voice-admin.scss
rename to plugins/live/assets/stylesheets/common/live-admin.scss
index 9efb784d2d8..a260cf5ba81 100644
--- a/plugins/voice/assets/stylesheets/common/voice-admin.scss
+++ b/plugins/live/assets/stylesheets/common/live-admin.scss
@@ -1,8 +1,8 @@
-.voice-rooms-table {
+.live-rooms-table {
margin-top: 1.5em;
}
-.voice-rooms {
+.live-rooms {
&__creator-link {
display: flex;
width: fit-content;
@@ -17,7 +17,7 @@
}
}
-.voice-dashboard {
+.live-dashboard {
&__header {
display: flex;
align-items: center;
@@ -76,7 +76,7 @@
}
}
-.voice-livekit-status {
+.live-livekit-status {
margin-top: 2em;
padding: 1em;
background: var(--primary-very-low);
@@ -142,7 +142,7 @@
}
}
-.voice-recordings {
+.live-recordings {
&__status-badge {
display: inline-block;
padding: 0.1em 0.5em;
diff --git a/plugins/voice/assets/stylesheets/common/voice-chat.scss b/plugins/live/assets/stylesheets/common/live-chat.scss
similarity index 96%
rename from plugins/voice/assets/stylesheets/common/voice-chat.scss
rename to plugins/live/assets/stylesheets/common/live-chat.scss
index 21452cc52c8..cf59ed74fdd 100644
--- a/plugins/voice/assets/stylesheets/common/voice-chat.scss
+++ b/plugins/live/assets/stylesheets/common/live-chat.scss
@@ -1,4 +1,4 @@
-.voice-chat {
+.live-chat {
// border-box so the 22rem min-width (set by the room sidebar) includes the
// borders — content-box would make the panel 2px wider than the sidebar,
// whose overflow: hidden then clips the right border off.
@@ -37,7 +37,7 @@
// The chat toggle in the room's control bar is the close affordance; only
// the narrow-viewport layout needs an X of its own, because there the
// panel becomes a drawer overlaying that control bar. Breakpoint matches
- // the sidebar drawer in voice-room-page.scss.
+ // the sidebar drawer in live-room-page.scss.
display: none;
@media (width <= 1000px) {
@@ -64,7 +64,7 @@
// thread swap so it doesn't read as a flicker.
.chat-thread {
height: 100% !important;
- animation: voice-chat-fade-in 0.15s ease-out;
+ animation: live-chat-fade-in 0.15s ease-out;
@media (prefers-reduced-motion: reduce) {
animation: none;
@@ -152,7 +152,7 @@
}
}
-@keyframes voice-chat-fade-in {
+@keyframes live-chat-fade-in {
from {
opacity: 0;
}
diff --git a/plugins/voice/assets/stylesheets/common/voice-room-page.scss b/plugins/live/assets/stylesheets/common/live-room-page.scss
similarity index 90%
rename from plugins/voice/assets/stylesheets/common/voice-room-page.scss
rename to plugins/live/assets/stylesheets/common/live-room-page.scss
index 771251997a9..21d1d73feb1 100644
--- a/plugins/voice/assets/stylesheets/common/voice-room-page.scss
+++ b/plugins/live/assets/stylesheets/common/live-room-page.scss
@@ -2,13 +2,13 @@
// stays visible and grabbable, while everything that already outranked the
// header (mobile composer, fullscreen layers, modals) keeps outranking the
// widget. Menus opened from the widget sit one step higher still.
-$voice-widget-z: z("header") + 1;
+$live-widget-z: z("header") + 1;
-.voice-call-widget {
+.live-call-widget {
position: fixed;
inset-inline-end: max(1rem, env(safe-area-inset-right));
inset-block-end: max(1rem, env(safe-area-inset-bottom));
- z-index: $voice-widget-z;
+ z-index: $live-widget-z;
// border-box so the inline width/height set during resize match the
// border-box geometry the resize math measures (getBoundingClientRect);
@@ -67,10 +67,10 @@ $voice-widget-z: z("header") + 1;
overflow: hidden;
}
- .voice-video-tile {
+ .live-video-tile {
flex: 0 0 auto;
- width: var(--voice-tile-width, 45%);
- height: var(--voice-tile-height, 5rem);
+ width: var(--live-tile-width, 45%);
+ height: var(--live-tile-height, 5rem);
min-height: 0;
transition:
width 0.2s ease-out,
@@ -88,8 +88,8 @@ $voice-widget-z: z("header") + 1;
align-items: center;
justify-content: center;
gap: 0.25rem;
- width: var(--voice-tile-width, 45%);
- height: var(--voice-tile-height, 5rem);
+ width: var(--live-tile-width, 45%);
+ height: var(--live-tile-height, 5rem);
overflow: hidden;
padding: 0;
border: none;
@@ -133,16 +133,16 @@ $voice-widget-z: z("header") + 1;
font-size: var(--font-down-1);
}
- .voice-video-tile__fullscreen {
+ .live-video-tile__fullscreen {
display: none;
}
- .voice-video-tile__avatar img {
+ .live-video-tile__avatar img {
width: 2.75rem;
height: 2.75rem;
}
- .voice-video-tile__info {
+ .live-video-tile__info {
font-size: var(--font-down-2);
}
@@ -153,7 +153,7 @@ $voice-widget-z: z("header") + 1;
// Stretch (not center) so every control shares the tallest button's height;
// icon-only DMenu triggers render a few px shorter otherwise. See the
- // matching note on .voice-room-page__controls.
+ // matching note on .live-room-page__controls.
align-items: stretch;
gap: 0.35rem;
@@ -173,7 +173,7 @@ $voice-widget-z: z("header") + 1;
height: auto;
padding: var(--space-2);
- .voice-call-widget__controls {
+ .live-call-widget__controls {
flex-wrap: nowrap;
}
}
@@ -181,7 +181,7 @@ $voice-widget-z: z("header") + 1;
&.--dragging {
user-select: none;
- .voice-call-widget__room {
+ .live-call-widget__room {
cursor: grabbing;
}
}
@@ -226,7 +226,7 @@ $voice-widget-z: z("header") + 1;
// On touch devices the widget is a full-width bottom dock: corner resize is
// hidden (component-side) and the header only drags it vertically, since
// free positioning and tiny corner handles are awkward with a finger.
-html.discourse-touch .voice-call-widget {
+html.discourse-touch .live-call-widget {
inset-inline: 0.5rem;
width: auto;
height: min(19rem, 45vh);
@@ -236,7 +236,7 @@ html.discourse-touch .voice-call-widget {
}
}
-.voice-room-page {
+.live-room-page {
display: flex;
flex-direction: column;
gap: 1em;
@@ -292,15 +292,15 @@ html.discourse-touch .voice-call-widget {
// Animating the width (not just fading in place) makes the whole layout
// ease — the video column and controls resize smoothly instead of
// jumping the moment the panel claims its space.
- animation: voice-sidebar-in 0.25s ease-out;
+ animation: live-sidebar-in 0.25s ease-out;
&.--closing {
- animation: voice-sidebar-out 0.2s ease-in forwards;
+ animation: live-sidebar-out 0.2s ease-in forwards;
}
// The panel keeps its full-width layout and gets revealed/clipped by the
// animating box, rather than squishing and rewrapping every frame.
- .voice-chat {
+ .live-chat {
min-width: 22rem;
}
@@ -347,14 +347,14 @@ html.discourse-touch .voice-call-widget {
border-radius: var(--d-border-radius);
background: var(--secondary);
- .voice-video-tile {
+ .live-video-tile {
width: 100%;
height: 100%;
border-radius: calc(var(--d-border-radius) - 1px);
}
- .voice-video-tile.--screen .voice-video-tile__video,
- .voice-video-tile.--avatar .voice-video-tile__video {
+ .live-video-tile.--screen .live-video-tile__video,
+ .live-video-tile.--avatar .live-video-tile__video {
object-fit: contain;
}
}
@@ -369,7 +369,7 @@ html.discourse-touch .voice-call-widget {
overflow: auto;
padding-inline-end: 1px;
- .voice-video-tile {
+ .live-video-tile {
width: 100%;
height: 100%;
}
@@ -456,15 +456,15 @@ html.discourse-touch .voice-call-widget {
}
}
-// Split "combo" button (mic/camera) shared by VoiceCallControls in both the
+// Split "combo" button (mic/camera) shared by LiveCallControls in both the
// room page and the widget: the main toggle and its caret read as one button.
// The main button drops its trailing border so the caret's leading border is
// the only divider between them.
-.voice-call-controls__combo {
+.live-call-controls__combo {
display: inline-flex;
align-items: stretch;
- .voice-call-controls__combo-main {
+ .live-call-controls__combo-main {
position: relative;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
@@ -473,7 +473,7 @@ html.discourse-touch .voice-call-widget {
// Same look as the sidebar room lock: a tiny unobtrusive glyph tucked
// into the button's top-right corner, no backdrop.
- .voice-call-controls__ns-badge {
+ .live-call-controls__ns-badge {
position: absolute;
top: 0.15em;
right: 0.2em;
@@ -485,11 +485,11 @@ html.discourse-touch .voice-call-widget {
}
&.--starting {
- animation: voice-ns-badge-pulse 1s ease-in-out infinite;
+ animation: live-ns-badge-pulse 1s ease-in-out infinite;
}
}
- .voice-call-controls__combo-caret {
+ .live-call-controls__combo-caret {
margin-inline-start: 0;
padding-inline: 0.4em;
border-top-left-radius: 0;
@@ -501,7 +501,7 @@ html.discourse-touch .voice-call-widget {
// Live subtitles. A zero-height flow child between the video area and the
// control bar: lines are packed toward the bottom so they overflow upward,
// floating over the tiles without shifting the layout when they appear.
-.voice-captions {
+.live-captions {
align-self: center;
width: min(100%, 46rem);
height: 0;
@@ -543,16 +543,16 @@ html.discourse-touch .voice-call-widget {
}
}
-@keyframes voice-ns-badge-pulse {
+@keyframes live-ns-badge-pulse {
50% {
opacity: 0.4;
}
}
-.voice-speak-queue-trigger {
+.live-speak-queue-trigger {
position: relative;
- .voice-speak-queue-trigger__count {
+ .live-speak-queue-trigger__count {
position: absolute;
top: -0.4em;
right: -0.4em;
@@ -567,7 +567,7 @@ html.discourse-touch .voice-call-widget {
}
}
-.voice-speak-queue {
+.live-speak-queue {
min-width: 16em;
padding: 0.5em;
@@ -626,21 +626,21 @@ html.discourse-touch .voice-call-widget {
// persistent call widget sits above the site header and would otherwise cover
// any menu opened from it. Lift the call menus above the widget. Harmless on
// the room page, which has no competing high-z layer.
-.fk-d-menu[data-identifier^="voice-"] {
- z-index: $voice-widget-z + 1;
+.fk-d-menu[data-identifier^="live-"] {
+ z-index: $live-widget-z + 1;
}
// Below this the 22rem sidebar would squash the video column into a sliver,
// so instead of sitting beside it the panel becomes a full-height drawer over
// the page (above the docked call widget). Keep in sync with the close-button
-// breakpoint in voice-chat.scss.
+// breakpoint in live-chat.scss.
@media (width <= 1000px) {
- .voice-room-page__presentation {
+ .live-room-page__presentation {
grid-template-columns: 1fr;
grid-template-rows: minmax(0, 1fr) auto;
}
- .voice-room-page__presentation-rail {
+ .live-room-page__presentation-rail {
grid-auto-flow: column;
grid-auto-columns: minmax(8rem, 11rem);
grid-auto-rows: 6rem;
@@ -649,7 +649,7 @@ html.discourse-touch .voice-call-widget {
padding-block-end: 1px;
}
- .voice-room-page__sidebar {
+ .live-room-page__sidebar {
position: fixed;
inset-block: var(--header-offset, 4em) 0;
inset-inline: 0;
@@ -657,27 +657,27 @@ html.discourse-touch .voice-call-widget {
flex: none;
width: auto;
background: var(--secondary);
- animation-name: voice-drawer-in;
+ animation-name: live-drawer-in;
&.--closing {
- animation-name: voice-drawer-out;
+ animation-name: live-drawer-out;
}
- .voice-chat {
+ .live-chat {
min-width: 0;
}
}
}
-.voice-video-tile {
+.live-video-tile {
position: relative;
flex: 0 0 auto;
// Rows share a height (computed per layout, published as
- // --voice-tile-height); each tile sets its own aspect-ratio inline from
+ // --live-tile-height); each tile sets its own aspect-ratio inline from
// its measured video, so portrait and landscape feeds coexist without
// cropping. The fallback height covers first paint before measurement.
- height: var(--voice-tile-height, 12em);
+ height: var(--live-tile-height, 12em);
// The computed height always lags the layout by a beat (resize observer →
// re-render); the hard cap keeps a stale value from ever growing the tile
@@ -812,7 +812,7 @@ html.discourse-touch .voice-call-widget {
}
}
-@keyframes voice-sidebar-in {
+@keyframes live-sidebar-in {
from {
flex-basis: 0;
width: 0;
@@ -826,7 +826,7 @@ html.discourse-touch .voice-call-widget {
}
}
-@keyframes voice-sidebar-out {
+@keyframes live-sidebar-out {
from {
flex-basis: 22rem;
width: 22rem;
@@ -842,7 +842,7 @@ html.discourse-touch .voice-call-widget {
// The narrow-viewport drawer overlays the page instead of participating in
// its layout, so it slides over from the edge rather than animating width.
-@keyframes voice-drawer-in {
+@keyframes live-drawer-in {
from {
transform: translateX(100%);
}
@@ -852,7 +852,7 @@ html.discourse-touch .voice-call-widget {
}
}
-@keyframes voice-drawer-out {
+@keyframes live-drawer-out {
from {
transform: none;
}
@@ -862,7 +862,7 @@ html.discourse-touch .voice-call-widget {
}
}
-.voice-ringing-tile {
+.live-ringing-tile {
// No measured video to derive a shape from — assume the default tile
// aspect so it packs into the grid like everyone else.
aspect-ratio: 16 / 9;
@@ -881,7 +881,7 @@ html.discourse-touch .voice-call-widget {
.d-icon {
font-size: var(--font-up-4);
color: var(--primary-medium);
- animation: voice-ringing-pulse 1.4s ease-in-out infinite;
+ animation: live-ringing-pulse 1.4s ease-in-out infinite;
@media (prefers-reduced-motion: reduce) {
animation: none;
@@ -889,12 +889,12 @@ html.discourse-touch .voice-call-widget {
}
}
- .voice-video-tile__name {
+ .live-video-tile__name {
font-style: italic;
}
}
-@keyframes voice-ringing-pulse {
+@keyframes live-ringing-pulse {
0%,
100% {
transform: scale(1);
diff --git a/plugins/voice/assets/stylesheets/common/voice.scss b/plugins/live/assets/stylesheets/common/live.scss
similarity index 93%
rename from plugins/voice/assets/stylesheets/common/voice.scss
rename to plugins/live/assets/stylesheets/common/live.scss
index d02b90e1ee1..55a553a8656 100644
--- a/plugins/voice/assets/stylesheets/common/voice.scss
+++ b/plugins/live/assets/stylesheets/common/live.scss
@@ -1,4 +1,4 @@
-.sidebar-section-link.voice-sidebar-link {
+.sidebar-section-link.live-sidebar-link {
.sidebar-section-link-suffix {
font-size: var(--font-down-2);
@@ -7,12 +7,12 @@
}
}
- &.voice-sidebar-link--connecting .sidebar-section-link-suffix .d-icon {
+ &.live-sidebar-link--connecting .sidebar-section-link-suffix .d-icon {
animation: spin 1s linear infinite;
}
}
-.voice-sidebar-participant {
+.live-sidebar-participant {
// Indent so participant avatars start where the room name text starts,
// making rows read unambiguously as children of the room above.
padding-left: calc(
@@ -54,7 +54,7 @@
// Every applicable state icon renders together, in a fixed order
// (hand raised, screenshare, camera, PTT, muted, deafened), at one size
// and color.
- .voice-participant-suffix {
+ .live-participant-suffix {
margin-left: auto;
display: inline-flex;
align-items: center;
@@ -200,7 +200,7 @@
3px 70%,
3px 50%;
background-repeat: no-repeat;
- animation: voice-audio-bars 0.8s ease-in-out infinite;
+ animation: live-audio-bars 0.8s ease-in-out infinite;
@media (prefers-reduced-motion: reduce) {
animation: none;
@@ -210,7 +210,7 @@
}
}
-@keyframes voice-audio-bars {
+@keyframes live-audio-bars {
0%,
100% {
background-size:
@@ -241,7 +241,7 @@
}
}
-.voice-room {
+.live-room {
padding: 1.5em;
&__header {
@@ -280,7 +280,7 @@
}
}
-.voice-voice-canvas {
+.live-voice-canvas {
position: absolute;
width: 0;
height: 0;
@@ -296,7 +296,7 @@
// Core lays the toggle field out as a single flex row, which crams the
// description beside the control once the field goes full width. Regroup it:
// title and description stacked on the left, control centered on the right.
-.voice-room-form__form {
+.live-room-form__form {
.form-kit__field-toggle {
box-sizing: border-box;
display: grid;
@@ -319,7 +319,7 @@
}
}
- .voice-room-form__manage-members {
+ .live-room-form__manage-members {
padding: 0;
font-size: var(--font-down-1);
@@ -331,26 +331,26 @@
}
}
-.voice-room-form {
- .voice-admin-back {
+.live-room-form {
+ .live-admin-back {
margin-bottom: 1em;
}
- .voice-room-form__form {
+ .live-room-form__form {
max-width: 600px;
}
// `.form-kit` spaces its own direct children with a flex gap; wrapping the
// chat fields in this container opts them out of that, so it needs the same
// treatment to keep a consistent rhythm with the rest of the form.
- .voice-room-form__chat {
+ .live-room-form__chat {
display: flex;
flex-direction: column;
gap: 1.5em;
align-items: flex-start;
}
- .voice-room-form__quality {
+ .live-room-form__quality {
align-self: stretch;
summary {
@@ -365,8 +365,8 @@
}
}
-.voice-create-room-modal {
- .voice-room-form__form {
+.live-create-room-modal {
+ .live-room-form__form {
max-width: 100%;
}
@@ -381,14 +381,14 @@
}
}
-.voice-room-sidebar-context-menu {
+.live-room-sidebar-context-menu {
.btn {
width: 100%;
justify-content: flex-start;
}
}
-.voice-participant-sidebar-context-menu {
+.live-participant-sidebar-context-menu {
min-width: 200px;
.btn {
@@ -454,7 +454,7 @@
}
}
-.voice-ptt-key-capture {
+.live-ptt-key-capture {
display: flex;
flex-direction: row;
align-items: center;
@@ -492,7 +492,7 @@
flex-shrink: 0;
}
- .btn.btn-flat.voice-ptt-key-capture__confirm:not(:disabled) {
+ .btn.btn-flat.live-ptt-key-capture__confirm:not(:disabled) {
color: var(--success);
.d-icon {
@@ -504,7 +504,7 @@
}
}
- .btn.btn-flat.voice-ptt-key-capture__cancel {
+ .btn.btn-flat.live-ptt-key-capture__cancel {
color: var(--danger);
.d-icon {
@@ -517,14 +517,14 @@
}
}
-.voice-sidebar-participant__ptt-badge {
+.live-sidebar-participant__ptt-badge {
font-size: var(--font-down-2);
color: var(--tertiary);
font-weight: 600;
margin-left: 0.25rem;
}
-.voice-room-info-modal {
+.live-room-info-modal {
.d-modal__body {
padding: 0;
}
@@ -814,7 +814,7 @@
&__edit-form {
padding: 1.5rem;
- .voice-room-form__form {
+ .live-room-form__form {
max-width: 100%;
}
@@ -830,7 +830,7 @@
}
}
-.voice-voice-settings {
+.live-voice-settings {
display: flex;
flex-direction: column;
gap: 1.25rem;
@@ -872,7 +872,7 @@
border-radius: 0.375rem;
background: var(--primary-low);
- &.--open .voice-voice-settings__meter-fill {
+ &.--open .live-voice-settings__meter-fill {
background: var(--success);
}
}
@@ -913,7 +913,7 @@
}
}
-.voice-video-settings {
+.live-video-settings {
display: flex;
flex-direction: column;
gap: 1.25rem;
@@ -965,7 +965,7 @@
// A quiet pill: the label stays muted like any secondary metadata; only the
// small dot carries the "live" red.
-.voice-recording-badge {
+.live-recording-badge {
display: inline-flex;
align-items: center;
flex-shrink: 0;
@@ -984,7 +984,7 @@
width: 0.5em;
height: 0.5em;
color: var(--danger);
- animation: voice-recording-pulse 2s ease-in-out infinite;
+ animation: live-recording-pulse 2s ease-in-out infinite;
@media (prefers-reduced-motion: reduce) {
animation: none;
@@ -994,7 +994,7 @@
// Same quiet pill as the recording badge, minus the "live" red: the
// transcript is local to this user, not a room-wide broadcast.
-.voice-transcript-badge {
+.live-transcript-badge {
display: inline-flex;
align-items: center;
flex-shrink: 0;
@@ -1018,7 +1018,7 @@
width: 0.85em;
height: 0.85em;
color: var(--tertiary);
- animation: voice-recording-pulse 2s ease-in-out infinite;
+ animation: live-recording-pulse 2s ease-in-out infinite;
@media (prefers-reduced-motion: reduce) {
animation: none;
@@ -1026,11 +1026,11 @@
}
}
-.fk-d-tooltip__content.voice-transcript-badge-content {
+.fk-d-tooltip__content.live-transcript-badge-content {
font-size: var(--font-down-1);
}
-.voice-room-page__transcript-toggle {
+.live-room-page__transcript-toggle {
&.--recording {
.d-icon {
color: var(--danger);
@@ -1038,11 +1038,11 @@
}
}
-.voice-call-controls__record {
+.live-call-controls__record {
&.--recording {
.d-icon {
color: var(--danger);
- animation: voice-recording-pulse 2s ease-in-out infinite;
+ animation: live-recording-pulse 2s ease-in-out infinite;
@media (prefers-reduced-motion: reduce) {
animation: none;
@@ -1051,7 +1051,7 @@
}
}
-@keyframes voice-recording-pulse {
+@keyframes live-recording-pulse {
0%,
100% {
opacity: 1;
@@ -1062,13 +1062,13 @@
}
}
-.voice-call-menu__device-row {
+.live-call-menu__device-row {
.d-button-label {
flex: 1 1 auto;
text-align: left;
}
- .voice-call-menu__current-device {
+ .live-call-menu__current-device {
max-width: 11em;
overflow: hidden;
white-space: nowrap;
@@ -1081,7 +1081,7 @@
}
}
-.voice-invite-modal {
+.live-invite-modal {
.d-modal__body {
display: flex;
flex-direction: column;
@@ -1178,7 +1178,7 @@
}
}
-.voice-mesh-privacy-warning-modal {
+.live-mesh-privacy-warning-modal {
.d-modal__container {
max-width: 32rem;
}
@@ -1200,7 +1200,7 @@
}
}
-.voice-mic-permission-modal {
+.live-mic-permission-modal {
.d-modal__container {
max-width: 32rem;
}
@@ -1214,7 +1214,7 @@
}
}
-.voice-incoming-call-modal {
+.live-incoming-call-modal {
.d-modal__container {
max-width: 22rem;
}
@@ -1250,11 +1250,11 @@
@media (prefers-reduced-motion: no-preference) {
&::before {
- animation: voice-call-pulse 2s ease-out infinite;
+ animation: live-call-pulse 2s ease-out infinite;
}
&::after {
- animation: voice-call-pulse 2s ease-out 1s infinite;
+ animation: live-call-pulse 2s ease-out 1s infinite;
}
}
}
@@ -1286,7 +1286,7 @@
}
}
-@keyframes voice-call-pulse {
+@keyframes live-call-pulse {
0% {
transform: scale(1);
opacity: 0.5;
@@ -1298,7 +1298,7 @@
}
}
-.voice-invite-agent-modal {
+.live-invite-agent-modal {
&__hint {
margin: 0 0 1em;
font-size: var(--font-down-1);
diff --git a/plugins/voice/config/locales/client.en.yml b/plugins/live/config/locales/client.en.yml
similarity index 93%
rename from plugins/voice/config/locales/client.en.yml
rename to plugins/live/config/locales/client.en.yml
index 86262038c5b..39a0734d8d8 100644
--- a/plugins/voice/config/locales/client.en.yml
+++ b/plugins/live/config/locales/client.en.yml
@@ -1,16 +1,16 @@
en:
js:
- voice:
+ live:
about:
participants:
one: "%{formatted_number} person joined voice chats"
other: "%{formatted_number} people joined voice chats"
sidebar:
- title: "Voice rooms"
+ title: "Live rooms"
create: "Create room"
- empty: "No voice rooms yet."
+ empty: "No live rooms yet."
room:
- join: "Join voice room"
+ join: "Join live room"
leave: "Leave room"
info: "Room info"
edit: "Edit room"
@@ -54,7 +54,7 @@ en:
room_page:
empty: "No one is here yet — join to get things started."
widget:
- title: "Active voice room: %{room}"
+ title: "Active live room: %{room}"
open_chat: "Open room chat"
expand: "Expand call widget"
hide: "Hide call widget"
@@ -73,7 +73,7 @@ en:
composer_placeholder: "Message the room…"
send: "Send"
open_in_chat: "Open in chat"
- back_to_voice_room: "Back to voice room"
+ back_to_live_room: "Back to live room"
video:
camera_on: "Turn on camera"
camera_off: "Turn off camera"
@@ -103,14 +103,14 @@ en:
click_to_unmute: "Click to unmute."
disconnected: "You were disconnected from %{room} due to inactivity."
livekit:
- browser_unsupported: "Your browser can't connect to this site's voice server. Try updating it or using a different browser."
- connect_failed: "Your network cannot reach the voice server. Check your connection or contact your administrator."
- reconnect_failed: "The connection to the voice server was lost, so you left the call. Rejoin to reconnect."
+ browser_unsupported: "Your browser can't connect to this site's live server. Try updating it or using a different browser."
+ connect_failed: "Your network cannot reach the live server. Check your connection or contact your administrator."
+ reconnect_failed: "The connection to the live server was lost, so you left the call. Rejoin to reconnect."
room_ended: "The call ended while you were disconnected. Rejoin to start a new one."
duplicate_tab: "This call continued in another tab or window, so this one was disconnected."
mic_permission:
title: "Your microphone is blocked"
- body: "Voice rooms need microphone access, but your browser is blocking it for this site — usually because access was denied here before and the browser recorded that choice."
+ body: "Live rooms need microphone access, but your browser is blocking it for this site — usually because access was denied here before and the browser recorded that choice."
instructions: "To fix it, open the site permissions in your browser (the lock or settings icon next to the address bar), allow the microphone, and try joining again."
ok: "Got it"
mesh_privacy_warning:
@@ -296,7 +296,7 @@ en:
sent:
one: "Invite sent."
other: "%{count} invites sent."
- skipped: "%{usernames} can't be invited because they don't have access to voice rooms."
+ skipped: "%{usernames} can't be invited because they don't have access to live rooms."
memberships:
add_user: "Add participant"
remove_user: "Remove participant"
@@ -309,11 +309,11 @@ en:
deploy_hint: "Ensure your agent is deployed before adding it to this call."
invited: "Agent invited. It will appear when LiveKit connects it. This can take about a minute."
admin:
- title: "Voice"
+ title: "Live"
dashboard_title: "Dashboard"
recordings_title: "Recordings"
recordings:
- webhook_config_hint: "No LiveKit webhooks have been received recently. Configure a webhook in LiveKit pointing to %{webhook_url}. Use the same API key configured in the voice livekit api key site setting and include egress_ended events so recording statuses and download notifications update when recordings finish."
+ webhook_config_hint: "No LiveKit webhooks have been received recently. Configure a webhook in LiveKit pointing to %{webhook_url}. Use the same API key configured in the live livekit api key site setting and include egress_ended events so recording statuses and download notifications update when recordings finish."
description: "Call recordings produced by the LiveKit egress service. Files stay on the storage configured on the recording server; completed recordings link to that location when it is a URL."
room: "Room"
requested_by: "Requested by"
@@ -369,13 +369,13 @@ en:
missing_in_presence: "Connected but not in the roster: %{users}"
room_error: "Could not list participants: %{error}"
no_rooms: "No live calls are using LiveKit right now."
- rooms_title: "Voice rooms"
+ rooms_title: "Live rooms"
create_room: "New room"
edit: "Edit"
update: "Update"
create: "Create"
back: "Back"
- no_rooms_yet: "No voice rooms configured yet."
+ no_rooms_yet: "No live rooms configured yet."
room_created: "Room created successfully."
room_updated: "Room updated successfully."
destroy_room:
@@ -415,12 +415,12 @@ en:
creator: "Created by"
created_at: "Created"
notifications:
- voice_invitation: "invited you to join %{room_name}"
- voice_call: "is calling you"
+ live_invitation: "invited you to join %{room_name}"
+ live_call: "is calling you"
titles:
- voice_invitation: "Voice room invite"
- voice_call: "Incoming voice call"
+ live_invitation: "Live room invite"
+ live_call: "Incoming live call"
review:
types:
- reviewable_voice_user:
- title: "Flagged voice room participant"
+ reviewable_live_user:
+ title: "Flagged live room participant"
diff --git a/plugins/voice/config/locales/client.tr_TR.yml b/plugins/live/config/locales/client.tr_TR.yml
similarity index 98%
rename from plugins/voice/config/locales/client.tr_TR.yml
rename to plugins/live/config/locales/client.tr_TR.yml
index 1b33a8d0454..176305627c8 100644
--- a/plugins/voice/config/locales/client.tr_TR.yml
+++ b/plugins/live/config/locales/client.tr_TR.yml
@@ -1,6 +1,6 @@
tr_TR:
js:
- voice:
+ live:
sidebar:
title: "Sesli odalar"
create: "Oda oluştur"
@@ -68,7 +68,7 @@ tr_TR:
composer_placeholder: "Odaya mesaj gönderin…"
send: "Gönder"
open_in_chat: "Sohbette aç"
- back_to_voice_room: "Sesli odaya dön"
+ back_to_live_room: "Sesli odaya dön"
video:
camera_on: "Kamerayı aç"
camera_off: "Kamerayı kapat"
@@ -282,7 +282,7 @@ tr_TR:
add_user: "Katılımcı ekle"
remove_user: "Katılımcıyı kaldır"
admin:
- title: "Voice"
+ title: "Live"
dashboard_title: "Kontrol paneli"
recordings_title: "Kayıtlar"
recordings:
@@ -391,12 +391,12 @@ tr_TR:
creator: "Oluşturan"
created_at: "Oluşturulma"
notifications:
- voice_invitation: "sizi %{room_name} odasına katılmaya davet etti"
- voice_call: "sizi arıyor"
+ live_invitation: "sizi %{room_name} odasına katılmaya davet etti"
+ live_call: "sizi arıyor"
titles:
- voice_invitation: "Sesli oda daveti"
- voice_call: "Gelen sesli arama"
+ live_invitation: "Sesli oda daveti"
+ live_call: "Gelen sesli arama"
review:
types:
- reviewable_voice_user:
+ reviewable_live_user:
title: "Bildirilen sesli oda katılımcısı"
diff --git a/plugins/live/config/locales/server.en.yml b/plugins/live/config/locales/server.en.yml
new file mode 100644
index 00000000000..b08683433bc
--- /dev/null
+++ b/plugins/live/config/locales/server.en.yml
@@ -0,0 +1,262 @@
+en:
+ site_settings:
+ live_verbose_logging: "Log Live diagnostic information and warnings in server logs and browser consoles. Disabled by default. Logs exclude credentials, transcripts, signaling payloads, and raw error details."
+ live_enabled: "Live brings integrated voice and video rooms to Discourse, with screen sharing, background blur, noise suppression, live subtitles, direct calls, room chat, and group-based permissions. Members can keep browsing while they talk, with no external app required."
+ live_allowed_groups: "Groups that can access live rooms."
+ live_create_room_allowed_groups: "Groups that can create new live rooms."
+ live_direct_calls_allowed_groups: "Groups that can start a direct call with another user from their user card or profile. Empty disables direct calls. Callers also need to be in {{setting:live_allowed_groups}}; anyone with live room access can receive a call."
+ live_max_rooms_per_user: "Maximum number of live rooms a single user can own. Temporary rooms created automatically by other features do not count."
+ live_max_invites_per_day: "Maximum number of live room invite notifications a single user can send per day. Repeated invites to the same person in the same room don't notify again (and don't count) until a day has passed."
+ live_ephemeral_room_ttl_minutes: "Minutes a temporary room (created automatically by another feature, such as a direct call) can sit empty before it is deleted. Rooms with people in them are never deleted."
+ live_participant_ttl_seconds: "Seconds to keep active speaker presence in Redis before automatic cleanup. Client heartbeat refreshes every 10 seconds."
+ live_max_room_participants: "Maximum number of people who can be in a live room at the same time. A room's own participant limit can lower this, but never raise it."
+ live_auto_status_enabled: "Automatically set user status when they join a live room (e.g. '🎙️ In Watercooler'). Requires the 'enable user status' site setting."
+ live_mesh_privacy_warning_enabled: "Warn users before they join a peer-to-peer live room that other participants may be able to see their IP address, with an option to not show the warning again on that device. Calls hosted on a LiveKit server never show the warning."
+ live_badges_enabled: "Enable Live badges when {{setting:live_enabled}} is enabled. Grants badges for live room milestones like time spent, rooms visited, and connections made. Toggling this enables or disables every badge in the Live group at once. Requires {{setting:live_analytics_enabled}}, which records the sessions the badges are computed from."
+ live_analytics_enabled: "Record who joined which live room and when, and how long people spent in a room together. Powers the admin Live statistics, the contacts and companions suggestions, and every Live badge."
+ live_session_retention_days: "Days to keep live session and time-together history before it is deleted. Badges already earned are never taken away, but progress toward badges that accumulate over time (hours in Live, days in a room, people met) only counts history within this window."
+ live_idle_threshold_minutes: "Minutes of inactivity before a live room participant is marked as idle. Set to 0 to disable."
+ live_afk_auto_mute_threshold_minutes: "Minutes of inactivity before a live room participant is automatically muted. Set to 0 to disable."
+ live_afk_disconnect_threshold_minutes: "Minutes of inactivity before a live room participant is automatically disconnected. Set to 0 to disable."
+ live_video_allowed_groups: "Groups whose members can share their camera in live rooms. Leave empty to turn camera video off site-wide. Rooms can individually opt out of all media via their room settings, and stage room listeners can never publish."
+ live_screen_share_allowed_groups: "Groups whose members can share their screen in live rooms. Leave empty to turn screen sharing off site-wide. Rooms can individually opt out of all media via their room settings, and stage room listeners can never publish."
+ live_video_max_publishers: "Maximum number of participants who can share video or their screen at the same time in a room. On peer-to-peer rooms, higher values increase CPU and bandwidth load for everyone watching; on rooms using a LiveKit media server, they mainly increase load on that server."
+ live_video_background_blur_enabled: "Allow participants to blur their camera background. Segmentation runs on the publisher's device via MediaPipe, which increases CPU/GPU load while their camera is on."
+ live_subtitles_enabled: "Allow participants to turn on live subtitles for other people's speech. Transcription runs entirely on the viewer's device via an NVIDIA Parakeet speech-to-text model (less than 0.5 GB, downloaded on first use, WebGPU required); no audio leaves the browser."
+ live_stt_model_base_url: "Optional base URL for a self-hosted mirror of the subtitles models. When blank, the model files are downloaded on first use from Discourse's HuggingFace repository (Discourse/Discourse-STT). A mirror must keep that repository's folder layout and file names, reachable by browsers with CORS allowed — see docs/subtitles-model-mirror.md in the plugin."
+ live_max_voice_quality: "Highest microphone audio quality participants may choose in their voice settings. Standard is the browser's speech default (~32 kbps); high (~64 kbps) and maximum (~128 kbps) improve fidelity for good microphones at the cost of bandwidth."
+ live_max_camera_quality: "Highest camera quality participants may choose in their video settings. Standard captures at 720p; high captures at 1080p; maximum additionally stops automatic quality reduction as viewer count grows on peer-to-peer rooms, which multiplies the sender's upload bandwidth and CPU use."
+ live_max_screen_share_quality: "Highest screen share quality participants may choose in their video settings. Standard targets 15 fps at a modest bitrate; high allows 30 fps at a higher bitrate; maximum allows 60 fps at a very high bitrate ceiling, letting fast connections share high-resolution screens at full quality."
+ live_chat_enabled: "Allow live rooms to be linked to a chat channel. Each chat session opens a thread in that channel; messages are real chat messages, so participants can also follow along in the chat UI."
+ live_stun_servers: "STUN server URIs (stun:host:port), separated by |, used by peer-to-peer live rooms for NAT traversal. Can be left empty when {{setting:live_turn_secret_servers}} is configured — clients then discover their public address through the TURN server itself."
+ live_turn_servers: "TURN server URIs (turn:host:port or turns:host:port), separated by |, used to relay call traffic when a direct connection cannot be established. Authenticated with {{setting:live_turn_username}} and {{setting:live_turn_credential}}; for servers supporting short-lived credentials, use {{setting:live_turn_secret_servers}} instead."
+ live_turn_username: "Static username for the TURN servers in {{setting:live_turn_servers}}."
+ live_turn_credential: "Static password for the TURN servers in {{setting:live_turn_servers}}."
+ live_turn_secret: "Shared secret used to mint short-lived TURN credentials for the servers in {{setting:live_turn_secret_servers}} (TURN REST API, coturn's use-auth-secret mode). Must match the secret configured on those TURN servers."
+ live_turn_secret_servers: "TURN server URIs (turn:host:port or turns:host:port), separated by |, that authenticate with short-lived per-user credentials derived from {{setting:live_turn_secret}} instead of a static username and password, so credentials cannot be reused by third parties."
+ live_livekit_agent_enabled: "Allow members of {{setting:live_livekit_agent_invite_allowed_groups}} to invite a LiveKit Cloud agent to public live rooms. Creates the livekit_agent_bot account. Requires configured LiveKit Cloud credentials."
+ live_livekit_agent_invite_allowed_groups: "Groups that can invite a LiveKit Cloud agent to a public live room they can join. Admins are always included. Members also need to be in {{setting:live_allowed_groups}}; room managers can kick an agent regardless of this setting."
+ live_livekit_url: "WebSocket URL (wss://, or ws:// outside production) of a self-hosted LiveKit server. Together with the API key and secret, lets live rooms use it as their media server (SFU) instead of the peer-to-peer mesh. The server must be reachable at a public address."
+ live_livekit_api_key: "API key of the LiveKit server."
+ live_livekit_api_secret: "API secret of the LiveKit server, used to sign short-lived room access tokens."
+ live_livekit_room_policy: "Which rooms use the LiveKit media server instead of the peer-to-peer mesh. Changes never affect calls already in progress — each room switches when its next call starts."
+ live_livekit_room_prefix: "Namespace prefix for room names on the LiveKit server. Leave empty to use the site's database name."
+ live_livekit_mesh_fallback: "When a LiveKit access token cannot be issued and the room is empty, start the call on the peer-to-peer mesh instead of failing the join. Off by default because silent degradation can hide a LiveKit outage."
+ live_livekit_recording_enabled: "Allow room moderators to record calls that run on the LiveKit media server. LiveKit Cloud requires {{setting:live_livekit_recording_s3_bucket}}. Self-hosted Egress can use its own storage configuration. Recordings are not Discourse uploads.<br><br>Configure a webhook in LiveKit pointing to <code>https://YOUR-FORUM/live/livekit/webhook</code>, replacing YOUR-FORUM with this site's hostname. Use the same API key as {{setting:live_livekit_api_key}} and include <code>egress_ended</code> events so recording statuses and download notifications update when recordings finish."
+ live_livekit_recording_filepath: "Filepath passed to LiveKit Egress for recordings. Supports LiveKit's template placeholders such as {room_name}, {room_id}, {time} and {utc}; the file extension is added automatically."
+ live_livekit_recording_s3_bucket: "Dedicated S3 bucket for live recordings, without a path. Set the recording credentials and region before saving this setting. Use {{setting:live_livekit_recording_filepath}} for a folder prefix. Leave empty to use self-hosted Egress storage. Discourse upload storage settings are not used."
+ live_livekit_recording_s3_region: "AWS region of the recording bucket, such as us-east-1. Required unless {{setting:live_livekit_recording_s3_endpoint}} is set."
+ live_livekit_recording_s3_access_key_id: "S3 access key for the recording bucket. Sent to the configured LiveKit server over HTTPS when starting a recording. Use credentials with write access limited to the recording location."
+ live_livekit_recording_s3_secret_access_key: "S3 secret key for the recording bucket. Sent only to the configured LiveKit server over HTTPS, never to participants."
+ live_livekit_recording_s3_endpoint: "Optional HTTPS endpoint for S3-compatible recording storage, without a path or trailing slash. Leave empty for AWS S3. Custom endpoints use path-style bucket addressing."
+ errors:
+ live_livekit_agent_requires_cloud: "Configure a LiveKit Cloud URL, API key, and API secret before enabling the agent."
+ live_livekit_agent_username_taken: "The username livekit_agent_bot is already in use. Rename that account before enabling the agent."
+ live_livekit_recording_s3_requires_credentials: "Set the recording S3 access key and secret key before setting a recording bucket."
+ live_livekit_recording_s3_requires_region: "Set the recording S3 region or a custom endpoint before setting a recording bucket."
+ live_livekit_recording_s3_requires_wss: "Use a wss:// LiveKit URL before configuring S3 recording storage so storage credentials are sent over HTTPS."
+ live_turn_secret_servers_requires_secret: "Set live_turn_secret before adding TURN servers that use short-lived credentials."
+ live_livekit_policy_requires_url: "Set live_livekit_url to a valid wss:// URL before enabling a LiveKit room policy."
+ live_livekit_url_invalid: "The LiveKit URL must be a ws:// or wss:// URL with a hostname and no embedded credentials."
+ live_livekit_url_requires_wss: "The LiveKit URL must use wss:// in production."
+ live_livekit_policy_requires_api_key: "Set live_livekit_api_key before enabling a LiveKit room policy."
+ live_livekit_policy_requires_api_secret: "Set live_livekit_api_secret before enabling a LiveKit room policy."
+ live:
+ defaults:
+ watercooler_description: "Join for casual drop-in voice chats with other community members."
+ chat:
+ default_thread_title: "Voice chat in %{room}"
+ default_thread_opener: "In %{room} - %{message}"
+ user_status:
+ in_room: "In %{room_name}"
+ in_private_room: "In a live room"
+ afk_in_room: "AFK in %{room_name}"
+ afk_in_private_room: "AFK in a live room"
+ errors:
+ not_enabled: "Live rooms are disabled."
+ not_authorized: "You are not allowed to perform that action for this room."
+ room_limit: "You reached the maximum number of rooms you can create."
+ missing_payload: "Signal payload is required."
+ participant_session_required: "Your call session has expired. Rejoin the room to start a new one."
+ room_full: "This room is full."
+ invalid_signal: "The signal payload is malformed or exceeds the allowed size."
+ state_change_required: "A state change is required."
+ ephemeral_room_limit: "You have too many ongoing calls. End one before starting another."
+ cannot_call_user: "Sorry, you cannot call that user."
+ cannot_kick_self: "You cannot kick yourself from the room."
+ cannot_kick_creator: "You cannot kick the room creator."
+ listeners_cannot_unmute: "Listeners cannot unmute in a Stage room."
+ video_not_allowed: "You are not allowed to share your camera in this room."
+ screen_share_not_allowed: "You are not allowed to share your screen in this room."
+ video_publisher_limit: "The maximum number of simultaneous video streams for this room has been reached."
+ chat_unavailable: "Chat is not available for this room."
+ chat_requires_presence: "Join the live room to use its chat."
+ flag_target_never_joined: "That user has not joined this room."
+ flag_already_handled: "Thanks, we have already been notified about this user and are looking into it."
+ chat_threading_disabled: "The linked chat channel no longer has threading enabled, so a chat session can't be started."
+ livekit_unavailable: "The live server is unavailable. Contact your site administrator."
+ agent_dispatch_forbidden: "The agent can only join an ongoing LiveKit call in a public room. Check the agent settings and make sure a human is present."
+ agent_dispatch_failed: "LiveKit could not confirm the agent invitation. Check the agent's deployment and the server logs before trying again."
+ agent_list_failed: "LiveKit could not list the deployed agents. Enter the agent's dispatch name instead."
+ livekit_room_instance_ended: "This call has ended. Rejoin the room to start a new one."
+ livekit_no_signaling: "This room's call uses a media server; peer-to-peer signaling is disabled."
+ recording_unavailable: "Recording is not available for this call."
+ recording_already_active: "This call is already being recorded."
+ recording_not_active: "This call is not being recorded."
+ recording_failed: "The recording could not be started. Contact your site administrator."
+ recording_stop_failed: "The recording could not be stopped. Please try again."
+ reviewable_score_types:
+ notify_moderators:
+ pm_title: "A live room participant requires staff attention"
+ pm_body: "@%{username} in the live room [%{room_name}](%{link}) requires staff attention:\n\n%{message}"
+ reviewables:
+ actions:
+ agree_and_keep:
+ title: "Agree"
+ description: "Agree with the flag."
+ agree_and_suspend:
+ title: "Suspend user"
+ description: "Agree with the flag and suspend the user."
+ agree_and_silence:
+ title: "Silence user"
+ description: "Agree with the flag and silence the user."
+ disagree:
+ title: "Disagree"
+ description: "Disagree with the flag."
+ ignore:
+ title: "Ignore flag"
+ description: "Remove the flag from the queue without taking action."
+ invite_notification:
+ title: "%{username} invited you to %{room_name}"
+ excerpt: "Join the live room %{room_name}"
+ call_notification:
+ title: "%{username} is calling you"
+ excerpt: "Join %{room_name} to answer"
+ call:
+ room_name: "📞 %{caller} + %{callee}"
+ recording_ready_pm:
+ title: "Your recording of %{room_name} is ready"
+ body_with_link: |
+ Your recording of the live room **%{room_name}** (%{duration}) is ready:
+
+ [Download the recording](%{link})
+
+ Anyone with this link can access the recording — share it carefully.
+ body_with_path: |
+ Your recording of the live room **%{room_name}** (%{duration}) has finished.
+
+ It is stored on the recording server at:
+
+ `%{filepath}`
+
+ Ask your site administrator for access.
+ unknown_duration: "unknown duration"
+ badges:
+ mic_check:
+ name: "Mic Check"
+ description: "Completed your first voice chat session."
+ long_description: "Awarded after spending at least 30 seconds in a live room with another person."
+ rookie:
+ name: "Rookie"
+ description: "Spent 1 hour in voice chat."
+ long_description: "Awarded for accumulating 1 hour of total live time."
+ chatterbox:
+ name: "Chatterbox"
+ description: "Spent 10 hours in voice chat."
+ long_description: "Awarded for accumulating 10 hours of total live time."
+ silver_tongue:
+ name: "Silver Tongue"
+ description: "Spent 100 hours in voice chat."
+ long_description: "Awarded for accumulating 100 hours of total live time."
+ icebreaker:
+ name: "Icebreaker"
+ description: "Joined a room full of strangers."
+ long_description: "Awarded for joining a live room where you had no prior co-presence history with anyone."
+ social_butterfly:
+ name: "Social Butterfly"
+ description: "Chatted with 10 different people."
+ long_description: "Awarded for achieving co-presence with 10 or more distinct users."
+ life_of_the_party:
+ name: "Life of the Party"
+ description: "Chatted with 50 different people."
+ long_description: "Awarded for achieving co-presence with 50 or more distinct users."
+ familiar_face:
+ name: "Familiar Face"
+ description: "Spent 2 hours chatting with the same person."
+ long_description: "Awarded for achieving co-presence with one specific user for 2 or more hours total."
+ inner_circle:
+ name: "Inner Circle"
+ description: "Spent 10 hours chatting with the same person."
+ long_description: "Awarded for achieving co-presence with one specific user for 10 or more hours total."
+ partners_in_crime:
+ name: "Partners in Crime"
+ description: "Spent 50 hours chatting with the same person."
+ long_description: "Awarded for achieving co-presence with one specific user for 50 or more hours total."
+ explorer:
+ name: "Explorer"
+ description: "Joined 5 different live rooms."
+ long_description: "Awarded for joining 5 different live rooms."
+ nomad:
+ name: "Nomad"
+ description: "Joined 20 different live rooms."
+ long_description: "Awarded for joining 20 different live rooms."
+ omnipresent:
+ name: "Omnipresent"
+ description: "Joined 50 different live rooms."
+ long_description: "Awarded for joining 50 different live rooms."
+ patron:
+ name: "Patron"
+ description: "Visited the same room on 10 different days."
+ long_description: "Awarded for joining the same live room on 10 distinct days."
+ barfly:
+ name: "Barfly"
+ description: "Visited the same room on 30 different days."
+ long_description: "Awarded for joining the same live room on 30 distinct days."
+ the_mayor:
+ name: "The Mayor"
+ description: "Visited the same room on 100 different days."
+ long_description: "Awarded for joining the same live room on 100 distinct days."
+ host:
+ name: "Host"
+ description: "Created your first live room."
+ long_description: "Awarded for creating your first live room."
+ crowd_puller:
+ name: "Crowd Puller"
+ description: "A room you created reached 50 total joins."
+ long_description: "Awarded when a live room you created accumulates 50 or more total joins."
+ master_of_ceremonies:
+ name: "Master of Ceremonies"
+ description: "A room you created reached 500 total joins."
+ long_description: "Awarded when a live room you created accumulates 500 or more total joins."
+ plus_one:
+ name: "Plus One"
+ description: "Someone joined a live room through your invite."
+ long_description: "Awarded the first time a person you invited joins a live room through your invite."
+ connector:
+ name: "Connector"
+ description: "10 people joined live rooms through your invites."
+ long_description: "Awarded when 10 different people join live rooms through your invites."
+ people_magnet:
+ name: "People Magnet"
+ description: "50 people joined live rooms through your invites."
+ long_description: "Awarded when 50 different people join live rooms through your invites."
+ night_owl:
+ name: "Night Owl"
+ description: "Chatted between midnight and 5 AM."
+ long_description: "Awarded for participating in a live session between midnight and 5 AM in your local timezone."
+ early_bird:
+ name: "Early Bird"
+ description: "Chatted between 5 AM and 9 AM."
+ long_description: "Awarded for participating in a live session between 5 AM and 9 AM in your local timezone."
+ packed_house:
+ name: "Packed House"
+ description: "Was in a room when it hit max capacity."
+ long_description: "Awarded for being in a live room at the exact moment it reaches maximum capacity."
+ weekend_warrior:
+ name: "Weekend Warrior"
+ description: "Spent 5 hours chatting on weekends."
+ long_description: "Awarded for accumulating 5 or more hours of voice chat on weekends."
+ marathoner:
+ name: "Marathoner"
+ description: "Spent 4 hours in a single live session with company."
+ long_description: "Awarded for a single continuous live session with 4 or more hours spent while at least one other person was in the room."
diff --git a/plugins/voice/config/locales/server.tr_TR.yml b/plugins/live/config/locales/server.tr_TR.yml
similarity index 51%
rename from plugins/voice/config/locales/server.tr_TR.yml
rename to plugins/live/config/locales/server.tr_TR.yml
index 5d4fe8e6d14..1b399be6a52 100644
--- a/plugins/voice/config/locales/server.tr_TR.yml
+++ b/plugins/live/config/locales/server.tr_TR.yml
@@ -1,47 +1,47 @@
tr_TR:
site_settings:
- voice_enabled: "Voice sesli odalar eklentisini etkinleştir."
- voice_allowed_groups: "Sesli odalara erişebilen gruplar."
- voice_create_room_allowed_groups: "Yeni sesli oda oluşturabilen gruplar."
- voice_direct_calls_allowed_groups: "Kullanıcı kartından veya profilinden başka bir kullanıcıyı doğrudan arayabilen gruplar. Boş bırakılırsa doğrudan aramalar kapatılır. Arayanların ayrıca {{setting:voice_allowed_groups}} içinde olması gerekir; sesli oda erişimi olan herkes arama alabilir."
- voice_max_rooms_per_user: "Bir kullanıcının sahip olabileceği en fazla sesli oda sayısı. Diğer özellikler tarafından otomatik oluşturulan geçici odalar bu sınıra dahil değildir."
- voice_max_invites_per_day: "Bir kullanıcının günde gönderebileceği en fazla sesli oda daveti bildirimi. Aynı odada aynı kişiye yinelenen davetler, bir gün geçene kadar yeniden bildirim göndermez ve sınıra dahil edilmez."
- voice_ephemeral_room_ttl_minutes: "Başka bir özellik (örneğin doğrudan arama) tarafından otomatik oluşturulan geçici bir odanın silinmeden önce boş kalabileceği dakika sayısı. İçinde kişi bulunan odalar silinmez."
- voice_participant_ttl_seconds: "Etkin konuşmacı durumunun otomatik temizlenmeden önce Redis'te tutulacağı saniye sayısı. İstemci yaşam sinyali her 10 saniyede yenilenir."
- voice_auto_status_enabled: "Kullanıcı sesli odaya katıldığında durumunu otomatik ayarla (ör. '🎙️ Sohbet Odasında'). 'Kullanıcı durumunu etkinleştir' site ayarının açık olması gerekir."
- voice_mesh_privacy_warning_enabled: "Kullanıcıları eşler arası sesli odaya katılmadan önce diğer katılımcıların IP adreslerini görebileceği konusunda uyar ve bu aygıtta uyarıyı bir daha göstermeme seçeneği sun. LiveKit sunucusunda barındırılan görüşmelerde uyarı gösterilmez."
- voice_badges_enabled: "Sesli sohbet rozetlerini etkinleştir. Sesli odalarda geçirilen süre, ziyaret edilen odalar ve kurulan bağlantılar gibi dönüm noktaları için rozet verir."
- voice_idle_threshold_minutes: "Sesli oda katılımcısının boşta olarak işaretlenmesi için geçmesi gereken etkinlik dışı dakika sayısı. Kapatmak için 0 yapın."
- voice_afk_auto_mute_threshold_minutes: "Sesli oda katılımcısının mikrofonunun otomatik kapatılması için geçmesi gereken etkinlik dışı dakika sayısı. Kapatmak için 0 yapın."
- voice_afk_disconnect_threshold_minutes: "Sesli oda katılımcısının bağlantısının otomatik kesilmesi için geçmesi gereken etkinlik dışı dakika sayısı. Kapatmak için 0 yapın."
- voice_video_max_publishers: "Bir odada aynı anda video veya ekran paylaşabilen en fazla katılımcı sayısı. Eşler arası odalarda yüksek değerler tüm izleyicilerin işlemci ve bant genişliği yükünü artırır; LiveKit medya sunucusu kullanan odalarda ise ağırlıklı olarak sunucu yükünü artırır."
- voice_video_background_blur_enabled: "Katılımcıların kamera arka planını bulanıklaştırmasına izin ver. Bölümleme, yayıncının aygıtında MediaPipe ile çalışır ve kamera açıkken işlemci/GPU yükünü artırır."
- voice_subtitles_enabled: "Katılımcıların diğer kişilerin konuşmaları için canlı altyazıları açmasına izin ver. Yazıya aktarma tamamen izleyicinin aygıtında NVIDIA Parakeet konuşmadan metne modeliyle çalışır (yaklaşık 2,5 GB, ilk kullanımda indirilir, WebGPU gerekir); ses tarayıcıdan dışarı çıkmaz."
- voice_stt_model_base_url: "Altyazı modelinin kendi sunucunuzda barındırılan yansısı için isteğe bağlı temel URL. Boşken model dosyaları ilk kullanımda Discourse'un HuggingFace deposundan (Discourse/parakeet-tdt-0.6b-v3-onnx) indirilir. Yansı, özgün adlarıyla aynı dört dosyayı tarayıcıların CORS izniyle erişebileceği şekilde sunmalıdır; eklentideki docs/subtitles-model-mirror.md belgesine bakın."
- voice_max_voice_quality: "Katılımcıların ses ayarlarında seçebileceği en yüksek mikrofon ses kalitesi. Standart, tarayıcının konuşma varsayılanıdır (yaklaşık 32 kbps); yüksek (yaklaşık 64 kbps) ve en yüksek (yaklaşık 128 kbps), bant genişliği karşılığında iyi mikrofonların ses kalitesini artırır."
- voice_max_camera_quality: "Katılımcıların video ayarlarında seçebileceği en yüksek kamera kalitesi. Standart 720p, yüksek 1080p görüntü yakalar; en yüksek ise eşler arası odalarda izleyici sayısı arttıkça otomatik kalite düşürmeyi de durdurur ve göndericinin yükleme bant genişliği ile işlemci kullanımını katlar."
- voice_max_screen_share_quality: "Katılımcıların video ayarlarında seçebileceği en yüksek ekran paylaşımı kalitesi. Standart makul bit hızında 15 fps, yüksek daha yüksek bit hızında 30 fps, en yüksek ise çok yüksek bit hızı sınırıyla 60 fps hedefler ve hızlı bağlantıların yüksek çözünürlüklü ekranları tam kalitede paylaşmasını sağlar."
- voice_chat_enabled: "Sesli odaların bir sohbet kanalına bağlanmasına izin ver. Her sohbet oturumu o kanalda bir konu açar; iletiler gerçek sohbet iletileridir ve katılımcılar sohbet arayüzünden de takip edebilir."
- voice_stun_servers: "Eşler arası sesli odalarda NAT geçişi için kullanılan ve | ile ayrılan STUN sunucusu URI'leri (stun:ana_makine:port). {{setting:voice_turn_secret_servers}} yapılandırıldığında boş bırakılabilir; istemciler genel adreslerini TURN sunucusunun kendisi üzerinden bulur."
- voice_turn_servers: "Doğrudan bağlantı kurulamadığında ses trafiğini aktarmak için kullanılan ve | ile ayrılan TURN sunucusu URI'leri (turn:ana_makine:port veya turns:ana_makine:port). {{setting:voice_turn_username}} ve {{setting:voice_turn_credential}} ile kimlik doğrulanır; kısa ömürlü kimlik bilgilerini destekleyen sunucular için bunun yerine {{setting:voice_turn_secret_servers}} kullanın."
- voice_turn_username: "{{setting:voice_turn_servers}} içindeki TURN sunucuları için sabit kullanıcı adı."
- voice_turn_credential: "{{setting:voice_turn_servers}} içindeki TURN sunucuları için sabit parola."
- voice_turn_secret: "{{setting:voice_turn_secret_servers}} içindeki sunucular için kısa ömürlü TURN kimlik bilgileri üretmekte kullanılan ortak gizli anahtar (TURN REST API, coturn use-auth-secret modu). Bu TURN sunucularında yapılandırılan gizli anahtarla aynı olmalıdır."
- voice_turn_secret_servers: "Sabit kullanıcı adı ve parola yerine {{setting:voice_turn_secret}} üzerinden türetilen, kullanıcıya özel kısa ömürlü kimlik bilgileriyle doğrulama yapan ve | ile ayrılan TURN sunucusu URI'leri (turn:ana_makine:port veya turns:ana_makine:port). Böylece kimlik bilgileri üçüncü kişilerce yeniden kullanılamaz."
- voice_livekit_url: "Kendi sunucunuzda barındırılan LiveKit sunucusunun WebSocket URL'si (ws:// veya wss://). API anahtarı ve gizli anahtarla birlikte sesli odaların eşler arası ağ yerine bu sunucuyu medya sunucusu (SFU) olarak kullanmasını sağlar."
- voice_livekit_api_key: "LiveKit sunucusunun API anahtarı."
- voice_livekit_api_secret: "Kısa ömürlü oda erişim belirteçlerini imzalamak için kullanılan LiveKit sunucusu API gizli anahtarı."
- voice_livekit_room_policy: "Eşler arası ağ yerine LiveKit medya sunucusunu kullanacak odalar. Değişiklikler devam eden görüşmeleri etkilemez; her oda bir sonraki görüşme başladığında geçiş yapar."
- voice_livekit_room_prefix: "LiveKit sunucusundaki oda adları için ad alanı ön eki. Sitenin veritabanı adını kullanmak için boş bırakın."
- voice_livekit_mesh_fallback: "LiveKit erişim belirteci üretilemediğinde ve oda boşken katılımı başarısız kılmak yerine görüşmeyi eşler arası ağda başlat. Sessiz kalite düşüşü LiveKit kesintisini gizleyebileceği için varsayılan olarak kapalıdır."
- voice_livekit_recording_enabled: "Oda moderatörlerinin LiveKit medya sunucusunda çalışan görüşmeleri kaydetmesine izin ver. Kayıtlar LiveKit Egress hizmeti tarafından oluşturulur ve kurulumun yazmak üzere yapılandırıldığı yerde (S3, GCS veya yerel disk) saklanır; bu siteye yüklenmez."
- voice_livekit_recording_filepath: "Kayıtlar için LiveKit Egress'e gönderilen dosya yolu. {room_name}, {room_id}, {time} ve {utc} gibi LiveKit şablon değişkenlerini destekler; dosya uzantısı otomatik eklenir."
+ live_enabled: "Live sesli odalar eklentisini etkinleştir."
+ live_allowed_groups: "Sesli odalara erişebilen gruplar."
+ live_create_room_allowed_groups: "Yeni sesli oda oluşturabilen gruplar."
+ live_direct_calls_allowed_groups: "Kullanıcı kartından veya profilinden başka bir kullanıcıyı doğrudan arayabilen gruplar. Boş bırakılırsa doğrudan aramalar kapatılır. Arayanların ayrıca {{setting:live_allowed_groups}} içinde olması gerekir; sesli oda erişimi olan herkes arama alabilir."
+ live_max_rooms_per_user: "Bir kullanıcının sahip olabileceği en fazla sesli oda sayısı. Diğer özellikler tarafından otomatik oluşturulan geçici odalar bu sınıra dahil değildir."
+ live_max_invites_per_day: "Bir kullanıcının günde gönderebileceği en fazla sesli oda daveti bildirimi. Aynı odada aynı kişiye yinelenen davetler, bir gün geçene kadar yeniden bildirim göndermez ve sınıra dahil edilmez."
+ live_ephemeral_room_ttl_minutes: "Başka bir özellik (örneğin doğrudan arama) tarafından otomatik oluşturulan geçici bir odanın silinmeden önce boş kalabileceği dakika sayısı. İçinde kişi bulunan odalar silinmez."
+ live_participant_ttl_seconds: "Etkin konuşmacı durumunun otomatik temizlenmeden önce Redis'te tutulacağı saniye sayısı. İstemci yaşam sinyali her 10 saniyede yenilenir."
+ live_auto_status_enabled: "Kullanıcı sesli odaya katıldığında durumunu otomatik ayarla (ör. '🎙️ Sohbet Odasında'). 'Kullanıcı durumunu etkinleştir' site ayarının açık olması gerekir."
+ live_mesh_privacy_warning_enabled: "Kullanıcıları eşler arası sesli odaya katılmadan önce diğer katılımcıların IP adreslerini görebileceği konusunda uyar ve bu aygıtta uyarıyı bir daha göstermeme seçeneği sun. LiveKit sunucusunda barındırılan görüşmelerde uyarı gösterilmez."
+ live_badges_enabled: "Sesli sohbet rozetlerini etkinleştir. Sesli odalarda geçirilen süre, ziyaret edilen odalar ve kurulan bağlantılar gibi dönüm noktaları için rozet verir."
+ live_idle_threshold_minutes: "Sesli oda katılımcısının boşta olarak işaretlenmesi için geçmesi gereken etkinlik dışı dakika sayısı. Kapatmak için 0 yapın."
+ live_afk_auto_mute_threshold_minutes: "Sesli oda katılımcısının mikrofonunun otomatik kapatılması için geçmesi gereken etkinlik dışı dakika sayısı. Kapatmak için 0 yapın."
+ live_afk_disconnect_threshold_minutes: "Sesli oda katılımcısının bağlantısının otomatik kesilmesi için geçmesi gereken etkinlik dışı dakika sayısı. Kapatmak için 0 yapın."
+ live_video_max_publishers: "Bir odada aynı anda video veya ekran paylaşabilen en fazla katılımcı sayısı. Eşler arası odalarda yüksek değerler tüm izleyicilerin işlemci ve bant genişliği yükünü artırır; LiveKit medya sunucusu kullanan odalarda ise ağırlıklı olarak sunucu yükünü artırır."
+ live_video_background_blur_enabled: "Katılımcıların kamera arka planını bulanıklaştırmasına izin ver. Bölümleme, yayıncının aygıtında MediaPipe ile çalışır ve kamera açıkken işlemci/GPU yükünü artırır."
+ live_subtitles_enabled: "Katılımcıların diğer kişilerin konuşmaları için canlı altyazıları açmasına izin ver. Yazıya aktarma tamamen izleyicinin aygıtında NVIDIA Parakeet konuşmadan metne modeliyle çalışır (yaklaşık 2,5 GB, ilk kullanımda indirilir, WebGPU gerekir); ses tarayıcıdan dışarı çıkmaz."
+ live_stt_model_base_url: "Altyazı modelinin kendi sunucunuzda barındırılan yansısı için isteğe bağlı temel URL. Boşken model dosyaları ilk kullanımda Discourse'un HuggingFace deposundan (Discourse/parakeet-tdt-0.6b-v3-onnx) indirilir. Yansı, özgün adlarıyla aynı dört dosyayı tarayıcıların CORS izniyle erişebileceği şekilde sunmalıdır; eklentideki docs/subtitles-model-mirror.md belgesine bakın."
+ live_max_voice_quality: "Katılımcıların ses ayarlarında seçebileceği en yüksek mikrofon ses kalitesi. Standart, tarayıcının konuşma varsayılanıdır (yaklaşık 32 kbps); yüksek (yaklaşık 64 kbps) ve en yüksek (yaklaşık 128 kbps), bant genişliği karşılığında iyi mikrofonların ses kalitesini artırır."
+ live_max_camera_quality: "Katılımcıların video ayarlarında seçebileceği en yüksek kamera kalitesi. Standart 720p, yüksek 1080p görüntü yakalar; en yüksek ise eşler arası odalarda izleyici sayısı arttıkça otomatik kalite düşürmeyi de durdurur ve göndericinin yükleme bant genişliği ile işlemci kullanımını katlar."
+ live_max_screen_share_quality: "Katılımcıların video ayarlarında seçebileceği en yüksek ekran paylaşımı kalitesi. Standart makul bit hızında 15 fps, yüksek daha yüksek bit hızında 30 fps, en yüksek ise çok yüksek bit hızı sınırıyla 60 fps hedefler ve hızlı bağlantıların yüksek çözünürlüklü ekranları tam kalitede paylaşmasını sağlar."
+ live_chat_enabled: "Sesli odaların bir sohbet kanalına bağlanmasına izin ver. Her sohbet oturumu o kanalda bir konu açar; iletiler gerçek sohbet iletileridir ve katılımcılar sohbet arayüzünden de takip edebilir."
+ live_stun_servers: "Eşler arası sesli odalarda NAT geçişi için kullanılan ve | ile ayrılan STUN sunucusu URI'leri (stun:ana_makine:port). {{setting:live_turn_secret_servers}} yapılandırıldığında boş bırakılabilir; istemciler genel adreslerini TURN sunucusunun kendisi üzerinden bulur."
+ live_turn_servers: "Doğrudan bağlantı kurulamadığında ses trafiğini aktarmak için kullanılan ve | ile ayrılan TURN sunucusu URI'leri (turn:ana_makine:port veya turns:ana_makine:port). {{setting:live_turn_username}} ve {{setting:live_turn_credential}} ile kimlik doğrulanır; kısa ömürlü kimlik bilgilerini destekleyen sunucular için bunun yerine {{setting:live_turn_secret_servers}} kullanın."
+ live_turn_username: "{{setting:live_turn_servers}} içindeki TURN sunucuları için sabit kullanıcı adı."
+ live_turn_credential: "{{setting:live_turn_servers}} içindeki TURN sunucuları için sabit parola."
+ live_turn_secret: "{{setting:live_turn_secret_servers}} içindeki sunucular için kısa ömürlü TURN kimlik bilgileri üretmekte kullanılan ortak gizli anahtar (TURN REST API, coturn use-auth-secret modu). Bu TURN sunucularında yapılandırılan gizli anahtarla aynı olmalıdır."
+ live_turn_secret_servers: "Sabit kullanıcı adı ve parola yerine {{setting:live_turn_secret}} üzerinden türetilen, kullanıcıya özel kısa ömürlü kimlik bilgileriyle doğrulama yapan ve | ile ayrılan TURN sunucusu URI'leri (turn:ana_makine:port veya turns:ana_makine:port). Böylece kimlik bilgileri üçüncü kişilerce yeniden kullanılamaz."
+ live_livekit_url: "Kendi sunucunuzda barındırılan LiveKit sunucusunun WebSocket URL'si (ws:// veya wss://). API anahtarı ve gizli anahtarla birlikte sesli odaların eşler arası ağ yerine bu sunucuyu medya sunucusu (SFU) olarak kullanmasını sağlar."
+ live_livekit_api_key: "LiveKit sunucusunun API anahtarı."
+ live_livekit_api_secret: "Kısa ömürlü oda erişim belirteçlerini imzalamak için kullanılan LiveKit sunucusu API gizli anahtarı."
+ live_livekit_room_policy: "Eşler arası ağ yerine LiveKit medya sunucusunu kullanacak odalar. Değişiklikler devam eden görüşmeleri etkilemez; her oda bir sonraki görüşme başladığında geçiş yapar."
+ live_livekit_room_prefix: "LiveKit sunucusundaki oda adları için ad alanı ön eki. Sitenin veritabanı adını kullanmak için boş bırakın."
+ live_livekit_mesh_fallback: "LiveKit erişim belirteci üretilemediğinde ve oda boşken katılımı başarısız kılmak yerine görüşmeyi eşler arası ağda başlat. Sessiz kalite düşüşü LiveKit kesintisini gizleyebileceği için varsayılan olarak kapalıdır."
+ live_livekit_recording_enabled: "Oda moderatörlerinin LiveKit medya sunucusunda çalışan görüşmeleri kaydetmesine izin ver. Kayıtlar LiveKit Egress hizmeti tarafından oluşturulur ve kurulumun yazmak üzere yapılandırıldığı yerde (S3, GCS veya yerel disk) saklanır; bu siteye yüklenmez."
+ live_livekit_recording_filepath: "Kayıtlar için LiveKit Egress'e gönderilen dosya yolu. {room_name}, {room_id}, {time} ve {utc} gibi LiveKit şablon değişkenlerini destekler; dosya uzantısı otomatik eklenir."
errors:
- voice_turn_secret_servers_requires_secret: "Kısa ömürlü kimlik bilgileri kullanan TURN sunucularını eklemeden önce voice_turn_secret ayarını yapın."
- voice_livekit_policy_requires_url: "Bir LiveKit oda ilkesini etkinleştirmeden önce voice_livekit_url ayarını ws:// veya wss:// URL'si olarak girin."
- voice_livekit_policy_requires_api_key: "Bir LiveKit oda ilkesini etkinleştirmeden önce voice_livekit_api_key ayarını yapın."
- voice_livekit_policy_requires_api_secret: "Bir LiveKit oda ilkesini etkinleştirmeden önce voice_livekit_api_secret ayarını yapın."
- voice:
+ live_turn_secret_servers_requires_secret: "Kısa ömürlü kimlik bilgileri kullanan TURN sunucularını eklemeden önce live_turn_secret ayarını yapın."
+ live_livekit_policy_requires_url: "Bir LiveKit oda ilkesini etkinleştirmeden önce live_livekit_url ayarını ws:// veya wss:// URL'si olarak girin."
+ live_livekit_policy_requires_api_key: "Bir LiveKit oda ilkesini etkinleştirmeden önce live_livekit_api_key ayarını yapın."
+ live_livekit_policy_requires_api_secret: "Bir LiveKit oda ilkesini etkinleştirmeden önce live_livekit_api_secret ayarını yapın."
+ live:
defaults:
watercooler_description: "Diğer topluluk üyeleriyle rahat ve anlık sesli sohbetler için katılın."
chat:
@@ -52,7 +52,7 @@ tr_TR:
afk_in_room: "%{room_name} odasında AFK"
afk_in_private_room: "Bir sesli odada AFK"
errors:
- not_enabled: "Voice sesli odaları devre dışı."
+ not_enabled: "Live sesli odaları devre dışı."
not_authorized: "Bu oda için bu işlemi yapma izniniz yok."
room_limit: "Oluşturabileceğiniz en fazla oda sayısına ulaştınız."
missing_payload: "Sinyal verisi gereklidir."
diff --git a/plugins/voice/config/routes.rb b/plugins/live/config/routes.rb
similarity index 53%
rename from plugins/voice/config/routes.rb
rename to plugins/live/config/routes.rb
index e7c3f6d6068..c1d263788fb 100644
--- a/plugins/voice/config/routes.rb
+++ b/plugins/live/config/routes.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-Voice::Engine.routes.draw do
+Live::Engine.routes.draw do
resources :rooms do
member do
post :invite_agent
@@ -49,31 +49,43 @@ Voice::Engine.routes.draw do
end
Discourse::Application.routes.draw do
- scope "/admin/plugins/voice", constraints: AdminConstraint.new do
+ scope "/admin/plugins/live", constraints: AdminConstraint.new do
scope format: false do
- get "/voice-rooms" => "voice/admin#index"
- get "/voice-rooms/new" => "voice/admin#new"
- get "/voice-rooms/:id" => "voice/admin#edit"
- get "/voice-dashboard" => "voice/admin#index"
- get "/voice-recordings" => "voice/admin#index"
+ get "/live-rooms" => "live/admin#index"
+ get "/live-rooms/new" => "live/admin#new"
+ get "/live-rooms/:id" => "live/admin#edit"
+ get "/live-dashboard" => "live/admin#index"
+ get "/live-recordings" => "live/admin#index"
end
scope format: :json do
- get "/rooms" => "voice/admin_rooms#index"
- get "/rooms/:id" => "voice/admin_rooms#show"
- post "/rooms" => "voice/admin_rooms#create"
- put "/rooms/:id" => "voice/admin_rooms#update"
- delete "/rooms/:id" => "voice/admin_rooms#destroy"
- post "/rooms/:id/end_call" => "voice/admin_rooms#end_call"
+ get "/rooms" => "live/admin_rooms#index"
+ get "/rooms/:id" => "live/admin_rooms#show"
+ post "/rooms" => "live/admin_rooms#create"
+ put "/rooms/:id" => "live/admin_rooms#update"
+ delete "/rooms/:id" => "live/admin_rooms#destroy"
+ post "/rooms/:id/end_call" => "live/admin_rooms#end_call"
- get "/stats/overview" => "voice/admin_stats#overview"
- get "/stats/rooms" => "voice/admin_stats#rooms"
- get "/stats/users" => "voice/admin_stats#users"
+ get "/stats/overview" => "live/admin_stats#overview"
+ get "/stats/rooms" => "live/admin_stats#rooms"
+ get "/stats/users" => "live/admin_stats#users"
- get "/livekit/status" => "voice/admin_livekit#status"
- post "/livekit/probe" => "voice/admin_livekit#probe"
+ get "/livekit/status" => "live/admin_livekit#status"
+ post "/livekit/probe" => "live/admin_livekit#probe"
- get "/recordings" => "voice/admin_recordings#index"
+ get "/recordings" => "live/admin_recordings#index"
end
end
+
+ # Links and LiveKit webhook URLs configured before the plugin was renamed.
+ post "/voice/livekit/webhook" => "live/livekit_webhooks#create"
+ get "/voice/r/*path",
+ to:
+ redirect { |params, request|
+ [
+ "#{Discourse.base_path}/live/r/#{params[:path]}",
+ request.query_string.presence,
+ ].compact.join("?")
+ },
+ format: false
end
diff --git a/plugins/voice/config/settings.yml b/plugins/live/config/settings.yml
similarity index 62%
rename from plugins/voice/config/settings.yml
rename to plugins/live/config/settings.yml
index 8d9f77ffb29..fec2260eef3 100644
--- a/plugins/voice/config/settings.yml
+++ b/plugins/live/config/settings.yml
@@ -1,5 +1,5 @@
plugins:
- voice_enabled:
+ live_enabled:
default: false
client: true
hidden: true
@@ -11,10 +11,10 @@ plugins:
learn_more_url: "https://meta.discourse.org/t/-/411337"
requires_plugin_enabled: false
permanent_warning: false
- voice_verbose_logging:
+ live_verbose_logging:
default: false
client: true
- voice_allowed_groups:
+ live_allowed_groups:
type: group_list
list_type: compact
default: "4|5" # auto groups anonymous_users, logged_in_users
@@ -22,8 +22,8 @@ plugins:
refresh: true
disallowed_groups: "0"
depends_on:
- - voice_enabled
- voice_create_room_allowed_groups:
+ - live_enabled
+ live_create_room_allowed_groups:
type: group_list
list_type: compact
default: "1|2|12" # auto groups admins, moderators, trust_level_2
@@ -32,8 +32,8 @@ plugins:
mandatory_values: "1" # auto group admins
disallowed_groups: "0|4"
depends_on:
- - voice_enabled
- voice_direct_calls_allowed_groups:
+ - live_enabled
+ live_direct_calls_allowed_groups:
type: group_list
list_type: compact
default: ""
@@ -41,63 +41,63 @@ plugins:
refresh: true
disallowed_groups: "0|4"
depends_on:
- - voice_enabled
- voice_max_rooms_per_user:
+ - live_enabled
+ live_max_rooms_per_user:
default: 5
- voice_max_invites_per_day:
+ live_max_invites_per_day:
default: 100
min: 1
max: 5000
- voice_ephemeral_room_ttl_minutes:
+ live_ephemeral_room_ttl_minutes:
default: 30
min: 5
max: 10080
- voice_participant_ttl_seconds:
+ live_participant_ttl_seconds:
default: 30
- voice_max_room_participants:
+ live_max_room_participants:
default: 50
min: 2
max: 200
- voice_stun_servers:
+ live_stun_servers:
default: "stun:stun.l.google.com:19302|stun:global.stun.twilio.com:3478"
- voice_turn_servers:
+ live_turn_servers:
default: ""
- voice_turn_username:
+ live_turn_username:
default: ""
- voice_turn_credential:
+ live_turn_credential:
default: ""
secret: true
- voice_turn_secret:
+ live_turn_secret:
default: ""
secret: true
- voice_turn_secret_servers:
+ live_turn_secret_servers:
default: ""
- validator: "VoiceTurnSecretServersValidator"
- voice_livekit_url:
+ validator: "LiveTurnSecretServersValidator"
+ live_livekit_url:
default: ""
- validator: "VoiceLivekitUrlValidator"
- voice_livekit_api_key:
+ validator: "LiveLivekitUrlValidator"
+ live_livekit_api_key:
default: ""
- voice_livekit_api_secret:
+ live_livekit_api_secret:
default: ""
secret: true
- voice_livekit_room_policy:
+ live_livekit_room_policy:
default: "disabled"
type: enum
choices:
- disabled
- per_room
- all_rooms
- validator: "VoiceLivekitPolicyValidator"
- voice_livekit_room_prefix:
+ validator: "LiveLivekitPolicyValidator"
+ live_livekit_room_prefix:
default: ""
- voice_livekit_mesh_fallback:
+ live_livekit_mesh_fallback:
default: false
- voice_livekit_agent_enabled:
+ live_livekit_agent_enabled:
default: false
- validator: "VoiceLivekitAgentValidator"
+ validator: "LiveLivekitAgentValidator"
refresh: true
- voice_livekit_agent_invite_allowed_groups:
+ live_livekit_agent_invite_allowed_groups:
type: group_list
list_type: compact
default: "1" # auto group admins
@@ -106,28 +106,28 @@ plugins:
mandatory_values: "1" # auto group admins
disallowed_groups: "0|4"
depends_on:
- - voice_livekit_agent_enabled
- voice_livekit_recording_enabled:
+ - live_livekit_agent_enabled
+ live_livekit_recording_enabled:
default: false
client: true
- voice_livekit_recording_filepath:
- default: "voice/{room_name}-{utc}"
- voice_livekit_recording_s3_region:
+ live_livekit_recording_filepath:
+ default: "live/{room_name}-{utc}"
+ live_livekit_recording_s3_region:
default: "us-east-1"
- voice_livekit_recording_s3_access_key_id:
+ live_livekit_recording_s3_access_key_id:
default: ""
secret: true
- voice_livekit_recording_s3_secret_access_key:
+ live_livekit_recording_s3_secret_access_key:
default: ""
secret: true
- voice_livekit_recording_s3_endpoint:
+ live_livekit_recording_s3_endpoint:
default: ""
regex: '^https://[a-zA-Z0-9.-]+(:[0-9]+)?$'
- voice_livekit_recording_s3_bucket:
+ live_livekit_recording_s3_bucket:
default: ""
regex: '^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$'
- validator: "VoiceLivekitRecordingS3BucketValidator"
- voice_video_allowed_groups:
+ validator: "LiveLivekitRecordingS3BucketValidator"
+ live_video_allowed_groups:
type: group_list
list_type: compact
default: "5" # auto group logged_in_users
@@ -135,8 +135,8 @@ plugins:
refresh: true
disallowed_groups: "0|4"
depends_on:
- - voice_enabled
- voice_screen_share_allowed_groups:
+ - live_enabled
+ live_screen_share_allowed_groups:
type: group_list
list_type: compact
default: "5" # auto group logged_in_users
@@ -144,22 +144,22 @@ plugins:
refresh: true
disallowed_groups: "0|4"
depends_on:
- - voice_enabled
- voice_video_max_publishers:
+ - live_enabled
+ live_video_max_publishers:
default: 8
min: 2
max: 16
client: true
- voice_video_background_blur_enabled:
+ live_video_background_blur_enabled:
default: true
client: true
- voice_subtitles_enabled:
+ live_subtitles_enabled:
default: false
client: true
- voice_stt_model_base_url:
+ live_stt_model_base_url:
default: ""
client: true
- voice_max_voice_quality:
+ live_max_voice_quality:
default: "maximum"
type: enum
client: true
@@ -167,7 +167,7 @@ plugins:
- standard
- high
- maximum
- voice_max_camera_quality:
+ live_max_camera_quality:
default: "maximum"
type: enum
client: true
@@ -175,7 +175,7 @@ plugins:
- standard
- high
- maximum
- voice_max_screen_share_quality:
+ live_max_screen_share_quality:
default: "maximum"
type: enum
client: true
@@ -183,37 +183,37 @@ plugins:
- standard
- high
- maximum
- voice_idle_threshold_minutes:
+ live_idle_threshold_minutes:
default: 5
min: 0
max: 60
client: true
- voice_afk_auto_mute_threshold_minutes:
+ live_afk_auto_mute_threshold_minutes:
default: 15
min: 0
max: 120
client: true
- voice_afk_disconnect_threshold_minutes:
+ live_afk_disconnect_threshold_minutes:
default: 30
min: 0
max: 240
client: true
- voice_auto_status_enabled:
+ live_auto_status_enabled:
default: true
client: true
- voice_mesh_privacy_warning_enabled:
+ live_mesh_privacy_warning_enabled:
default: true
client: true
- voice_badges_enabled:
+ live_badges_enabled:
default: true
depends_on:
- - voice_enabled
- voice_analytics_enabled:
+ - live_enabled
+ live_analytics_enabled:
default: true
- voice_session_retention_days:
+ live_session_retention_days:
default: 1095
min: 7
max: 3650
- voice_chat_enabled:
+ live_chat_enabled:
default: true
client: true
diff --git a/plugins/voice/db/fixtures/001_badges.rb b/plugins/live/db/fixtures/001_badges.rb
similarity index 79%
rename from plugins/voice/db/fixtures/001_badges.rb
rename to plugins/live/db/fixtures/001_badges.rb
index 3213d288256..aadde72ca82 100644
--- a/plugins/voice/db/fixtures/001_badges.rb
+++ b/plugins/live/db/fixtures/001_badges.rb
@@ -1,26 +1,26 @@
# frozen_string_literal: true
-voice_badge_group = "Voice"
-voice_badges_enabled = SiteSetting.voice_enabled && SiteSetting.voice_badges_enabled
+live_badge_group = "Live"
+live_badges_enabled = SiteSetting.live_enabled && SiteSetting.live_badges_enabled
BadgeGrouping.seed(:name) do |g|
- g.name = voice_badge_group
+ g.name = live_badge_group
g.default_position = 15
end
-voice_grouping = BadgeGrouping.find_by(name: voice_badge_group)
+live_grouping = BadgeGrouping.find_by(name: live_badge_group)
duration_sql = "EXTRACT(EPOCH FROM (COALESCE(left_at, CURRENT_TIMESTAMP) - joined_at))"
co_presence_distinct_partners = lambda { |min_count| <<~SQL }
SELECT uid user_id, current_timestamp granted_at FROM (
SELECT user_id_1 AS uid, user_id_2 AS partner_id
- FROM voice_co_presences
+ FROM live_co_presences
GROUP BY user_id_1, user_id_2
HAVING SUM(total_seconds) >= 300
UNION ALL
SELECT user_id_2 AS uid, user_id_1 AS partner_id
- FROM voice_co_presences
+ FROM live_co_presences
GROUP BY user_id_2, user_id_1
HAVING SUM(total_seconds) >= 300
) sub
@@ -31,12 +31,12 @@ co_presence_distinct_partners = lambda { |min_count| <<~SQL }
co_presence_with_one_partner = lambda { |min_seconds| <<~SQL }
SELECT DISTINCT uid user_id, current_timestamp granted_at FROM (
SELECT user_id_1 AS uid
- FROM voice_co_presences
+ FROM live_co_presences
GROUP BY user_id_1, user_id_2
HAVING SUM(total_seconds) >= #{min_seconds}
UNION ALL
SELECT user_id_2 AS uid
- FROM voice_co_presences
+ FROM live_co_presences
GROUP BY user_id_1, user_id_2
HAVING SUM(total_seconds) >= #{min_seconds}
) sub
@@ -45,7 +45,7 @@ co_presence_with_one_partner = lambda { |min_seconds| <<~SQL }
loyalty_query = lambda { |min_days| <<~SQL }
SELECT DISTINCT user_id, current_timestamp granted_at FROM (
SELECT user_id, room_id
- FROM voice_sessions
+ FROM live_sessions
GROUP BY user_id, room_id
HAVING COUNT(DISTINCT DATE(joined_at)) >= #{min_days}
) sub
@@ -61,9 +61,9 @@ Badge.seed(:name) do |b|
b.target_posts = false
b.show_posts = false
b.query = nil
- b.default_badge_grouping_id = voice_grouping.id
+ b.default_badge_grouping_id = live_grouping.id
b.trigger = Badge::Trigger::None
- b.default_enabled = voice_badges_enabled
+ b.default_enabled = live_badges_enabled
b.system = true
end
@@ -83,14 +83,14 @@ end
b.show_posts = false
b.query = <<~SQL
SELECT user_id, current_timestamp granted_at
- FROM voice_sessions
+ FROM live_sessions
GROUP BY user_id
HAVING SUM(#{duration_sql}) >= #{threshold}
SQL
b.auto_revoke = false
- b.default_badge_grouping_id = voice_grouping.id
+ b.default_badge_grouping_id = live_grouping.id
b.trigger = Badge::Trigger::None
- b.default_enabled = voice_badges_enabled
+ b.default_enabled = live_badges_enabled
b.default_allow_title = type == BadgeType::Gold
b.system = true
end
@@ -106,9 +106,9 @@ Badge.seed(:name) do |b|
b.target_posts = false
b.show_posts = false
b.query = nil
- b.default_badge_grouping_id = voice_grouping.id
+ b.default_badge_grouping_id = live_grouping.id
b.trigger = Badge::Trigger::None
- b.default_enabled = voice_badges_enabled
+ b.default_enabled = live_badges_enabled
b.system = true
end
@@ -125,9 +125,9 @@ end
b.show_posts = false
b.query = co_presence_distinct_partners.call(count)
b.auto_revoke = false
- b.default_badge_grouping_id = voice_grouping.id
+ b.default_badge_grouping_id = live_grouping.id
b.trigger = Badge::Trigger::None
- b.default_enabled = voice_badges_enabled
+ b.default_enabled = live_badges_enabled
b.default_allow_title = type == BadgeType::Gold
b.system = true
end
@@ -149,9 +149,9 @@ end
b.show_posts = false
b.query = co_presence_with_one_partner.call(threshold)
b.auto_revoke = false
- b.default_badge_grouping_id = voice_grouping.id
+ b.default_badge_grouping_id = live_grouping.id
b.trigger = Badge::Trigger::None
- b.default_enabled = voice_badges_enabled
+ b.default_enabled = live_badges_enabled
b.default_allow_title = type == BadgeType::Gold
b.system = true
end
@@ -173,15 +173,15 @@ end
b.show_posts = false
b.query = <<~SQL
SELECT s.user_id, current_timestamp granted_at
- FROM voice_sessions s
- JOIN voice_rooms r ON r.id = s.room_id AND NOT r.ephemeral
+ FROM live_sessions s
+ JOIN live_rooms r ON r.id = s.room_id AND NOT r.ephemeral
GROUP BY s.user_id
HAVING COUNT(DISTINCT s.room_id) >= #{count}
SQL
b.auto_revoke = false
- b.default_badge_grouping_id = voice_grouping.id
+ b.default_badge_grouping_id = live_grouping.id
b.trigger = Badge::Trigger::None
- b.default_enabled = voice_badges_enabled
+ b.default_enabled = live_badges_enabled
b.default_allow_title = type == BadgeType::Gold
b.system = true
end
@@ -203,9 +203,9 @@ end
b.show_posts = false
b.query = loyalty_query.call(days)
b.auto_revoke = false
- b.default_badge_grouping_id = voice_grouping.id
+ b.default_badge_grouping_id = live_grouping.id
b.trigger = Badge::Trigger::None
- b.default_enabled = voice_badges_enabled
+ b.default_enabled = live_badges_enabled
b.default_allow_title = type == BadgeType::Gold
b.system = true
end
@@ -221,9 +221,9 @@ Badge.seed(:name) do |b|
b.target_posts = false
b.show_posts = false
b.query = nil
- b.default_badge_grouping_id = voice_grouping.id
+ b.default_badge_grouping_id = live_grouping.id
b.trigger = Badge::Trigger::None
- b.default_enabled = voice_badges_enabled
+ b.default_enabled = live_badges_enabled
b.system = true
end
@@ -240,16 +240,16 @@ end
b.show_posts = false
b.query = <<~SQL
SELECT r.creator_id user_id, current_timestamp granted_at
- FROM voice_rooms r
- JOIN voice_sessions s ON s.room_id = r.id AND s.user_id <> r.creator_id
+ FROM live_rooms r
+ JOIN live_sessions s ON s.room_id = r.id AND s.user_id <> r.creator_id
WHERE NOT r.ephemeral
GROUP BY r.creator_id
HAVING COUNT(DISTINCT s.user_id) >= #{count}
SQL
b.auto_revoke = false
- b.default_badge_grouping_id = voice_grouping.id
+ b.default_badge_grouping_id = live_grouping.id
b.trigger = Badge::Trigger::None
- b.default_enabled = voice_badges_enabled
+ b.default_enabled = live_badges_enabled
b.default_allow_title = type == BadgeType::Gold
b.system = true
end
@@ -265,9 +265,9 @@ Badge.seed(:name) do |b|
b.target_posts = false
b.show_posts = false
b.query = nil
- b.default_badge_grouping_id = voice_grouping.id
+ b.default_badge_grouping_id = live_grouping.id
b.trigger = Badge::Trigger::None
- b.default_enabled = voice_badges_enabled
+ b.default_enabled = live_badges_enabled
b.system = true
end
@@ -284,15 +284,15 @@ end
b.show_posts = false
b.query = <<~SQL
SELECT invited_by_id user_id, current_timestamp granted_at
- FROM voice_invites
+ FROM live_invites
WHERE redeemed_at IS NOT NULL
GROUP BY invited_by_id
HAVING COUNT(DISTINCT user_id) >= #{count}
SQL
b.auto_revoke = false
- b.default_badge_grouping_id = voice_grouping.id
+ b.default_badge_grouping_id = live_grouping.id
b.trigger = Badge::Trigger::None
- b.default_enabled = voice_badges_enabled
+ b.default_enabled = live_badges_enabled
b.default_allow_title = type == BadgeType::Gold
b.system = true
end
@@ -308,9 +308,9 @@ Badge.seed(:name) do |b|
b.target_posts = false
b.show_posts = false
b.query = nil
- b.default_badge_grouping_id = voice_grouping.id
+ b.default_badge_grouping_id = live_grouping.id
b.trigger = Badge::Trigger::None
- b.default_enabled = voice_badges_enabled
+ b.default_enabled = live_badges_enabled
b.system = true
end
@@ -322,9 +322,9 @@ Badge.seed(:name) do |b|
b.target_posts = false
b.show_posts = false
b.query = nil
- b.default_badge_grouping_id = voice_grouping.id
+ b.default_badge_grouping_id = live_grouping.id
b.trigger = Badge::Trigger::None
- b.default_enabled = voice_badges_enabled
+ b.default_enabled = live_badges_enabled
b.system = true
end
@@ -336,9 +336,9 @@ Badge.seed(:name) do |b|
b.target_posts = false
b.show_posts = false
b.query = nil
- b.default_badge_grouping_id = voice_grouping.id
+ b.default_badge_grouping_id = live_grouping.id
b.trigger = Badge::Trigger::None
- b.default_enabled = voice_badges_enabled
+ b.default_enabled = live_badges_enabled
b.system = true
end
@@ -351,15 +351,15 @@ Badge.seed(:name) do |b|
b.show_posts = false
b.query = <<~SQL
SELECT user_id, current_timestamp granted_at
- FROM voice_sessions
+ FROM live_sessions
WHERE EXTRACT(DOW FROM joined_at) IN (0, 6)
GROUP BY user_id
HAVING SUM(#{duration_sql}) >= #{5.hours.to_i}
SQL
b.auto_revoke = false
- b.default_badge_grouping_id = voice_grouping.id
+ b.default_badge_grouping_id = live_grouping.id
b.trigger = Badge::Trigger::None
- b.default_enabled = voice_badges_enabled
+ b.default_enabled = live_badges_enabled
b.system = true
end
@@ -371,11 +371,11 @@ Badge.seed(:name) do |b|
b.target_posts = false
b.show_posts = false
b.query = nil
- b.default_badge_grouping_id = voice_grouping.id
+ b.default_badge_grouping_id = live_grouping.id
b.trigger = Badge::Trigger::None
- b.default_enabled = voice_badges_enabled
+ b.default_enabled = live_badges_enabled
b.default_allow_title = true
b.system = true
end
-Voice::BadgeGranterHooks.disable_all! unless voice_badges_enabled
+Live::BadgeGranterHooks.disable_all! unless live_badges_enabled
diff --git a/plugins/voice/db/migrate/20241107000000_create_voice_rooms.rb b/plugins/live/db/migrate/20241107000000_create_voice_rooms.rb
similarity index 100%
rename from plugins/voice/db/migrate/20241107000000_create_voice_rooms.rb
rename to plugins/live/db/migrate/20241107000000_create_voice_rooms.rb
diff --git a/plugins/voice/db/migrate/20260220154336_add_cooked_description_to_voice_rooms.rb b/plugins/live/db/migrate/20260220154336_add_cooked_description_to_voice_rooms.rb
similarity index 100%
rename from plugins/voice/db/migrate/20260220154336_add_cooked_description_to_voice_rooms.rb
rename to plugins/live/db/migrate/20260220154336_add_cooked_description_to_voice_rooms.rb
diff --git a/plugins/voice/db/migrate/20260305162426_add_room_type_to_voice_rooms.rb b/plugins/live/db/migrate/20260305162426_add_room_type_to_voice_rooms.rb
similarity index 100%
rename from plugins/voice/db/migrate/20260305162426_add_room_type_to_voice_rooms.rb
rename to plugins/live/db/migrate/20260305162426_add_room_type_to_voice_rooms.rb
diff --git a/plugins/voice/db/migrate/20260305165400_create_voice_sessions.rb b/plugins/live/db/migrate/20260305165400_create_voice_sessions.rb
similarity index 100%
rename from plugins/voice/db/migrate/20260305165400_create_voice_sessions.rb
rename to plugins/live/db/migrate/20260305165400_create_voice_sessions.rb
diff --git a/plugins/voice/db/migrate/20260305165401_create_voice_co_presences.rb b/plugins/live/db/migrate/20260305165401_create_voice_co_presences.rb
similarity index 100%
rename from plugins/voice/db/migrate/20260305165401_create_voice_co_presences.rb
rename to plugins/live/db/migrate/20260305165401_create_voice_co_presences.rb
diff --git a/plugins/voice/db/migrate/20260612135211_add_video_enabled_to_voice_rooms.rb b/plugins/live/db/migrate/20260612135211_add_video_enabled_to_voice_rooms.rb
similarity index 100%
rename from plugins/voice/db/migrate/20260612135211_add_video_enabled_to_voice_rooms.rb
rename to plugins/live/db/migrate/20260612135211_add_video_enabled_to_voice_rooms.rb
diff --git a/plugins/voice/db/migrate/20260630183841_add_chat_settings_to_voice_rooms.rb b/plugins/live/db/migrate/20260630183841_add_chat_settings_to_voice_rooms.rb
similarity index 100%
rename from plugins/voice/db/migrate/20260630183841_add_chat_settings_to_voice_rooms.rb
rename to plugins/live/db/migrate/20260630183841_add_chat_settings_to_voice_rooms.rb
diff --git a/plugins/voice/db/migrate/20260709165411_add_livekit_enabled_to_voice_rooms.rb b/plugins/live/db/migrate/20260709165411_add_livekit_enabled_to_voice_rooms.rb
similarity index 100%
rename from plugins/voice/db/migrate/20260709165411_add_livekit_enabled_to_voice_rooms.rb
rename to plugins/live/db/migrate/20260709165411_add_livekit_enabled_to_voice_rooms.rb
diff --git a/plugins/voice/db/migrate/20260717172530_create_voice_recordings.rb b/plugins/live/db/migrate/20260717172530_create_voice_recordings.rb
similarity index 100%
rename from plugins/voice/db/migrate/20260717172530_create_voice_recordings.rb
rename to plugins/live/db/migrate/20260717172530_create_voice_recordings.rb
diff --git a/plugins/voice/db/migrate/20260728201053_add_max_quality_profile_to_voice_rooms.rb b/plugins/live/db/migrate/20260728201053_add_max_quality_profile_to_voice_rooms.rb
similarity index 100%
rename from plugins/voice/db/migrate/20260728201053_add_max_quality_profile_to_voice_rooms.rb
rename to plugins/live/db/migrate/20260728201053_add_max_quality_profile_to_voice_rooms.rb
diff --git a/plugins/voice/db/migrate/20260803144425_add_ephemeral_to_voice_rooms.rb b/plugins/live/db/migrate/20260803144425_add_ephemeral_to_voice_rooms.rb
similarity index 100%
rename from plugins/voice/db/migrate/20260803144425_add_ephemeral_to_voice_rooms.rb
rename to plugins/live/db/migrate/20260803144425_add_ephemeral_to_voice_rooms.rb
diff --git a/plugins/voice/db/migrate/20260813160047_create_voice_invites.rb b/plugins/live/db/migrate/20260813160047_create_voice_invites.rb
similarity index 100%
rename from plugins/voice/db/migrate/20260813160047_create_voice_invites.rb
rename to plugins/live/db/migrate/20260813160047_create_voice_invites.rb
diff --git a/plugins/voice/db/migrate/20260824214603_mark_chat_thread_title_template_readonly.rb b/plugins/live/db/migrate/20260824214603_mark_chat_thread_title_template_readonly.rb
similarity index 100%
rename from plugins/voice/db/migrate/20260824214603_mark_chat_thread_title_template_readonly.rb
rename to plugins/live/db/migrate/20260824214603_mark_chat_thread_title_template_readonly.rb
diff --git a/plugins/voice/db/post_migrate/20260703134812_remove_voice_noise_suppression_setting.rb b/plugins/live/db/post_migrate/20260703134812_remove_voice_noise_suppression_setting.rb
similarity index 100%
rename from plugins/voice/db/post_migrate/20260703134812_remove_voice_noise_suppression_setting.rb
rename to plugins/live/db/post_migrate/20260703134812_remove_voice_noise_suppression_setting.rb
diff --git a/plugins/voice/db/post_migrate/20260803163214_remove_voice_sessions_room_foreign_key.rb b/plugins/live/db/post_migrate/20260803163214_remove_voice_sessions_room_foreign_key.rb
similarity index 100%
rename from plugins/voice/db/post_migrate/20260803163214_remove_voice_sessions_room_foreign_key.rb
rename to plugins/live/db/post_migrate/20260803163214_remove_voice_sessions_room_foreign_key.rb
diff --git a/plugins/voice/db/post_migrate/20260803163818_remove_voice_user_foreign_keys.rb b/plugins/live/db/post_migrate/20260803163818_remove_voice_user_foreign_keys.rb
similarity index 100%
rename from plugins/voice/db/post_migrate/20260803163818_remove_voice_user_foreign_keys.rb
rename to plugins/live/db/post_migrate/20260803163818_remove_voice_user_foreign_keys.rb
diff --git a/plugins/voice/db/post_migrate/20260824214608_drop_chat_thread_title_template_from_voice_rooms.rb b/plugins/live/db/post_migrate/20260824214608_drop_chat_thread_title_template_from_voice_rooms.rb
similarity index 100%
rename from plugins/voice/db/post_migrate/20260824214608_drop_chat_thread_title_template_from_voice_rooms.rb
rename to plugins/live/db/post_migrate/20260824214608_drop_chat_thread_title_template_from_voice_rooms.rb
diff --git a/plugins/voice/db/post_migrate/20260831162602_rename_resenha_to_voice.rb b/plugins/live/db/post_migrate/20260831162602_rename_resenha_to_voice.rb
similarity index 100%
rename from plugins/voice/db/post_migrate/20260831162602_rename_resenha_to_voice.rb
rename to plugins/live/db/post_migrate/20260831162602_rename_resenha_to_voice.rb
diff --git a/plugins/voice/db/post_migrate/20260903195501_enable_voice_badges_by_default.rb b/plugins/live/db/post_migrate/20260903195501_enable_voice_badges_by_default.rb
similarity index 100%
rename from plugins/voice/db/post_migrate/20260903195501_enable_voice_badges_by_default.rb
rename to plugins/live/db/post_migrate/20260903195501_enable_voice_badges_by_default.rb
diff --git a/plugins/voice/db/post_migrate/20261009144947_replace_voice_video_enabled_setting.rb b/plugins/live/db/post_migrate/20261009144947_replace_voice_video_enabled_setting.rb
similarity index 100%
rename from plugins/voice/db/post_migrate/20261009144947_replace_voice_video_enabled_setting.rb
rename to plugins/live/db/post_migrate/20261009144947_replace_voice_video_enabled_setting.rb
diff --git a/plugins/live/db/post_migrate/20261013160643_rename_voice_to_live.rb b/plugins/live/db/post_migrate/20261013160643_rename_voice_to_live.rb
new file mode 100644
index 00000000000..de4ba2c2f26
--- /dev/null
+++ b/plugins/live/db/post_migrate/20261013160643_rename_voice_to_live.rb
@@ -0,0 +1,216 @@
+# frozen_string_literal: true
+
+# The plugin was renamed from "voice" to "live". The historical migrations
+# still create the voice_* schema; this converts it, along with every
+# persisted reference to the old name.
+class RenameVoiceToLive < ActiveRecord::Migration[8.0]
+ RENAMED_TABLES = {
+ voice_rooms: :live_rooms,
+ voice_room_memberships: :live_room_memberships,
+ voice_sessions: :live_sessions,
+ voice_co_presences: :live_co_presences,
+ voice_recordings: :live_recordings,
+ voice_invites: :live_invites,
+ }
+
+ RENAMED_SETTINGS =
+ %w[
+ voice_enabled
+ voice_verbose_logging
+ voice_allowed_groups
+ voice_create_room_allowed_groups
+ voice_direct_calls_allowed_groups
+ voice_max_rooms_per_user
+ voice_max_invites_per_day
+ voice_ephemeral_room_ttl_minutes
+ voice_participant_ttl_seconds
+ voice_max_room_participants
+ voice_stun_servers
+ voice_turn_servers
+ voice_turn_username
+ voice_turn_credential
+ voice_turn_secret
+ voice_turn_secret_servers
+ voice_livekit_url
+ voice_livekit_api_key
+ voice_livekit_api_secret
+ voice_livekit_room_policy
+ voice_livekit_room_prefix
+ voice_livekit_mesh_fallback
+ voice_livekit_agent_enabled
+ voice_livekit_agent_invite_allowed_groups
+ voice_livekit_recording_enabled
+ voice_livekit_recording_filepath
+ voice_livekit_recording_s3_region
+ voice_livekit_recording_s3_access_key_id
+ voice_livekit_recording_s3_secret_access_key
+ voice_livekit_recording_s3_endpoint
+ voice_livekit_recording_s3_bucket
+ voice_video_allowed_groups
+ voice_screen_share_allowed_groups
+ voice_video_max_publishers
+ voice_video_background_blur_enabled
+ voice_subtitles_enabled
+ voice_stt_model_base_url
+ voice_max_voice_quality
+ voice_max_camera_quality
+ voice_max_screen_share_quality
+ voice_idle_threshold_minutes
+ voice_afk_auto_mute_threshold_minutes
+ voice_afk_disconnect_threshold_minutes
+ voice_auto_status_enabled
+ voice_mesh_privacy_warning_enabled
+ voice_badges_enabled
+ voice_analytics_enabled
+ voice_session_retention_days
+ voice_chat_enabled
+ ].to_h { |name| [name, name.sub(/\Avoice_/, "live_")] }
+
+ def up
+ RENAMED_TABLES.each do |old_name, new_name|
+ rename_table(old_name, new_name) if table_exists?(old_name) && !table_exists?(new_name)
+ end
+
+ RENAMED_TABLES.each do |old_name, new_name|
+ rename_table_objects(old_name.to_s, new_name.to_s) if table_exists?(new_name)
+ end
+
+ RENAMED_SETTINGS.each do |old_name, new_name|
+ DB.exec(<<~SQL, old_name:, new_name:)
+ UPDATE site_settings
+ SET name = :new_name
+ WHERE name = :old_name
+ AND NOT EXISTS (SELECT 1 FROM site_settings WHERE name = :new_name)
+ SQL
+
+ DB.exec(<<~SQL, old_name:, new_name:)
+ UPDATE site_setting_groups
+ SET name = :new_name
+ WHERE name = :old_name
+ AND NOT EXISTS (SELECT 1 FROM site_setting_groups WHERE name = :new_name)
+ SQL
+
+ DB.exec(<<~SQL, old_name:, new_name:)
+ UPDATE site_setting_localizations
+ SET setting_name = :new_name
+ WHERE setting_name = :old_name
+ SQL
+ end
+
+ # Without this the upcoming change looks brand new and notifies admins
+ # again. Once-off events may already exist under the new name if the new
+ # code booted first, so conflicts are dropped.
+ execute <<~SQL
+ INSERT INTO upcoming_change_events
+ (event_type, upcoming_change_name, event_data, acting_user_id, created_at, updated_at)
+ SELECT event_type, 'live_enabled', event_data, acting_user_id, created_at, updated_at
+ FROM upcoming_change_events
+ WHERE upcoming_change_name = 'voice_enabled'
+ ON CONFLICT DO NOTHING
+ SQL
+
+ execute <<~SQL
+ DELETE FROM upcoming_change_events
+ WHERE upcoming_change_name = 'voice_enabled'
+ SQL
+
+ execute <<~SQL
+ UPDATE reviewables
+ SET type = 'ReviewableLiveUser',
+ type_source = 'live',
+ target_type = CASE
+ WHEN target_type = 'Voice::Session' THEN 'Live::Session'
+ ELSE target_type
+ END
+ WHERE type = 'ReviewableVoiceUser'
+ SQL
+
+ execute <<~SQL if table_exists?(:chat_thread_custom_fields)
+ UPDATE chat_thread_custom_fields
+ SET name = 'live_room_id'
+ WHERE name = 'voice_room_id'
+ SQL
+
+ execute <<~SQL
+ UPDATE plugin_store_rows
+ SET plugin_name = 'live'
+ WHERE plugin_name = 'voice'
+ SQL
+
+ execute <<~SQL
+ UPDATE badge_groupings
+ SET name = 'Live'
+ WHERE name = 'Voice'
+ AND NOT EXISTS (SELECT 1 FROM badge_groupings WHERE name = 'Live')
+ SQL
+ end
+
+ def down
+ raise ActiveRecord::IrreversibleMigration
+ end
+
+ private
+
+ # rename_table only renames conventionally named indexes and sequences, so
+ # rename the table's remaining objects that still embed its old name.
+ # Index-backed constraints follow their indexes.
+ def rename_table_objects(old_name, new_name)
+ rename = ->(name) { name.sub(old_name, new_name) }
+ table = quote_table_name(new_name)
+
+ DB
+ .query_single(<<~SQL, new_name, old_name)
+ SELECT i.relname
+ FROM pg_index x
+ JOIN pg_class i ON i.oid = x.indexrelid
+ WHERE x.indrelid = ?::regclass AND strpos(i.relname, ?) > 0
+ SQL
+ .each do |name|
+ execute "ALTER INDEX #{quote_table_name(name)} RENAME TO #{quote_table_name(rename[name])}"
+ end
+
+ DB
+ .query_single(<<~SQL, new_name, old_name)
+ SELECT s.relname
+ FROM pg_class s
+ JOIN pg_depend d ON d.objid = s.oid AND d.classid = 'pg_class'::regclass
+ WHERE s.relkind = 'S' AND d.refobjid = ?::regclass AND d.deptype IN ('a', 'i')
+ AND strpos(s.relname, ?) > 0
+ SQL
+ .each do |name|
+ execute "ALTER SEQUENCE #{quote_table_name(name)} RENAME TO #{quote_table_name(rename[name])}"
+ end
+
+ DB
+ .query_single(<<~SQL, new_name, old_name)
+ SELECT conname
+ FROM pg_constraint
+ WHERE conrelid = ?::regclass AND contype IN ('c', 'f', 'n') AND strpos(conname, ?) > 0
+ SQL
+ .each do |name|
+ execute "ALTER TABLE #{table} RENAME CONSTRAINT #{quote_column_name(name)} TO #{quote_column_name(rename[name])}"
+ end
+
+ DB
+ .query_single(<<~SQL, new_name, old_name)
+ SELECT tgname
+ FROM pg_trigger
+ WHERE tgrelid = ?::regclass AND NOT tgisinternal AND strpos(tgname, ?) > 0
+ SQL
+ .each do |name|
+ execute "ALTER TRIGGER #{quote_column_name(name)} ON #{table} RENAME TO #{quote_column_name(rename[name])}"
+ end
+
+ # Functions called by the table's triggers, e.g. readonly-column guards.
+ DB
+ .query(<<~SQL, new_name, old_name)
+ SELECT DISTINCT p.oid::regprocedure::text AS signature, p.proname
+ FROM pg_trigger t
+ JOIN pg_proc p ON p.oid = t.tgfoid
+ WHERE t.tgrelid = ?::regclass AND NOT t.tgisinternal AND strpos(p.proname, ?) > 0
+ SQL
+ .each do |row|
+ execute "ALTER FUNCTION #{row.signature} RENAME TO #{quote_column_name(rename[row.proname])}"
+ end
+ end
+end
diff --git a/plugins/live/docs/ARCHITECTURE.md b/plugins/live/docs/ARCHITECTURE.md
new file mode 100644
index 00000000000..176d93f4c9e
--- /dev/null
+++ b/plugins/live/docs/ARCHITECTURE.md
@@ -0,0 +1,41 @@
+# Live Plugin Architecture
+
+Live adds lightweight WebRTC live rooms to Discourse without proxying audio/video through the server. Media runs over one of two transports — the default peer-to-peer mesh, or an optional self-hosted [LiveKit](https://livekit.io) SFU (see [livekit.md](./livekit.md)) — while everything else (presence, sessions, roster, moderation) is transport-independent. It consists of the following layers:
+
+## Backend
+
+- **Models**
+ - `Live::Room`: describes each live space and keeps ownership, slug, visibility, and capacity metadata. Creator is automatically promoted to room moderator. Rooms flagged `ephemeral` are short-lived rooms created programmatically by other features and are excluded from every discovery surface (see [ephemeral-rooms.md](./ephemeral-rooms.md)).
+ - `Live::RoomMembership`: links users to rooms while storing participant/moderator roles.
+- **Services**
+ - `Live::ParticipantTracker`: stores the list of actively connected users per room in Redis with a short TTL. Join/leave actions refresh MessageBus subscribers. Also pins each live call's transport (`mesh` or `livekit`) so every participant of a call is on the same one; the pin clears when the room empties.
+ - `Live::RoomBroadcaster`: emits participant snapshots to `/live/rooms/:id` MessageBus channels so Ember clients can update sidebars in real time.
+ - `Live::DirectoryBroadcaster`: keeps the sidebar list in sync across clients by broadcasting CRUD events to `/live/rooms/index`. Skips ephemeral rooms, which never appear in the directory.
+ - `Live::EphemeralRoomManager`: the only entry point for creating ephemeral rooms, plus their TTL-based reaping (driven by a scheduled job). Contract in [ephemeral-rooms.md](./ephemeral-rooms.md).
+ - `Live::SignalRelay`: relays raw WebRTC SDP/ICE payloads between peers via MessageBus without touching media data (mesh rooms only).
+ - `Live::Livekit`: mints short-lived, least-privilege LiveKit access tokens (HS256 JWT) and resolves whether a room is eligible for the SFU per `live_livekit_room_policy`. `Live::Livekit::RoomServiceClient` mirrors kicks, role changes, and room deletion to the LiveKit server best-effort via Twirp-JSON.
+- **Controllers**
+ - `RoomsController` exposes CRUD, join/leave, participant, and signaling endpoints.
+ - `RoomMembershipsController` lets moderators manage explicit memberships.
+- **Authorization**
+ - Guardian extensions gate room visibility, membership, and management. Site settings define who can create/manage rooms and cap per-user ownership tallies.
+ - Camera and screen sharing are separate group-gated capabilities, resolved per user against the room's own media flag and their speaking rights. Publishing is enforced at the state endpoint and, on LiveKit rooms, by the token's track-source grants. Each room's serialization carries the viewer's own two rights for the UI, and every roster entry carries that sender's entitlements — mesh peers exchange media directly, so receivers gate video and screen audio on the sender's server-attested entitlement plus their published state.
+
+## Frontend
+
+- **Services**
+ - `live-rooms`: fetches initial room data, subscribes to MessageBus channels, updates tracked sidebar state, and forwards participant events to the UI.
+ - `live-webrtc`: manages `navigator.mediaDevices` capture, maintains one `RTCPeerConnection` per peer (mesh) or one `LivekitRoomSession` per room (LiveKit), exchanges offers/answers/candidates through the `signal` endpoint on mesh rooms, and keeps remote audio elements synced. Both transports feed the same remote-media registry, so every component downstream is transport-agnostic; the vendored `livekit-client` bundle is dynamically imported only when a LiveKit room is joined.
+- **Sidebar Integration**
+ - `live-sidebar` initializer registers a sidebar section with custom links for each room. Each link swaps its label with inline avatar thumbnails (plus a counter) so active participants are visible without modifying core sidebar components.
+- **Room UI**
+ - `live-room` route/controller fetch full room metadata, render participant lists, and command the WebRTC service to join/leave rooms. `Live::VoiceCanvas` mounts `<audio>` sinks for local and remote streams during active calls.
+ - Presentation layout automatically features the first screen share or active camera. A viewer can locally override that choice from a participant's video-tile menu; selecting a layout through the standard control restores automatic selection.
+
+## Message Flow
+
+1. User joins a room → `POST /live/rooms/:id/join` resolves the call's transport (pinned in Redis for the call's lifetime), adds them to Redis, and broadcasts the participants list. For LiveKit calls the response also carries the server URL and a short-lived access token.
+2. Clients refresh presence with `POST /live/rooms/:id/heartbeat` every 10 seconds (TTL is 30 seconds) without re-broadcasting participants.
+3. On mesh calls, each participant receiving the broadcast spins up `RTCPeerConnection` objects (only lower user IDs send offers to avoid glare) and relays SDP/ICE payloads via `POST /live/rooms/:id/signal`. On LiveKit calls the client instead opens a single connection to the SFU and publishes/subscribes there; the `signal` endpoint rejects payloads for those rooms.
+4. Audio flows directly peer-to-peer (or through the site's own LiveKit server); Discourse only transports JSON signaling events.
+5. Sidebar avatars and the room screen update automatically as MessageBus notifications arrive — the roster is driven by Redis presence on both transports, never by media state.
diff --git a/plugins/voice/docs/ephemeral-rooms.md b/plugins/live/docs/ephemeral-rooms.md
similarity index 76%
rename from plugins/voice/docs/ephemeral-rooms.md
rename to plugins/live/docs/ephemeral-rooms.md
index 43933aa3872..78d00b5cba0 100644
--- a/plugins/voice/docs/ephemeral-rooms.md
+++ b/plugins/live/docs/ephemeral-rooms.md
@@ -1,11 +1,11 @@
# Ephemeral rooms — backend interface
-Ephemeral rooms are short-lived `Voice::Room` records created by **other
+Ephemeral rooms are short-lived `Live::Room` records created by **other
features**, not by a user filling in the room form: the backing room for a
direct call between users, or a room spun up by an integration (e.g. an
events/livestream plugin) for the duration of an event. This document is the
contract for code that consumes them; there is no user-visible surface in the
-Voice plugin itself.
+Live plugin itself.
## What "ephemeral" changes — and what it doesn't
@@ -16,23 +16,23 @@ ephemeral *stage* room.
An ephemeral room:
- **Never appears in discovery surfaces**: the room directory (`GET
- /voice/rooms`), directory MessageBus broadcasts on
- `/voice/rooms/index`, and hashtag autocomplete/rendering all exclude it.
+ /live/rooms`), directory MessageBus broadcasts on
+ `/live/rooms/index`, and hashtag autocomplete/rendering all exclude it.
Whoever creates the room is responsible for surfacing it to its users.
- **Cannot be created through the rooms API**: the `ephemeral` attribute is
not permitted in `RoomsController` or the admin rooms controller. The only
- way in is `Voice::EphemeralRoomManager.create!`.
-- **Does not count** against `voice_max_rooms_per_user` (rooms are created
+ way in is `Live::EphemeralRoomManager.create!`.
+- **Does not count** against `live_max_rooms_per_user` (rooms are created
*for* users by features), and does not satisfy the default-room seeder's
"a room already exists" check.
- **Is reaped automatically** once it sits empty past
- `voice_ephemeral_room_ttl_minutes` (see Lifecycle below).
+ `live_ephemeral_room_ttl_minutes` (see Lifecycle below).
Everything else behaves like any other room: `show`, `join`/`leave`,
heartbeats, signaling, LiveKit transport resolution, chat sessions,
recordings, and moderation all work unchanged, and the standard Guardian
rules apply (`public` or membership gates joining; staff/creator/moderators
-manage). The room page at `/voice/r/:slug` renders it, so consumers can
+manage). The room page at `/live/r/:slug` renders it, so consumers can
simply link users there.
## Creating one
@@ -41,7 +41,7 @@ simply link users there.
# A direct call: both parties are moderators, so either can invite more
# people mid-call (inviting is a moderator ability).
room =
- Voice::EphemeralRoomManager.create!(
+ Live::EphemeralRoomManager.create!(
creator: caller,
name: "Call",
moderators: [callee],
@@ -49,11 +49,11 @@ room =
# An event room: the host runs it, the audience are plain members.
room =
- Voice::EphemeralRoomManager.create!(
+ Live::EphemeralRoomManager.create!(
creator: host,
name: event.title,
public: true,
- room_type: Voice::Room::ROOM_TYPE_STAGE,
+ room_type: Live::Room::ROOM_TYPE_STAGE,
members: attendees,
)
```
@@ -61,7 +61,7 @@ room =
- The creator always gets a moderator membership (standard room behavior).
- `moderators:` users get moderator memberships; `members:` users get
participant memberships. A user in both lists stays a moderator.
-- Any other `Voice::Room` attribute (`public`, `video_enabled`,
+- Any other `Live::Room` attribute (`public`, `video_enabled`,
`max_participants`, `livekit_enabled`, …) passes through as a keyword.
- Slugs get a random suffix (`call-a1b2c3d4`), so generic names never
collide with existing rooms — don't rely on a predictable slug; keep the
@@ -72,7 +72,7 @@ room =
A scheduled job (every 5 minutes) walks ephemeral rooms:
- Rooms with live participants get their `last_occupied_at` refreshed.
-- Rooms empty for longer than `voice_ephemeral_room_ttl_minutes`
+- Rooms empty for longer than `live_ephemeral_room_ttl_minutes`
(default 30, measured from `last_occupied_at`, or `created_at` if never
joined) are destroyed, including their LiveKit room and Redis presence
state.
@@ -83,12 +83,12 @@ at once. Consumers must therefore treat the room as **disposable**: hold its
id, not assumptions about its continued existence, and be prepared for a
404 once a call has been over for a while. A consumer that finishes with a
room early (call rejected, event cancelled) may destroy it immediately via
-`Voice::EphemeralRoomManager.destroy!(room)`, which performs the same full
+`Live::EphemeralRoomManager.destroy!(room)`, which performs the same full
teardown.
## Telling them apart
-- Ruby: `room.ephemeral?`, and the `Voice::Room.ephemeral` /
- `Voice::Room.persistent` scopes.
-- Serialized rooms (`Voice::RoomSerializer`) carry an `ephemeral`
+- Ruby: `room.ephemeral?`, and the `Live::Room.ephemeral` /
+ `Live::Room.persistent` scopes.
+- Serialized rooms (`Live::RoomSerializer`) carry an `ephemeral`
attribute, so client code can branch on it.
diff --git a/plugins/voice/docs/examples/voice-bots.example.json b/plugins/live/docs/examples/live-bots.example.json
similarity index 74%
rename from plugins/voice/docs/examples/voice-bots.example.json
rename to plugins/live/docs/examples/live-bots.example.json
index e4a6bfe8ead..6c205bcfad5 100644
--- a/plugins/voice/docs/examples/voice-bots.example.json
+++ b/plugins/live/docs/examples/live-bots.example.json
@@ -1,18 +1,18 @@
[
{
- "username": "voice_bot_1",
+ "username": "live_bot_1",
"label": "Alice fake camera",
"color": "#2563eb",
"accent": "#f97316"
},
{
- "username": "voice_bot_2",
+ "username": "live_bot_2",
"label": "Bob fake camera",
"color": "#16a34a",
"accent": "#7c3aed"
},
{
- "username": "voice_bot_3",
+ "username": "live_bot_3",
"label": "Charlie fake camera",
"color": "#dc2626",
"accent": "#0891b2"
diff --git a/plugins/voice/docs/livekit.md b/plugins/live/docs/livekit.md
similarity index 82%
rename from plugins/voice/docs/livekit.md
rename to plugins/live/docs/livekit.md
index 22c4bf926db..35286537985 100644
--- a/plugins/voice/docs/livekit.md
+++ b/plugins/live/docs/livekit.md
@@ -1,6 +1,6 @@
# LiveKit media server (SFU) — deployment and operations
-By default Voice runs calls as a pure peer-to-peer mesh: every participant
+By default Live runs calls as a pure peer-to-peer mesh: every participant
sends media to every other participant, and nothing touches the Discourse
server. That is the right default for small rooms and zero-infrastructure
installs, but upstream bandwidth grows with room size, so large rooms and
@@ -23,7 +23,7 @@ configuration, verification, and day-2 operations. For the design itself see
- The **server** decides the transport when the first participant joins, and
pins it (in Redis) for the life of that call. Everyone in a call is always
on the same transport; there is no mixed room and no client-side choice.
-- `voice_livekit_room_policy` controls the resolution: `disabled` (default,
+- `live_livekit_room_policy` controls the resolution: `disabled` (default,
everything mesh), `per_room` (rooms opt in individually via a room-form
checkbox), or `all_rooms`.
- **Setting changes never affect a call already in progress.** A room switches
@@ -48,7 +48,7 @@ Go binary) with:
webhook:
api_key: <the same API key>
urls:
- - https://forum.example/voice/livekit/webhook
+ - https://forum.example/live/livekit/webhook
```
## Network setup
@@ -79,12 +79,12 @@ configured host — tracked as a known risk in the roadmap.)
| Setting | Value |
| --- | --- |
-| `voice_livekit_url` | `wss://livekit.example.com` (or `ws://` for plain-HTTP labs) |
-| `voice_livekit_api_key` | the API key |
-| `voice_livekit_api_secret` | the API secret |
-| `voice_livekit_room_policy` | `per_room` or `all_rooms` |
-| `voice_livekit_room_prefix` | optional room-name namespace; defaults to the site's database name |
-| `voice_livekit_mesh_fallback` | opt-in: when a token can't be minted and the room is empty, start on mesh instead of failing the join. Off by default — silent degradation hides outages |
+| `live_livekit_url` | `wss://livekit.example.com` (or `ws://` for plain-HTTP labs) |
+| `live_livekit_api_key` | the API key |
+| `live_livekit_api_secret` | the API secret |
+| `live_livekit_room_policy` | `per_room` or `all_rooms` |
+| `live_livekit_room_prefix` | optional room-name namespace; defaults to the site's database name |
+| `live_livekit_mesh_fallback` | opt-in: when a token can't be minted and the room is empty, start on mesh instead of failing the join. Off by default — silent degradation hides outages |
The policy setting validates that URL, key, and secret are present before it
can leave `disabled`, so misconfiguration fails at save time, not at a user's
@@ -92,8 +92,8 @@ first join. None of these settings are sent to clients; the URL and a
short-lived (10 minute), single-room, single-user token reach the browser only
in the join response of rooms actually resolved to LiveKit.
-Mesh rooms keep using the existing `voice_stun_servers` /
-`voice_turn_servers` settings; LiveKit brings its own ICE/TURN and ignores
+Mesh rooms keep using the existing `live_stun_servers` /
+`live_turn_servers` settings; LiveKit brings its own ICE/TURN and ignores
them.
With `per_room` policy, room creators/managers get a "Use media server (SFU)"
@@ -103,36 +103,36 @@ live one.
## Recording to S3 with LiveKit Cloud
LiveKit Cloud runs the recorder, but each recording request must specify
-where to store the file. Voice supports a dedicated S3 bucket using the
+where to store the file. Live supports a dedicated S3 bucket using the
settings below. These settings are independent of Discourse's upload and
backup storage configuration.
1. Create an S3 bucket for recordings and credentials with permission to
write objects under the recording prefix. Keep the bucket private unless
you intentionally want anyone with a recording URL to be able to read it.
-2. Configure `voice_livekit_url` with the project's `wss://` URL and set its
+2. Configure `live_livekit_url` with the project's `wss://` URL and set its
API key and secret.
3. In Discourse site settings, configure these values, saving the bucket
last:
| Setting | Value |
| --- | --- |
- | `voice_livekit_recording_s3_region` | The recording bucket's AWS region |
- | `voice_livekit_recording_s3_access_key_id` | Dedicated recording access key |
- | `voice_livekit_recording_s3_secret_access_key` | Dedicated recording secret key |
- | `voice_livekit_recording_s3_endpoint` | Leave empty for AWS S3; an HTTPS origin for S3-compatible storage |
- | `voice_livekit_recording_s3_bucket` | Bucket name only, without a folder prefix |
- | `voice_livekit_recording_filepath` | Object key template, default `voice/{room_name}-{utc}` |
-
-4. Enable `voice_livekit_recording_enabled` and start a recording in a
- LiveKit-routed room. Egress adds the file extension and Voice adds a random
+ | `live_livekit_recording_s3_region` | The recording bucket's AWS region |
+ | `live_livekit_recording_s3_access_key_id` | Dedicated recording access key |
+ | `live_livekit_recording_s3_secret_access_key` | Dedicated recording secret key |
+ | `live_livekit_recording_s3_endpoint` | Leave empty for AWS S3; an HTTPS origin for S3-compatible storage |
+ | `live_livekit_recording_s3_bucket` | Bucket name only, without a folder prefix |
+ | `live_livekit_recording_filepath` | Object key template, default `live/{room_name}-{utc}` |
+
+4. Enable `live_livekit_recording_enabled` and start a recording in a
+ LiveKit-routed room. Egress adds the file extension and Live adds a random
suffix to the object key.
The recording credentials are sent to the configured LiveKit server over
HTTPS with each start request. No S3 credentials are sent to participants.
The endpoint option uses path-style addressing for S3-compatible providers.
-When recording finishes, Voice sends the requester a PM with the location
+When recording finishes, Live sends the requester a PM with the location
returned by LiveKit. **This is not a signed download URL.** For private
buckets, an operator must retrieve the file using authenticated S3 access;
the PM link alone does not grant access. Discourse secure-upload rules do
@@ -151,15 +151,15 @@ See [LiveKit's output and storage documentation](https://docs.livekit.io/transpo
hear each other and see cameras.
2. In `chrome://webrtc-internals`, a LiveKit call shows a **single**
PeerConnection to the SFU host (a mesh call shows one per participant).
-3. The join response (`POST /voice/rooms/:id/join` in devtools) carries
+3. The join response (`POST /live/rooms/:id/join` in devtools) carries
`"transport": "livekit"`.
4. For an automated end-to-end check from a dev machine, see
[Local testing](#local-testing-and-the-gated-system-spec).
-If joins fail with "Voice server unavailable", the server rejected the token
+If joins fail with "Live server unavailable", the server rejected the token
mint (bad key/secret or half-deleted config) — check `/logs` for entries
-prefixed `[voice-livekit]`. If joins fail with "Your network cannot reach
-the voice server", minting worked but the **client** couldn't reach the SFU
+prefixed `[live-livekit]`. If joins fail with "Your network cannot reach
+the live server", minting worked but the **client** couldn't reach the SFU
(corporate firewall blocking WSS/UDP is the usual suspect) — this is
deliberately never fallen back to mesh, because other participants may reach
the SFU fine and a room must never split across transports.
@@ -169,11 +169,11 @@ the SFU fine and a room must never split across transports.
- **Settings changes** (URL, keys, policy) apply to each room's next call.
Live calls keep their pinned transport until the room empties.
- **Ending a live call**: admins can end any room's call from
- **Admin → Plugins → Voice** (the room list's "End call" action). It kicks
+ **Admin → Plugins → Live** (the room list's "End call" action). It kicks
every participant, deletes the LiveKit room, and clears the transport pin,
so the next join re-resolves against current settings.
- **Emergency levers**:
- - `rake voice:clear_transport_pins` drops every pinned transport at once
+ - `rake live:clear_transport_pins` drops every pinned transport at once
(rooms re-resolve on their next join; occupants of a live call are not
disconnected, so prefer "End call" for occupied rooms).
- Setting the policy back to `disabled` stops new LiveKit calls immediately;
@@ -190,7 +190,7 @@ the SFU fine and a room must never split across transports.
With `webhook.urls` configured on the LiveKit server (see
[Provisioning](#provisioning-a-livekit-server)), the plugin accepts signed
-webhook deliveries at `POST /voice/livekit/webhook` and uses them as a
+webhook deliveries at `POST /live/livekit/webhook` and uses them as a
**reconcile-only backstop**:
- `participant_left` / `participant_connection_aborted` expire the
@@ -214,14 +214,14 @@ and its implementation checklist.
Deliveries are authenticated by the `Authorization` JWT LiveKit signs with the
API secret, which includes a hash of the request body — no extra shared
secret to configure. Rejected deliveries are logged to `/logs` prefixed
-`[voice-livekit]`.
+`[live-livekit]`.
## Multisite / shared clusters
- Use one API key pair per site.
- Room names are namespaced with the site's database name by default
(`{db}-r{room_id}`), so sites on a shared LiveKit server can't collide;
- `voice_livekit_room_prefix` overrides the prefix.
+ `live_livekit_room_prefix` overrides the prefix.
- Webhooks are a partial fit here: LiveKit signs every delivery with the
single `webhook.api_key`, so with per-site key pairs only the site owning
that key can verify deliveries — the others safely reject them (403) and
@@ -248,8 +248,8 @@ Then run the real-LiveKit system spec, which is skipped unless the URL is
present:
```bash
-VOICE_LIVEKIT_TEST_URL=ws://localhost:7880 \
- bin/rspec plugins/voice/spec/system/voice_livekit_spec.rb
+LIVE_LIVEKIT_TEST_URL=ws://localhost:7880 \
+ bin/rspec plugins/live/spec/system/live_livekit_spec.rb
```
(When running on a dev machine add `CI=1`: outside CI, core pins every test
@@ -266,20 +266,20 @@ against LiveKit-routed rooms unchanged, for the same reason.
## LiveKit Agent Builder
-Voice supports manually inviting a chosen LiveKit Cloud agent into ongoing
-public Voice calls. Deploy the agent with Agent Builder in the same Cloud project
-configured for Voice. The agent does not need `VOICE_AGENT_CREDENTIAL` or a
+Live supports manually inviting a chosen LiveKit Cloud agent into ongoing
+public Live calls. Deploy the agent with Agent Builder in the same Cloud project
+configured for Live. The agent does not need `LIVE_AGENT_CREDENTIAL` or a
Discourse HTTP tool.
### Setup and testing
-1. In **Admin → Settings**, enable `voice_livekit_agent_enabled`. This creates the
- `livekit_agent_bot` account automatically. Voice uses its existing LiveKit URL
+1. In **Admin → Settings**, enable `live_livekit_agent_enabled`. This creates the
+ `livekit_agent_bot` account automatically. Live uses its existing LiveKit URL
and API credentials.
-2. Make a public Voice room use LiveKit through the existing room policy. Join it
+2. Make a public Live room use LiveKit through the existing room policy. Join it
as a human and confirm that the call uses LiveKit. Mesh calls cannot invite an
agent and do not switch transport automatically.
-3. As a member of `voice_livekit_agent_invite_allowed_groups` (admins by default),
+3. As a member of `live_livekit_agent_invite_allowed_groups` (admins by default),
open the room's **…** menu (on its page or in the sidebar) and
select **Invite LiveKit agent**. The same action is available in the widget’s
**…** menu. The modal lists the agents deployed to the LiveKit Cloud project by
@@ -302,12 +302,12 @@ Discourse HTTP tool.
invite groups, and a missing or inactive bot cannot initiate an invitation.
Set the LiveKit webhook URL to the site's public HTTPS origin followed by
-`/voice/livekit/webhook`. Keep scheduled jobs running even
+`/live/livekit/webhook`. Keep scheduled jobs running even
when webhooks are configured so missed events and cleanup failures are retried.
Agents always join as speakers. They do not count toward human capacity,
attendance, badges, or participation statistics. Room managers can kick them;
-only members of `voice_livekit_agent_invite_allowed_groups` (admins by default)
+only members of `live_livekit_agent_invite_allowed_groups` (admins by default)
can invite them. Nothing automatically dispatches an agent when humans join a
room.
@@ -340,8 +340,8 @@ and [implementation contract](./roadmap/agent-participation.md).
Automated checks:
```bash
-LOAD_PLUGINS=1 bin/rspec plugins/voice/spec --exclude-pattern 'plugins/voice/spec/system/**/*_spec.rb'
-CI=1 bin/qunit --standalone --target voice --filter '/VoiceInviteAgentButton|VoiceParticipantSidebarContextMenu|voice-webrtc-livekit/i'
+LOAD_PLUGINS=1 bin/rspec plugins/live/spec --exclude-pattern 'plugins/live/spec/system/**/*_spec.rb'
+CI=1 bin/qunit --standalone --target live --filter '/LiveInviteAgentButton|LiveParticipantSidebarContextMenu|live-webrtc-livekit/i'
```
The real-SFU system spec above tests human media. A real dashboard-agent
diff --git a/plugins/voice/docs/local-fake-participants.md b/plugins/live/docs/local-fake-participants.md
similarity index 67%
rename from plugins/voice/docs/local-fake-participants.md
rename to plugins/live/docs/local-fake-participants.md
index 324c5b2d2b2..4354eb9e85c 100644
--- a/plugins/voice/docs/local-fake-participants.md
+++ b/plugins/live/docs/local-fake-participants.md
@@ -1,6 +1,6 @@
-# Local fake participants for Voice
+# Local fake participants for Live
-This developer-only harness opens several Playwright browser contexts, logs each one in as a bot user, injects fake camera/audio/screen-share media, and joins a Voice room. It is meant for local interactive WebRTC testing, not CI.
+This developer-only harness opens several Playwright browser contexts, logs each one in as a bot user, injects fake camera/audio/screen-share media, and joins a Live room. It is meant for local interactive WebRTC testing, not CI.
## Quick start
@@ -9,20 +9,20 @@ From the plugin checkout:
```bash
pnpm install
DISCOURSE_URL=http://localhost:4200 ROOM=watercooler BOT_COUNT=3 \
- pnpm voice:bots -- --headed --screenshots
+ pnpm live:bots -- --headed --screenshots
```
By default the harness uses Discourse's development/test-only `/session/:username/become.json` login route. That means the named users must already exist and the target site must allow that route.
## Bot config
-If `.local/voice-bots.json` exists, it is used instead of generated `voice_bot_N` usernames.
+If `.local/live-bots.json` exists, it is used instead of generated `live_bot_N` usernames.
Create it from the example:
```bash
mkdir -p .local
-cp docs/examples/voice-bots.example.json .local/voice-bots.json
+cp docs/examples/live-bots.example.json .local/live-bots.json
```
Example:
@@ -30,13 +30,13 @@ Example:
```json
[
{
- "username": "voice_bot_1",
+ "username": "live_bot_1",
"label": "Alice fake camera",
"color": "#2563eb",
"accent": "#f97316"
},
{
- "username": "voice_bot_2",
+ "username": "live_bot_2",
"label": "Bob fake camera",
"color": "#16a34a",
"accent": "#7c3aed"
@@ -47,22 +47,22 @@ Example:
You can also pass JSON directly:
```bash
-VOICE_BOTS_JSON='[{"username":"alice"},{"username":"bob"}]' \
- DISCOURSE_URL=http://localhost:4200 ROOM=watercooler pnpm voice:bots -- --headed
+LIVE_BOTS_JSON='[{"username":"alice"},{"username":"bob"}]' \
+ DISCOURSE_URL=http://localhost:4200 ROOM=watercooler pnpm live:bots -- --headed
```
## Useful options
```bash
-pnpm voice:bots -- --help
+pnpm live:bots -- --help
```
Common flags:
- `--headed`: show browser windows.
-- `--screenshots`: write screenshots to `tmp/voice-bots/`.
-- `--trace`: write Playwright trace zips to `tmp/voice-bots/`.
-- `--record-video`: write Playwright videos to `tmp/voice-bots/`.
+- `--screenshots`: write screenshots to `tmp/live-bots/`.
+- `--trace`: write Playwright trace zips to `tmp/live-bots/`.
+- `--record-video`: write Playwright videos to `tmp/live-bots/`.
- `--screen-share-bot 1`: make the first bot start fake screen share.
- `--hold-ms 30000`: auto-close after 30 seconds; otherwise runs until Ctrl-C.
- `--no-camera`: join without immediately starting camera.
@@ -73,8 +73,8 @@ For non-development sites, use password login with credentials in the ignored lo
```json
[
- { "username": "voice_bot_1", "password": "local-only-password" },
- { "username": "voice_bot_2", "password": "local-only-password" }
+ { "username": "live_bot_1", "password": "local-only-password" },
+ { "username": "live_bot_2", "password": "local-only-password" }
]
```
@@ -82,7 +82,7 @@ Then run:
```bash
LOGIN_MODE=password DISCOURSE_URL=https://example.test ROOM=watercooler \
- pnpm voice:bots -- --headed
+ pnpm live:bots -- --headed
```
Do not commit real credentials.
diff --git a/plugins/voice/docs/roadmap/agent-participation.md b/plugins/live/docs/roadmap/agent-participation.md
similarity index 93%
rename from plugins/voice/docs/roadmap/agent-participation.md
rename to plugins/live/docs/roadmap/agent-participation.md
index 62f53cd3250..acf7ac0319a 100644
--- a/plugins/voice/docs/roadmap/agent-participation.md
+++ b/plugins/live/docs/roadmap/agent-participation.md
@@ -2,15 +2,15 @@
## Product contract
-- `voice_livekit_agent_enabled` creates one negative-ID bot, `livekit_agent_bot`.
+- `live_livekit_agent_enabled` creates one negative-ID bot, `livekit_agent_bot`.
Disabling preserves the account; enabling again reuses it. An existing unrelated
account with that username is never adopted.
- The invite modal lists the dispatch names of agents deployed to the LiveKit Cloud
project (read through the Cloud agents catalogue with the project credentials, cached
briefly) and falls back to a typed dispatch name when nothing is listed. The feature
uses the existing LiveKit Cloud project credentials and dashboard deployment.
-- Members of `voice_livekit_agent_invite_allowed_groups` (admins by default, admins always
- included) explicitly invite the bot through a public Voice room's menu, including the widget
+- Members of `live_livekit_agent_invite_allowed_groups` (admins by default, admins always
+ included) explicitly invite the bot through a public Live room's menu, including the widget
menu. A human must already be present, and the call must already use LiveKit.
- The bot speaks and listens. Room managers can kick it without a timed exclusion;
inviters can immediately invite it again. Private rooms and mesh calls are outside
diff --git a/plugins/voice/docs/roadmap/livekit-sfu.md b/plugins/live/docs/roadmap/livekit-sfu.md
similarity index 87%
rename from plugins/voice/docs/roadmap/livekit-sfu.md
rename to plugins/live/docs/roadmap/livekit-sfu.md
index 4d8183f82ac..7e217467365 100644
--- a/plugins/voice/docs/roadmap/livekit-sfu.md
+++ b/plugins/live/docs/roadmap/livekit-sfu.md
@@ -24,7 +24,7 @@ nothing more), replacing mesh as the default.
## 1. Design summary
LiveKit is added *beside* the mesh as a per-room transport branch inside
-`voice-webrtc.js` — not as a formal transport-interface refactor. The mesh
+`live-webrtc.js` — not as a formal transport-interface refactor. The mesh
path (glare handling, offer retries, ICE-restart detection, transceiver
pre-allocation, join-race buffering in `peer-manager.js` / `signaling.js`) is
battle-tested and is **not extracted, rewritten, or adapterized**. The service
@@ -62,17 +62,17 @@ media — they are **identical on both transports by construction**.
| Decision | Choice | Why |
|---|---|---|
-| Presence/sessions | Keep REST heartbeat + Redis + MessageBus for both transports; LiveKit webhooks are an optional reconcile-only backstop (PR 8) | Sessions, badges, co-presence, user status, admin stats, anon directory all key off `ParticipantTracker` + `Voice::Session`. Webhooks-as-authority would fork every consumer and break anon directory viewing. Heartbeats guarantee identical analytics on both transports with zero change. |
+| Presence/sessions | Keep REST heartbeat + Redis + MessageBus for both transports; LiveKit webhooks are an optional reconcile-only backstop (PR 8) | Sessions, badges, co-presence, user status, admin stats, anon directory all key off `ParticipantTracker` + `Live::Session`. Webhooks-as-authority would fork every consumer and break anon directory viewing. Heartbeats guarantee identical analytics on both transports with zero change. |
| LiveKit JS delivery | Vendored ESM bundle under `public/javascripts/livekit/`, dynamic `import()` at join time | Matches the mediapipe precedent (`background-blur.js:39–51` dynamically imports vendored assets by URL). Zero LiveKit bytes shipped/parsed on the P2P path; no coupling to core's build. Pinned + checked in, rebuilt via a script like `scripts/build-dtln-worklet.sh`. |
| Ruby dependency | No gem. Mint JWTs with core's `jwt` gem; hand-roll three Twirp-JSON RoomService calls (~60 lines) | The token is a stable, documented HS256 JWT; RoomService accepts plain JSON POSTs to `/twirp/livekit.RoomService/*` with a `roomAdmin` JWT bearer. Avoids plugin gem pinning/boot friction. |
| Transport policy | Server-decided at join; pinned per live room instance; policy enum `disabled \| per_room \| all_rooms`. No threshold-based auto-cascade | Mid-call mesh→SFU migration requires dual-connection handoff — maximum risk, zero-regression antithesis. Static per-room-instance resolution covers the enterprise ask ("our town-hall room uses the SFU"). A static size-based variant is a 5-line resolver addition later if demand appears. |
| Mute/PTT semantics | Keep `track.enabled` flipping on LiveKit too (silence frames through SFU, DTX-suppressed); do not use LiveKit `setMuted` | Identical code path on both transports (`toggleMute` ~:652, PTT ~:2767); zero divergence in PTT latency. Roster mute state already travels as presence metadata via `POST /state`, not media state. |
-| SDK options | `adaptiveStream: false`, `dynacast: true`, audio auto-subscribe on | `adaptiveStream` keys quality/pausing off attached-element visibility — incompatible with service-owned elements (would pause "invisible" video). `autoSubscribe: false` for audio risks a subscription bug meaning silence — the worst failure mode for a voice product. |
+| SDK options | `adaptiveStream: false`, `dynacast: true`, audio auto-subscribe on | `adaptiveStream` keys quality/pausing off attached-element visibility — incompatible with service-owned elements (would pause "invisible" video). `autoSubscribe: false` for audio risks a subscription bug meaning silence — the worst failure mode for a live product. |
| Client secrets | None of the new settings are `client: true` | URL + token reach the client only through the join response of rooms actually resolved to LiveKit. (Deliberately not repeating the TURN-credential-to-every-client pattern of `settings.yml:30–33`.) |
## 3. Transport seam contract
-The exact call sites in `voice-webrtc.js` that branch on transport.
+The exact call sites in `live-webrtc.js` that branch on transport.
`LivekitRoomSession` must satisfy the right-hand column.
### Service → transport (outbound)
@@ -106,12 +106,12 @@ match roster participant ids — `remoteStreamFor(roomId, userId)`
### Explicitly unchanged
-`lib/voice/peer-manager.js`, `lib/voice/signaling.js`,
+`lib/live/peer-manager.js`, `lib/live/signaling.js`,
`room-message-queue.js`, all pipeline libs (`noise-suppression.js`,
`input-gate.js`, `background-blur.js`, `audio-monitor.js`, `media-devices.js`,
`ptt-manager.js`, `ptt-utils.js`, `sound-effects.js`), every component
(call-controls, call-widget, room-page, video-tile, voice-canvas, chat-panel,
-settings modals, sidebar), all initializers, `voice-rooms.js`, and the whole
+settings modals, sidebar), all initializers, `live-rooms.js`, and the whole
public service API consumed by the UI
(`join/leave/toggleMute/toggleDeafen/toggleCamera/toggleScreenShare/attachStream/attachVideoStream/remoteStreams/remoteScreenAudioStreams/remoteStreamFor/connectionStateFor/setWatching/canPublishVideo/videoAllowedIn/setInputDevice/setOutputDevice/setVideoInputDevice/localStream/localVideoStream/localVideoKind/audioEnabled/deafened/ptt*`).
@@ -120,45 +120,45 @@ public service API consumed by the UI
### Settings (`config/settings.yml`, after the TURN block)
```yaml
-voice_livekit_url: # wss://livekit.example.com — empty = unavailable
+live_livekit_url: # wss://livekit.example.com — empty = unavailable
default: ""
-voice_livekit_api_key:
+live_livekit_api_key:
default: ""
-voice_livekit_api_secret:
+live_livekit_api_secret:
default: ""
secret: true
-voice_livekit_room_policy:
+live_livekit_room_policy:
default: "disabled"
type: enum
choices: [disabled, per_room, all_rooms]
- validator: "VoiceLivekitPolicyValidator"
-voice_livekit_room_prefix: # LiveKit room-name namespace override
+ validator: "LiveLivekitPolicyValidator"
+live_livekit_room_prefix: # LiveKit room-name namespace override
default: ""
-voice_livekit_mesh_fallback: # opt-in: empty room + mint failure → pin mesh
+live_livekit_mesh_fallback: # opt-in: empty room + mint failure → pin mesh
default: false
```
-None are `client: true`. `VoiceLivekitPolicyValidator` follows core's
+None are `client: true`. `LiveLivekitPolicyValidator` follows core's
`lib/validators/*_validator.rb` convention: refuses any policy other than
-`disabled` unless `voice_livekit_url` (must be `ws://` or `wss://`),
-`voice_livekit_api_key`, and `voice_livekit_api_secret` are all present,
+`disabled` unless `live_livekit_url` (must be `ws://` or `wss://`),
+`live_livekit_api_key`, and `live_livekit_api_secret` are all present,
with a specific translated error per missing field (`server.en.yml`). Admins
get config-time failure, not first-join failure.
-`plugin.rb` serializes one Site attribute next to `voice_public_access`
-(plugin.rb:90): `voice_livekit_per_room_available` = configured **and**
+`plugin.rb` serializes one Site attribute next to `live_public_access`
+(plugin.rb:90): `live_livekit_per_room_available` = configured **and**
policy == `per_room`. It exists solely to gate the room-form checkbox — the
client never needs the policy enum itself.
-### New: `lib/voice/livekit.rb`
+### New: `lib/live/livekit.rb`
```ruby
-module Voice::Livekit
+module Live::Livekit
def self.configured? # url + key + secret all present
def self.available_for?(room) # configured? && (all_rooms || (per_room && room.livekit_enabled))
def self.room_name(room)
# default: "#{RailsMultisite::ConnectionManagement.current_db}-r#{room.id}"
- # (room id, not slug — slugs are mutable); voice_livekit_room_prefix overrides the db prefix
+ # (room id, not slug — slugs are mutable); live_livekit_room_prefix overrides the db prefix
end
def self.mint_token(user:, room:, guardian:) # HS256 JWT via core's `jwt` gem
end
@@ -168,7 +168,7 @@ Token claims — least privilege, explicit:
- `iss`: api key, `sub`: `user.id.to_s`, `name`: username, `exp`: now + 10 min
- `video`: `room` = room_name, `roomJoin: true`, `canSubscribe: true`,
- `canPublish` = `guardian.can_speak_in_voice_room?(room)`
+ `canPublish` = `guardian.can_speak_in_live_room?(room)`
(guardian_extension.rb:86–91), `canPublishSources` = mic always (when
canPublish) + `camera`/`screen_share`/`screen_share_audio` iff
`room.video_allowed?`, `canPublishData: false`,
@@ -178,19 +178,19 @@ Token claims — least privilege, explicit:
A leaked token can only join one room, as one user, for ≤10 minutes. Guardian
remains the sole authority: tokens exist only for users who passed
-`ensure_can_join_voice_room!`. `voice_video_max_publishers` stays enforced
+`ensure_can_join_live_room!`. `live_video_max_publishers` stays enforced
where it is today (`rooms_controller#state`, rooms_controller.rb:207–210) —
it's a roster-flag gate, transport-independent.
-### Transport pin: `app/services/voice/participant_tracker.rb`
+### Transport pin: `app/services/live/participant_tracker.rb`
-(NOT `lib/voice/` — the class lives in app/services, `KEY_NAMESPACE =
-"voice:room"`, `SAFETY_TTL = 30.minutes` at :5–7.)
+(NOT `lib/live/` — the class lives in app/services, `KEY_NAMESPACE =
+"live:room"`, `SAFETY_TTL = 30.minutes` at :5–7.)
-- New Redis key `voice:room:{id}:transport`; `pin_transport!(room_id,
+- New Redis key `live:room:{id}:transport`; `pin_transport!(room_id,
transport)` uses `SET NX`; `pinned_transport(room_id)`;
`clear_transport_pin(room_id)`.
-- TTL = `2 × SiteSetting.voice_participant_ttl_seconds` (settings.yml:19,
+- TTL = `2 × SiteSetting.live_participant_ttl_seconds` (settings.yml:19,
default 30 s), refreshed on every join/heartbeat — a crashed room self-heals
in ~60 s instead of holding a stale transport.
- Cleared explicitly when the room empties: on last leave in
@@ -199,15 +199,15 @@ it's a roster-flag gate, transport-independent.
which already sweeps recently-active rooms and can detect emptied ones.
Room-emptied cleanup also fires best-effort `delete_room` (below).
-### `app/controllers/voice/rooms_controller.rb`
+### `app/controllers/live/rooms_controller.rb`
- **`#join`** (:95–128): before the presence add —
`transport = pinned || (Livekit.available_for?(room) ? "livekit" : "mesh")`;
pin it. Response gains `transport:` and, for livekit,
`livekit: { url:, token: }`. Mint failure handling per the §7 table.
- **New `#livekit_token`** (`POST rooms/:id/livekit_token` in
- `config/routes.rb`): `ensure_can_join_voice_room!` +
- `RateLimiter.new(current_user, "voice-livekit-token", 10, 1.minute)`
+ `config/routes.rb`): `ensure_can_join_live_room!` +
+ `RateLimiter.new(current_user, "live-livekit-token", 10, 1.minute)`
(network-flap rejoins are the legitimate burst case). The endpoint
**re-adds presence + refreshes metadata itself** (same authz as heartbeat) —
it must not require existing Redis presence, because its one consumer is the
@@ -225,7 +225,7 @@ it's a roster-flag gate, transport-independent.
session too.
- **`#destroy`**: best-effort `delete_room`.
-### `app/controllers/voice/room_memberships_controller.rb`
+### `app/controllers/live/room_memberships_controller.rb`
On role change in a livekit-pinned room, best-effort
`RoomServiceClient.update_participant(permission: { can_publish: ... })` so a
@@ -233,13 +233,13 @@ promoted stage listener can publish without reconnecting (client sees
`ParticipantPermissionsChanged` → `refreshPublications()`). Fallback if the
call fails: client re-mints via `livekit_token` and reconnects.
-### New: `lib/voice/livekit/room_service_client.rb` (~60 lines)
+### New: `lib/live/livekit/room_service_client.rb` (~60 lines)
Twirp-JSON POSTs — `RemoveParticipant`, `UpdateParticipant`, `DeleteRoom` — to
`/twirp/livekit.RoomService/*` with a short-lived `roomAdmin` JWT bearer, via
core HTTP conventions (`FinalDestination`/Excon). Timeout 2 s, always rescued:
LiveKit being down must never fail a Discourse request. Every failure log
-prefixed `[voice-livekit]`.
+prefixed `[live-livekit]`.
### Admin: emergency "End live call"
@@ -248,31 +248,31 @@ clears the transport pin, and iterates current participant ids publishing the
**existing per-user `kicked` message** (`RoomBroadcaster#publish_kick`,
room_broadcaster.rb:69–75) to each — zero client changes, `#handleKicked`
already forces leave. Rejoining users re-resolve the transport. Also ship
-`rake voice:clear_transport_pins` for emergencies.
+`rake live:clear_transport_pins` for emergencies.
### Admin health/diagnostics (own PR)
1. Flipping LiveKit config enqueues a one-shot connectivity-probe job whose
result surfaces to the admin within seconds, not at first user join.
-2. `GET /admin/plugins/voice/livekit/status` (AdminConstraint) returns:
+2. `GET /admin/plugins/live/livekit/status` (AdminConstraint) returns:
settings-present booleans (never values), a token self-mint check, a
RoomService `list_rooms` probe with latency + error string,
`last_webhook_at`, and currently pinned livekit rooms with a
Redis-presence vs LiveKit `list_participants` diff — the triage view for
"connects but no media" / ghost-participant support cases.
-3. Rendered as a card in `admin/assets/javascripts/admin/components/voice-dashboard.gjs`.
+3. Rendered as a card in `admin/assets/javascripts/admin/components/live-dashboard.gjs`.
4. A request spec asserts the API secret never appears in any serializer or
status payload.
### Per-room policy surface
-- Migration: `add_column :voice_rooms, :livekit_enabled, :boolean,
+- Migration: `add_column :live_rooms, :livekit_enabled, :boolean,
default: false, null: false` (load `.skills/discourse-migration` first).
- Permit `livekit_enabled` in both room param lists; expose on
`room_serializer.rb` to managers only. The live instance's transport is
never serialized — clients learn it at join.
-- `components/voice-room-form.gjs`: one FormKit checkbox ("Use media server
- (SFU)") gated on `Site.voice_livekit_per_room_available`. Stale-form edge:
+- `components/live-room-form.gjs`: one FormKit checkbox ("Use media server
+ (SFU)") gated on `Site.live_livekit_per_room_available`. Stale-form edge:
a form loaded before an admin flips policy can still submit
`livekit_enabled` — harmless (resolver re-checks policy at join); pin with a
request spec that the attribute is accepted-but-inert when policy no longer
@@ -280,18 +280,18 @@ already forces leave. Rejoining users re-resolve the transport. Also ship
### Webhooks (optional, PR 8 — reconcile-only)
-`POST /voice/livekit/webhook` (engine-scoped, skips CSRF + login), verifies
+`POST /live/livekit/webhook` (engine-scoped, skips CSRF + login), verifies
the `Authorization` JWT (HS256, api key/secret) + SHA256 body hash. Handles
`participant_left` **and** `participant_connection_aborted` by early-expiring
Redis presence that LiveKit knows is gone (same removal path heartbeat-TTL
uses); `room_finished` clears the transport pin. Every verified webhook
-`SETEX`es `voice:livekit:last_webhook_at` for the status panel (stale = warning,
+`SETEX`es `live:livekit:last_webhook_at` for the status panel (stale = warning,
never error). Never creates presence; never touches `Session` rows —
`CloseOrphanedSessions` remains the correctness backstop on both transports.
## 5. Client changes
-### New: `lib/voice/livekit-session.js` (~350 lines)
+### New: `lib/live/livekit-session.js` (~350 lines)
One instance per active LiveKit room, owned by the service, callback-injected
in the same style as `PeerManager` (which is what makes it unit-testable):
@@ -319,7 +319,7 @@ export default class LivekitRoomSession {
```
Default `loadSdk`:
-`import(getURL("/plugins/voice/javascripts/livekit/livekit-client.mjs"))` —
+`import(getURL("/plugins/live/javascripts/livekit/livekit-client.mjs"))` —
never evaluated for mesh rooms.
**Publish rules**
@@ -363,7 +363,7 @@ big rooms):
stop immediately, local teardown + rejoin toast; after exhaustion,
`leave(room)` + toast.
-### Modified: `app/services/voice-webrtc.js` (~200-line diff, all additive/guarded)
+### Modified: `app/services/live-webrtc.js` (~200-line diff, all additive/guarded)
1. State: `#roomTransports = new Map()` (roomId → transport, default `"mesh"`
when untagged so pre-tag messages/tests/old servers behave identically),
@@ -375,8 +375,8 @@ big rooms):
`ajax(.../leave, { type: "DELETE" })` before `#handleJoinFailure(room.id)`**
— the exact precedent of the mic-failure path at ~:431–437; otherwise the
user ghosts in the roster for the presence TTL and the Session row dangles.
- Distinct translated toast ("your network cannot reach the voice server" —
- different from the server-side mint-failure copy) + `[voice-livekit]`
+ Distinct translated toast ("your network cannot reach the live server" —
+ different from the server-side mint-failure copy) + `[live-livekit]`
console log. **No mesh fallback client-side ever** — other clients may
reach the SFU fine; falling back would split future joins.
3. `#processRoomMessage` (~:1735): `signal` case early-returns for livekit
@@ -427,7 +427,7 @@ attach/volume/deafen/PTT/idle/audio-monitor code.
Server-only, at join:
```
-pinned = redis GET voice:room:{id}:transport
+pinned = redis GET live:room:{id}:transport
if pinned → use pinned
elsif Livekit.available_for?(room) → "livekit", pin
else → "mesh", pin
@@ -439,18 +439,18 @@ else → "mesh", pin
- **Config changes affect only the next room instance** (first join after the
room empties / pin expires). Live calls are never migrated or split. Setting
descriptions state this explicitly. Emergency levers: admin "End live call",
- `rake voice:clear_transport_pins`.
+ `rake live:clear_transport_pins`.
## 7. Failure-mode policy
| # | Failure | Behavior |
|---|---|---|
-| a | Token mint fails, room EMPTY | Join fails: specific translated toast ("Voice server unavailable — contact your administrator"), `[voice-livekit]` log, status panel red. If `voice_livekit_mesh_fallback` is on (opt-in — silent degradation hides outages from ops) **and the room is empty**, pin mesh for this call and proceed. |
+| a | Token mint fails, room EMPTY | Join fails: specific translated toast ("Live server unavailable — contact your administrator"), `[live-livekit]` log, status panel red. If `live_livekit_mesh_fallback` is on (opt-in — silent degradation hides outages from ops) **and the room is empty**, pin mesh for this call and proceed. |
| b | Token mint fails, room OCCUPIED on livekit | Join fails with the same toast. Never fall back — would split the call. |
| c | Mid-call SFU blip | SDK auto-resume; heartbeats keep presence/sessions/badges unaffected throughout. |
| d | Mid-call SFU hard-down | Reconnect ladder: 3 token-refetch attempts with backoff via `livekit_token`; then `leave()` + toast. |
| e | Webhooks undeliverable | Zero correctness impact; status panel shows stale `last_webhook_at` as a warning. |
-| f | Mint succeeds but the CLIENT can't reach the SFU (corporate firewall blocking WSS/UDP — the most common enterprise failure) | Distinct toast ("your network cannot reach the voice server"), immediate `DELETE /leave` cleanup, `[voice-livekit]` console log. **No mesh fallback even under (a)'s setting** — other clients may reach the SFU fine. |
+| f | Mint succeeds but the CLIENT can't reach the SFU (corporate firewall blocking WSS/UDP — the most common enterprise failure) | Distinct toast ("your network cannot reach the live server"), immediate `DELETE /leave` cleanup, `[live-livekit]` console log. **No mesh fallback even under (a)'s setting** — other clients may reach the SFU fine. |
| g | Pin says livekit, config half-deleted | Same as (a)/(b) — 503 with clear error; validator (§4) makes this hard to reach. |
| h | Reconnect ladder finds pin gone/re-resolved (room instance ended while client slept) | `livekit_token` returns `410 Gone`; client stops the ladder, local teardown, rejoin toast. |
@@ -484,18 +484,18 @@ Order: 1 → 2 → 3 strictly sequential; 4/5/6 parallelizable after 3; 7/8/9
last. Run `bin/lint --fix` on every change; JS tests run via CI.
**PR 1 — P2P-only seam tagging (zero behavior change).**
-`voice-webrtc.js`: `#roomTransports`/`#isMeshRoom` defaulting mesh; guard
+`live-webrtc.js`: `#roomTransports`/`#isMeshRoom` defaulting mesh; guard
the peer-build block in `#handleParticipants`, the `signal` dispatch, and
`#handleRoleChange`'s rebuild; read `data.transport ?? "mesh"` in `join`.
`rooms_controller.rb`: join response gains `transport: "mesh"`.
-*Acceptance*: entire existing JS suite (`voice-webrtc-test.js`,
+*Acceptance*: entire existing JS suite (`live-webrtc-test.js`,
`peer-manager-test.js`, `signaling-test.js`), integration `.gjs` tests, and
system specs pass **unmodified**; diff has no deletions of mesh logic.
**PR 2 — Server: settings, validator, resolver, tokens, pin.**
-`settings.yml` + locales, `lib/validators/voice_livekit_policy_validator.rb`,
-`lib/voice/livekit.rb`, pin helpers in
-`app/services/voice/participant_tracker.rb`, `rooms_controller.rb`
+`settings.yml` + locales, `lib/validators/live_livekit_policy_validator.rb`,
+`lib/live/livekit.rb`, pin helpers in
+`app/services/live/participant_tracker.rb`, `rooms_controller.rb`
(resolution, join payload, `livekit_token` with presence re-add + rate limit +
410 semantics, signal guard, pin-clear on last leave),
`Jobs::PublishRoomParticipants` backstop, `config/routes.rb`, `plugin.rb`
@@ -511,7 +511,7 @@ mesh-fallback setting. Secret never appears in any payload.
**PR 3 — Client: vendored SDK + LivekitRoomSession, audio-only calls.**
`scripts/build-livekit-bundle.sh`, checked-in bundle, package.json devDep,
-`lib/voice/livekit-session.js`, `voice-webrtc.js` (join/connect path with
+`lib/live/livekit-session.js`, `live-webrtc.js` (join/connect path with
DELETE-/leave-on-failure, `#replaceTrackOnAllPeers` fan-out, leave/teardown +
`skipServer`, disconnect-reason handling, ghost-participant roster rule), unit
tests with a fake SDK injected via `loadSdk`.
@@ -537,10 +537,10 @@ selection: >6 publishers → LOW tiles, screenshare stays HIGH; role promotion
publishes mic without reconnect. Mesh video tests untouched.
**PR 5 — Server: moderation/lifecycle sync.**
-`lib/voice/livekit/room_service_client.rb` (3 Twirp calls),
+`lib/live/livekit/room_service_client.rb` (3 Twirp calls),
`rooms_controller#kick`/`#destroy`, `room_memberships_controller.rb`, "End
live call" admin action (per-user `publish_kick` loop + `delete_room` + pin
-clear), `rake voice:clear_transport_pins`, WebMock specs.
+clear), `rake live:clear_transport_pins`, WebMock specs.
*Acceptance*: kick/role change/destroy fire Twirp calls on livekit-pinned
rooms; LiveKit downtime never fails a Discourse request; mesh rooms make zero
HTTP calls; End-live-call empties a room using only existing client message
@@ -548,25 +548,25 @@ types.
**PR 6 — Per-room policy surface.**
Migration (load `.skills/discourse-migration` first), `room.rb`, serializer,
-both param permit lists, `voice-room-form.gjs` FormKit checkbox gated on
-`Site.voice_livekit_per_room_available`, locales.
+both param permit lists, `live-room-form.gjs` FormKit checkbox gated on
+`Site.live_livekit_per_room_available`, locales.
*Acceptance*: checkbox visible only when configured + policy `per_room`;
toggling mid-call doesn't affect the live instance (pin precedence spec);
stale-form submit is accepted-but-inert when policy changed; mesh-only
installs see no form change.
**PR 7 — Real-LiveKit testing, docs, runbook.**
-`spec/system/voice_livekit_spec.rb` (two-browser camera flow mirroring
-`voice_voice_rooms_spec.rb`, gated on `ENV["VOICE_LIVEKIT_TEST_URL"]`,
+`spec/system/live_livekit_spec.rb` (two-browser camera flow mirroring
+`live_live_rooms_spec.rb`, gated on `ENV["LIVE_LIVEKIT_TEST_URL"]`,
docs show `docker run livekit/livekit-server --dev`); verify
-`voice_fake_media.rb` fakes satisfy the SDK (expected no-op — livekit-client
+`live_fake_media.rb` fakes satisfy the SDK (expected no-op — livekit-client
uses `navigator.mediaDevices` and we publish our own tracks);
`docs/local-fake-participants.md`, `README.md`, `ARCHITECTURE.md` updates;
§10 runbook as an ops doc including CSP note; manual Safari + iOS/Android
checklist (join, hear audio, publish camera, receive screenshare, reconnect
after backgrounding — livekit-client has real platform nuances: H.264 vs VP8
simulcast on Safari, autoplay vs service-owned elements);
-`isBrowserSupported()` guard wired to a translated toast; voice-bots README
+`isBrowserSupported()` guard wired to a translated toast; live-bots README
PR in the external repo (WSS/UDP egress; the "≥2 bots per room" mesh
workaround does not apply to livekit rooms).
*Acceptance*: gated system spec green against a dev container locally;
@@ -579,7 +579,7 @@ presence; `room_finished` clears the pin; `last_webhook_at` freshness marker;
no effect on Session rows beyond existing TTL behavior.
**PR 9 (optional) — Admin health panel.** Probe job, status endpoint,
-dashboard card, `[voice-livekit]` log audit, secret-never-serialized spec,
+dashboard card, `[live-livekit]` log audit, secret-never-serialized spec,
per §4.
## 10. Enterprise deployment runbook (sketch — full version ships in PR 7)
@@ -587,7 +587,7 @@ per §4.
1. Provision: 2–4 cores is ample (audio ≈ hundreds of participants/core,
720p ≈ ~100 tracks/core). Run `livekit/livekit-server` (Docker or binary)
with one `key: secret` API pair, `use_external_ip: true` behind NAT,
- `webhook.urls: [https://forum.example/voice/livekit/webhook]` if PR 8 is
+ `webhook.urls: [https://forum.example/live/livekit/webhook]` if PR 8 is
deployed. Single node — no Redis needed; each room must fit one node.
2. Network: reverse proxy (WebSocket upgrade + long timeouts) → 7880 as
`wss://livekit.example.com`; open 7881/TCP (ICE-TCP fallback) and the UDP
@@ -597,14 +597,14 @@ per §4.
proxy in front of **Discourse**, `connect-src` must include the LiveKit wss
host (Discourse core currently emits no connect-src of its own — but see
risk 8).
-3. Discourse: set `voice_livekit_url` / `_api_key` / `_api_secret`; pick
- `voice_livekit_room_policy`. Mesh rooms keep using the existing
+3. Discourse: set `live_livekit_url` / `_api_key` / `_api_secret`; pick
+ `live_livekit_room_policy`. Mesh rooms keep using the existing
STUN/TURN settings.
4. Verify: PR 9's status panel, or join a livekit room from two networks and
confirm `transport: "livekit"` in the join response + a single PC to the
SFU in `chrome://webrtc-internals`.
5. Operations: settings changes apply to the next room instance; force-flip a
- live room via "End live call" or `rake voice:clear_transport_pins`. If
+ live room via "End live call" or `rake live:clear_transport_pins`. If
the SFU dies mid-call, clients run the reconnect ladder; presence/analytics
keep working (heartbeats are Discourse-side).
6. Multisite / shared cluster: one API key pair per site; each site's webhook
@@ -623,7 +623,7 @@ per §4.
3. **Watcher-gating semantics shift** — mesh gates at the publisher
(non-watchers cost the publisher nothing); LiveKit publishes once
regardless. Publisher upstream is constant (the point of an SFU), but the
- `voice_video_max_publishers` copy ("increases CPU for everyone") is wrong
+ `live_video_max_publishers` copy ("increases CPU for everyone") is wrong
for livekit rooms — locale nuance in PR 7.
4. **Role-change permission race** — if `UpdateParticipant` fails and the
client publishes before re-mint, the SFU rejects the publish. Mitigation:
@@ -641,18 +641,18 @@ per §4.
extendable default directive (`lib/content_security_policy/builder.rb`
currently no-ops plugin connect_src extensions). When that lands, the
plugin must register a CSP extension for the configured
- `voice_livekit_url` host or every LiveKit install breaks on a core
+ `live_livekit_url` host or every LiveKit install breaks on a core
upgrade. Track it; cheap now, expensive to discover later.
## 12. Open questions (product)
-1. Should `all_rooms` also cover audio-only rooms while `voice_video_enabled`
+1. Should `all_rooms` also cover audio-only rooms while `live_video_enabled`
is off? Design says yes — audio-only is the cheapest LiveKit workload.
2. Adopt LiveKit `ActiveSpeakersChanged` for speaking indicators on livekit
rooms eventually (saves N AudioContexts in large rooms)? Deferred — forks
the indicator path.
3. Egress/HLS "broadcast stages" — confirm the room-name scheme now
(`{db}-r{id}`) so egress can key off it later.
-4. voice-bots at SFU scale: a lone bot *does* transmit to an SFU (the mesh
+4. live-bots at SFU scale: a lone bot *does* transmit to an SFU (the mesh
"≥2 bots" workaround is obsolete there) — downsize bot rosters for livekit
demo rooms?
diff --git a/plugins/voice/docs/roadmap/smart-notifications.md b/plugins/live/docs/roadmap/smart-notifications.md
similarity index 79%
rename from plugins/voice/docs/roadmap/smart-notifications.md
rename to plugins/live/docs/roadmap/smart-notifications.md
index cdc8b2daf69..bf5de7e7563 100644
--- a/plugins/voice/docs/roadmap/smart-notifications.md
+++ b/plugins/live/docs/roadmap/smart-notifications.md
@@ -2,14 +2,14 @@
## Overview
-Alert users when their frequent voice contacts join rooms. Uses co-presence
+Alert users when their frequent live contacts join rooms. Uses co-presence
data from the analytics system (see `analytics.md`) to determine relationship
strength.
## Prerequisites
-- Session tracking (analytics Phase 1) — `voice_sessions` table.
-- Co-presence tracking (analytics Phase 2) — `voice_co_presences` table.
+- Session tracking (analytics Phase 1) — `live_sessions` table.
+- Co-presence tracking (analytics Phase 2) — `live_co_presences` table.
## "Your frequent contact joined a room"
@@ -17,12 +17,12 @@ strength.
**Logic (in `RoomsController#join`, after recording the session):**
-1. Query the joining user's top contacts from `voice_co_presences`
+1. Query the joining user's top contacts from `live_co_presences`
(cached — see below).
2. For each top contact who is currently online (Discourse presence) but NOT
- in any voice room:
+ in any live room:
- Check if the room the user just joined is one the contact frequents
- (from `voice_sessions` aggregation, also cached).
+ (from `live_sessions` aggregation, also cached).
- If both conditions met (strong relationship + familiar room), send a
notification.
@@ -37,14 +37,14 @@ a toast notification with a "Join" action button.
Computing top contacts and frequent rooms on every join would be expensive.
- **Top contacts per user:** Cache in Redis as a sorted set
- `voice:contacts:{user_id}` with score = aggregated `total_seconds` over
+ `live:contacts:{user_id}` with score = aggregated `total_seconds` over
the last 30 days. Refresh every hour via a scheduled job, or invalidate
when `UpdateCoPresence` runs.
-- **Frequent rooms per user:** Cache as `voice:frequent_rooms:{user_id}`.
+- **Frequent rooms per user:** Cache as `live:frequent_rooms:{user_id}`.
Refresh daily or on session close.
- **Notification cooldown:** Don't notify the same user about the same contact
more than once per hour. Track in Redis:
- `voice:notified:{user_id}:{contact_id}` with 1h TTL.
+ `live:notified:{user_id}:{contact_id}` with 1h TTL.
## Thresholds
@@ -65,17 +65,17 @@ All thresholds configurable via site settings.
## Site settings
```yaml
-voice_smart_notifications_enabled:
+live_smart_notifications_enabled:
default: true
-voice_co_presence_min_seconds:
+live_co_presence_min_seconds:
default: 1800
description: "Minimum co-presence time (seconds) before a relationship is considered for notifications"
-voice_co_presence_min_sessions:
+live_co_presence_min_sessions:
default: 3
-voice_smart_notification_cooldown_minutes:
+live_smart_notification_cooldown_minutes:
default: 60
min: 10
max: 1440
@@ -84,7 +84,7 @@ voice_smart_notification_cooldown_minutes:
## User preferences
Users can control notification behavior from their Discourse notification
-preferences (or a Voice-specific section):
+preferences (or a Live-specific section):
- **Enable/disable** smart room notifications (default: enabled).
- **Quiet hours** — respect Discourse's existing Do Not Disturb setting.
diff --git a/plugins/voice/docs/roadmap/video-screenshare.md b/plugins/live/docs/roadmap/video-screenshare.md
similarity index 91%
rename from plugins/voice/docs/roadmap/video-screenshare.md
rename to plugins/live/docs/roadmap/video-screenshare.md
index 7b664d894f7..bc14f554572 100644
--- a/plugins/voice/docs/roadmap/video-screenshare.md
+++ b/plugins/live/docs/roadmap/video-screenshare.md
@@ -20,7 +20,7 @@
## Overview
-Add optional camera video and screen sharing to voice rooms, staying **pure
+Add optional camera video and screen sharing to live rooms, staying **pure
full-mesh P2P** — no SFU, no media through the server. Joining a room remains
audio-first; video is something you opt into by opening the room's dedicated
page and turning on your camera.
@@ -56,7 +56,7 @@ mesh gets per-link adaptation natively.
## Facts about the current architecture that shape the design
-From `voice-webrtc.js`, `peer-manager.js`, `signaling.js`:
+From `live-webrtc.js`, `peer-manager.js`, `signaling.js`:
- **Negotiation is one-shot.** Offers/answers happen at peer setup. Glare is
resolved by user-ID ordering only during setup; answers in unexpected
@@ -67,12 +67,12 @@ From `voice-webrtc.js`, `peer-manager.js`, `signaling.js`:
(`#replaceTrackOnAllPeers`); role changes rebuild peers wholesale
(`#reconnectAllPeers`).
- **The signal relay is payload-opaque.** SDP with video m-lines flows through
- `POST /voice/rooms/:id/signal` unchanged. No server work needed for media.
+ `POST /live/rooms/:id/signal` unchanged. No server work needed for media.
- **Presence metadata is a free-form per-participant hash** in Redis
(`ParticipantTracker`), already carrying `is_muted` / `is_deafened` /
`idle_state`, broadcast via `RoomBroadcaster.publish_participants`. Video
flags slot straight in.
-- **Call state lives in the `voice-webrtc` service**, independent of routes —
+- **Call state lives in the `live-webrtc` service**, independent of routes —
which is why audio survives navigation today, and why a video _page_ can be
a pure view over service state.
@@ -179,7 +179,7 @@ Plus:
- A user-selectable quality profile (High/Medium/Low, persisted in
`localStorage`) remains useful as a manual override for weak _sending_
hardware, layered under the automatic count-based ladder.
-- `voice_video_max_publishers` (default 8) as the honest backstop: camera
+- `live_video_max_publishers` (default 8) as the honest backstop: camera
buttons disable past the cap, server rejects the flag. Audio mesh keeps
scaling beyond it.
@@ -190,11 +190,11 @@ Plus:
- Sidebar room rows gain an "open room" affordance (and/or clicking the room
name while connected navigates; click-to-join on the join button is
unchanged).
-- Route: **`/voice/r/:slug`**. The engine already serves JSON at
- `/voice/rooms/:id`, so the page uses a distinct path. Server side: a route
+- Route: **`/live/r/:slug`**. The engine already serves JSON at
+ `/live/rooms/:id`, so the page uses a distinct path. Server side: a route
that renders the Ember app shell (core chat's full-page route is the
reference pattern); client side: a plugin route map entry.
-- The Discourse sidebar — including the Voice rooms section — persists
+- The Discourse sidebar — including the Live rooms section — persists
automatically: the page renders in the regular content outlet.
```
@@ -219,7 +219,7 @@ Plus:
flips it off and senders drop your video feed. Audio continues regardless
(service state is route-independent).
- Layout: CSS grid, `auto-fit`/`minmax`, BEM classes
- (`.voice-room-page`, `.voice-video-tile`, modifiers like `--speaking`,
+ (`.live-room-page`, `.live-video-tile`, modifiers like `--speaking`,
`--screen-share`, `--self`).
- Active-speaker spotlight and click-to-pin: follow-on, not v1.
@@ -250,19 +250,19 @@ share buttons render only when video is effectively enabled for the room
Video has a different social temperature than audio; room owners should
control it.
-- **Schema:** `video_enabled` boolean on `voice_rooms`, `null: false`,
+- **Schema:** `video_enabled` boolean on `live_rooms`, `null: false`,
`default: true`.
- **Effective rule:**
```
- video allowed in room = SiteSetting.voice_video_enabled &&
+ video allowed in room = SiteSetting.live_video_enabled &&
room.video_enabled &&
room.open? # stage rooms excluded in v1
```
- **Editing:** checkbox in the room create/edit form (FormKit), editable by
whoever can manage the room (creator/managers — existing
- `can_manage_voice_room?` guardian); also exposed in the admin room UI.
+ `can_manage_live_room?` guardian); also exposed in the admin room UI.
Permitted in `rooms_controller#room_params` and serialized in
`RoomSerializer`.
- **Enforcement:** server-side in the state endpoint (below) — reject
@@ -275,31 +275,31 @@ control it.
## Server changes (small by design)
-1. **Migration:** add `video_enabled` to `voice_rooms` (see above).
+1. **Migration:** add `video_enabled` to `live_rooms` (see above).
2. **Presence metadata keys:** `is_video_on`, `is_screen_sharing`,
`watching_video` — same mechanism as `is_muted`/`is_deafened`.
3. **Endpoint:** generalize `toggle_mute` into (or add alongside it)
- `POST /voice/rooms/:id/state` accepting the metadata booleans, with the
+ `POST /live/rooms/:id/state` accepting the metadata booleans, with the
per-room enforcement above and the publisher-cap check
- (count of participants with `is_video_on` ≥ `voice_video_max_publishers`
+ (count of participants with `is_video_on` ≥ `live_video_max_publishers`
→ 422).
4. **Site settings** (`config/settings.yml`):
```yaml
- voice_video_enabled:
+ live_video_enabled:
default: false
client: true
- voice_video_max_publishers:
+ live_video_max_publishers:
default: 8
min: 2
max: 16
client: true
```
- Off by default — admin opt-in, independent of voice.
+ Off by default — admin opt-in, independent of live.
-5. **Page route** rendering the app shell at `/voice/r/:slug`, guarded by
- `ensure_can_join_voice_room!`-equivalent visibility (the room must be
+5. **Page route** rendering the app shell at `/live/r/:slug`, guarded by
+ `ensure_can_join_live_room!`-equivalent visibility (the room must be
visible to the user; joining still requires the explicit join action).
Nothing changes in the signal relay.
@@ -324,8 +324,8 @@ Nearly free once camera works — it's the same transceiver machinery:
separate camera stream, `replaceTrack` camera toggle (temporary debug
button), per-user stream registry fix, restart-path media reattachment,
`is_video_on` presence flag, site settings. Behind
- `voice_video_enabled`; audio path untouched.
-2. **The page.** `/voice/r/:slug` route, tile grid (avatar tiles for all
+ `live_video_enabled`; audio path untouched.
+2. **The page.** `/live/r/:slug` route, tile grid (avatar tiles for all
rooms, video tiles where allowed), controls bar, sidebar indicators,
per-room `video_enabled` toggle + form + enforcement.
3. **Boundary pushing.** `watching_video` subscription gating, watcher-count
diff --git a/plugins/voice/docs/roadmap/windows-hardware-mesh-screenshare.md b/plugins/live/docs/roadmap/windows-hardware-mesh-screenshare.md
similarity index 98%
rename from plugins/voice/docs/roadmap/windows-hardware-mesh-screenshare.md
rename to plugins/live/docs/roadmap/windows-hardware-mesh-screenshare.md
index 00bbbb5fffc..49c015aaf67 100644
--- a/plugins/voice/docs/roadmap/windows-hardware-mesh-screenshare.md
+++ b/plugins/live/docs/roadmap/windows-hardware-mesh-screenshare.md
@@ -51,7 +51,7 @@ On a supported Windows 11 and NVIDIA test system:
- Adding viewers does not add encoder sessions for the same quality layer.
- Game-process or system audio remains synchronized with video.
- One slow viewer cannot stall capture or delivery to other viewers.
-- Voice and camera remain usable through the existing primary connection.
+- Live and camera remain usable through the existing primary connection.
- Unsupported systems fail closed with an actionable explanation.
- Disabling the experiment restores the existing screen-sharing behavior.
@@ -190,7 +190,7 @@ bounded connection discriminator while preserving the current behavior:
Allowed values initially are:
-- `primary`: existing voice/camera connection and the default when omitted.
+- `primary`: existing live/camera connection and the default when omitted.
- `screen`: experimental screen video and audio connection.
The server validates the value, groups batches by both recipient and
@@ -230,7 +230,7 @@ subscribeEvents() -> signal, state, stats, warning, failure
Do not expose NVIDIA, webrtc-rs, or raw FFI types to the Dart application.
Events need correlation IDs and redacted diagnostics consistent with the
-existing Voice diagnostic capture.
+existing Live diagnostic capture.
The capability result must verify all of the following:
@@ -249,7 +249,7 @@ fall back to software encoding while presenting itself as hardware sharing.
Add a client-visible, default-off plugin site setting:
```text
-voice_windows_hardware_screen_share_enabled
+live_windows_hardware_screen_share_enabled
```
It only allows the client to attempt the feature. The client must additionally
@@ -291,12 +291,12 @@ passes a bridge smoke test in CI and on Windows 11.
room destruction, and participant-session replacement.
Exit: two capable clients establish and tear down a fake secondary connection
-without affecting primary voice; old clients never receive secondary offers.
+without affecting primary live; old clients never receive secondary offers.
### 2. Rust WebRTC transport
- Create one webrtc-rs peer connection per capable viewer.
-- Consume Voice ICE/TURN configuration.
+- Consume Live ICE/TURN configuration.
- Implement publisher-offers/viewer-answers signaling.
- Publish synthetic H.264 and Opus fixtures.
- Implement bounded per-peer queues and independent transport workers.
diff --git a/plugins/voice/docs/security-review-2026-08-26.md b/plugins/live/docs/security-review-2026-08-26.md
similarity index 88%
rename from plugins/voice/docs/security-review-2026-08-26.md
rename to plugins/live/docs/security-review-2026-08-26.md
index 54ed4dca5f2..819c2770464 100644
--- a/plugins/voice/docs/security-review-2026-08-26.md
+++ b/plugins/live/docs/security-review-2026-08-26.md
@@ -2,7 +2,7 @@
## Status
-This review covers Voice at commit `60fc027`, with native mesh WebRTC as the
+This review covers Live at commit `60fc027`, with native mesh WebRTC as the
planned transport for Discourse free hosting. LiveKit is considered an optional
bring-your-own-service integration and is discussed separately.
@@ -23,7 +23,7 @@ The review assumes:
- public rooms may be joinable by every authenticated user, or by everyone when
anonymous browsing is enabled;
- a malicious participant controls their browser and is not constrained by the
- Voice client UI;
+ Live client UI;
- room presence and participant roles must be authoritative security
boundaries, rather than advisory client state;
- denial-of-service resistance is important because the plugin will run on a
@@ -51,17 +51,17 @@ now bound to a server-attested participant session minted by `join`, rotated
by `livekit_token`, and revoked on leave/kick/TTL expiry; the relay drops
recipients without a live session and carries the serialized sender so early
offers render a visible participant. See the regression tests in
-`spec/requests/voice/rooms_controller_spec.rb`
+`spec/requests/live/rooms_controller_spec.rb`
("#signal participant session enforcement").
**Affected code:**
-- `app/controllers/voice/rooms_controller.rb`, `RoomsController#signal`
-- `app/services/voice/signal_relay.rb`
-- `assets/javascripts/discourse/lib/voice/mesh-signal-handler.js`
-- `assets/javascripts/discourse/lib/voice/peer-manager.js`
-- `assets/javascripts/discourse/lib/voice/presence-pending-peers.js`
-- `assets/javascripts/discourse/app/services/voice-webrtc.js`
+- `app/controllers/live/rooms_controller.rb`, `RoomsController#signal`
+- `app/services/live/signal_relay.rb`
+- `assets/javascripts/discourse/lib/live/mesh-signal-handler.js`
+- `assets/javascripts/discourse/lib/live/peer-manager.js`
+- `assets/javascripts/discourse/lib/live/presence-pending-peers.js`
+- `assets/javascripts/discourse/app/services/live-webrtc.js`
`RoomsController#signal` verifies that the sender is eligible to join the room,
but it does not require either the sender or recipient to be actively present.
@@ -93,9 +93,9 @@ receiving room media is visible as a participant.
Existing coverage preserves the unsafe behavior:
-- `spec/requests/voice/rooms_controller_spec.rb` sends signals to recipients
+- `spec/requests/live/rooms_controller_spec.rb` sends signals to recipients
who have not joined the room;
-- `test/javascripts/unit/services/voice-webrtc-test.js` includes
+- `test/javascripts/unit/services/live-webrtc-test.js` includes
"honors an early offer from a participant whose presence has not propagated
yet" and asserts that an absent sender receives an answer.
@@ -143,7 +143,7 @@ accepted.
rationale:
- Signaling schema: only `offer`, `answer`, and `candidate` events, with exact
- per-type shapes, validated by `Voice::SignalValidator` — an SDP of at most
+ per-type shapes, validated by `Live::SignalValidator` — an SDP of at most
32 KiB, a candidate body of at most 2 KiB restricted to the four standard
ICE fields, at most 25 events per recipient per request, recipients bounded
by the room's effective capacity minus one, 1 MiB of signal body per
@@ -157,14 +157,14 @@ rationale:
before MessageBus work: 30 requests/10 s, 5,000 events/min per user
(roughly 4× a 50-person connect burst with an ICE restart), and 100,000
events/min per room (50 users bursting at once), via the weighted
- `Voice::ControlPlaneLimiter`. The client's 75 ms candidate batching and
+ `Live::ControlPlaneLimiter`. The client's 75 ms candidate batching and
200 ms HTTP batching are unchanged; it just flushes a recipient's batch
early at 20 events to stay under the per-recipient cap.
- Capacity: presence is admitted atomically by a Lua script
(`ParticipantTracker.add_within_capacity`) that purges expired presence,
refreshes existing participants (even in a full room), and rejects new
joiners at the effective capacity — the lower of `room.max_participants`
- and the new `voice_max_room_participants` site ceiling (default 50).
+ and the new `live_max_room_participants` site ceiling (default 50).
Concurrent joins cannot exceed the cap; a full room returns 422.
- Join is rate limited (30/min per user) and idempotent: a repeat carrying
the live participant session refreshes the grant without rotating the
@@ -184,23 +184,23 @@ rationale:
the co-presence job iterates pairs lazily under the site capacity ceiling
instead of materializing them.
-Regression tests: `spec/requests/voice/rooms_controller_spec.rb`
+Regression tests: `spec/requests/live/rooms_controller_spec.rb`
("#signal validation", "#signal rate limits", the join capacity/idempotency
-and stale-leave tests), `spec/services/voice/participant_tracker_spec.rb`
+and stale-leave tests), `spec/services/live/participant_tracker_spec.rb`
(".add_within_capacity", including a concurrency test),
-`spec/requests/voice/calls_controller_spec.rb`, and
-`spec/services/voice/ephemeral_room_manager_spec.rb`.
+`spec/requests/live/calls_controller_spec.rb`, and
+`spec/services/live/ephemeral_room_manager_spec.rb`.
**Affected code:**
-- `app/controllers/voice/rooms_controller.rb`
-- `app/services/voice/participant_tracker.rb`
-- `app/models/voice/room.rb`
-- `app/services/voice/signal_relay.rb`
-- `app/jobs/scheduled/voice/update_co_presence.rb`
-- `app/controllers/voice/calls_controller.rb`
-- `app/services/voice/ephemeral_room_manager.rb`
-- `app/services/voice/room_inviter.rb`
+- `app/controllers/live/rooms_controller.rb`
+- `app/services/live/participant_tracker.rb`
+- `app/models/live/room.rb`
+- `app/services/live/signal_relay.rb`
+- `app/jobs/scheduled/live/update_co_presence.rb`
+- `app/controllers/live/calls_controller.rb`
+- `app/services/live/ephemeral_room_manager.rb`
+- `app/services/live/room_inviter.rb`
Several individually inexpensive operations can be amplified into database,
Redis, MessageBus, browser, and WebRTC work:
@@ -209,7 +209,7 @@ Redis, MessageBus, browser, and WebRTC work:
then emits one MessageBus publish per event. Signal types, recipient counts,
event counts, SDP size, and candidate size are not bounded locally.
- `join` is not idempotent. With analytics enabled, every request creates a new
- `Voice::Session`, even while the user already has active presence. Only the
+ `Live::Session`, even while the user already has active presence. Only the
newest session ID is retained in presence metadata.
- `heartbeat` can create presence for a user who never called `join`.
- `state` can write metadata and broadcast a full participant roster for a user
@@ -250,10 +250,10 @@ Redis, MessageBus, browser, and WebRTC work:
**Affected code:**
-- `assets/javascripts/discourse/lib/voice/roster-handler.js`
-- `assets/javascripts/discourse/lib/voice/mesh-signal-handler.js`
-- `assets/javascripts/discourse/lib/voice/peer-manager.js`
-- `assets/javascripts/discourse/lib/voice/remote-stream-registry.js`
+- `assets/javascripts/discourse/lib/live/roster-handler.js`
+- `assets/javascripts/discourse/lib/live/mesh-signal-handler.js`
+- `assets/javascripts/discourse/lib/live/peer-manager.js`
+- `assets/javascripts/discourse/lib/live/remote-stream-registry.js`
Stage listeners need peer connections to speakers so they can receive the
stage. The mesh topology therefore retains a connection when either side may
@@ -284,7 +284,7 @@ malicious browser put into its peer connection.
**Status:** Remediated after this review (mesh receive-side media policy).
-- `remoteTrackAllowed` (`lib/voice/stage-roles.js`) is the receive-side
+- `remoteTrackAllowed` (`lib/live/stage-roles.js`) is the receive-side
boundary: before a remote track is registered or played, the sender's role
in the server-broadcast roster and the room's media policy are checked.
In stage rooms only moderators and speakers may deliver any media; video
@@ -292,7 +292,7 @@ malicious browser put into its peer connection.
Disallowed tracks are stopped and never reach the stream registry, the
audio monitor, transcription, or playback.
- Both mesh registration paths go through the guard
- (`VoiceWebrtcService#registerRemoteTrack`): `PeerManager`'s `ontrack`
+ (`LiveWebrtcService#registerRemoteTrack`): `PeerManager`'s `ontrack`
and the roster handler's video re-registration. The LiveKit path is
unchanged: there the SFU enforces per-user publish grants server-side
(`canPublish`/`canPublishSources` on tokens and `UpdateParticipant`).
@@ -307,13 +307,13 @@ malicious browser put into its peer connection.
which hold no local stream). Promotions rebuild all peers, so directions
never change on a live connection. This is not the security boundary —
the receive-side check is.
-- Tests (`test/javascripts/unit/services/voice-webrtc-test.js`): a
+- Tests (`test/javascripts/unit/services/live-webrtc-test.js`): a
listener-created microphone track arriving at a speaker is stopped and
never registered; a speaker's microphone still plays for listeners and
listener transceivers stay receive-only; video tracks are dropped in
rooms whose policy disallows video and register once allowed; a roster
refresh demoting a participant drops their already-registered media.
- Existing multi-session system specs (stage speak queue, voice rooms,
+ Existing multi-session system specs (stage speak queue, live rooms,
video, subtitles) pass unchanged, confirming legitimate stage promotion
and media flows survive the new boundary.
@@ -323,12 +323,12 @@ malicious browser put into its peer connection.
**Affected code:**
-- `lib/voice.rb`, `Voice.public_room_message_bus_targets`
-- `app/services/voice/room_broadcaster.rb`
-- `app/services/voice/directory_broadcaster.rb`
+- `lib/live.rb`, `Live.public_room_message_bus_targets`
+- `app/services/live/room_broadcaster.rb`
+- `app/services/live/directory_broadcaster.rb`
The `everyone`, `anonymous_users`, and `logged_in_users` automatic groups do not
-have enumerable `group_users` rows. Voice handles all three by publishing
+have enumerable `group_users` rows. Live handles all three by publishing
without MessageBus targets.
That is correct when access is intentionally available to everyone, but it is
@@ -356,7 +356,7 @@ reveals network information to peers. The configured STUN service also observes
the connecting public IP and request timing. The default configuration uses
public Google and Twilio STUN endpoints.
-Voice provides a mesh privacy warning and enables it by default. For hosted
+Live provides a mesh privacy warning and enables it by default. For hosted
service use, the warning should not be customer-disableable without an explicit
hosting policy decision.
@@ -390,10 +390,10 @@ customer administrators.
**Affected code:**
- `config/settings.yml`
-- `app/validators/voice_livekit_policy_validator.rb`
-- `lib/voice/livekit/twirp.rb`
-- `lib/voice/livekit/health_check.rb`
-- `app/jobs/regular/voice_livekit_probe.rb`
+- `app/validators/live_livekit_policy_validator.rb`
+- `lib/live/livekit/twirp.rb`
+- `lib/live/livekit/health_check.rb`
+- `app/jobs/regular/live_livekit_probe.rb`
- `plugin.rb` setting-change callbacks
The validator only requires a `ws://` or `wss://` prefix. `Twirp.post` converts
@@ -421,7 +421,7 @@ reach services that are not otherwise exposed outside the hosting network.
**Status:** Remediated after this review (destination vetting via
`FinalDestination`).
-- `Voice::Livekit::Twirp.post` now performs all LiveKit HTTP calls through
+- `Live::Livekit::Twirp.post` now performs all LiveKit HTTP calls through
core's `FinalDestination::HTTP` instead of Excon. It resolves the host
itself, filters every resolved address against the private/loopback/
link-local/reserved IPv4+IPv6 ranges and `blocked_ip_blocks`, and hands
@@ -431,20 +431,20 @@ reach services that are not otherwise exposed outside the hosting network.
- A blocked destination surfaces to admins as a fixed message ("resolves to
an address this server is not allowed to reach"); sync calls fail closed
(return false) without raising into the triggering request.
-- New `VoiceLivekitUrlValidator` on `voice_livekit_url`: must be a bare
+- New `LiveLivekitUrlValidator` on `live_livekit_url`: must be a bare
ws(s):// origin with a hostname and no embedded credentials, and `wss://`
- is mandatory in production. `VoiceLivekitPolicyValidator` now requires
+ is mandatory in production. `LiveLivekitPolicyValidator` now requires
the URL to pass the same check before any non-disabled policy can be
enabled, so a pre-existing invalid URL cannot be activated.
- Upstream response bodies no longer reach customer administrators: probe
and egress errors carry only the HTTP status code; the truncated body goes
to the server log for the operator.
-- Tests: `spec/lib/voice/livekit/room_service_client_spec.rb` (disallowed
+- Tests: `spec/lib/live/livekit/room_service_client_spec.rb` (disallowed
address refused for probes and sync calls via
`FinalDestination::TestHelper.stub_to_fail`; probe errors exclude the
- upstream body), `spec/lib/voice/livekit/egress_client_spec.rb` (error
+ upstream body), `spec/lib/live/livekit/egress_client_spec.rb` (error
results exclude the upstream body), and
- `spec/validators/voice_livekit_url_validator_spec.rb` (shape checks,
+ `spec/validators/live_livekit_url_validator_spec.rb` (shape checks,
credentials rejection, wss-required-in-production).
- Still open from this finding's hosting guidance: an operator-owned egress
proxy / hostname allowlist as a second boundary, and keeping the settings
@@ -476,13 +476,13 @@ entry.
### Contacts authorization
`ContactsController#index` requires a logged-in user and analytics to be
-enabled, but does not call `guardian.can_access_voice?`. A user removed from
+enabled, but does not call `guardian.can_access_live?`. A user removed from
the allowed groups can continue retrieving their own historical top contacts,
durations, and session counts.
### Client-controlled invite attribution
-`RoomsController#join` accepts `invited_by`, and `Voice::Invite.redeem!`
+`RoomsController#join` accepts `invited_by`, and `Live::Invite.redeem!`
creates a redeemed link-invite row without proving that a signed link or pending
invite existed. A user can attribute their join to another user and influence
invite analytics or badge hooks.
@@ -528,7 +528,7 @@ management, or direct template XSS path was identified during this review.
The following checks were run against commit `60fc027`:
- focused Ruby security-related suite: 188 examples, 0 failures;
-- Voice JavaScript suite: 181 tests, 0 failures;
+- Live JavaScript suite: 181 tests, 0 failures;
- production dependency audit: no reported advisories;
- full dependency audit: 11 high, 4 moderate, and 1 low advisory, all reached
through lint/build dependency chains rather than the reviewed deployed
diff --git a/plugins/voice/docs/security-review-2026-08-27.md b/plugins/live/docs/security-review-2026-08-27.md
similarity index 91%
rename from plugins/voice/docs/security-review-2026-08-27.md
rename to plugins/live/docs/security-review-2026-08-27.md
index 6525e6b802e..419b3410e5c 100644
--- a/plugins/voice/docs/security-review-2026-08-27.md
+++ b/plugins/live/docs/security-review-2026-08-27.md
@@ -2,7 +2,7 @@
## Status
-This is a second-pass review of Voice at commit `5a2543b`. It follows
+This is a second-pass review of Live at commit `5a2543b`. It follows
`security-review-2026-08-26.md` and focuses on the native mesh WebRTC transport
planned for Discourse free hosting with hosting-operated coturn instances.
@@ -29,7 +29,7 @@ This review retains the first review's threat model:
- ordinary authenticated users may be malicious and may automate requests;
- public rooms may be joinable by every authenticated user;
- a malicious participant controls their browser and is not constrained by the
- Voice client;
+ Live client;
- presence, room capacity, participant roles, and call termination must be
server-authoritative rather than cooperative client state;
- existing peer connections continue carrying media until a peer explicitly
@@ -59,11 +59,11 @@ This review retains the first review's threat model:
**Affected code:**
-- `app/controllers/voice/rooms_controller.rb`, `RoomsController#heartbeat`
-- `app/controllers/voice/rooms_controller.rb`, `RoomsController#livekit_token`
-- `app/controllers/voice/rooms_controller.rb`, `RoomsController#signal`
-- `app/services/voice/participant_tracker.rb`
-- `app/services/voice/signal_relay.rb`
+- `app/controllers/live/rooms_controller.rb`, `RoomsController#heartbeat`
+- `app/controllers/live/rooms_controller.rb`, `RoomsController#livekit_token`
+- `app/controllers/live/rooms_controller.rb`, `RoomsController#signal`
+- `app/services/live/participant_tracker.rb`
+- `app/services/live/signal_relay.rb`
`ParticipantTracker.add_within_capacity` correctly purges expired presence and
atomically admits new participants up to the room cap. Participant sessions,
@@ -140,10 +140,10 @@ Regression tests should cover:
**Affected code:**
-- `app/controllers/voice/rooms_controller.rb`, `RoomsController#join`
-- `app/controllers/voice/rooms_controller.rb`, `RoomsController#repeat_join?`
-- `app/jobs/scheduled/voice/close_orphaned_sessions.rb`
-- `app/models/voice/session.rb`
+- `app/controllers/live/rooms_controller.rb`, `RoomsController#join`
+- `app/controllers/live/rooms_controller.rb`, `RoomsController#repeat_join?`
+- `app/jobs/scheduled/live/close_orphaned_sessions.rb`
+- `app/models/live/session.rb`
The idempotent join branch only runs when the request supplies the exact current
participant session ID and the user is still present. A malicious active
@@ -203,12 +203,12 @@ Regression tests should cover:
**Affected code:**
-- `app/controllers/voice/room_memberships_controller.rb`,
+- `app/controllers/live/room_memberships_controller.rb`,
`RoomMembershipsController#destroy`
-- `app/controllers/voice/rooms_controller.rb`, `RoomsController#update`
-- `app/controllers/voice/rooms_controller.rb`, `RoomsController#destroy`
-- `app/controllers/voice/rooms_controller.rb`, `RoomsController#kick`
-- `app/controllers/voice/admin_rooms_controller.rb`,
+- `app/controllers/live/rooms_controller.rb`, `RoomsController#update`
+- `app/controllers/live/rooms_controller.rb`, `RoomsController#destroy`
+- `app/controllers/live/rooms_controller.rb`, `RoomsController#kick`
+- `app/controllers/live/admin_rooms_controller.rb`,
`AdminRoomsController#destroy` and `#end_call`
Removing a membership always demotes a present user to `participant`. That is
@@ -263,13 +263,13 @@ explicitly means "disconnect once" rather than moderation for the current call.
**Affected code:**
-- `app/controllers/voice/rooms_controller.rb`, `RoomsController#state`
-- `app/services/voice/signal_validator.rb`
-- `assets/javascripts/discourse/lib/voice/stage-roles.js`
-- `assets/javascripts/discourse/app/services/voice-webrtc.js`
-- `assets/javascripts/discourse/lib/voice/remote-stream-registry.js`
+- `app/controllers/live/rooms_controller.rb`, `RoomsController#state`
+- `app/services/live/signal_validator.rb`
+- `assets/javascripts/discourse/lib/live/stage-roles.js`
+- `assets/javascripts/discourse/app/services/live-webrtc.js`
+- `assets/javascripts/discourse/lib/live/remote-stream-registry.js`
-The server enforces `voice_video_max_publishers` when a client reports
+The server enforces `live_video_max_publishers` when a client reports
`video: true` or `screen: true`. A modified mesh client does not have to report
that state before adding video tracks to its peer connections.
@@ -296,8 +296,8 @@ malicious offer can attempt multiple unexpected tracks.
- Test direct attachment of video without a state grant, concurrent publisher
acquisition at the cap, duplicate tracks, and lease revocation.
-Keeping `voice_video_enabled` host-locked to false is an adequate temporary
-control for the planned voice-first mesh launch.
+Keeping `live_video_enabled` host-locked to false is an adequate temporary
+control for the planned live-first mesh launch.
### 5. Logged-in-only MessageBus delivery remains open
@@ -307,9 +307,9 @@ control for the planned voice-first mesh launch.
**Affected code:**
-- `lib/voice.rb`, `Voice.public_room_message_bus_targets`
-- `app/services/voice/room_broadcaster.rb`
-- `app/services/voice/directory_broadcaster.rb`
+- `lib/live.rb`, `Live.public_room_message_bus_targets`
+- `app/services/live/room_broadcaster.rb`
+- `app/services/live/directory_broadcaster.rb`
`public_room_message_bus_targets` treats the `everyone`, `anonymous_users`, and
`logged_in_users` pseudo-groups identically and publishes without targets.
@@ -336,13 +336,13 @@ MessageBus subscriber rather than asserting only that a publish has no target.
**Affected code:**
-- `lib/voice/ice_config.rb`
+- `lib/live/ice_config.rb`
-Voice issues standard coturn REST credentials with a 12-hour validity window
+Live issues standard coturn REST credentials with a 12-hour validity window
and a username shaped as `<expiry>:<user_id>`. Any authorized user can extract
the credential from a join response and use it from a separate TURN client for
the remainder of that window. TURN authentication proves entitlement to use
-the relay; it does not bind traffic to a Voice room or WebRTC peer.
+the relay; it does not bind traffic to a Live room or WebRTC peer.
Coturn strips the numeric expiry prefix before applying its per-user allocation
quota. This means expiry rotation does not bypass `user-quota`, but the stable
@@ -412,7 +412,7 @@ environment.
**Affected code:**
-- `app/controllers/voice/invites_controller.rb`, `InvitesController#create`
+- `app/controllers/live/invites_controller.rb`, `InvitesController#create`
The endpoint converts and deduplicates the complete `usernames` parameter,
then places the complete list in `WHERE username_lower IN (...)`. The subsequent
@@ -430,7 +430,7 @@ rather than silently truncated after querying.
The following lower-priority observations from `security-review-2026-08-26.md`
remain relevant and were not promoted by this pass:
-- contacts authorization should use the same Voice access predicate as the
+- contacts authorization should use the same Live access predicate as the
rest of the plugin;
- client-supplied invite attribution should be replaced with a server-issued
pending invite or signed token; and
@@ -468,7 +468,7 @@ The following checks were run against commit `5a2543b`:
- focused server suite covering rooms, participant tracking, memberships,
admin room actions, and ICE configuration: 242 examples, 0 failures;
-- Voice JavaScript/QUnit run: 187 tests, 0 failures;
+- Live JavaScript/QUnit run: 187 tests, 0 failures;
- `pnpm audit --prod`: no known vulnerabilities;
- direct test-Redis reproduction of the capacity bypass, with scoped cleanup;
- review of current coturn quota source, configuration, releases, and 2026
diff --git a/plugins/voice/docs/subtitles-model-mirror.md b/plugins/live/docs/subtitles-model-mirror.md
similarity index 95%
rename from plugins/voice/docs/subtitles-model-mirror.md
rename to plugins/live/docs/subtitles-model-mirror.md
index 341078cd0cf..2ac8a2ad2e2 100644
--- a/plugins/voice/docs/subtitles-model-mirror.md
+++ b/plugins/live/docs/subtitles-model-mirror.md
@@ -8,7 +8,7 @@ The plugin pins that repository to a specific commit.
Some sites can't let browsers reach `huggingface.co`, or prefer not to:
airgapped deployments, enterprise networks, or anyone who wants to control
the bytes. They can serve the models themselves and point the
-`voice_stt_model_base_url` site setting at their own mirror.
+`live_stt_model_base_url` site setting at their own mirror.
Only the **model weights** are affected. The runtime bundles (worker, VAD,
onnxruntime) are always served from the plugin's own `public/` directory and
@@ -34,7 +34,7 @@ Every folder holds the same three files:
| `vocab.txt` | tokenizer vocabulary |
To download them, using the commit the plugin pins (see `DEFAULT_MODEL_ROOT`
-in `assets/javascripts/discourse/lib/voice/stt-models.js`):
+in `assets/javascripts/discourse/lib/live/stt-models.js`):
```bash
REV=0862913c8a5c08254d1082747c6443a06e062988
@@ -78,7 +78,7 @@ location /models/discourse-stt/ {
Then set the site setting (the trailing slash is optional):
```
-voice_stt_model_base_url = https://cdn.example.com/models/discourse-stt
+live_stt_model_base_url = https://cdn.example.com/models/discourse-stt
```
## Updating a mirror
diff --git a/plugins/live/lib/live.rb b/plugins/live/lib/live.rb
new file mode 100644
index 00000000000..bc9a4986c26
--- /dev/null
+++ b/plugins/live/lib/live.rb
@@ -0,0 +1,63 @@
+# frozen_string_literal: true
+
+module ::Live
+ PLUGIN_NAME = "live"
+ ROOM_CHANNEL_PREFIX = "/live/rooms"
+ ROOM_INDEX_CHANNEL = "/live/rooms/index"
+
+ # Chat::Thread custom field marking a thread as a room's live session
+ # thread, so it can be traced back to its room long after the live session
+ # pointer in Redis has expired.
+ THREAD_ROOM_ID_FIELD = "live_room_id"
+
+ def self.table_name_prefix
+ "live_"
+ end
+
+ def self.enabled?
+ SiteSetting.live_enabled
+ end
+
+ # Callers must omit raw errors and payloads, which can contain credentials or content.
+ def self.warn(message)
+ Rails.logger.warn(message) if SiteSetting.live_verbose_logging
+ end
+
+ def self.room_channel(room_id)
+ "#{ROOM_CHANNEL_PREFIX}/#{room_id}"
+ end
+
+ def self.room_chat_channel(room_id)
+ "#{ROOM_CHANNEL_PREFIX}/#{room_id}/chat"
+ end
+
+ def self.room_index_channel
+ ROOM_INDEX_CHANNEL
+ end
+
+ # Pseudo-groups have no group_users rows, but a client's message-bus groups
+ # don't come only from that table (see config/initializers/004-message_bus.rb):
+ # logged-in clients carry the logged_in_users pseudo-group and anonymous
+ # clients carry anonymous_users, so targeting the allowed groups reaches
+ # exactly the visitors who may see public rooms — anonymous ones included,
+ # when they are admitted.
+ def self.public_room_message_bus_targets
+ { group_ids: SiteSetting.live_allowed_groups_map }
+ end
+end
+
+require_relative "live/engine"
+require_relative "live/guardian_extension"
+require_relative "live/ice_config"
+require_relative "live/livekit"
+require_relative "live/livekit/twirp"
+require_relative "live/livekit/egress_client"
+require_relative "live/livekit/health_check"
+require_relative "live/livekit/room_service_client"
+require_relative "live/livekit/agent_dispatch_client"
+require_relative "live/livekit/cloud_agent_client"
+require_relative "live/livekit/webhook_verifier"
+require_relative "live/media_entitlements"
+require_relative "live/room_hashtag_data_source"
+require_relative "live/user_status_manager"
+require_relative "../app/services/live/agent_manager"
diff --git a/plugins/voice/lib/voice/engine.rb b/plugins/live/lib/live/engine.rb
similarity index 71%
rename from plugins/voice/lib/voice/engine.rb
rename to plugins/live/lib/live/engine.rb
index d8c2b7cfba9..0c4fb5a4652 100644
--- a/plugins/voice/lib/voice/engine.rb
+++ b/plugins/live/lib/live/engine.rb
@@ -1,8 +1,8 @@
# frozen_string_literal: true
-module Voice
+module Live
class Engine < ::Rails::Engine
- isolate_namespace Voice
+ isolate_namespace Live
engine_name PLUGIN_NAME
end
end
diff --git a/plugins/live/lib/live/guardian_extension.rb b/plugins/live/lib/live/guardian_extension.rb
new file mode 100644
index 00000000000..62d15484af4
--- /dev/null
+++ b/plugins/live/lib/live/guardian_extension.rb
@@ -0,0 +1,195 @@
+# frozen_string_literal: true
+
+module Live
+ module GuardianExtension
+ # Access means participating — joining rooms, calling, appearing in
+ # rosters — so it always requires authentication. Anonymous visitors are
+ # served read-only through live_public_access? instead.
+ def can_access_live?
+ SiteSetting.live_enabled? && authenticated? &&
+ in_any_groups?(SiteSetting.live_allowed_groups_map)
+ end
+
+ # Whether Live is open to anonymous visitors, letting them browse (but
+ # not join) public rooms. Never true on login-required sites, where there
+ # are no anonymous visitors to serve.
+ def live_public_access?
+ return false unless SiteSetting.live_enabled?
+ return false if SiteSetting.login_required
+
+ SiteSetting.live_allowed_groups_map.include?(Group::AUTO_GROUPS[:anonymous_users])
+ end
+
+ def can_create_live_room?
+ return false unless can_access_live?
+ user.in_any_groups?(SiteSetting.live_create_room_allowed_groups_map)
+ end
+
+ # Starting a direct call is gated separately from receiving one: anyone
+ # with live-room access can be called, but only these groups get the
+ # call button and the calls endpoint.
+ def can_start_live_call?
+ return false unless can_access_live?
+ user.in_any_groups?(SiteSetting.live_direct_calls_allowed_groups_map)
+ end
+
+ # A specific user may be rung only by callers they could receive a
+ # personal message from: muting or ignoring the caller, disabling
+ # personal messages, or an allowlist that omits the caller all block the
+ # call. Staff are exempt, as they are for personal messages.
+ def can_call_live_user?(target)
+ return false unless can_start_live_call?
+ return false if target.blank? || target.bot? || target.id == user.id
+ return false unless target.guardian.can_access_live?
+
+ !UserCommScreener.new(
+ acting_user: user,
+ target_user_ids: [target.id],
+ ).disallowing_pms_from_actor?(target.id)
+ end
+
+ # Being allowed to create rooms grants nothing over other people's rooms:
+ # a room is managed by site staff, its creator, and its moderators only.
+ def can_manage_live_room?(room)
+ return false unless can_access_live?
+ return false unless room
+
+ is_staff? || room.creator_id == user.id || room.moderator?(user)
+ end
+
+ def ensure_can_manage_live_room!(room)
+ unless can_manage_live_room?(room)
+ raise Discourse::InvalidAccess.new(I18n.t("live.errors.not_authorized"))
+ end
+ end
+
+ def ensure_can_create_live_room!
+ unless can_create_live_room?
+ raise Discourse::InvalidAccess.new(I18n.t("live.errors.not_authorized"))
+ end
+ end
+
+ def can_join_live_room?(room)
+ return false unless can_access_live?
+ return false unless room
+
+ room.public? || room.member?(user) || can_manage_live_room?(room)
+ end
+
+ def ensure_can_join_live_room!(room)
+ unless can_join_live_room?(room)
+ raise Discourse::InvalidAccess.new(I18n.t("live.errors.not_authorized"))
+ end
+ end
+
+ # Inviting is sharing access you already have: anyone who can join a
+ # public room may invite others to it, while a private room's roster is a
+ # management concern — inviting there grants a membership.
+ def can_invite_to_live_room?(room)
+ return false unless can_join_live_room?(room)
+
+ room.public? || can_manage_live_room?(room)
+ end
+
+ # Room-independent half of can_invite_live_agent?, so the client can learn
+ # whether to offer the action before any room is chosen.
+ def can_invite_live_agents?
+ return false unless can_access_live?
+ user.in_any_groups?(SiteSetting.live_livekit_agent_invite_allowed_groups_map)
+ end
+
+ def can_invite_live_agent?(room)
+ can_invite_live_agents? && can_join_live_room?(room) && room.public? &&
+ Live::AgentBot.available?
+ end
+
+ def ensure_can_invite_to_live_room!(room)
+ unless can_invite_to_live_room?(room)
+ raise Discourse::InvalidAccess.new(I18n.t("live.errors.not_authorized"))
+ end
+ end
+
+ def can_see_live_room?(room)
+ return false unless room
+ return true if can_join_live_room?(room)
+
+ # Anonymous and not-yet-authorized visitors may browse public rooms when
+ # access is open to everyone. Joining still requires authentication.
+ live_public_access? && room.public?
+ end
+
+ def ensure_can_see_live_room!(room)
+ unless can_see_live_room?(room)
+ raise Discourse::InvalidAccess.new(I18n.t("live.errors.not_authorized"))
+ end
+ end
+
+ def can_flag_live_user?(room, target_user)
+ return false unless can_join_live_room?(room)
+ return false if target_user.blank? || target_user.bot?
+
+ target_user.id != user.id
+ end
+
+ def ensure_can_flag_live_user!(room, target_user)
+ unless can_flag_live_user?(room, target_user)
+ raise Discourse::InvalidAccess.new(I18n.t("live.errors.not_authorized"))
+ end
+ end
+
+ def can_speak_in_live_room?(room)
+ return true if room.open?
+ return true if user&.admin?
+ membership = room.membership_for(user)
+ membership&.can_speak? || false
+ end
+
+ # Camera and screen sharing are gated independently, per user: the room
+ # must allow media at all, the user must be able to speak in it (a stage
+ # listener publishes nothing), and their groups must carry the capability.
+ def can_publish_video_in_live_room?(room)
+ eligible_to_publish_video_in_live_room?(room) && live_room_media_live?(room)
+ end
+
+ def can_screen_share_in_live_room?(room)
+ eligible_to_screen_share_in_live_room?(room) && live_room_media_live?(room)
+ end
+
+ # The same capability minus the room's media flag and the stage role,
+ # which clients track live from room and role_change broadcasts. This is
+ # the half that gets serialized, so neither re-enabling a room's media nor
+ # a promotion needs the room re-serialized for each user.
+ def eligible_to_publish_video_in_live_room?(room)
+ live_media_entitlements(room)[:can_publish_video]
+ end
+
+ def eligible_to_screen_share_in_live_room?(room)
+ live_media_entitlements(room)[:can_screen_share]
+ end
+
+ # Only stage-room listeners have anything to request — anyone who can
+ # already speak (including admins and everyone in open rooms) cannot.
+ def can_request_to_speak_in_live_room?(room)
+ return false unless can_join_live_room?(room)
+ room.stage? && !can_speak_in_live_room?(room)
+ end
+
+ def ensure_can_request_to_speak_in_live_room!(room)
+ unless can_request_to_speak_in_live_room?(room)
+ raise Discourse::InvalidAccess.new(I18n.t("live.errors.not_authorized"))
+ end
+ end
+
+ private
+
+ def live_media_entitlements(room)
+ return Live::MediaEntitlements::NONE unless can_join_live_room?(room)
+
+ Live::MediaEntitlements.for_user(user)
+ end
+
+ def live_room_media_live?(room)
+ room.video_enabled? && can_speak_in_live_room?(room)
+ end
+ end
+end
diff --git a/plugins/voice/lib/voice/ice_config.rb b/plugins/live/lib/live/ice_config.rb
similarity index 80%
rename from plugins/voice/lib/voice/ice_config.rb
rename to plugins/live/lib/live/ice_config.rb
index 019cf6a85dd..10942e7d957 100644
--- a/plugins/voice/lib/voice/ice_config.rb
+++ b/plugins/live/lib/live/ice_config.rb
@@ -1,9 +1,9 @@
# frozen_string_literal: true
-module Voice
+module Live
# Builds the RTCPeerConnection ICE configuration delivered to clients on
- # room join. TURN servers come from two independent lists: voice_turn_servers
- # uses the static username/password pair, while voice_turn_secret_servers
+ # room join. TURN servers come from two independent lists: live_turn_servers
+ # uses the static username/password pair, while live_turn_secret_servers
# gets credentials minted per user with the TURN REST API scheme (coturn's
# use-auth-secret), so both kinds of deployment can coexist.
module IceConfig
@@ -21,8 +21,8 @@ module Voice
end
def self.static_turn_servers
- username = SiteSetting.voice_turn_username
- credential = SiteSetting.voice_turn_credential
+ username = SiteSetting.live_turn_username
+ credential = SiteSetting.live_turn_credential
static_turn_urls.map do |url|
server = { urls: url }
@@ -33,7 +33,7 @@ module Voice
end
def self.ephemeral_turn_servers(user)
- return [] if ephemeral_turn_urls.empty? || SiteSetting.voice_turn_secret.blank?
+ return [] if ephemeral_turn_urls.empty? || SiteSetting.live_turn_secret.blank?
username, credential = ephemeral_credentials(user)
ephemeral_turn_urls.map { |url| { urls: url, username: username, credential: credential } }
@@ -48,7 +48,7 @@ module Voice
def self.ephemeral_credentials(user)
username =
"#{EPHEMERAL_CREDENTIAL_TTL.from_now.to_i}:#{Discourse.current_hostname}:#{user.id}"
- digest = OpenSSL::HMAC.digest("SHA1", SiteSetting.voice_turn_secret, username)
+ digest = OpenSSL::HMAC.digest("SHA1", SiteSetting.live_turn_secret, username)
[username, Base64.strict_encode64(digest)]
end
@@ -57,7 +57,7 @@ module Voice
# "all" even without STUN: server-reflexive candidates come from the
# (authenticated) TURN allocation, so direct connections still work.
def self.transport_policy
- ephemeral_active = ephemeral_turn_urls.any? && SiteSetting.voice_turn_secret.present?
+ ephemeral_active = ephemeral_turn_urls.any? && SiteSetting.live_turn_secret.present?
if stun_urls.empty? && !ephemeral_active && static_turn_urls.any?
"relay"
@@ -67,15 +67,15 @@ module Voice
end
def self.stun_urls
- parse_url_list(SiteSetting.voice_stun_servers)
+ parse_url_list(SiteSetting.live_stun_servers)
end
def self.static_turn_urls
- parse_url_list(SiteSetting.voice_turn_servers)
+ parse_url_list(SiteSetting.live_turn_servers)
end
def self.ephemeral_turn_urls
- parse_url_list(SiteSetting.voice_turn_secret_servers)
+ parse_url_list(SiteSetting.live_turn_secret_servers)
end
def self.parse_url_list(setting)
diff --git a/plugins/voice/lib/voice/livekit.rb b/plugins/live/lib/live/livekit.rb
similarity index 82%
rename from plugins/voice/lib/voice/livekit.rb
rename to plugins/live/lib/live/livekit.rb
index 4c9d7736fff..6917893d978 100644
--- a/plugins/voice/lib/voice/livekit.rb
+++ b/plugins/live/lib/live/livekit.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-module Voice
+module Live
module Livekit
# Raised when an access token cannot be minted (typically a half-deleted
# configuration on a room whose live call is already pinned to LiveKit).
@@ -8,16 +8,17 @@ module Voice
end
TOKEN_TTL = 10.minutes
+ # Pre-rename key, kept so in-flight state survives the deploy.
LAST_WEBHOOK_KEY = "voice:livekit:last_webhook_at"
LAST_WEBHOOK_TTL = 7.days
def self.configured?
- SiteSetting.voice_livekit_url.present? && SiteSetting.voice_livekit_api_key.present? &&
- SiteSetting.voice_livekit_api_secret.present?
+ SiteSetting.live_livekit_url.present? && SiteSetting.live_livekit_api_key.present? &&
+ SiteSetting.live_livekit_api_secret.present?
end
def self.cloud?
- uri = URI.parse(SiteSetting.voice_livekit_url)
+ uri = URI.parse(SiteSetting.live_livekit_url)
uri.scheme == "wss" && uri.host&.end_with?(".livekit.cloud")
rescue URI::InvalidURIError
false
@@ -26,7 +27,7 @@ module Voice
def self.available_for?(room)
return false unless configured?
- case SiteSetting.voice_livekit_room_policy
+ case SiteSetting.live_livekit_room_policy
when "all_rooms"
true
when "per_room"
@@ -51,7 +52,7 @@ module Voice
end
def self.room_name_prefix
- SiteSetting.voice_livekit_room_prefix.presence ||
+ SiteSetting.live_livekit_room_prefix.presence ||
RailsMultisite::ConnectionManagement.current_db
end
@@ -76,8 +77,8 @@ module Voice
return [] unless can_publish
sources = ["microphone"]
- sources << "camera" if guardian.can_publish_video_in_voice_room?(room)
- if guardian.can_screen_share_in_voice_room?(room)
+ sources << "camera" if guardian.can_publish_video_in_live_room?(room)
+ if guardian.can_screen_share_in_live_room?(room)
sources.concat(%w[screen_share screen_share_audio])
end
sources
@@ -86,11 +87,11 @@ module Voice
def self.mint_token(user:, room:, guardian:)
raise MintError, "LiveKit is not fully configured" unless configured?
- can_publish = guardian.can_speak_in_voice_room?(room)
+ can_publish = guardian.can_speak_in_live_room?(room)
sources = publish_sources(room, can_publish, guardian)
payload = {
- iss: SiteSetting.voice_livekit_api_key,
+ iss: SiteSetting.live_livekit_api_key,
sub: user.id.to_s,
name: user.username,
exp: TOKEN_TTL.from_now.to_i,
@@ -111,7 +112,7 @@ module Voice
},
}
- JWT.encode(payload, SiteSetting.voice_livekit_api_secret, "HS256")
+ JWT.encode(payload, SiteSetting.live_livekit_api_secret, "HS256")
end
end
end
diff --git a/plugins/voice/lib/voice/livekit/agent_dispatch_client.rb b/plugins/live/lib/live/livekit/agent_dispatch_client.rb
similarity index 86%
rename from plugins/voice/lib/voice/livekit/agent_dispatch_client.rb
rename to plugins/live/lib/live/livekit/agent_dispatch_client.rb
index c4c9b639485..48c35988555 100644
--- a/plugins/voice/lib/voice/livekit/agent_dispatch_client.rb
+++ b/plugins/live/lib/live/livekit/agent_dispatch_client.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-module Voice
+module Live
module Livekit
class AgentDispatchClient
def self.create(room, agent_name:, metadata:)
@@ -33,10 +33,10 @@ module Voice
return { ok: true, data: {} } if method == "DeleteDispatch" && response.status == 404
return { ok: true, data: JSON.parse(response.body) } if response.status == 200
- Rails.logger.warn("[voice-livekit] #{method} failed: HTTP #{response.status}")
+ Rails.logger.warn("[live-livekit] #{method} failed: HTTP #{response.status}")
{ ok: false }
rescue StandardError => error
- Rails.logger.warn("[voice-livekit] #{method} failed: #{error.class}")
+ Rails.logger.warn("[live-livekit] #{method} failed: #{error.class}")
{ ok: false }
end
private_class_method :request
diff --git a/plugins/voice/lib/voice/livekit/cloud_agent_client.rb b/plugins/live/lib/live/livekit/cloud_agent_client.rb
similarity index 95%
rename from plugins/voice/lib/voice/livekit/cloud_agent_client.rb
rename to plugins/live/lib/live/livekit/cloud_agent_client.rb
index 8fde9d0671c..27bd98d184b 100644
--- a/plugins/voice/lib/voice/livekit/cloud_agent_client.rb
+++ b/plugins/live/lib/live/livekit/cloud_agent_client.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-module Voice
+module Live
module Livekit
# Read-only catalogue of the agents deployed to the LiveKit Cloud project,
# so inviters can pick a dispatch name instead of typing one. Cloud-only:
@@ -11,7 +11,7 @@ module Voice
class RequestError < StandardError
end
- CACHE_KEY = "voice:livekit:cloud_agents"
+ CACHE_KEY = "live:livekit:cloud_agents"
CACHE_TTL = 30.seconds
TIMEOUT_SECONDS = 5
@@ -34,7 +34,7 @@ module Voice
Discourse.redis.setex(CACHE_KEY, CACHE_TTL.to_i, agents.to_json)
{ ok: true, agents: }
rescue StandardError => error
- Rails.logger.warn("[voice-livekit] ListAgents failed: #{error.message}")
+ Rails.logger.warn("[live-livekit] ListAgents failed: #{error.message}")
{ ok: false }
end
diff --git a/plugins/voice/lib/voice/livekit/egress_client.rb b/plugins/live/lib/live/livekit/egress_client.rb
similarity index 71%
rename from plugins/voice/lib/voice/livekit/egress_client.rb
rename to plugins/live/lib/live/livekit/egress_client.rb
index c8b459785ac..83c64bc63ab 100644
--- a/plugins/voice/lib/voice/livekit/egress_client.rb
+++ b/plugins/live/lib/live/livekit/egress_client.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-module Voice
+module Live
module Livekit
# Twirp-JSON client for LiveKit's Egress service, which records rooms
# server-side. Dedicated S3 settings override the egress deployment's
@@ -17,23 +17,23 @@ module Voice
class << self
def start_room_composite(room, filepath:)
output = { filepath: filepath }
- if SiteSetting.voice_livekit_recording_s3_bucket.present?
- validator = VoiceLivekitRecordingS3BucketValidator.new
- unless validator.valid_value?(SiteSetting.voice_livekit_recording_s3_bucket)
- Voice.warn(
- "[voice-livekit] StartRoomCompositeEgress refused: invalid recording storage configuration",
+ if SiteSetting.live_livekit_recording_s3_bucket.present?
+ validator = LiveLivekitRecordingS3BucketValidator.new
+ unless validator.valid_value?(SiteSetting.live_livekit_recording_s3_bucket)
+ Live.warn(
+ "[live-livekit] StartRoomCompositeEgress refused: invalid recording storage configuration",
)
return { ok: false, error: validator.error_message }
end
output[:s3] = {
- bucket: SiteSetting.voice_livekit_recording_s3_bucket,
- region: SiteSetting.voice_livekit_recording_s3_region,
- accessKey: SiteSetting.voice_livekit_recording_s3_access_key_id,
- secret: SiteSetting.voice_livekit_recording_s3_secret_access_key,
+ bucket: SiteSetting.live_livekit_recording_s3_bucket,
+ region: SiteSetting.live_livekit_recording_s3_region,
+ accessKey: SiteSetting.live_livekit_recording_s3_access_key_id,
+ secret: SiteSetting.live_livekit_recording_s3_secret_access_key,
}
- if SiteSetting.voice_livekit_recording_s3_endpoint.present?
- output[:s3][:endpoint] = SiteSetting.voice_livekit_recording_s3_endpoint
+ if SiteSetting.live_livekit_recording_s3_endpoint.present?
+ output[:s3][:endpoint] = SiteSetting.live_livekit_recording_s3_endpoint
output[:s3][:forcePathStyle] = true
end
end
@@ -73,8 +73,8 @@ module Voice
if response.status == 200
{ ok: true, data: JSON.parse(response.body) }
else
- Voice.warn(
- "[voice-livekit] #{method} failed: " \
+ Live.warn(
+ "[live-livekit] #{method} failed: " \
"HTTP #{response.status}",
)
{ ok: false, error: "HTTP #{response.status}" }
@@ -86,15 +86,15 @@ module Voice
}
rescue StandardError => e
message = redact_credentials(e.message)
- Voice.warn("[voice-livekit] #{method} failed: #{e.class}")
+ Live.warn("[live-livekit] #{method} failed: #{e.class}")
{ ok: false, error: "#{e.class}: #{message}" }
end
def redact_credentials(message)
message = message.to_s
[
- SiteSetting.voice_livekit_recording_s3_access_key_id,
- SiteSetting.voice_livekit_recording_s3_secret_access_key,
+ SiteSetting.live_livekit_recording_s3_access_key_id,
+ SiteSetting.live_livekit_recording_s3_secret_access_key,
].each do |credential|
message = message.gsub(credential, "[FILTERED]") if credential.present?
end
diff --git a/plugins/voice/lib/voice/livekit/health_check.rb b/plugins/live/lib/live/livekit/health_check.rb
similarity index 88%
rename from plugins/voice/lib/voice/livekit/health_check.rb
rename to plugins/live/lib/live/livekit/health_check.rb
index 05c3daa3f53..3f8391e4097 100644
--- a/plugins/voice/lib/voice/livekit/health_check.rb
+++ b/plugins/live/lib/live/livekit/health_check.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-module Voice
+module Live
module Livekit
# Diagnostics behind the admin status panel and the one-shot probe job:
# config-time connectivity checks (token self-mint, RoomService reach)
@@ -9,15 +9,15 @@ module Voice
# Results carry booleans, latencies and error strings; never setting
# values — the API secret must not be reconstructable from any payload.
module HealthCheck
- LAST_PROBE_KEY = "voice:livekit:last_probe"
+ LAST_PROBE_KEY = "live:livekit:last_probe"
LAST_PROBE_TTL = 7.days
def self.settings_status
{
- url_present: SiteSetting.voice_livekit_url.present?,
- api_key_present: SiteSetting.voice_livekit_api_key.present?,
- api_secret_present: SiteSetting.voice_livekit_api_secret.present?,
- policy: SiteSetting.voice_livekit_room_policy,
+ url_present: SiteSetting.live_livekit_url.present?,
+ api_key_present: SiteSetting.live_livekit_api_key.present?,
+ api_secret_present: SiteSetting.live_livekit_api_secret.present?,
+ policy: SiteSetting.live_livekit_room_policy,
}
end
@@ -30,16 +30,16 @@ module Voice
token =
JWT.encode(
{
- iss: SiteSetting.voice_livekit_api_key,
+ iss: SiteSetting.live_livekit_api_key,
exp: 1.minute.from_now.to_i,
video: {
roomList: true,
},
},
- SiteSetting.voice_livekit_api_secret,
+ SiteSetting.live_livekit_api_secret,
"HS256",
)
- JWT.decode(token, SiteSetting.voice_livekit_api_secret, true, algorithm: "HS256")
+ JWT.decode(token, SiteSetting.live_livekit_api_secret, true, algorithm: "HS256")
{ ok: true }
rescue StandardError => e
{ ok: false, error: "#{e.class}: #{e.message}" }
@@ -92,7 +92,7 @@ module Voice
end
return [] if room_ids.empty?
- Voice::Room
+ Live::Room
.where(id: room_ids)
.order(:id)
.map { |room| room_status(room, probe_participants:) }
diff --git a/plugins/voice/lib/voice/livekit/room_service_client.rb b/plugins/live/lib/live/livekit/room_service_client.rb
similarity index 89%
rename from plugins/voice/lib/voice/livekit/room_service_client.rb
rename to plugins/live/lib/live/livekit/room_service_client.rb
index 00e424f79a9..65f310a0235 100644
--- a/plugins/voice/lib/voice/livekit/room_service_client.rb
+++ b/plugins/live/lib/live/livekit/room_service_client.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-module Voice
+module Live
module Livekit
# Minimal Twirp-JSON client for the three RoomService calls that keep the
# SFU in sync with Discourse-side moderation and lifecycle events. Every
@@ -29,7 +29,13 @@ module Voice
def update_participant(room, user, identity: nil)
guardian = user.guardian
can_publish =
- user.bot? ? user.id == AgentBot.user&.id : guardian.can_speak_in_voice_room?(room)
+ (
+ if user.bot?
+ user.id == AgentBot.user&.id
+ else
+ guardian.can_speak_in_live_room?(room)
+ end
+ )
call(
room,
"UpdateParticipant",
@@ -90,7 +96,7 @@ module Voice
def sync?(room, agent_cleanup:)
Livekit.configured? &&
(
- Voice::ParticipantTracker.pinned_transport(room.id) == "livekit" ||
+ Live::ParticipantTracker.pinned_transport(room.id) == "livekit" ||
(agent_cleanup && AgentManager.provider_room?(room.id))
)
end
@@ -107,17 +113,17 @@ module Voice
# The SFU tears an emptied room down on its own, so the last
# leave's DeleteRoom routinely races it — already-gone is the
# desired end state, not a fault worth a Logster entry.
- Rails.logger.debug("[voice-livekit] DeleteRoom no-op for room #{room.id}: already gone")
+ Rails.logger.debug("[live-livekit] DeleteRoom no-op for room #{room.id}: already gone")
true
else
- Voice.warn(
- "[voice-livekit] #{method} failed for room #{room.id}: " \
+ Live.warn(
+ "[live-livekit] #{method} failed for room #{room.id}: " \
"HTTP #{response.status}",
)
false
end
rescue StandardError => e
- Voice.warn("[voice-livekit] #{method} failed for room #{room.id}: #{e.class}")
+ Live.warn("[live-livekit] #{method} failed for room #{room.id}: #{e.class}")
false
end
@@ -131,8 +137,8 @@ module Voice
if response.status == 200
{ ok: true, latency_ms:, data: JSON.parse(response.body) }
else
- Voice.warn(
- "[voice-livekit] #{method} probe failed: " \
+ Live.warn(
+ "[live-livekit] #{method} probe failed: " \
"HTTP #{response.status}",
)
{ ok: false, latency_ms:, error: "HTTP #{response.status}" }
diff --git a/plugins/voice/lib/voice/livekit/twirp.rb b/plugins/live/lib/live/livekit/twirp.rb
similarity index 89%
rename from plugins/voice/lib/voice/livekit/twirp.rb
rename to plugins/live/lib/live/livekit/twirp.rb
index 652f4773946..f393c91946d 100644
--- a/plugins/voice/lib/voice/livekit/twirp.rb
+++ b/plugins/live/lib/live/livekit/twirp.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-module Voice
+module Live
module Livekit
# Shared HTTP layer for LiveKit's Twirp-JSON services (RoomService,
# Egress). Callers own error handling and timeouts; this only builds the
@@ -53,16 +53,16 @@ module Voice
# The Twirp services listen over HTTP(S) on the same host that serves
# the SFU's WebSocket signaling.
def self.api_base_url
- SiteSetting.voice_livekit_url.sub(/\Awss:/, "https:").sub(/\Aws:/, "http:")
+ SiteSetting.live_livekit_url.sub(/\Awss:/, "https:").sub(/\Aws:/, "http:")
end
def self.admin_token(grants, claims = {})
payload = {
- iss: SiteSetting.voice_livekit_api_key,
+ iss: SiteSetting.live_livekit_api_key,
exp: TOKEN_TTL.from_now.to_i,
video: grants,
}.compact.merge(claims)
- JWT.encode(payload, SiteSetting.voice_livekit_api_secret, "HS256")
+ JWT.encode(payload, SiteSetting.live_livekit_api_secret, "HS256")
end
end
end
diff --git a/plugins/voice/lib/voice/livekit/webhook_verifier.rb b/plugins/live/lib/live/livekit/webhook_verifier.rb
similarity index 87%
rename from plugins/voice/lib/voice/livekit/webhook_verifier.rb
rename to plugins/live/lib/live/livekit/webhook_verifier.rb
index a554854d074..cc51befbdf4 100644
--- a/plugins/voice/lib/voice/livekit/webhook_verifier.rb
+++ b/plugins/live/lib/live/livekit/webhook_verifier.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-module Voice
+module Live
module Livekit
# Verifies LiveKit webhook deliveries. The Authorization header carries a
# short-lived HS256 JWT signed with the API secret whose `sha256` claim is
@@ -18,12 +18,12 @@ module Voice
begin
claims, _headers =
- JWT.decode(token, SiteSetting.voice_livekit_api_secret, true, algorithm: "HS256")
+ JWT.decode(token, SiteSetting.live_livekit_api_secret, true, algorithm: "HS256")
rescue JWT::DecodeError => e
raise VerificationError, "invalid token (#{e.class})"
end
- if claims["iss"] != SiteSetting.voice_livekit_api_key
+ if claims["iss"] != SiteSetting.live_livekit_api_key
raise VerificationError, "token issued for a different API key"
end
diff --git a/plugins/voice/lib/voice/media_entitlements.rb b/plugins/live/lib/live/media_entitlements.rb
similarity index 85%
rename from plugins/voice/lib/voice/media_entitlements.rb
rename to plugins/live/lib/live/media_entitlements.rb
index 8ad7a6a7a8d..23cc3a8b048 100644
--- a/plugins/voice/lib/voice/media_entitlements.rb
+++ b/plugins/live/lib/live/media_entitlements.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-module Voice
+module Live
# Who may publish camera and screen media, answered for a whole roster at
# once. Mesh peers attach media straight to each other, so a receiver has to
# know every sender's entitlement — not just its own — before it plays a
@@ -19,8 +19,8 @@ module Voice
return {} if users.blank?
return users.to_h { |user| [user.id, NONE] } if !room || !room.video_enabled?
- video_ids = user_ids_in_groups(users, SiteSetting.voice_video_allowed_groups_map)
- screen_ids = user_ids_in_groups(users, SiteSetting.voice_screen_share_allowed_groups_map)
+ video_ids = user_ids_in_groups(users, SiteSetting.live_video_allowed_groups_map)
+ screen_ids = user_ids_in_groups(users, SiteSetting.live_screen_share_allowed_groups_map)
users.to_h do |user|
[
@@ -42,8 +42,8 @@ module Voice
return NONE if user.blank?
{
- can_publish_video: user.in_any_groups?(SiteSetting.voice_video_allowed_groups_map),
- can_screen_share: user.in_any_groups?(SiteSetting.voice_screen_share_allowed_groups_map),
+ can_publish_video: user.in_any_groups?(SiteSetting.live_video_allowed_groups_map),
+ can_screen_share: user.in_any_groups?(SiteSetting.live_screen_share_allowed_groups_map),
}
end
diff --git a/plugins/voice/lib/voice/room_hashtag_data_source.rb b/plugins/live/lib/live/room_hashtag_data_source.rb
similarity index 74%
rename from plugins/voice/lib/voice/room_hashtag_data_source.rb
rename to plugins/live/lib/live/room_hashtag_data_source.rb
index 5625a4b3b10..c7a0e767501 100644
--- a/plugins/voice/lib/voice/room_hashtag_data_source.rb
+++ b/plugins/live/lib/live/room_hashtag_data_source.rb
@@ -1,9 +1,9 @@
# frozen_string_literal: true
-module Voice
+module Live
class RoomHashtagDataSource
def self.enabled?
- SiteSetting.voice_enabled
+ SiteSetting.live_enabled
end
def self.icon
@@ -21,14 +21,14 @@ module Voice
item.slug = room.slug
item.icon = room.stage? ? "podcast" : icon
item.style_type = "icon"
- item.relative_url = "#{Discourse.base_path}/voice/r/#{room.slug}"
+ item.relative_url = "#{Discourse.base_path}/live/r/#{room.slug}"
item.type = type
item.id = room.id
end
end
def self.find_by_ids(guardian, ids)
- visible_rooms(guardian, Voice::Room.where(id: ids)).map { |room| room_to_hashtag_item(room) }
+ visible_rooms(guardian, Live::Room.where(id: ids)).map { |room| room_to_hashtag_item(room) }
end
def self.lookup(guardian, slugs)
@@ -36,7 +36,7 @@ module Voice
visible_rooms(
guardian,
- Voice::Room.where("LOWER(slug) IN (?)", slugs.map(&:downcase)),
+ Live::Room.where("LOWER(slug) IN (?)", slugs.map(&:downcase)),
).map { |room| room_to_hashtag_item(room) }
end
@@ -56,7 +56,7 @@ module Voice
visible_rooms(
guardian,
- Voice::Room.where("slug ILIKE :pattern OR name ILIKE :pattern", pattern: pattern),
+ Live::Room.where("slug ILIKE :pattern OR name ILIKE :pattern", pattern: pattern),
).take(limit).map { |room| room_to_hashtag_item(room) }
end
@@ -65,15 +65,15 @@ module Voice
end
def self.search_without_term(guardian, limit)
- visible_rooms(guardian, Voice::Room.all).take(limit).map { |room| room_to_hashtag_item(room) }
+ visible_rooms(guardian, Live::Room.all).take(limit).map { |room| room_to_hashtag_item(room) }
end
def self.visible_rooms(guardian, scope)
scope
- .merge(Voice::Room.visible_to(guardian))
+ .merge(Live::Room.visible_to(guardian))
.includes(:room_memberships)
.order(:name)
- .select { |room| guardian.can_see_voice_room?(room) }
+ .select { |room| guardian.can_see_live_room?(room) }
end
private_class_method :visible_rooms
end
diff --git a/plugins/voice/lib/voice/user_extension.rb b/plugins/live/lib/live/user_extension.rb
similarity index 67%
rename from plugins/voice/lib/voice/user_extension.rb
rename to plugins/live/lib/live/user_extension.rb
index 96c8e9a80d0..90364957ee2 100644
--- a/plugins/voice/lib/voice/user_extension.rb
+++ b/plugins/live/lib/live/user_extension.rb
@@ -1,15 +1,15 @@
# frozen_string_literal: true
-module Voice
+module Live
module UserExtension
extend ActiveSupport::Concern
included do
# No dependent option: a deleted creator's rooms are reassigned to the
# system user by the plugin's user_destroyed handler, not destroyed.
- has_many :voice_rooms, class_name: "Voice::Room", foreign_key: :creator_id
+ has_many :live_rooms, class_name: "Live::Room", foreign_key: :creator_id
end
end
end
-::User.include Voice::UserExtension
+::User.include Live::UserExtension
diff --git a/plugins/voice/lib/voice/user_status_manager.rb b/plugins/live/lib/live/user_status_manager.rb
similarity index 81%
rename from plugins/voice/lib/voice/user_status_manager.rb
rename to plugins/live/lib/live/user_status_manager.rb
index 000bf7c8dc7..88c5e2f4106 100644
--- a/plugins/voice/lib/voice/user_status_manager.rb
+++ b/plugins/live/lib/live/user_status_manager.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-module Voice
+module Live
class UserStatusManager
EMOJI = "studio_microphone"
AFK_EMOJI = "zzz"
@@ -8,6 +8,7 @@ module Voice
# ownership — anyone can pick zzz from the status picker — and the sweep
# must never touch a status it didn't set. Self-healing: heartbeats
# re-add, and Redis drops the key once the set empties.
+ # Keep the persisted key so statuses without an expiry remain eligible for cleanup.
OWNERS_KEY = "voice:status_owners"
# A status younger than this is skipped by the sweep: it may have been set
# by a join that raced the sweep's liveness snapshot, and the heartbeat
@@ -17,12 +18,12 @@ module Voice
# Statuses carry no ends_at: they mirror room presence, not a timer, so
# the tooltip shows no "until" line. Leave/kick clear them directly;
# crashed or lapsed clients are reaped by clear_stale_statuses.
- def self.set_voice_status(user, room)
+ def self.set_live_status(user, room)
return if user.bot?
return unless SiteSetting.enable_user_status
- return unless SiteSetting.voice_auto_status_enabled
- return if user_has_non_voice_status?(user)
+ return unless SiteSetting.live_auto_status_enabled
+ return if user_has_non_live_status?(user)
set_status(user, status_description(room), EMOJI)
end
@@ -31,16 +32,16 @@ module Voice
return if user.bot?
return unless SiteSetting.enable_user_status
- return unless voice_status_active?(user)
+ return unless live_status_active?(user)
set_status(user, status_description(room, afk: true), AFK_EMOJI)
end
- def self.clear_voice_status(user)
+ def self.clear_live_status(user)
return unless SiteSetting.enable_user_status
Discourse.redis.srem(OWNERS_KEY, user.id)
- return unless voice_status_active?(user)
+ return unless live_status_active?(user)
user.clear_status!
end
@@ -61,7 +62,7 @@ module Voice
user = users_by_id[user_id]
status = user&.user_status
- if user.nil? || status.nil? || !voice_emoji?(status.emoji)
+ if user.nil? || status.nil? || !live_emoji?(status.emoji)
# Deleted user, or the status was since cleared/replaced: ownership
# lapsed on its own.
released_ids << user_id
@@ -76,9 +77,9 @@ module Voice
Discourse.redis.srem(OWNERS_KEY, released_ids) if released_ids.any?
end
- def self.voice_status_active?(user)
+ def self.live_status_active?(user)
status = user.user_status
- status && !status.expired? && voice_emoji?(status.emoji)
+ status && !status.expired? && live_emoji?(status.emoji)
end
# Statuses are visible site-wide, so a non-public room's name must not
@@ -86,9 +87,9 @@ module Voice
private_class_method def self.status_description(room, afk: false)
prefix = afk ? "afk_" : ""
if room.public?
- I18n.t("voice.user_status.#{prefix}in_room", room_name: room.name)
+ I18n.t("live.user_status.#{prefix}in_room", room_name: room.name)
else
- I18n.t("voice.user_status.#{prefix}in_private_room")
+ I18n.t("live.user_status.#{prefix}in_private_room")
end
end
@@ -107,12 +108,12 @@ module Voice
Discourse.redis.sadd(OWNERS_KEY, user.id)
end
- private_class_method def self.user_has_non_voice_status?(user)
+ private_class_method def self.user_has_non_live_status?(user)
status = user.user_status
- status && !status.expired? && !voice_emoji?(status.emoji)
+ status && !status.expired? && !live_emoji?(status.emoji)
end
- private_class_method def self.voice_emoji?(emoji)
+ private_class_method def self.live_emoji?(emoji)
[EMOJI, AFK_EMOJI].include?(emoji)
end
end
diff --git a/plugins/voice/lib/tasks/voice.rake b/plugins/live/lib/tasks/live.rake
similarity index 63%
rename from plugins/voice/lib/tasks/voice.rake
rename to plugins/live/lib/tasks/live.rake
index 67e635bf223..acf4286a995 100644
--- a/plugins/voice/lib/tasks/voice.rake
+++ b/plugins/live/lib/tasks/live.rake
@@ -1,17 +1,17 @@
# frozen_string_literal: true
-# Emergency lever: drops every pinned voice-room transport so each room's
+# Emergency lever: drops every pinned live-room transport so each room's
# next join re-resolves against current settings. Calls already in progress
# are not interrupted, but their next joiner may land on a different
# transport than the current occupants — prefer the per-room "End live call"
# admin action unless the media server is already unreachable.
-desc "Clear all pinned voice room transports"
-task "voice:clear_transport_pins" => :environment do
+desc "Clear all pinned live room transports"
+task "live:clear_transport_pins" => :environment do
cleared = 0
Discourse
.redis
- .scan_each(match: "#{Voice::ParticipantTracker::KEY_NAMESPACE}:*:transport") do |key|
+ .scan_each(match: "#{Live::ParticipantTracker::KEY_NAMESPACE}:*:transport") do |key|
Discourse.redis.del(key)
cleared += 1
end
diff --git a/plugins/voice/package.json b/plugins/live/package.json
similarity index 65%
rename from plugins/voice/package.json
rename to plugins/live/package.json
index 840324617b7..214f80076a1 100644
--- a/plugins/voice/package.json
+++ b/plugins/live/package.json
@@ -1,7 +1,7 @@
{
"private": true,
"scripts": {
- "voice:bots": "node scripts/voice-fake-participants.mjs"
+ "live:bots": "node scripts/live-fake-participants.mjs"
},
"dependencies": {
"discourse": "workspace:@discourse/types@*"
diff --git a/plugins/voice/plugin.rb b/plugins/live/plugin.rb
similarity index 61%
rename from plugins/voice/plugin.rb
rename to plugins/live/plugin.rb
index 0ce3b6103e5..f4e0fd1097f 100644
--- a/plugins/voice/plugin.rb
+++ b/plugins/live/plugin.rb
@@ -1,10 +1,10 @@
# frozen_string_literal: true
-# name: voice
-# about: Voice chat rooms powered by WebRTC inside Discourse
+# name: live
+# about: Voice and video rooms powered by WebRTC inside Discourse
# version: 0.1
# authors: Discourse Contributors
-# url: https://github.com/discourse/discourse/tree/main/plugins/voice
+# url: https://github.com/discourse/discourse/tree/main/plugins/live
require "discourse_voice_assets"
@@ -14,21 +14,21 @@ require "discourse_voice_assets"
# gem-version-stamped path: /plugins/ assets are cached long-term as
# immutable, so the versioned URL is what busts caches on a gem bump. The
# client learns the current base path from the site serializer.
-voice_javascripts_dir = File.join(__dir__, "public", "javascripts")
-FileUtils.mkdir_p(voice_javascripts_dir)
+live_javascripts_dir = File.join(__dir__, "public", "javascripts")
+FileUtils.mkdir_p(live_javascripts_dir)
Dir
- .children(voice_javascripts_dir)
+ .children(live_javascripts_dir)
.each do |entry|
if entry != DiscourseVoiceAssets::VERSION
- FileUtils.rm_rf(File.join(voice_javascripts_dir, entry))
+ FileUtils.rm_rf(File.join(live_javascripts_dir, entry))
end
end
Discourse::Utils.atomic_ln_s(
DiscourseVoiceAssets.vendor_path,
- File.join(voice_javascripts_dir, DiscourseVoiceAssets::VERSION),
+ File.join(live_javascripts_dir, DiscourseVoiceAssets::VERSION),
)
-enabled_site_setting :voice_enabled
+enabled_site_setting :live_enabled
register_svg_icon "microphone-lines"
register_svg_icon "lock"
@@ -88,33 +88,33 @@ register_svg_icon "copy"
register_svg_icon "closed-captioning"
register_svg_icon "stop"
register_svg_icon "far-file-lines"
-register_asset "stylesheets/common/voice.scss"
-register_asset "stylesheets/common/voice-room-page.scss"
-register_asset "stylesheets/common/voice-chat.scss"
-register_asset "stylesheets/common/voice-admin.scss", :admin
+register_asset "stylesheets/common/live.scss"
+register_asset "stylesheets/common/live-room-page.scss"
+register_asset "stylesheets/common/live-chat.scss"
+register_asset "stylesheets/common/live-admin.scss", :admin
-add_admin_route "voice.admin.title", "voice", use_new_show_route: true
+add_admin_route "live.admin.title", "live", use_new_show_route: true
-require_relative "lib/voice"
+require_relative "lib/live"
after_initialize do
- register_stat("voice_users", expose_via_api: true) { Voice::Statistics.about_users }
+ register_stat("live_users", expose_via_api: true) { Live::Statistics.about_users }
- SeedFu.fixture_paths << Rails.root.join("plugins/voice/db/fixtures").to_s
+ SeedFu.fixture_paths << Rails.root.join("plugins/live/db/fixtures").to_s
- require_relative "lib/voice/user_extension"
+ require_relative "lib/live/user_extension"
- Discourse::Application.routes.append { mount ::Voice::Engine, at: "/voice" }
+ Discourse::Application.routes.append { mount ::Live::Engine, at: "/live" }
- Guardian.prepend Voice::GuardianExtension
+ Guardian.prepend Live::GuardianExtension
- register_reviewable_type ReviewableVoiceUser
+ register_reviewable_type ReviewableLiveUser
# Chat snapshots the hashtag orderings into Site.markdown_additional_options
# at its own after_initialize, which runs before this one (plugins load
# alphabetically) — refresh it so chat transcripts quoted inside posts can
# cook room hashtags too. The snapshot also bakes in each source's enabled?
- # state, so it must be refreshed again when voice_enabled toggles.
+ # state, so it must be refreshed again when live_enabled toggles.
def self.refresh_chat_hashtag_configurations
return unless defined?(::Chat) && Site.markdown_additional_options["chat"]
@@ -126,65 +126,65 @@ after_initialize do
# Rooms rank below chat channels (200) but above categories (100) in the
# chat composer, and below everything (category 100, tag 50, channel 10) in
# the topic composer, so a bare #slug in a post still means the category.
- register_hashtag_data_source(Voice::RoomHashtagDataSource)
+ register_hashtag_data_source(Live::RoomHashtagDataSource)
register_hashtag_type_priority_for_context("room", "chat-composer", 150)
register_hashtag_type_priority_for_context("room", "topic-composer", 5)
refresh_chat_hashtag_configurations
# Gates the user-card call button: the viewer needs the direct-call
- # permission and the target must be callable by them — voice-room access,
+ # permission and the target must be callable by them — live-room access,
# not the viewer themselves or a bot, and not screened out by the target's
# mute, ignore, or personal message preferences.
add_to_serializer(
:user_card,
- :voice_can_call,
- include_condition: -> { scope.can_start_voice_call? },
- ) { scope.can_call_voice_user?(object) }
+ :live_can_call,
+ include_condition: -> { scope.can_start_live_call? },
+ ) { scope.can_call_live_user?(object) }
# Lets the client decide whether to render the rooms sidebar for anonymous
# visitors without exposing the configured group ids.
- add_to_serializer(:site, :voice_public_access) { scope.voice_public_access? }
+ add_to_serializer(:site, :live_public_access) { scope.live_public_access? }
# Base URL for the gem-vendored media assets (see the symlink setup above).
# Version-stamped so a gem bump busts the immutable /plugins/ caches; the
# client builds every asset URL from this, so filenames can stay stable.
- add_to_serializer(:site, :voice_assets_path) do
- "/plugins/voice/javascripts/#{DiscourseVoiceAssets::VERSION}"
+ add_to_serializer(:site, :live_assets_path) do
+ "/plugins/live/javascripts/#{DiscourseVoiceAssets::VERSION}"
end
# Gates the room-form SFU checkbox only — the client never needs the policy
# enum itself, and a live room's transport is learned at join, not here.
- add_to_serializer(:site, :voice_livekit_per_room_available) do
- SiteSetting.voice_livekit_room_policy == "per_room" && Voice::Livekit.configured?
+ add_to_serializer(:site, :live_livekit_per_room_available) do
+ SiteSetting.live_livekit_room_policy == "per_room" && Live::Livekit.configured?
end
# Gates the room-form media checkbox: with neither capability granted to any
# group, a room-level media toggle would decide nothing. The per-user rights
# themselves ride on each room's serialization instead.
- add_to_serializer(:site, :voice_video_available) do
- SiteSetting.voice_video_allowed_groups.present? ||
- SiteSetting.voice_screen_share_allowed_groups.present?
+ add_to_serializer(:site, :live_video_available) do
+ SiteSetting.live_video_allowed_groups.present? ||
+ SiteSetting.live_screen_share_allowed_groups.present?
end
- Voice::DefaultRoomSeeder.ensure! if SiteSetting.voice_enabled?
- Voice::AgentBot.ensure! if SiteSetting.voice_enabled?
+ Live::DefaultRoomSeeder.ensure! if SiteSetting.live_enabled?
+ Live::AgentBot.ensure! if SiteSetting.live_enabled?
- add_to_serializer(:site, :voice_livekit_agent_bot_id) do
- Voice::AgentBot.user&.id if scope.can_invite_voice_agents? && Voice::AgentBot.available?
+ add_to_serializer(:site, :live_livekit_agent_bot_id) do
+ Live::AgentBot.user&.id if scope.can_invite_live_agents? && Live::AgentBot.available?
end
# This can't live in the on(:site_setting_changed) handler below: plugin
# event handlers are skipped while the plugin is disabled, which silently
# covers the disabling transition itself.
on_enabled_change do |_old_value, new_value|
- if new_value && SiteSetting.voice_badges_enabled
- Voice::BadgeGranterHooks.enable_all!
+ if new_value && SiteSetting.live_badges_enabled
+ Live::BadgeGranterHooks.enable_all!
else
- Voice::BadgeGranterHooks.disable_all!
+ Live::BadgeGranterHooks.disable_all!
end
- Voice::DefaultRoomSeeder.ensure! if new_value
- new_value ? Voice::AgentBot.ensure! : Voice::AgentManager.stop_all!
- clear_all_voice_statuses unless new_value
+ Live::DefaultRoomSeeder.ensure! if new_value
+ new_value ? Live::AgentBot.ensure! : Live::AgentManager.stop_all!
+ clear_all_live_statuses unless new_value
refresh_chat_hashtag_configurations
end
@@ -193,40 +193,40 @@ after_initialize do
# endpoints tolerate the dangling user_id). Rooms must stay owned, so
# they move to the system user; the roster and per-pair contact rows are
# meaningless without the user.
- Voice::Room.where(creator_id: user.id).update_all(creator_id: Discourse.system_user.id)
- Voice::RoomMembership.where(user_id: user.id).delete_all
- Voice::CoPresence.where("user_id_1 = :id OR user_id_2 = :id", id: user.id).delete_all
+ Live::Room.where(creator_id: user.id).update_all(creator_id: Discourse.system_user.id)
+ Live::RoomMembership.where(user_id: user.id).delete_all
+ Live::CoPresence.where("user_id_1 = :id OR user_id_2 = :id", id: user.id).delete_all
end
on(:site_setting_changed) do |name, _old_value, new_value|
- if name.to_sym == :voice_livekit_agent_enabled
- new_value ? Voice::AgentBot.ensure! : Voice::AgentManager.stop_all!
+ if name.to_sym == :live_livekit_agent_enabled
+ new_value ? Live::AgentBot.ensure! : Live::AgentManager.stop_all!
end
- if name.to_sym == :voice_badges_enabled
- if new_value && SiteSetting.voice_enabled
- Voice::BadgeGranterHooks.enable_all!
+ if name.to_sym == :live_badges_enabled
+ if new_value && SiteSetting.live_enabled
+ Live::BadgeGranterHooks.enable_all!
else
- Voice::BadgeGranterHooks.disable_all!
+ Live::BadgeGranterHooks.disable_all!
end
end
- clear_all_voice_statuses if name.to_sym == :voice_auto_status_enabled && !new_value
+ clear_all_live_statuses if name.to_sym == :live_auto_status_enabled && !new_value
# Surface a bad URL or key pair on the admin status panel within seconds
# of saving, not at the first user's failed join.
livekit_settings = %i[
- voice_livekit_url
- voice_livekit_api_key
- voice_livekit_api_secret
- voice_livekit_room_policy
- voice_livekit_mesh_fallback
+ live_livekit_url
+ live_livekit_api_key
+ live_livekit_api_secret
+ live_livekit_room_policy
+ live_livekit_mesh_fallback
]
- Jobs.enqueue(:voice_livekit_probe) if livekit_settings.include?(name.to_sym)
+ Jobs.enqueue(:live_livekit_probe) if livekit_settings.include?(name.to_sym)
end
- def self.clear_all_voice_statuses
+ def self.clear_all_live_statuses
UserStatus
- .where(emoji: [Voice::UserStatusManager::EMOJI, Voice::UserStatusManager::AFK_EMOJI])
+ .where(emoji: [Live::UserStatusManager::EMOJI, Live::UserStatusManager::AFK_EMOJI])
.find_each { |status| User.find_by(id: status.user_id)&.clear_status! }
end
end
diff --git a/plugins/voice/public/images/upcoming_changes/voice_enabled.png b/plugins/live/public/images/upcoming_changes/live_enabled.png
similarity index 100%
rename from plugins/voice/public/images/upcoming_changes/voice_enabled.png
rename to plugins/live/public/images/upcoming_changes/live_enabled.png
diff --git a/plugins/voice/scripts/voice-fake-participants.mjs b/plugins/live/scripts/live-fake-participants.mjs
similarity index 92%
rename from plugins/voice/scripts/voice-fake-participants.mjs
rename to plugins/live/scripts/live-fake-participants.mjs
index de59a4b9c89..9a91ed07faf 100644
--- a/plugins/voice/scripts/voice-fake-participants.mjs
+++ b/plugins/live/scripts/live-fake-participants.mjs
@@ -14,7 +14,7 @@ function parseArgs(argv) {
baseUrl: process.env.DISCOURSE_URL || "http://localhost:4200",
room: process.env.ROOM || "watercooler",
botCount: Number(process.env.BOT_COUNT || 2),
- botsFile: process.env.VOICE_BOTS_FILE || ".local/voice-bots.json",
+ botsFile: process.env.LIVE_BOTS_FILE || ".local/live-bots.json",
headed: false,
trace: false,
screenshots: false,
@@ -95,18 +95,18 @@ function parseArgs(argv) {
function printHelp() {
console.log(`Usage:
- DISCOURSE_URL=http://localhost:4200 ROOM=watercooler pnpm voice:bots -- --headed --bot-count 3
+ DISCOURSE_URL=http://localhost:4200 ROOM=watercooler pnpm live:bots -- --headed --bot-count 3
Options:
--url <url> Base Discourse URL. Env: DISCOURSE_URL
- --room <slug> Voice room slug. Env: ROOM
+ --room <slug> Live room slug. Env: ROOM
--bot-count <n> Number of generated bots if no bots file exists. Env: BOT_COUNT
- --bots-file <path> JSON bot config. Default: .local/voice-bots.json
+ --bots-file <path> JSON bot config. Default: .local/live-bots.json
--login-mode <mode> become or password. Default: become
--headed Show browser windows
- --trace Capture Playwright traces under tmp/voice-bots
- --screenshots Capture screenshots under tmp/voice-bots
- --record-video Record Playwright videos under tmp/voice-bots
+ --trace Capture Playwright traces under tmp/live-bots
+ --screenshots Capture screenshots under tmp/live-bots
+ --record-video Record Playwright videos under tmp/live-bots
--no-camera Join without auto-enabling camera
--screen-share-bot <n> 1-based bot index that should start screen share
--hold-ms <ms> Auto-close after this many ms; default holds until Ctrl-C
@@ -126,8 +126,8 @@ async function fileExists(path) {
async function loadBots(options) {
const { readFile } = await import("node:fs/promises");
- if (process.env.VOICE_BOTS_JSON) {
- return JSON.parse(process.env.VOICE_BOTS_JSON).slice(0, options.botCount);
+ if (process.env.LIVE_BOTS_JSON) {
+ return JSON.parse(process.env.LIVE_BOTS_JSON).slice(0, options.botCount);
}
if (options.botsFile && (await fileExists(options.botsFile))) {
@@ -138,15 +138,15 @@ async function loadBots(options) {
}
return Array.from({ length: options.botCount }, (_, index) => ({
- username: `voice_bot_${index + 1}`,
- name: `Voice Bot ${index + 1}`,
+ username: `live_bot_${index + 1}`,
+ name: `Live Bot ${index + 1}`,
}));
}
function feedFor(bot, index) {
const [color, accent] = DEFAULT_COLORS[index % DEFAULT_COLORS.length];
return {
- label: bot.label || bot.name || bot.username || `Voice Bot ${index + 1}`,
+ label: bot.label || bot.name || bot.username || `Live Bot ${index + 1}`,
width: bot.width || 640,
height: bot.height || 360,
color: bot.color || color,
@@ -209,7 +209,7 @@ function fakeMediaInitScript({ feed }) {
const timer = window.setInterval(drawFrame, 100);
const stream = canvas.captureStream(10);
stream.getTracks().forEach((track) => {
- track.__voiceFakeMediaLabel = videoFeed.label;
+ track.__liveFakeMediaLabel = videoFeed.label;
cleanupWhenTrackStops(track, () => window.clearInterval(timer));
});
streams.push(stream);
@@ -269,7 +269,7 @@ function fakeMediaInitScript({ feed }) {
});
};
- window.__voiceFakeBotMedia = { feed, streams };
+ window.__liveFakeBotMedia = { feed, streams };
}
async function login(page, bot, options) {
@@ -335,7 +335,7 @@ async function runBot({ browser, bot, index, options, outputDir }) {
await login(page, bot, options);
const roomUrl = new URL(
- `/voice/r/${encodeURIComponent(options.room)}`,
+ `/live/r/${encodeURIComponent(options.room)}`,
options.baseUrl
).toString();
console.log(`[${bot.username}] opening ${roomUrl}`);
@@ -382,7 +382,7 @@ async function main() {
});
const { mkdir } = await import("node:fs/promises");
- const outputDir = "tmp/voice-bots";
+ const outputDir = "tmp/live-bots";
await mkdir(outputDir, { recursive: true });
const bots = await loadBots(options);
@@ -391,7 +391,7 @@ async function main() {
}
console.log(
- `Starting ${bots.length} Voice fake participant(s) against ${options.baseUrl}`
+ `Starting ${bots.length} Live fake participant(s) against ${options.baseUrl}`
);
const browser = await chromium.launch({ headless: !options.headed });
const sessions = [];
diff --git a/plugins/live/spec/fabricators/live_room_fabricator.rb b/plugins/live/spec/fabricators/live_room_fabricator.rb
new file mode 100644
index 00000000000..38970c03a3c
--- /dev/null
+++ b/plugins/live/spec/fabricators/live_room_fabricator.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+Fabricator(:live_room, class_name: "Live::Room") do
+ name { sequence(:live_room_name) { |i| "Live #{i}" } }
+ public { false }
+ creator { Fabricate(:user) }
+end
+
+Fabricator(:live_ephemeral_room, from: :live_room) do
+ ephemeral true
+ last_occupied_at { Time.current }
+end
diff --git a/plugins/voice/spec/fabricators/voice_session_fabricator.rb b/plugins/live/spec/fabricators/live_session_fabricator.rb
similarity index 50%
rename from plugins/voice/spec/fabricators/voice_session_fabricator.rb
rename to plugins/live/spec/fabricators/live_session_fabricator.rb
index 0fee17d689e..9e9a8dcff08 100644
--- a/plugins/voice/spec/fabricators/voice_session_fabricator.rb
+++ b/plugins/live/spec/fabricators/live_session_fabricator.rb
@@ -1,8 +1,8 @@
# frozen_string_literal: true
-Fabricator(:voice_session, class_name: "Voice::Session") do
+Fabricator(:live_session, class_name: "Live::Session") do
user
- room { Fabricate(:voice_room) }
+ room { Fabricate(:live_room) }
joined_at { 1.hour.ago }
left_at { Time.current }
end
diff --git a/plugins/voice/spec/integrity/voice_assets_spec.rb b/plugins/live/spec/integrity/live_assets_spec.rb
similarity index 92%
rename from plugins/voice/spec/integrity/voice_assets_spec.rb
rename to plugins/live/spec/integrity/live_assets_spec.rb
index af9735143bf..c2fc2a651fb 100644
--- a/plugins/voice/spec/integrity/voice_assets_spec.rb
+++ b/plugins/live/spec/integrity/live_assets_spec.rb
@@ -43,11 +43,11 @@ RSpec.describe "discourse_voice_assets integrity" do
end
it "serializes the versioned base path the client builds URLs from" do
- SiteSetting.voice_enabled = true
+ SiteSetting.live_enabled = true
guardian = Guardian.new
serialized = SiteSerializer.new(Site.new(guardian), scope: guardian, root: false).as_json
- expect(serialized[:voice_assets_path]).to eq(
- "/plugins/voice/javascripts/#{DiscourseVoiceAssets::VERSION}",
+ expect(serialized[:live_assets_path]).to eq(
+ "/plugins/live/javascripts/#{DiscourseVoiceAssets::VERSION}",
)
end
end
diff --git a/plugins/voice/spec/integrity/livekit_static_import_spec.rb b/plugins/live/spec/integrity/livekit_static_import_spec.rb
similarity index 93%
rename from plugins/voice/spec/integrity/livekit_static_import_spec.rb
rename to plugins/live/spec/integrity/livekit_static_import_spec.rb
index cd78e46e938..bfe3cb9be5d 100644
--- a/plugins/voice/spec/integrity/livekit_static_import_spec.rb
+++ b/plugins/live/spec/integrity/livekit_static_import_spec.rb
@@ -45,8 +45,8 @@ RSpec.describe "LiveKit SDK static import guard" do
it "allows the dynamic import the session uses" do
[
- 'import(getURL("/plugins/voice/javascripts/livekit/livekit-client.js"))',
- 'import LivekitRoomSession from "../../lib/voice/livekit-session";',
+ 'import(getURL("/plugins/live/javascripts/livekit/livekit-client.js"))',
+ 'import LivekitRoomSession from "../../lib/live/livekit-session";',
].each { |snippet| expect(offenders_in(snippet)).to eq(false), "expected no match: #{snippet}" }
end
end
diff --git a/plugins/voice/spec/jobs/voice/update_co_presence_spec.rb b/plugins/live/spec/jobs/live/update_co_presence_spec.rb
similarity index 50%
rename from plugins/voice/spec/jobs/voice/update_co_presence_spec.rb
rename to plugins/live/spec/jobs/live/update_co_presence_spec.rb
index ede38421ddf..e82752f7496 100644
--- a/plugins/voice/spec/jobs/voice/update_co_presence_spec.rb
+++ b/plugins/live/spec/jobs/live/update_co_presence_spec.rb
@@ -2,30 +2,30 @@
require "rails_helper"
-RSpec.describe Jobs::Voice::UpdateCoPresence do
- fab!(:room, :voice_room)
+RSpec.describe Jobs::Live::UpdateCoPresence do
+ fab!(:room, :live_room)
fab!(:user)
fab!(:other_user, :user)
fab!(:bot) { Fabricate(:user, id: -1400) }
before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_analytics_enabled = true
- SiteSetting.voice_max_room_participants = 2
+ SiteSetting.live_enabled = true
+ SiteSetting.live_analytics_enabled = true
+ SiteSetting.live_max_room_participants = 2
end
describe "#execute" do
it "counts human pairs at capacity without counting agents" do
[bot, user, other_user].each do |participant|
- Voice::ParticipantTracker.add(room.id, participant.id)
+ Live::ParticipantTracker.add(room.id, participant.id)
end
described_class.new.execute({})
- expect(Voice::CoPresence.pluck(:user_id_1, :user_id_2)).to contain_exactly(
+ expect(Live::CoPresence.pluck(:user_id_1, :user_id_2)).to contain_exactly(
[user.id, other_user.id].sort,
)
- expect(Voice::CoPresence.sole.total_seconds).to eq(300)
+ expect(Live::CoPresence.sole.total_seconds).to eq(300)
end
end
end
diff --git a/plugins/voice/spec/jobs/regular/voice_livekit_probe_spec.rb b/plugins/live/spec/jobs/regular/live_livekit_probe_spec.rb
similarity index 51%
rename from plugins/voice/spec/jobs/regular/voice_livekit_probe_spec.rb
rename to plugins/live/spec/jobs/regular/live_livekit_probe_spec.rb
index 76ced51a45f..2c1162816fa 100644
--- a/plugins/voice/spec/jobs/regular/voice_livekit_probe_spec.rb
+++ b/plugins/live/spec/jobs/regular/live_livekit_probe_spec.rb
@@ -2,15 +2,15 @@
require "rails_helper"
-RSpec.describe Jobs::VoiceLivekitProbe do
+RSpec.describe Jobs::LiveLivekitProbe do
before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_livekit_url = "wss://livekit.example.com"
- SiteSetting.voice_livekit_api_key = "lk_api_key"
- SiteSetting.voice_livekit_api_secret = "lk_api_secret"
+ SiteSetting.live_enabled = true
+ SiteSetting.live_livekit_url = "wss://livekit.example.com"
+ SiteSetting.live_livekit_api_key = "lk_api_key"
+ SiteSetting.live_livekit_api_secret = "lk_api_secret"
end
- after { Voice::Livekit::HealthCheck.clear_probe! }
+ after { Live::Livekit::HealthCheck.clear_probe! }
def list_rooms_stub
stub_request(:post, "https://livekit.example.com/twirp/livekit.RoomService/ListRooms")
@@ -21,7 +21,7 @@ RSpec.describe Jobs::VoiceLivekitProbe do
described_class.new.execute({})
- probe = Voice::Livekit::HealthCheck.last_probe
+ probe = Live::Livekit::HealthCheck.last_probe
expect(probe[:ok]).to eq(true)
expect(probe[:token][:ok]).to eq(true)
expect(probe[:server][:ok]).to eq(true)
@@ -29,53 +29,51 @@ RSpec.describe Jobs::VoiceLivekitProbe do
expect(probe[:checked_at]).to be_present
end
- it "stores the failure and logs it with the [voice-livekit] prefix" do
- SiteSetting.voice_verbose_logging = true
+ it "stores the failure and logs it with the [live-livekit] prefix" do
+ SiteSetting.live_verbose_logging = true
list_rooms_stub.to_timeout
- Rails.logger.expects(:warn).with(regexp_matches(/\[voice-livekit\] connectivity probe failed/))
+ Rails.logger.expects(:warn).with(regexp_matches(/\[live-livekit\] connectivity probe failed/))
described_class.new.execute({})
- probe = Voice::Livekit::HealthCheck.last_probe
+ probe = Live::Livekit::HealthCheck.last_probe
expect(probe[:ok]).to eq(false)
expect(probe[:server][:ok]).to eq(false)
expect(probe[:server][:error]).to be_present
end
it "drops the stored result instead of probing when LiveKit was deconfigured" do
- Voice::Livekit::HealthCheck.store_probe!(ok: true)
- SiteSetting.voice_livekit_api_secret = ""
+ Live::Livekit::HealthCheck.store_probe!(ok: true)
+ SiteSetting.live_livekit_api_secret = ""
probe_stub = stub_request(:post, %r{\Ahttps://})
described_class.new.execute({})
- expect(Voice::Livekit::HealthCheck.last_probe).to be_nil
+ expect(Live::Livekit::HealthCheck.last_probe).to be_nil
expect(probe_stub).not_to have_been_requested
end
describe "enqueueing" do
it "is enqueued when a LiveKit setting changes" do
- expect_enqueued_with(job: :voice_livekit_probe) do
- SiteSetting.voice_livekit_url = "wss://other.example.com"
+ expect_enqueued_with(job: :live_livekit_probe) do
+ SiteSetting.live_livekit_url = "wss://other.example.com"
end
end
it "is enqueued when the room policy changes" do
- expect_enqueued_with(job: :voice_livekit_probe) do
- SiteSetting.voice_livekit_room_policy = "all_rooms"
+ expect_enqueued_with(job: :live_livekit_probe) do
+ SiteSetting.live_livekit_room_policy = "all_rooms"
end
end
it "is enqueued when the mesh fallback changes" do
- expect_enqueued_with(job: :voice_livekit_probe) do
- SiteSetting.voice_livekit_mesh_fallback = true
+ expect_enqueued_with(job: :live_livekit_probe) do
+ SiteSetting.live_livekit_mesh_fallback = true
end
end
it "is not enqueued for unrelated settings" do
- expect_not_enqueued_with(job: :voice_livekit_probe) do
- SiteSetting.voice_max_rooms_per_user = 6
- end
+ expect_not_enqueued_with(job: :live_livekit_probe) { SiteSetting.live_max_rooms_per_user = 6 }
end
end
end
diff --git a/plugins/live/spec/jobs/scheduled/live/cleanup_ephemeral_rooms_spec.rb b/plugins/live/spec/jobs/scheduled/live/cleanup_ephemeral_rooms_spec.rb
new file mode 100644
index 00000000000..90d15e6e4d7
--- /dev/null
+++ b/plugins/live/spec/jobs/scheduled/live/cleanup_ephemeral_rooms_spec.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+RSpec.describe Jobs::Live::CleanupEphemeralRooms do
+ fab!(:stale_room) { Fabricate(:live_ephemeral_room, last_occupied_at: 2.hours.ago) }
+
+ it "reaps stale ephemeral rooms" do
+ SiteSetting.live_enabled = true
+ room_id = stale_room.id
+
+ described_class.new.execute({})
+
+ expect(Live::Room.exists?(room_id)).to eq(false)
+ end
+
+ it "does nothing while the plugin is disabled" do
+ SiteSetting.live_enabled = false
+
+ described_class.new.execute({})
+
+ expect(Live::Room.exists?(stale_room.id)).to eq(true)
+ end
+end
diff --git a/plugins/voice/spec/jobs/scheduled/voice/close_orphaned_sessions_spec.rb b/plugins/live/spec/jobs/scheduled/live/close_orphaned_sessions_spec.rb
similarity index 57%
rename from plugins/voice/spec/jobs/scheduled/voice/close_orphaned_sessions_spec.rb
rename to plugins/live/spec/jobs/scheduled/live/close_orphaned_sessions_spec.rb
index 9b93d0dc797..9a1b964ec44 100644
--- a/plugins/voice/spec/jobs/scheduled/voice/close_orphaned_sessions_spec.rb
+++ b/plugins/live/spec/jobs/scheduled/live/close_orphaned_sessions_spec.rb
@@ -1,23 +1,23 @@
# frozen_string_literal: true
-RSpec.describe Jobs::Voice::CloseOrphanedSessions do
+RSpec.describe Jobs::Live::CloseOrphanedSessions do
subject(:job) { described_class.new }
- fab!(:room, :voice_room)
+ fab!(:room, :live_room)
fab!(:user1, :user)
fab!(:user2, :user)
before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_analytics_enabled = true
+ SiteSetting.live_enabled = true
+ SiteSetting.live_analytics_enabled = true
end
- after { Voice::ParticipantTracker.clear(room.id) }
+ after { Live::ParticipantTracker.clear(room.id) }
def set_stale_participant(room, user, last_heartbeat:)
- key = "#{Voice::ParticipantTracker::KEY_NAMESPACE}:#{room.id}:participants"
+ key = "#{Live::ParticipantTracker::KEY_NAMESPACE}:#{room.id}:participants"
Discourse.redis.zadd(key, last_heartbeat.to_f, user.id)
- Voice::ParticipantTracker.update_metadata(
+ Live::ParticipantTracker.update_metadata(
room.id,
user.id,
{ last_heartbeat_at: last_heartbeat.to_f },
@@ -26,7 +26,7 @@ RSpec.describe Jobs::Voice::CloseOrphanedSessions do
it "closes orphaned sessions using the last heartbeat timestamp" do
session =
- Fabricate(:voice_session, user: user1, room: room, joined_at: 50.minutes.ago, left_at: nil)
+ Fabricate(:live_session, user: user1, room: room, joined_at: 50.minutes.ago, left_at: nil)
last_heartbeat = 2.minutes.ago
set_stale_participant(room, user1, last_heartbeat:)
@@ -39,7 +39,7 @@ RSpec.describe Jobs::Voice::CloseOrphanedSessions do
it "falls back to Time.current when Redis data has expired" do
session =
- Fabricate(:voice_session, user: user1, room: room, joined_at: 50.minutes.ago, left_at: nil)
+ Fabricate(:live_session, user: user1, room: room, joined_at: 50.minutes.ago, left_at: nil)
freeze_time do
job.execute({})
@@ -51,9 +51,9 @@ RSpec.describe Jobs::Voice::CloseOrphanedSessions do
it "does not close sessions for users with fresh heartbeats" do
session =
- Fabricate(:voice_session, user: user1, room: room, joined_at: 10.minutes.ago, left_at: nil)
+ Fabricate(:live_session, user: user1, room: room, joined_at: 10.minutes.ago, left_at: nil)
- Voice::ParticipantTracker.add(room.id, user1.id)
+ Live::ParticipantTracker.add(room.id, user1.id)
job.execute({})
@@ -62,38 +62,38 @@ RSpec.describe Jobs::Voice::CloseOrphanedSessions do
end
it "cleans up stale Redis entries after closing" do
- Fabricate(:voice_session, user: user1, room: room, joined_at: 50.minutes.ago, left_at: nil)
+ Fabricate(:live_session, user: user1, room: room, joined_at: 50.minutes.ago, left_at: nil)
set_stale_participant(room, user1, last_heartbeat: 2.minutes.ago)
job.execute({})
- expect(Voice::ParticipantTracker.get_metadata(room.id, user1.id)).to eq({})
+ expect(Live::ParticipantTracker.get_metadata(room.id, user1.id)).to eq({})
end
it "ends agent participation when the final human session expires" do
bot = Fabricate(:user, id: -1400)
session =
- Fabricate(:voice_session, user: user1, room: room, joined_at: 50.minutes.ago, left_at: nil)
+ Fabricate(:live_session, user: user1, room: room, joined_at: 50.minutes.ago, left_at: nil)
set_stale_participant(room, user1, last_heartbeat: 2.minutes.ago)
- Voice::ParticipantTracker.add(room.id, bot.id)
- Voice::ParticipantTracker.pin_transport!(room.id, "mesh")
+ Live::ParticipantTracker.add(room.id, bot.id)
+ Live::ParticipantTracker.pin_transport!(room.id, "mesh")
job.execute({})
expect(session.reload.left_at).to be_present
- expect(Voice::ParticipantTracker.agent_user_ids(room.id)).to be_empty
- expect(Voice::ParticipantTracker.pinned_transport(room.id)).to be_nil
+ expect(Live::ParticipantTracker.agent_user_ids(room.id)).to be_empty
+ expect(Live::ParticipantTracker.pinned_transport(room.id)).to be_nil
end
it "closes stale user sessions while keeping active users untouched" do
stale_session =
- Fabricate(:voice_session, user: user1, room: room, joined_at: 50.minutes.ago, left_at: nil)
+ Fabricate(:live_session, user: user1, room: room, joined_at: 50.minutes.ago, left_at: nil)
active_session =
- Fabricate(:voice_session, user: user2, room: room, joined_at: 50.minutes.ago, left_at: nil)
+ Fabricate(:live_session, user: user2, room: room, joined_at: 50.minutes.ago, left_at: nil)
set_stale_participant(room, user1, last_heartbeat: 2.minutes.ago)
- Voice::ParticipantTracker.add(room.id, user2.id)
+ Live::ParticipantTracker.add(room.id, user2.id)
job.execute({})
@@ -102,10 +102,10 @@ RSpec.describe Jobs::Voice::CloseOrphanedSessions do
end
it "closes sessions whose room has been deleted" do
- deleted_room = Fabricate(:voice_room)
+ deleted_room = Fabricate(:live_room)
session =
Fabricate(
- :voice_session,
+ :live_session,
user: user1,
room: deleted_room,
joined_at: 50.minutes.ago,
@@ -121,9 +121,9 @@ RSpec.describe Jobs::Voice::CloseOrphanedSessions do
end
it "does nothing when plugin is disabled" do
- SiteSetting.voice_enabled = false
+ SiteSetting.live_enabled = false
session =
- Fabricate(:voice_session, user: user1, room: room, joined_at: 50.minutes.ago, left_at: nil)
+ Fabricate(:live_session, user: user1, room: room, joined_at: 50.minutes.ago, left_at: nil)
job.execute({})
diff --git a/plugins/voice/spec/jobs/scheduled/voice/purge_old_sessions_spec.rb b/plugins/live/spec/jobs/scheduled/live/purge_old_sessions_spec.rb
similarity index 59%
rename from plugins/voice/spec/jobs/scheduled/voice/purge_old_sessions_spec.rb
rename to plugins/live/spec/jobs/scheduled/live/purge_old_sessions_spec.rb
index 2fb1039664e..ada021c0c1e 100644
--- a/plugins/voice/spec/jobs/scheduled/voice/purge_old_sessions_spec.rb
+++ b/plugins/live/spec/jobs/scheduled/live/purge_old_sessions_spec.rb
@@ -1,21 +1,21 @@
# frozen_string_literal: true
-RSpec.describe Jobs::Voice::PurgeOldSessions do
+RSpec.describe Jobs::Live::PurgeOldSessions do
fab!(:user)
fab!(:partner, :user)
- fab!(:room, :voice_room)
+ fab!(:room, :live_room)
- before { SiteSetting.voice_enabled = true }
+ before { SiteSetting.live_enabled = true }
def create_session(created_at)
- Fabricate(:voice_session, user: user, room: room).tap do |session|
+ Fabricate(:live_session, user: user, room: room).tap do |session|
session.update_columns(created_at: created_at)
end
end
def create_co_presence(date)
first, second = [user.id, partner.id].sort
- Voice::CoPresence.create!(
+ Live::CoPresence.create!(
user_id_1: first,
user_id_2: second,
date: date,
@@ -25,7 +25,7 @@ RSpec.describe Jobs::Voice::PurgeOldSessions do
end
it "deletes sessions and co-presence older than the retention period" do
- retention = SiteSetting.voice_session_retention_days
+ retention = SiteSetting.live_session_retention_days
old_session = create_session((retention + 1).days.ago)
recent_session = create_session((retention - 1).days.ago)
create_co_presence((retention + 1).days.ago.to_date)
@@ -33,9 +33,9 @@ RSpec.describe Jobs::Voice::PurgeOldSessions do
described_class.new.execute({})
- expect(Voice::Session.all).to contain_exactly(recent_session)
- expect(Voice::CoPresence.all).to contain_exactly(recent_co_presence)
- expect(Voice::Session.exists?(old_session.id)).to eq(false)
+ expect(Live::Session.all).to contain_exactly(recent_session)
+ expect(Live::CoPresence.all).to contain_exactly(recent_co_presence)
+ expect(Live::Session.exists?(old_session.id)).to eq(false)
end
it "keeps three years of history by default" do
@@ -44,15 +44,15 @@ RSpec.describe Jobs::Voice::PurgeOldSessions do
described_class.new.execute({})
- expect(Voice::Session.all).to contain_exactly(kept)
+ expect(Live::Session.all).to contain_exactly(kept)
end
- it "does nothing when voice is disabled" do
- SiteSetting.voice_enabled = false
+ it "does nothing when live is disabled" do
+ SiteSetting.live_enabled = false
old_session = create_session(10.years.ago)
described_class.new.execute({})
- expect(Voice::Session.exists?(old_session.id)).to eq(true)
+ expect(Live::Session.exists?(old_session.id)).to eq(true)
end
end
diff --git a/plugins/live/spec/jobs/scheduled/live/reconcile_recordings_spec.rb b/plugins/live/spec/jobs/scheduled/live/reconcile_recordings_spec.rb
new file mode 100644
index 00000000000..37e43ffbe4b
--- /dev/null
+++ b/plugins/live/spec/jobs/scheduled/live/reconcile_recordings_spec.rb
@@ -0,0 +1,73 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+
+RSpec.describe Jobs::Live::ReconcileRecordings do
+ fab!(:user)
+ fab!(:room) { Fabricate(:live_room, public: true) }
+
+ before do
+ SiteSetting.live_enabled = true
+ SiteSetting.live_livekit_url = "wss://livekit.example.com"
+ SiteSetting.live_livekit_api_key = "lk_api_key"
+ SiteSetting.live_livekit_api_secret = "lk_api_secret"
+ SiteSetting.live_livekit_recording_enabled = true
+ end
+
+ def create_stuck_recording
+ Live::Recording.create!(
+ room: room,
+ started_by: user,
+ egress_id: "EG_1",
+ filepath: "live/test-abc123",
+ started_at: 10.minutes.ago,
+ )
+ end
+
+ let!(:list_stub) do
+ stub_request(:post, "https://livekit.example.com/twirp/livekit.Egress/ListEgress").to_return(
+ body: {
+ items: [
+ {
+ "egressId" => "EG_1",
+ "status" => "EGRESS_COMPLETE",
+ "fileResults" => [{ "filename" => "test.mp4" }],
+ },
+ ],
+ }.to_json,
+ )
+ end
+
+ it "resolves stuck recordings without webhooks" do
+ recording = create_stuck_recording
+
+ described_class.new.execute({})
+
+ expect(recording.reload.status).to eq("completed")
+ expect(list_stub).to have_been_requested
+ end
+
+ it "makes zero HTTP calls when there is nothing to resolve" do
+ described_class.new.execute({})
+
+ expect(list_stub).not_to have_been_requested
+ end
+
+ it "makes zero HTTP calls when recordings are disabled" do
+ create_stuck_recording
+ SiteSetting.live_livekit_recording_enabled = false
+
+ described_class.new.execute({})
+
+ expect(list_stub).not_to have_been_requested
+ end
+
+ it "makes zero HTTP calls when LiveKit is not configured" do
+ create_stuck_recording
+ SiteSetting.live_livekit_api_secret = ""
+
+ described_class.new.execute({})
+
+ expect(list_stub).not_to have_been_requested
+ end
+end
diff --git a/plugins/voice/spec/jobs/scheduled/publish_room_participants_spec.rb b/plugins/live/spec/jobs/scheduled/publish_room_participants_spec.rb
similarity index 59%
rename from plugins/voice/spec/jobs/scheduled/publish_room_participants_spec.rb
rename to plugins/live/spec/jobs/scheduled/publish_room_participants_spec.rb
index ec3aaeeb3d4..c0db74bbd8e 100644
--- a/plugins/voice/spec/jobs/scheduled/publish_room_participants_spec.rb
+++ b/plugins/live/spec/jobs/scheduled/publish_room_participants_spec.rb
@@ -3,22 +3,22 @@
RSpec.describe Jobs::PublishRoomParticipants do
subject(:job) { described_class.new }
- fab!(:room, :voice_room)
+ fab!(:room, :live_room)
fab!(:user1, :user)
fab!(:user2, :user)
- before { SiteSetting.voice_enabled = true }
+ before { SiteSetting.live_enabled = true }
it "publishes participants for rooms with active participants" do
- Voice::ParticipantTracker.add(room.id, user1.id)
- Voice::ParticipantTracker.add(room.id, user2.id)
+ Live::ParticipantTracker.add(room.id, user1.id)
+ Live::ParticipantTracker.add(room.id, user2.id)
# Verify participants were added
- expect(Voice::ParticipantTracker.user_ids(room.id)).to contain_exactly(user1.id, user2.id)
+ expect(Live::ParticipantTracker.user_ids(room.id)).to contain_exactly(user1.id, user2.id)
messages = MessageBus.track_publish { job.execute({}) }
- room_messages = messages.select { |m| m.channel == Voice.room_channel(room.id) }
+ room_messages = messages.select { |m| m.channel == Live.room_channel(room.id) }
expect(room_messages.size).to eq(1)
expect(room_messages.first.data[:type]).to eq("participants")
expect(room_messages.first.data[:participants].map { |p| p[:id] }).to contain_exactly(
@@ -28,19 +28,19 @@ RSpec.describe Jobs::PublishRoomParticipants do
end
it "reflects TTL-expired participants in broadcast" do
- Voice::ParticipantTracker.add(room.id, user1.id)
- Voice::ParticipantTracker.add(room.id, user2.id)
+ Live::ParticipantTracker.add(room.id, user1.id)
+ Live::ParticipantTracker.add(room.id, user2.id)
# Set user2's heartbeat to a stale timestamp to simulate TTL expiration
Discourse.redis.zadd(
- "#{Voice::ParticipantTracker::KEY_NAMESPACE}:#{room.id}:participants",
+ "#{Live::ParticipantTracker::KEY_NAMESPACE}:#{room.id}:participants",
1.hour.ago.to_f,
user2.id,
)
messages = MessageBus.track_publish { job.execute({}) }
- room_messages = messages.select { |m| m.channel == Voice.room_channel(room.id) }
+ room_messages = messages.select { |m| m.channel == Live.room_channel(room.id) }
expect(room_messages.size).to eq(1)
expect(room_messages.first.data[:participants].map { |p| p[:id] }).to contain_exactly(user1.id)
end
@@ -52,21 +52,21 @@ RSpec.describe Jobs::PublishRoomParticipants do
end
it "publishes an empty list for rooms that recently emptied" do
- Voice::ParticipantTracker.add(room.id, user1.id)
- Voice::ParticipantTracker.remove(room.id, user1.id)
+ Live::ParticipantTracker.add(room.id, user1.id)
+ Live::ParticipantTracker.remove(room.id, user1.id)
messages = MessageBus.track_publish { job.execute({}) }
- room_messages = messages.select { |m| m.channel == Voice.room_channel(room.id) }
+ room_messages = messages.select { |m| m.channel == Live.room_channel(room.id) }
expect(room_messages.size).to eq(1)
expect(room_messages.first.data[:participants]).to be_empty
end
it "stops publishing once a room's last activity leaves the safety window" do
- Voice::ParticipantTracker.add(room.id, user1.id)
- Voice::ParticipantTracker.remove(room.id, user1.id)
+ Live::ParticipantTracker.add(room.id, user1.id)
+ Live::ParticipantTracker.remove(room.id, user1.id)
Discourse.redis.zadd(
- Voice::ParticipantTracker::RECENTLY_ACTIVE_ROOMS_KEY,
+ Live::ParticipantTracker::RECENTLY_ACTIVE_ROOMS_KEY,
1.hour.ago.to_f,
room.id,
)
@@ -77,24 +77,24 @@ RSpec.describe Jobs::PublishRoomParticipants do
end
it "handles rooms that no longer exist" do
- Voice::ParticipantTracker.add(99_999, user1.id)
+ Live::ParticipantTracker.add(99_999, user1.id)
expect { job.execute({}) }.not_to raise_error
end
it "deletes an emptied livekit-pinned room from the SFU exactly once" do
- SiteSetting.voice_livekit_url = "wss://livekit.example.com"
- SiteSetting.voice_livekit_api_key = "lk_api_key"
- SiteSetting.voice_livekit_api_secret = "lk_api_secret"
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
- Voice::ParticipantTracker.add(room.id, user1.id)
- Voice::ParticipantTracker.remove(room.id, user1.id)
+ SiteSetting.live_livekit_url = "wss://livekit.example.com"
+ SiteSetting.live_livekit_api_key = "lk_api_key"
+ SiteSetting.live_livekit_api_secret = "lk_api_secret"
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
+ Live::ParticipantTracker.add(room.id, user1.id)
+ Live::ParticipantTracker.remove(room.id, user1.id)
stub = stub_request(:post, "https://livekit.example.com/twirp/livekit.RoomService/DeleteRoom")
job.execute({})
expect(stub).to have_been_requested.once
- expect(Voice::ParticipantTracker.pinned_transport(room.id)).to be_nil
+ expect(Live::ParticipantTracker.pinned_transport(room.id)).to be_nil
# The room stays in the recently-active sweep for a while; with the pin
# gone, later sweeps must not keep re-deleting it.
@@ -105,18 +105,18 @@ RSpec.describe Jobs::PublishRoomParticipants do
describe "deleted room agent cleanup" do
before do
- SiteSetting.voice_livekit_url = "wss://test.livekit.cloud"
- SiteSetting.voice_livekit_api_key = "key"
- SiteSetting.voice_livekit_api_secret = "secret"
- SiteSetting.voice_livekit_agent_enabled = true
+ SiteSetting.live_livekit_url = "wss://test.livekit.cloud"
+ SiteSetting.live_livekit_api_key = "key"
+ SiteSetting.live_livekit_api_secret = "secret"
+ SiteSetting.live_livekit_agent_enabled = true
room.update!(public: true)
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
- Voice::ParticipantTracker.add(room.id, user1.id)
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
+ Live::ParticipantTracker.add(room.id, user1.id)
stub_request(
:post,
"https://test.livekit.cloud/twirp/livekit.AgentDispatchService/CreateDispatch",
).to_return(status: 200, body: { id: "AD_test" }.to_json)
- Voice::AgentDispatcher.dispatch!(room:, agent_name: "assistant")
+ Live::AgentDispatcher.dispatch!(room:, agent_name: "assistant")
end
it "retries failed cleanup after the room row and transport pin are gone" do
@@ -136,19 +136,19 @@ RSpec.describe Jobs::PublishRoomParticipants do
"https://test.livekit.cloud/twirp/livekit.RoomService/DeleteRoom",
).to_return(status: 503)
- Voice::AgentManager.evict_agents_in_room!(room)
+ Live::AgentManager.evict_agents_in_room!(room)
- expect(Voice::ParticipantTracker.pinned_transport(room.id)).to be_nil
- expect(Voice::AgentDispatcher.pending?(room.id)).to eq(true)
- expect(Voice::AgentManager.provider_room_ids).to contain_exactly(room.id)
+ expect(Live::ParticipantTracker.pinned_transport(room.id)).to be_nil
+ expect(Live::AgentDispatcher.pending?(room.id)).to eq(true)
+ expect(Live::AgentManager.provider_room_ids).to contain_exactly(room.id)
delete_dispatch.to_return(status: 200, body: "{}")
delete_room.to_return(status: 200, body: "{}")
messages = MessageBus.track_publish { job.execute({}) }
- expect(Voice::AgentDispatcher.pending?(room.id)).to eq(false)
- expect(Voice::AgentManager.provider_room_ids).to be_empty
- expect(messages.map(&:channel)).not_to include(Voice.room_channel(room.id))
+ expect(Live::AgentDispatcher.pending?(room.id)).to eq(false)
+ expect(Live::AgentManager.provider_room_ids).to be_empty
+ expect(messages.map(&:channel)).not_to include(Live.room_channel(room.id))
expect(delete_room).to have_been_requested.twice
job.execute({})
@@ -160,21 +160,21 @@ RSpec.describe Jobs::PublishRoomParticipants do
describe "stale status sweep" do
before do
SiteSetting.enable_user_status = true
- SiteSetting.voice_auto_status_enabled = true
+ SiteSetting.live_auto_status_enabled = true
end
# Statuses set within the sweep's grace window are skipped, so specs set
# them in the past and re-add the live user's heartbeat after traveling.
it "clears the status of a participant whose heartbeat lapsed" do
- Voice::ParticipantTracker.add(room.id, user1.id)
- Voice::ParticipantTracker.add(room.id, user2.id)
- Voice::UserStatusManager.set_voice_status(user1, room)
- Voice::UserStatusManager.set_voice_status(user2, room)
+ Live::ParticipantTracker.add(room.id, user1.id)
+ Live::ParticipantTracker.add(room.id, user2.id)
+ Live::UserStatusManager.set_live_status(user1, room)
+ Live::UserStatusManager.set_live_status(user2, room)
freeze_time(1.minute.from_now)
- Voice::ParticipantTracker.add(room.id, user1.id)
+ Live::ParticipantTracker.add(room.id, user1.id)
Discourse.redis.zadd(
- "#{Voice::ParticipantTracker::KEY_NAMESPACE}:#{room.id}:participants",
+ "#{Live::ParticipantTracker::KEY_NAMESPACE}:#{room.id}:participants",
1.hour.ago.to_f,
user2.id,
)
@@ -186,12 +186,12 @@ RSpec.describe Jobs::PublishRoomParticipants do
end
it "clears lingering statuses of a room that fully emptied" do
- Voice::ParticipantTracker.add(room.id, user1.id)
- Voice::UserStatusManager.set_voice_status(user1, room)
+ Live::ParticipantTracker.add(room.id, user1.id)
+ Live::UserStatusManager.set_live_status(user1, room)
freeze_time(1.minute.from_now)
Discourse.redis.zadd(
- "#{Voice::ParticipantTracker::KEY_NAMESPACE}:#{room.id}:participants",
+ "#{Live::ParticipantTracker::KEY_NAMESPACE}:#{room.id}:participants",
1.hour.ago.to_f,
user1.id,
)
@@ -202,14 +202,14 @@ RSpec.describe Jobs::PublishRoomParticipants do
end
it "keeps a user's status while they are live in another active room" do
- other_room = Fabricate(:voice_room)
- Voice::ParticipantTracker.add(room.id, user1.id)
- Voice::UserStatusManager.set_voice_status(user1, other_room)
+ other_room = Fabricate(:live_room)
+ Live::ParticipantTracker.add(room.id, user1.id)
+ Live::UserStatusManager.set_live_status(user1, other_room)
freeze_time(1.minute.from_now)
- Voice::ParticipantTracker.add(other_room.id, user1.id)
+ Live::ParticipantTracker.add(other_room.id, user1.id)
Discourse.redis.zadd(
- "#{Voice::ParticipantTracker::KEY_NAMESPACE}:#{room.id}:participants",
+ "#{Live::ParticipantTracker::KEY_NAMESPACE}:#{room.id}:participants",
1.hour.ago.to_f,
user1.id,
)
@@ -220,16 +220,16 @@ RSpec.describe Jobs::PublishRoomParticipants do
end
it "keeps a freshly set status even when the user is not yet live" do
- Voice::ParticipantTracker.add(room.id, user1.id)
- Voice::UserStatusManager.set_voice_status(user2, room)
+ Live::ParticipantTracker.add(room.id, user1.id)
+ Live::UserStatusManager.set_live_status(user2, room)
job.execute({})
expect(user2.reload.user_status).to be_present
end
- it "does not touch manually set statuses, even ones using Voice emojis" do
- Voice::ParticipantTracker.add(room.id, user1.id)
+ it "does not touch manually set statuses, even ones using Live emojis" do
+ Live::ParticipantTracker.add(room.id, user1.id)
user1.set_status!("Sleeping", "zzz")
user2.set_status!("On vacation", "palm_tree")
@@ -243,9 +243,9 @@ RSpec.describe Jobs::PublishRoomParticipants do
end
it "does not publish when plugin is disabled" do
- Voice::ParticipantTracker.add(room.id, user1.id)
+ Live::ParticipantTracker.add(room.id, user1.id)
- SiteSetting.voice_enabled = false
+ SiteSetting.live_enabled = false
messages = MessageBus.track_publish { job.execute({}) }
diff --git a/plugins/live/spec/lib/live/guardian_extension_spec.rb b/plugins/live/spec/lib/live/guardian_extension_spec.rb
new file mode 100644
index 00000000000..94df039aa31
--- /dev/null
+++ b/plugins/live/spec/lib/live/guardian_extension_spec.rb
@@ -0,0 +1,334 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+
+RSpec.describe Live::GuardianExtension do
+ fab!(:staff, :admin)
+ fab!(:creator) { Fabricate(:user, trust_level: TrustLevel[2]) }
+ fab!(:room_moderator) { Fabricate(:user, trust_level: TrustLevel[2]) }
+ fab!(:room_speaker) { Fabricate(:user, trust_level: TrustLevel[2]) }
+ fab!(:member) { Fabricate(:user, trust_level: TrustLevel[2]) }
+
+ # In live_create_room_allowed_groups but with no tie to the private room:
+ # the room-creation permission must not leak into other people's rooms.
+ fab!(:outsider) { Fabricate(:user, trust_level: TrustLevel[2]) }
+
+ fab!(:low_trust_user) { Fabricate(:user, trust_level: TrustLevel[0]) }
+ fab!(:public_room) { Fabricate(:live_room, creator: staff, public: true) }
+ fab!(:private_room) { Fabricate(:live_room, creator: creator, public: false) }
+
+ fab!(:moderator_membership) do
+ private_room.room_memberships.create!(
+ user: room_moderator,
+ role: Live::RoomMembership::ROLE_MODERATOR,
+ )
+ end
+
+ fab!(:speaker_membership) do
+ private_room.room_memberships.create!(
+ user: room_speaker,
+ role: Live::RoomMembership::ROLE_SPEAKER,
+ )
+ end
+
+ fab!(:participant_membership) do
+ private_room.room_memberships.create!(
+ user: member,
+ role: Live::RoomMembership::ROLE_PARTICIPANT,
+ )
+ end
+
+ let(:anonymous_guardian) { Guardian.new(nil) }
+
+ before do
+ SiteSetting.live_enabled = true
+ SiteSetting.live_allowed_groups =
+ "#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
+ SiteSetting.live_create_room_allowed_groups = "#{Group::AUTO_GROUPS[:trust_level_2]}"
+ end
+
+ describe "#live_public_access?" do
+ it "is true when anonymous visitors are admitted on a public site" do
+ expect(anonymous_guardian.live_public_access?).to eq(true)
+ end
+
+ it "is false on login-required sites even when anonymous visitors are admitted" do
+ SiteSetting.login_required = true
+
+ expect(anonymous_guardian.live_public_access?).to eq(false)
+ end
+
+ it "is true when access is open to the anonymous_users pseudogroup" do
+ SiteSetting.live_allowed_groups = "#{Group::AUTO_GROUPS[:anonymous_users]}"
+
+ expect(anonymous_guardian.live_public_access?).to eq(true)
+ end
+
+ it "is false when access is limited to logged-in users" do
+ SiteSetting.live_allowed_groups = "#{Group::AUTO_GROUPS[:logged_in_users]}"
+
+ expect(anonymous_guardian.live_public_access?).to eq(false)
+ end
+ end
+
+ describe "#can_create_live_room?" do
+ it "is true for users in the create-room groups" do
+ expect(outsider.guardian.can_create_live_room?).to eq(true)
+ end
+
+ it "is false for users outside the create-room groups" do
+ expect(low_trust_user.guardian.can_create_live_room?).to eq(false)
+ end
+
+ it "is false for anonymous visitors" do
+ expect(anonymous_guardian.can_create_live_room?).to eq(false)
+ end
+
+ it "is false for users outside the live allowed groups" do
+ SiteSetting.live_allowed_groups = "#{Group::AUTO_GROUPS[:staff]}"
+
+ expect(outsider.guardian.can_create_live_room?).to eq(false)
+ end
+ end
+
+ describe "#can_invite_live_agents?" do
+ it "is true for admins by default" do
+ expect(staff.guardian.can_invite_live_agents?).to eq(true)
+ end
+
+ it "is false for users outside the invite groups" do
+ expect(outsider.guardian.can_invite_live_agents?).to eq(false)
+ end
+
+ it "is true for users in the invite groups" do
+ SiteSetting.live_livekit_agent_invite_allowed_groups =
+ "#{Group::AUTO_GROUPS[:admins]}|#{Group::AUTO_GROUPS[:trust_level_2]}"
+
+ expect(outsider.guardian.can_invite_live_agents?).to eq(true)
+ end
+
+ it "is false for anonymous visitors" do
+ expect(anonymous_guardian.can_invite_live_agents?).to eq(false)
+ end
+
+ it "is false for users outside the live allowed groups" do
+ SiteSetting.live_livekit_agent_invite_allowed_groups =
+ "#{Group::AUTO_GROUPS[:admins]}|#{Group::AUTO_GROUPS[:trust_level_2]}"
+ SiteSetting.live_allowed_groups = "#{Group::AUTO_GROUPS[:staff]}"
+
+ expect(outsider.guardian.can_invite_live_agents?).to eq(false)
+ end
+ end
+
+ describe "#can_manage_live_room?" do
+ it "is false for a create-room-group user with no tie to the room" do
+ expect(outsider.guardian.can_manage_live_room?(private_room)).to eq(false)
+ end
+
+ it "is false for a plain participant member" do
+ expect(member.guardian.can_manage_live_room?(private_room)).to eq(false)
+ end
+
+ it "is false for a speaker member" do
+ expect(room_speaker.guardian.can_manage_live_room?(private_room)).to eq(false)
+ end
+
+ it "is true for the room creator" do
+ expect(creator.guardian.can_manage_live_room?(private_room)).to eq(true)
+ end
+
+ it "is true for a room moderator" do
+ expect(room_moderator.guardian.can_manage_live_room?(private_room)).to eq(true)
+ end
+
+ it "is true for site staff" do
+ expect(staff.guardian.can_manage_live_room?(private_room)).to eq(true)
+ end
+
+ it "is false for everyone when the plugin is disabled" do
+ SiteSetting.live_enabled = false
+
+ expect(creator.guardian.can_manage_live_room?(private_room)).to eq(false)
+ expect(staff.guardian.can_manage_live_room?(private_room)).to eq(false)
+ end
+
+ it "is false for a create-room-group user on public rooms they don't own" do
+ expect(outsider.guardian.can_manage_live_room?(public_room)).to eq(false)
+ end
+
+ it "is false for anonymous visitors" do
+ expect(anonymous_guardian.can_manage_live_room?(public_room)).to eq(false)
+ end
+
+ it "is false for a nil room" do
+ expect(creator.guardian.can_manage_live_room?(nil)).to eq(false)
+ end
+ end
+
+ describe "#can_join_live_room?" do
+ it "lets any allowed user join public rooms" do
+ expect(low_trust_user.guardian.can_join_live_room?(public_room)).to eq(true)
+ end
+
+ it "prevents anonymous visitors from joining public rooms" do
+ expect(anonymous_guardian.can_join_live_room?(public_room)).to eq(false)
+ end
+
+ it "prevents a create-room-group non-member from joining a private room" do
+ expect(outsider.guardian.can_join_live_room?(private_room)).to eq(false)
+ end
+
+ it "lets members join a private room regardless of role" do
+ expect(member.guardian.can_join_live_room?(private_room)).to eq(true)
+ expect(room_speaker.guardian.can_join_live_room?(private_room)).to eq(true)
+ expect(room_moderator.guardian.can_join_live_room?(private_room)).to eq(true)
+ end
+
+ it "lets the creator join their private room" do
+ expect(creator.guardian.can_join_live_room?(private_room)).to eq(true)
+ end
+
+ it "lets site staff join a private room they aren't a member of" do
+ expect(staff.guardian.can_join_live_room?(private_room)).to eq(true)
+ end
+
+ it "prevents users outside the live allowed groups from joining" do
+ SiteSetting.live_allowed_groups = "#{Group::AUTO_GROUPS[:staff]}"
+
+ expect(member.guardian.can_join_live_room?(private_room)).to eq(false)
+ end
+ end
+
+ describe "#can_see_live_room?" do
+ it "lets anonymous visitors see public rooms when anonymous visitors are admitted" do
+ expect(anonymous_guardian.can_see_live_room?(public_room)).to eq(true)
+ end
+
+ it "hides public rooms from anonymous visitors on login-required sites" do
+ SiteSetting.login_required = true
+
+ expect(anonymous_guardian.can_see_live_room?(public_room)).to eq(false)
+ end
+
+ it "hides private rooms from anonymous visitors" do
+ expect(anonymous_guardian.can_see_live_room?(private_room)).to eq(false)
+ end
+
+ it "hides private rooms from a create-room-group non-member" do
+ expect(outsider.guardian.can_see_live_room?(private_room)).to eq(false)
+ end
+
+ it "shows private rooms to their members" do
+ expect(member.guardian.can_see_live_room?(private_room)).to eq(true)
+ end
+
+ it "shows private rooms to site staff" do
+ expect(staff.guardian.can_see_live_room?(private_room)).to eq(true)
+ end
+ end
+
+ describe "#can_request_to_speak_in_live_room?" do
+ before { private_room.update!(room_type: Live::Room::ROOM_TYPE_STAGE) }
+
+ it "is true for a stage-room member with the participant role" do
+ expect(member.guardian.can_request_to_speak_in_live_room?(private_room)).to eq(true)
+ end
+
+ it "is false for a stage speaker, who can already speak" do
+ expect(room_speaker.guardian.can_request_to_speak_in_live_room?(private_room)).to eq(false)
+ end
+
+ it "is false for a room moderator, who can already speak" do
+ expect(room_moderator.guardian.can_request_to_speak_in_live_room?(private_room)).to eq(false)
+ end
+
+ it "is false for site staff, who can already speak" do
+ expect(staff.guardian.can_request_to_speak_in_live_room?(private_room)).to eq(false)
+ end
+
+ it "is false in an open room, where everyone can already speak" do
+ expect(member.guardian.can_request_to_speak_in_live_room?(public_room)).to eq(false)
+ end
+
+ it "is false for a non-member who cannot join the private stage room" do
+ expect(outsider.guardian.can_request_to_speak_in_live_room?(private_room)).to eq(false)
+ end
+
+ it "is false for anonymous visitors" do
+ public_room.update!(room_type: Live::Room::ROOM_TYPE_STAGE)
+
+ expect(anonymous_guardian.can_request_to_speak_in_live_room?(public_room)).to eq(false)
+ end
+ end
+
+ describe "media publish permissions" do
+ it "grants both capabilities to a member of the allowed groups" do
+ expect(member.guardian.can_publish_video_in_live_room?(public_room)).to eq(true)
+ expect(member.guardian.can_screen_share_in_live_room?(public_room)).to eq(true)
+ end
+
+ it "gates each capability on its own group setting" do
+ SiteSetting.live_video_allowed_groups = "#{Group::AUTO_GROUPS[:trust_level_4]}"
+
+ expect(member.guardian.can_publish_video_in_live_room?(public_room)).to eq(false)
+ expect(member.guardian.can_screen_share_in_live_room?(public_room)).to eq(true)
+
+ SiteSetting.live_screen_share_allowed_groups = ""
+
+ expect(member.guardian.can_screen_share_in_live_room?(public_room)).to eq(false)
+ end
+
+ it "is false for both when the room has media disabled" do
+ public_room.update!(video_enabled: false)
+
+ expect(member.guardian.can_publish_video_in_live_room?(public_room)).to eq(false)
+ expect(member.guardian.can_screen_share_in_live_room?(public_room)).to eq(false)
+ end
+
+ it "is false for a stage listener, who publishes nothing" do
+ private_room.update!(room_type: Live::Room::ROOM_TYPE_STAGE)
+
+ expect(member.guardian.can_publish_video_in_live_room?(private_room)).to eq(false)
+ expect(member.guardian.can_screen_share_in_live_room?(private_room)).to eq(false)
+ expect(room_speaker.guardian.can_publish_video_in_live_room?(private_room)).to eq(true)
+ expect(room_speaker.guardian.can_screen_share_in_live_room?(private_room)).to eq(true)
+ end
+
+ # Clients apply the role themselves, so a promotion takes effect without
+ # the room being re-serialized for the promoted user.
+ it "keeps a stage listener eligible so a promotion needs no fresh payload" do
+ private_room.update!(room_type: Live::Room::ROOM_TYPE_STAGE)
+
+ expect(member.guardian.eligible_to_publish_video_in_live_room?(private_room)).to eq(true)
+ expect(member.guardian.eligible_to_screen_share_in_live_room?(private_room)).to eq(true)
+ end
+
+ it "is not eligible when the group or access says no" do
+ SiteSetting.live_video_allowed_groups = ""
+
+ expect(member.guardian.eligible_to_publish_video_in_live_room?(private_room)).to eq(false)
+ expect(outsider.guardian.eligible_to_screen_share_in_live_room?(private_room)).to eq(false)
+ end
+
+ # The room flag reaches clients through anonymous broadcasts that can't
+ # refresh a per-user field, so folding it in would strand a "no" after
+ # the room's media is turned back on.
+ it "stays eligible while the room's media is off, but cannot publish" do
+ private_room.update!(video_enabled: false)
+
+ expect(member.guardian.eligible_to_screen_share_in_live_room?(private_room)).to eq(true)
+ expect(member.guardian.can_screen_share_in_live_room?(private_room)).to eq(false)
+ expect(member.guardian.can_publish_video_in_live_room?(private_room)).to eq(false)
+ end
+
+ it "is false for a user who cannot join the room" do
+ expect(outsider.guardian.can_publish_video_in_live_room?(private_room)).to eq(false)
+ expect(outsider.guardian.can_screen_share_in_live_room?(private_room)).to eq(false)
+ end
+
+ it "is false for anonymous visitors" do
+ expect(anonymous_guardian.can_publish_video_in_live_room?(public_room)).to eq(false)
+ expect(anonymous_guardian.can_screen_share_in_live_room?(public_room)).to eq(false)
+ end
+ end
+end
diff --git a/plugins/voice/spec/lib/voice/ice_config_spec.rb b/plugins/live/spec/lib/live/ice_config_spec.rb
similarity index 65%
rename from plugins/voice/spec/lib/voice/ice_config_spec.rb
rename to plugins/live/spec/lib/live/ice_config_spec.rb
index 24502e53f9d..32f305721eb 100644
--- a/plugins/voice/spec/lib/voice/ice_config_spec.rb
+++ b/plugins/live/spec/lib/live/ice_config_spec.rb
@@ -2,12 +2,12 @@
require "rails_helper"
-RSpec.describe Voice::IceConfig do
+RSpec.describe Live::IceConfig do
fab!(:user)
describe ".payload" do
it "builds one entry per STUN url, ignoring blank segments" do
- SiteSetting.voice_stun_servers = "stun:stun.example.com:3478| |stun:stun2.example.com:19302"
+ SiteSetting.live_stun_servers = "stun:stun.example.com:3478| |stun:stun2.example.com:19302"
payload = described_class.payload(user)
@@ -18,10 +18,10 @@ RSpec.describe Voice::IceConfig do
end
it "attaches the static username and credential to every static TURN url" do
- SiteSetting.voice_stun_servers = ""
- SiteSetting.voice_turn_servers = "turn:turn.example.com:3478|turns:turn.example.com:5349"
- SiteSetting.voice_turn_username = "static-user"
- SiteSetting.voice_turn_credential = "static-pass"
+ SiteSetting.live_stun_servers = ""
+ SiteSetting.live_turn_servers = "turn:turn.example.com:3478|turns:turn.example.com:5349"
+ SiteSetting.live_turn_username = "static-user"
+ SiteSetting.live_turn_credential = "static-pass"
payload = described_class.payload(user)
@@ -32,8 +32,8 @@ RSpec.describe Voice::IceConfig do
end
it "omits the username and credential keys when the static credentials are blank" do
- SiteSetting.voice_stun_servers = ""
- SiteSetting.voice_turn_servers = "turn:turn.example.com:3478"
+ SiteSetting.live_stun_servers = ""
+ SiteSetting.live_turn_servers = "turn:turn.example.com:3478"
payload = described_class.payload(user)
@@ -41,9 +41,9 @@ RSpec.describe Voice::IceConfig do
end
it "mints ephemeral HMAC credentials scoped to the site and user for secret TURN servers" do
- SiteSetting.voice_stun_servers = ""
- SiteSetting.voice_turn_secret = "coturn-shared-secret"
- SiteSetting.voice_turn_secret_servers = "turn:turn.example.com:3478"
+ SiteSetting.live_stun_servers = ""
+ SiteSetting.live_turn_secret = "coturn-shared-secret"
+ SiteSetting.live_turn_secret_servers = "turn:turn.example.com:3478"
freeze_time do
payload = described_class.payload(user)
@@ -65,9 +65,9 @@ RSpec.describe Voice::IceConfig do
end
it "separates quota identities of same-numbered users on different sites" do
- SiteSetting.voice_stun_servers = ""
- SiteSetting.voice_turn_secret = "coturn-shared-secret"
- SiteSetting.voice_turn_secret_servers = "turn:coturn.example.com:3478"
+ SiteSetting.live_stun_servers = ""
+ SiteSetting.live_turn_secret = "coturn-shared-secret"
+ SiteSetting.live_turn_secret_servers = "turn:coturn.example.com:3478"
freeze_time do
username = described_class.payload(user)[:servers].first[:username]
@@ -83,12 +83,12 @@ RSpec.describe Voice::IceConfig do
end
it "keeps static and secret TURN servers side by side with their own credentials" do
- SiteSetting.voice_stun_servers = ""
- SiteSetting.voice_turn_servers = "turn:third-party.example.com:3478"
- SiteSetting.voice_turn_username = "static-user"
- SiteSetting.voice_turn_credential = "static-pass"
- SiteSetting.voice_turn_secret = "coturn-shared-secret"
- SiteSetting.voice_turn_secret_servers = "turn:coturn.example.com:3478"
+ SiteSetting.live_stun_servers = ""
+ SiteSetting.live_turn_servers = "turn:third-party.example.com:3478"
+ SiteSetting.live_turn_username = "static-user"
+ SiteSetting.live_turn_credential = "static-pass"
+ SiteSetting.live_turn_secret = "coturn-shared-secret"
+ SiteSetting.live_turn_secret_servers = "turn:coturn.example.com:3478"
servers = described_class.payload(user)[:servers]
static_server = servers.find { |server| server[:urls].include?("third-party") }
@@ -106,40 +106,40 @@ RSpec.describe Voice::IceConfig do
end
it "skips secret TURN servers when the shared secret has been blanked" do
- SiteSetting.voice_stun_servers = ""
- SiteSetting.voice_turn_secret = "coturn-shared-secret"
- SiteSetting.voice_turn_secret_servers = "turn:coturn.example.com:3478"
- SiteSetting.voice_turn_secret = ""
+ SiteSetting.live_stun_servers = ""
+ SiteSetting.live_turn_secret = "coturn-shared-secret"
+ SiteSetting.live_turn_secret_servers = "turn:coturn.example.com:3478"
+ SiteSetting.live_turn_secret = ""
expect(described_class.payload(user)[:servers]).to eq([])
end
it "forces relay when only static TURN servers are configured" do
- SiteSetting.voice_stun_servers = ""
- SiteSetting.voice_turn_servers = "turn:turn.example.com:3478"
- SiteSetting.voice_turn_credential = "static-pass"
+ SiteSetting.live_stun_servers = ""
+ SiteSetting.live_turn_servers = "turn:turn.example.com:3478"
+ SiteSetting.live_turn_credential = "static-pass"
expect(described_class.payload(user)[:transport_policy]).to eq("relay")
end
it "keeps policy 'all' when secret TURN servers are active, even without STUN" do
- SiteSetting.voice_stun_servers = ""
- SiteSetting.voice_turn_secret = "coturn-shared-secret"
- SiteSetting.voice_turn_secret_servers = "turn:coturn.example.com:3478"
+ SiteSetting.live_stun_servers = ""
+ SiteSetting.live_turn_secret = "coturn-shared-secret"
+ SiteSetting.live_turn_secret_servers = "turn:coturn.example.com:3478"
expect(described_class.payload(user)[:transport_policy]).to eq("all")
end
it "keeps policy 'all' when STUN servers are configured alongside static TURN" do
- SiteSetting.voice_stun_servers = "stun:stun.example.com:3478"
- SiteSetting.voice_turn_servers = "turn:turn.example.com:3478"
- SiteSetting.voice_turn_credential = "static-pass"
+ SiteSetting.live_stun_servers = "stun:stun.example.com:3478"
+ SiteSetting.live_turn_servers = "turn:turn.example.com:3478"
+ SiteSetting.live_turn_credential = "static-pass"
expect(described_class.payload(user)[:transport_policy]).to eq("all")
end
it "keeps policy 'all' when no TURN servers are configured" do
- SiteSetting.voice_stun_servers = ""
+ SiteSetting.live_stun_servers = ""
expect(described_class.payload(user)[:transport_policy]).to eq("all")
end
diff --git a/plugins/voice/spec/lib/voice/livekit/cloud_agent_client_spec.rb b/plugins/live/spec/lib/live/livekit/cloud_agent_client_spec.rb
similarity index 90%
rename from plugins/voice/spec/lib/voice/livekit/cloud_agent_client_spec.rb
rename to plugins/live/spec/lib/live/livekit/cloud_agent_client_spec.rb
index a6aea3f59cd..36c4958ffa4 100644
--- a/plugins/voice/spec/lib/voice/livekit/cloud_agent_client_spec.rb
+++ b/plugins/live/spec/lib/live/livekit/cloud_agent_client_spec.rb
@@ -2,13 +2,13 @@
require "rails_helper"
-RSpec.describe Voice::Livekit::CloudAgentClient do
+RSpec.describe Live::Livekit::CloudAgentClient do
let(:endpoint) { "https://agents.livekit.cloud/twirp/livekit.CloudAgent/ListAgents" }
before do
- SiteSetting.voice_livekit_url = "wss://my-project-abc123.livekit.cloud"
- SiteSetting.voice_livekit_api_key = "lk_api_key"
- SiteSetting.voice_livekit_api_secret = "lk_api_secret"
+ SiteSetting.live_livekit_url = "wss://my-project-abc123.livekit.cloud"
+ SiteSetting.live_livekit_api_key = "lk_api_key"
+ SiteSetting.live_livekit_api_secret = "lk_api_secret"
described_class.clear_cache!
end
@@ -81,7 +81,7 @@ RSpec.describe Voice::Livekit::CloudAgentClient do
end
it "is unavailable outside LiveKit Cloud" do
- SiteSetting.voice_livekit_url = "wss://livekit.example.com"
+ SiteSetting.live_livekit_url = "wss://livekit.example.com"
stub = stub_request(:post, /livekit.example.com|agents\./)
expect(described_class.list).to eq(ok: false)
diff --git a/plugins/voice/spec/lib/voice/livekit/egress_client_spec.rb b/plugins/live/spec/lib/live/livekit/egress_client_spec.rb
similarity index 71%
rename from plugins/voice/spec/lib/voice/livekit/egress_client_spec.rb
rename to plugins/live/spec/lib/live/livekit/egress_client_spec.rb
index b0d7a0be38f..72fd94cedea 100644
--- a/plugins/voice/spec/lib/voice/livekit/egress_client_spec.rb
+++ b/plugins/live/spec/lib/live/livekit/egress_client_spec.rb
@@ -1,31 +1,15 @@
# frozen_string_literal: true
require "rails_helper"
-require_relative "../../../../db/migrate/20241107000000_create_voice_rooms"
-require_relative "../../../../db/migrate/20260305162426_add_room_type_to_voice_rooms"
-require_relative "../../../../db/migrate/20260612135211_add_video_enabled_to_voice_rooms"
-RSpec.describe Voice::Livekit::EgressClient do
- before do
- ActiveRecord::Migration.suppress_messages do
- CreateVoiceRooms.new.change unless ActiveRecord::Base.connection.table_exists?(:voice_rooms)
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :room_type)
- AddRoomTypeToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :video_enabled)
- AddVideoEnabledToVoiceRooms.new.change
- end
- end
- Voice::Room.reset_column_information
- end
-
- fab!(:room) { Fabricate(:voice_room, public: true) }
+RSpec.describe Live::Livekit::EgressClient do
+ fab!(:room) { Fabricate(:live_room, public: true) }
before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_livekit_url = "wss://livekit.example.com"
- SiteSetting.voice_livekit_api_key = "lk_api_key"
- SiteSetting.voice_livekit_api_secret = "lk_api_secret"
+ SiteSetting.live_enabled = true
+ SiteSetting.live_livekit_url = "wss://livekit.example.com"
+ SiteSetting.live_livekit_api_key = "lk_api_key"
+ SiteSetting.live_livekit_api_secret = "lk_api_secret"
end
def twirp_stub(method)
@@ -33,10 +17,10 @@ RSpec.describe Voice::Livekit::EgressClient do
end
def configure_recording_s3
- SiteSetting.voice_livekit_recording_s3_access_key_id = "recording-access-key"
- SiteSetting.voice_livekit_recording_s3_secret_access_key = "recording-secret-key"
- SiteSetting.voice_livekit_recording_s3_region = "eu-west-1"
- SiteSetting.voice_livekit_recording_s3_bucket = "voice-recordings"
+ SiteSetting.live_livekit_recording_s3_access_key_id = "recording-access-key"
+ SiteSetting.live_livekit_recording_s3_secret_access_key = "recording-secret-key"
+ SiteSetting.live_livekit_recording_s3_region = "eu-west-1"
+ SiteSetting.live_livekit_recording_s3_bucket = "live-recordings"
end
describe ".start_room_composite" do
@@ -51,9 +35,9 @@ RSpec.describe Voice::Livekit::EgressClient do
JSON.parse(request.body)["fileOutputs"] ==
[
{
- "filepath" => "voice/test-abc123",
+ "filepath" => "live/test-abc123",
"s3" => {
- "bucket" => "voice-recordings",
+ "bucket" => "live-recordings",
"region" => "eu-west-1",
"accessKey" => "recording-access-key",
"secret" => "recording-secret-key",
@@ -63,7 +47,7 @@ RSpec.describe Voice::Livekit::EgressClient do
end
.to_return(body: { egressId: "EG_1" }.to_json)
- result = described_class.start_room_composite(room, filepath: "voice/test-abc123")
+ result = described_class.start_room_composite(room, filepath: "live/test-abc123")
expect(result).to eq(ok: true, data: { "egressId" => "EG_1" })
expect(stub).to have_been_requested.once
@@ -71,7 +55,7 @@ RSpec.describe Voice::Livekit::EgressClient do
it "uses path-style addressing for a custom S3 endpoint" do
configure_recording_s3
- SiteSetting.voice_livekit_recording_s3_endpoint = "https://storage.example.com"
+ SiteSetting.live_livekit_recording_s3_endpoint = "https://storage.example.com"
stub =
twirp_stub("StartRoomCompositeEgress")
.with do |request|
@@ -81,7 +65,7 @@ RSpec.describe Voice::Livekit::EgressClient do
end
.to_return(body: "{}")
- result = described_class.start_room_composite(room, filepath: "voice/test")
+ result = described_class.start_room_composite(room, filepath: "live/test")
expect(result[:ok]).to eq(true)
expect(stub).to have_been_requested.once
@@ -89,52 +73,52 @@ RSpec.describe Voice::Livekit::EgressClient do
it "refuses to start if recording credentials were cleared after configuring the bucket" do
configure_recording_s3
- SiteSetting.voice_livekit_recording_s3_secret_access_key = ""
+ SiteSetting.live_livekit_recording_s3_secret_access_key = ""
stub = twirp_stub("StartRoomCompositeEgress")
- result = described_class.start_room_composite(room, filepath: "voice/test")
+ result = described_class.start_room_composite(room, filepath: "live/test")
expect(result).to eq(
ok: false,
- error: I18n.t("site_settings.errors.voice_livekit_recording_s3_requires_credentials"),
+ error: I18n.t("site_settings.errors.live_livekit_recording_s3_requires_credentials"),
)
expect(stub).not_to have_been_requested
end
it "refuses to send recording credentials over HTTP after a URL change" do
configure_recording_s3
- SiteSetting.voice_livekit_url = "ws://livekit.example.com"
+ SiteSetting.live_livekit_url = "ws://livekit.example.com"
stub =
stub_request(
:post,
"http://livekit.example.com/twirp/livekit.Egress/StartRoomCompositeEgress",
)
- result = described_class.start_room_composite(room, filepath: "voice/test")
+ result = described_class.start_room_composite(room, filepath: "live/test")
expect(result).to eq(
ok: false,
- error: I18n.t("site_settings.errors.voice_livekit_recording_s3_requires_wss"),
+ error: I18n.t("site_settings.errors.live_livekit_recording_s3_requires_wss"),
)
expect(stub).not_to have_been_requested
end
it "omits response bodies containing recording credentials from verbose logs" do
- SiteSetting.voice_verbose_logging = true
+ SiteSetting.live_verbose_logging = true
configure_recording_s3
credentials = [
- SiteSetting.voice_livekit_recording_s3_access_key_id,
- SiteSetting.voice_livekit_recording_s3_secret_access_key,
+ SiteSetting.live_livekit_recording_s3_access_key_id,
+ SiteSetting.live_livekit_recording_s3_secret_access_key,
]
twirp_stub("StartRoomCompositeEgress").to_return(status: 400, body: credentials.join(" "))
logs =
track_log_messages do
- result = described_class.start_room_composite(room, filepath: "voice/test")
+ result = described_class.start_room_composite(room, filepath: "live/test")
expect(result).to eq(ok: false, error: "HTTP 400")
end
- expect(logs.warnings).to eq(["[voice-livekit] StartRoomCompositeEgress failed: HTTP 400"])
+ expect(logs.warnings).to eq(["[live-livekit] StartRoomCompositeEgress failed: HTTP 400"])
credentials.each { |credential| expect(logs.warnings.join).not_to include(credential) }
end
@@ -142,7 +126,7 @@ RSpec.describe Voice::Livekit::EgressClient do
room.update!(video_enabled: false)
stub = twirp_stub("StartRoomCompositeEgress").to_return(body: { egressId: "EG_1" }.to_json)
- result = described_class.start_room_composite(room, filepath: "voice/test-abc123")
+ result = described_class.start_room_composite(room, filepath: "live/test-abc123")
expect(result).to eq(ok: true, data: { "egressId" => "EG_1" })
expect(stub).to have_been_requested
@@ -154,13 +138,13 @@ RSpec.describe Voice::Livekit::EgressClient do
body = JSON.parse(req.body)
token = req.headers["Authorization"].delete_prefix("Bearer ")
claims =
- JWT.decode(token, SiteSetting.voice_livekit_api_secret, true, algorithm: "HS256").first
+ JWT.decode(token, SiteSetting.live_livekit_api_secret, true, algorithm: "HS256").first
body ==
{
- "roomName" => Voice::Livekit.room_name(room),
+ "roomName" => Live::Livekit.room_name(room),
"audioOnly" => true,
- "fileOutputs" => [{ "filepath" => "voice/test-abc123" }],
+ "fileOutputs" => [{ "filepath" => "live/test-abc123" }],
} && claims["iss"] == "lk_api_key" && claims["video"] == { "roomRecord" => true }
end,
).to have_been_made.once
@@ -170,7 +154,7 @@ RSpec.describe Voice::Livekit::EgressClient do
room.update!(video_enabled: true)
twirp_stub("StartRoomCompositeEgress").to_return(body: "{}")
- described_class.start_room_composite(room, filepath: "voice/test-abc123")
+ described_class.start_room_composite(room, filepath: "live/test-abc123")
expect(
a_request(
@@ -184,7 +168,7 @@ RSpec.describe Voice::Livekit::EgressClient do
upstream_body = "egress unavailable"
twirp_stub("StartRoomCompositeEgress").to_return(status: 500, body: upstream_body)
- result = described_class.start_room_composite(room, filepath: "voice/test-abc123")
+ result = described_class.start_room_composite(room, filepath: "live/test-abc123")
expect(result[:ok]).to eq(false)
expect(result[:error]).to eq("HTTP 500")
@@ -194,16 +178,16 @@ RSpec.describe Voice::Livekit::EgressClient do
it "returns a structured error instead of raising on a timeout" do
twirp_stub("StartRoomCompositeEgress").to_timeout
- result = described_class.start_room_composite(room, filepath: "voice/test-abc123")
+ result = described_class.start_room_composite(room, filepath: "live/test-abc123")
expect(result[:ok]).to eq(false)
end
it "makes zero HTTP calls when livekit is not configured" do
stub = twirp_stub("StartRoomCompositeEgress")
- SiteSetting.voice_livekit_api_secret = ""
+ SiteSetting.live_livekit_api_secret = ""
- result = described_class.start_room_composite(room, filepath: "voice/test-abc123")
+ result = described_class.start_room_composite(room, filepath: "live/test-abc123")
expect(result[:ok]).to eq(false)
expect(stub).not_to have_been_requested
diff --git a/plugins/voice/spec/lib/voice/livekit/room_service_client_spec.rb b/plugins/live/spec/lib/live/livekit/room_service_client_spec.rb
similarity index 73%
rename from plugins/voice/spec/lib/voice/livekit/room_service_client_spec.rb
rename to plugins/live/spec/lib/live/livekit/room_service_client_spec.rb
index 85e3401a347..2fd7a75b741 100644
--- a/plugins/voice/spec/lib/voice/livekit/room_service_client_spec.rb
+++ b/plugins/live/spec/lib/live/livekit/room_service_client_spec.rb
@@ -1,36 +1,20 @@
# frozen_string_literal: true
require "rails_helper"
-require_relative "../../../../db/migrate/20241107000000_create_voice_rooms"
-require_relative "../../../../db/migrate/20260305162426_add_room_type_to_voice_rooms"
-require_relative "../../../../db/migrate/20260612135211_add_video_enabled_to_voice_rooms"
-
-RSpec.describe Voice::Livekit::RoomServiceClient do
- before do
- ActiveRecord::Migration.suppress_messages do
- CreateVoiceRooms.new.change unless ActiveRecord::Base.connection.table_exists?(:voice_rooms)
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :room_type)
- AddRoomTypeToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :video_enabled)
- AddVideoEnabledToVoiceRooms.new.change
- end
- end
- Voice::Room.reset_column_information
- end
+RSpec.describe Live::Livekit::RoomServiceClient do
fab!(:user)
- fab!(:room) { Fabricate(:voice_room, public: true) }
+ fab!(:room) { Fabricate(:live_room, public: true) }
before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_livekit_url = "wss://livekit.example.com"
- SiteSetting.voice_livekit_api_key = "lk_api_key"
- SiteSetting.voice_livekit_api_secret = "lk_api_secret"
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
+ SiteSetting.live_enabled = true
+ SiteSetting.live_livekit_url = "wss://livekit.example.com"
+ SiteSetting.live_livekit_api_key = "lk_api_key"
+ SiteSetting.live_livekit_api_secret = "lk_api_secret"
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
end
- after { Voice::ParticipantTracker.clear(room.id) }
+ after { Live::ParticipantTracker.clear(room.id) }
def twirp_stub(method)
stub_request(:post, "https://livekit.example.com/twirp/livekit.RoomService/#{method}")
@@ -51,17 +35,17 @@ RSpec.describe Voice::Livekit::RoomServiceClient do
body = JSON.parse(req.body)
token = req.headers["Authorization"].delete_prefix("Bearer ")
claims =
- JWT.decode(token, SiteSetting.voice_livekit_api_secret, true, algorithm: "HS256").first
+ JWT.decode(token, SiteSetting.live_livekit_api_secret, true, algorithm: "HS256").first
- body == { "room" => Voice::Livekit.room_name(room), "identity" => user.id.to_s } &&
+ body == { "room" => Live::Livekit.room_name(room), "identity" => user.id.to_s } &&
req.headers["Content-Type"] == "application/json" && claims["iss"] == "lk_api_key" &&
- claims["video"] == { "roomAdmin" => true, "room" => Voice::Livekit.room_name(room) }
+ claims["video"] == { "roomAdmin" => true, "room" => Live::Livekit.room_name(room) }
end,
).to have_been_made.once
end
it "converts a ws:// url to http:// for the API endpoint" do
- SiteSetting.voice_livekit_url = "ws://livekit.internal:7880"
+ SiteSetting.live_livekit_url = "ws://livekit.internal:7880"
stub =
stub_request(
:post,
@@ -103,8 +87,8 @@ RSpec.describe Voice::Livekit::RoomServiceClient do
end
it "grants all publish sources to a stage speaker in a video room" do
- room.update!(room_type: Voice::Room::ROOM_TYPE_STAGE, video_enabled: true)
- room.room_memberships.create!(user: user, role: Voice::RoomMembership::ROLE_SPEAKER)
+ room.update!(room_type: Live::Room::ROOM_TYPE_STAGE, video_enabled: true)
+ room.room_memberships.create!(user: user, role: Live::RoomMembership::ROLE_SPEAKER)
twirp_stub("UpdateParticipant")
described_class.update_participant(room, user)
@@ -122,7 +106,7 @@ RSpec.describe Voice::Livekit::RoomServiceClient do
end
it "keeps canSubscribe for a stage listener who cannot publish" do
- room.update!(room_type: Voice::Room::ROOM_TYPE_STAGE)
+ room.update!(room_type: Live::Room::ROOM_TYPE_STAGE)
stub = twirp_stub("UpdateParticipant")
described_class.update_participant(room, user)
@@ -142,7 +126,7 @@ RSpec.describe Voice::Livekit::RoomServiceClient do
describe ".delete_room" do
it "POSTs the room name with a roomCreate-granted token" do
- stub = twirp_stub("DeleteRoom").with(body: { room: Voice::Livekit.room_name(room) }.to_json)
+ stub = twirp_stub("DeleteRoom").with(body: { room: Live::Livekit.room_name(room) }.to_json)
expect(described_class.delete_room(room)).to eq(true)
@@ -154,10 +138,10 @@ RSpec.describe Voice::Livekit::RoomServiceClient do
).with do |req|
token = req.headers["Authorization"].delete_prefix("Bearer ")
claims =
- JWT.decode(token, SiteSetting.voice_livekit_api_secret, true, algorithm: "HS256").first
+ JWT.decode(token, SiteSetting.live_livekit_api_secret, true, algorithm: "HS256").first
# LiveKit authorizes DeleteRoom via roomCreate, not roomAdmin.
- claims["video"] == { "roomCreate" => true, "room" => Voice::Livekit.room_name(room) }
+ claims["video"] == { "roomCreate" => true, "room" => Live::Livekit.room_name(room) }
end,
).to have_been_made.once
end
@@ -174,8 +158,8 @@ RSpec.describe Voice::Livekit::RoomServiceClient do
let!(:stub) { stub_request(:post, %r{\Ahttps://livekit\.example\.com/twirp/}) }
it "makes zero HTTP calls for a mesh-pinned room" do
- Voice::ParticipantTracker.clear_transport_pin(room.id)
- Voice::ParticipantTracker.pin_transport!(room.id, "mesh")
+ Live::ParticipantTracker.clear_transport_pin(room.id)
+ Live::ParticipantTracker.pin_transport!(room.id, "mesh")
described_class.remove_participant(room, user.id)
described_class.update_participant(room, user)
@@ -185,7 +169,7 @@ RSpec.describe Voice::Livekit::RoomServiceClient do
end
it "makes zero HTTP calls for an unpinned room" do
- Voice::ParticipantTracker.clear_transport_pin(room.id)
+ Live::ParticipantTracker.clear_transport_pin(room.id)
described_class.delete_room(room)
@@ -193,7 +177,7 @@ RSpec.describe Voice::Livekit::RoomServiceClient do
end
it "makes zero HTTP calls when livekit is no longer configured" do
- SiteSetting.voice_livekit_api_secret = ""
+ SiteSetting.live_livekit_api_secret = ""
described_class.delete_room(room)
@@ -202,11 +186,11 @@ RSpec.describe Voice::Livekit::RoomServiceClient do
end
context "when LiveKit is down" do
- before { SiteSetting.voice_verbose_logging = true }
+ before { SiteSetting.live_verbose_logging = true }
it "never raises on a timeout and logs the failure" do
twirp_stub("DeleteRoom").to_timeout
- Rails.logger.expects(:warn).with(regexp_matches(/\[voice-livekit\] DeleteRoom failed/))
+ Rails.logger.expects(:warn).with(regexp_matches(/\[live-livekit\] DeleteRoom failed/))
expect(described_class.delete_room(room)).to eq(false)
end
@@ -222,7 +206,7 @@ RSpec.describe Voice::Livekit::RoomServiceClient do
Rails
.logger
.expects(:warn)
- .with(regexp_matches(/\[voice-livekit\] RemoveParticipant failed.*HTTP 404/))
+ .with(regexp_matches(/\[live-livekit\] RemoveParticipant failed.*HTTP 404/))
expect(described_class.remove_participant(room, user.id)).to eq(false)
end
@@ -232,7 +216,7 @@ RSpec.describe Voice::Livekit::RoomServiceClient do
Rails
.logger
.expects(:warn)
- .with(regexp_matches(/\[voice-livekit\] RemoveParticipant failed.*HTTP 500/))
+ .with(regexp_matches(/\[live-livekit\] RemoveParticipant failed.*HTTP 500/))
expect(described_class.remove_participant(room, user.id)).to eq(false)
end
diff --git a/plugins/voice/spec/lib/voice/livekit_spec.rb b/plugins/live/spec/lib/live/livekit_spec.rb
similarity index 63%
rename from plugins/voice/spec/lib/voice/livekit_spec.rb
rename to plugins/live/spec/lib/live/livekit_spec.rb
index 10fa68c7521..79862411de4 100644
--- a/plugins/voice/spec/lib/voice/livekit_spec.rb
+++ b/plugins/live/spec/lib/live/livekit_spec.rb
@@ -1,67 +1,47 @@
# frozen_string_literal: true
require "rails_helper"
-require_relative "../../../db/migrate/20241107000000_create_voice_rooms"
-require_relative "../../../db/migrate/20260305162426_add_room_type_to_voice_rooms"
-require_relative "../../../db/migrate/20260612135211_add_video_enabled_to_voice_rooms"
-require_relative "../../../db/migrate/20260709165411_add_livekit_enabled_to_voice_rooms"
-
-RSpec.describe Voice::Livekit do
- before do
- ActiveRecord::Migration.suppress_messages do
- CreateVoiceRooms.new.change unless ActiveRecord::Base.connection.table_exists?(:voice_rooms)
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :room_type)
- AddRoomTypeToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :video_enabled)
- AddVideoEnabledToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :livekit_enabled)
- AddLivekitEnabledToVoiceRooms.new.change
- end
- end
- Voice::Room.reset_column_information
- end
+RSpec.describe Live::Livekit do
fab!(:user)
- fab!(:room) { Fabricate(:voice_room, public: true) }
+ fab!(:room) { Fabricate(:live_room, public: true) }
before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_livekit_url = "wss://livekit.example.com"
- SiteSetting.voice_livekit_api_key = "lk_api_key"
- SiteSetting.voice_livekit_api_secret = "lk_api_secret"
+ SiteSetting.live_enabled = true
+ SiteSetting.live_livekit_url = "wss://livekit.example.com"
+ SiteSetting.live_livekit_api_key = "lk_api_key"
+ SiteSetting.live_livekit_api_secret = "lk_api_secret"
end
def decoded_token
token = described_class.mint_token(user: user, room: room, guardian: user.guardian)
- JWT.decode(token, SiteSetting.voice_livekit_api_secret, true, algorithm: "HS256").first
+ JWT.decode(token, SiteSetting.live_livekit_api_secret, true, algorithm: "HS256").first
end
describe ".configured?" do
it "is true only when url, key, and secret are all present" do
expect(described_class.configured?).to eq(true)
- SiteSetting.voice_livekit_api_secret = ""
+ SiteSetting.live_livekit_api_secret = ""
expect(described_class.configured?).to eq(false)
- SiteSetting.voice_livekit_api_secret = "lk_api_secret"
- SiteSetting.voice_livekit_url = ""
+ SiteSetting.live_livekit_api_secret = "lk_api_secret"
+ SiteSetting.live_livekit_url = ""
expect(described_class.configured?).to eq(false)
end
end
describe ".available_for?" do
it "follows the room policy" do
- SiteSetting.voice_livekit_room_policy = "disabled"
+ SiteSetting.live_livekit_room_policy = "disabled"
expect(described_class.available_for?(room)).to eq(false)
- SiteSetting.voice_livekit_room_policy = "all_rooms"
+ SiteSetting.live_livekit_room_policy = "all_rooms"
expect(described_class.available_for?(room)).to eq(true)
end
it "follows the room's own flag under the per_room policy" do
- SiteSetting.voice_livekit_room_policy = "per_room"
+ SiteSetting.live_livekit_room_policy = "per_room"
expect(described_class.available_for?(room)).to eq(false)
@@ -70,8 +50,8 @@ RSpec.describe Voice::Livekit do
end
it "is false when the policy allows but the config is incomplete" do
- SiteSetting.voice_livekit_room_policy = "all_rooms"
- SiteSetting.voice_livekit_api_secret = ""
+ SiteSetting.live_livekit_room_policy = "all_rooms"
+ SiteSetting.live_livekit_api_secret = ""
expect(described_class.available_for?(room)).to eq(false)
end
@@ -84,14 +64,14 @@ RSpec.describe Voice::Livekit do
end
it "prefers the configured prefix over the database name" do
- SiteSetting.voice_livekit_room_prefix = "acme"
+ SiteSetting.live_livekit_room_prefix = "acme"
expect(described_class.room_name(room)).to eq("acme-r#{room.id}")
end
end
describe ".mint_token" do
it "raises MintError when not fully configured" do
- SiteSetting.voice_livekit_api_secret = ""
+ SiteSetting.live_livekit_api_secret = ""
expect { decoded_token }.to raise_error(described_class::MintError)
end
@@ -125,7 +105,7 @@ RSpec.describe Voice::Livekit do
end
it "grants only the camera source when screen sharing is not allowed" do
- SiteSetting.voice_screen_share_allowed_groups = ""
+ SiteSetting.live_screen_share_allowed_groups = ""
room.update!(video_enabled: true)
payload = decoded_token
@@ -134,7 +114,7 @@ RSpec.describe Voice::Livekit do
end
it "grants only the screen sources when the camera is not allowed" do
- SiteSetting.voice_video_allowed_groups = ""
+ SiteSetting.live_video_allowed_groups = ""
room.update!(video_enabled: true)
payload = decoded_token
@@ -154,7 +134,7 @@ RSpec.describe Voice::Livekit do
end
it "denies publishing entirely to a stage listener" do
- room.update!(room_type: Voice::Room::ROOM_TYPE_STAGE)
+ room.update!(room_type: Live::Room::ROOM_TYPE_STAGE)
payload = decoded_token
@@ -164,8 +144,8 @@ RSpec.describe Voice::Livekit do
end
it "grants all publish sources to a stage speaker when the room has video" do
- room.update!(room_type: Voice::Room::ROOM_TYPE_STAGE, video_enabled: true)
- room.room_memberships.create!(user: user, role: Voice::RoomMembership::ROLE_SPEAKER)
+ room.update!(room_type: Live::Room::ROOM_TYPE_STAGE, video_enabled: true)
+ room.room_memberships.create!(user: user, role: Live::RoomMembership::ROLE_SPEAKER)
payload = decoded_token
@@ -176,8 +156,8 @@ RSpec.describe Voice::Livekit do
end
it "grants only the microphone to a stage speaker when the room has no video" do
- room.update!(room_type: Voice::Room::ROOM_TYPE_STAGE, video_enabled: false)
- room.room_memberships.create!(user: user, role: Voice::RoomMembership::ROLE_SPEAKER)
+ room.update!(room_type: Live::Room::ROOM_TYPE_STAGE, video_enabled: false)
+ room.room_memberships.create!(user: user, role: Live::RoomMembership::ROLE_SPEAKER)
payload = decoded_token
diff --git a/plugins/live/spec/lib/live/logging_spec.rb b/plugins/live/spec/lib/live/logging_spec.rb
new file mode 100644
index 00000000000..e0d1c75b8d8
--- /dev/null
+++ b/plugins/live/spec/lib/live/logging_spec.rb
@@ -0,0 +1,27 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+
+RSpec.describe Live do
+ describe ".warn" do
+ it "disables warning logs by default" do
+ expect(SiteSetting.live_verbose_logging).to eq(false)
+
+ logs = track_log_messages { described_class.warn("[live] chat operation failed") }
+
+ expect(logs.warnings).to be_empty
+ end
+
+ it "logs warnings only while verbose logging is enabled" do
+ logs =
+ track_log_messages do
+ SiteSetting.live_verbose_logging = true
+ described_class.warn("[live] chat operation failed")
+ SiteSetting.live_verbose_logging = false
+ described_class.warn("[live] chat operation failed")
+ end
+
+ expect(logs.warnings).to eq(["[live] chat operation failed"])
+ end
+ end
+end
diff --git a/plugins/voice/spec/lib/voice/media_entitlements_spec.rb b/plugins/live/spec/lib/live/media_entitlements_spec.rb
similarity index 67%
rename from plugins/voice/spec/lib/voice/media_entitlements_spec.rb
rename to plugins/live/spec/lib/live/media_entitlements_spec.rb
index 707de515bb7..51760744822 100644
--- a/plugins/voice/spec/lib/voice/media_entitlements_spec.rb
+++ b/plugins/live/spec/lib/live/media_entitlements_spec.rb
@@ -1,15 +1,15 @@
# frozen_string_literal: true
-RSpec.describe Voice::MediaEntitlements do
+RSpec.describe Live::MediaEntitlements do
fab!(:member) { Fabricate(:user, trust_level: TrustLevel[2]) }
fab!(:low_trust_user) { Fabricate(:user, trust_level: TrustLevel[0]) }
- fab!(:room) { Fabricate(:voice_room, public: true) }
+ fab!(:room) { Fabricate(:live_room, public: true) }
- before { SiteSetting.voice_enabled = true }
+ before { SiteSetting.live_enabled = true }
it "answers each capability per user in one pass" do
- SiteSetting.voice_video_allowed_groups = Group::AUTO_GROUPS[:trust_level_2]
- SiteSetting.voice_screen_share_allowed_groups = Group::AUTO_GROUPS[:logged_in_users]
+ SiteSetting.live_video_allowed_groups = Group::AUTO_GROUPS[:trust_level_2]
+ SiteSetting.live_screen_share_allowed_groups = Group::AUTO_GROUPS[:logged_in_users]
entitlements = described_class.for_users(room, [member, low_trust_user])
@@ -24,8 +24,8 @@ RSpec.describe Voice::MediaEntitlements do
end
it "denies everything when a capability has no groups" do
- SiteSetting.voice_video_allowed_groups = ""
- SiteSetting.voice_screen_share_allowed_groups = ""
+ SiteSetting.live_video_allowed_groups = ""
+ SiteSetting.live_screen_share_allowed_groups = ""
expect(described_class.for_users(room, [member])[member.id]).to eq(described_class::NONE)
end
@@ -33,8 +33,8 @@ RSpec.describe Voice::MediaEntitlements do
it "resolves a group list of real groups without the pseudogroup shortcut" do
group = Fabricate(:group)
group.add(member)
- SiteSetting.voice_video_allowed_groups = group.id.to_s
- SiteSetting.voice_screen_share_allowed_groups = group.id.to_s
+ SiteSetting.live_video_allowed_groups = group.id.to_s
+ SiteSetting.live_screen_share_allowed_groups = group.id.to_s
entitlements = described_class.for_users(room, [member, low_trust_user])
@@ -44,8 +44,8 @@ RSpec.describe Voice::MediaEntitlements do
describe ".for_user" do
it "matches the roster answer for a single user" do
- SiteSetting.voice_video_allowed_groups = Group::AUTO_GROUPS[:trust_level_2]
- SiteSetting.voice_screen_share_allowed_groups = Group::AUTO_GROUPS[:logged_in_users]
+ SiteSetting.live_video_allowed_groups = Group::AUTO_GROUPS[:trust_level_2]
+ SiteSetting.live_screen_share_allowed_groups = Group::AUTO_GROUPS[:logged_in_users]
expect(described_class.for_user(member)).to eq(
can_publish_video: true,
@@ -62,8 +62,8 @@ RSpec.describe Voice::MediaEntitlements do
end
it "reuses the user's group ids across calls" do
- SiteSetting.voice_video_allowed_groups = Group::AUTO_GROUPS[:trust_level_0]
- SiteSetting.voice_screen_share_allowed_groups = Group::AUTO_GROUPS[:trust_level_0]
+ SiteSetting.live_video_allowed_groups = Group::AUTO_GROUPS[:trust_level_0]
+ SiteSetting.live_screen_share_allowed_groups = Group::AUTO_GROUPS[:trust_level_0]
described_class.for_user(member)
queries = track_sql_queries { described_class.for_user(member) }
@@ -74,8 +74,8 @@ RSpec.describe Voice::MediaEntitlements do
it "reads a whole roster without querying per user" do
users = Array.new(3) { Fabricate(:user) }
- SiteSetting.voice_video_allowed_groups = Group::AUTO_GROUPS[:trust_level_0]
- SiteSetting.voice_screen_share_allowed_groups = Group::AUTO_GROUPS[:trust_level_0]
+ SiteSetting.live_video_allowed_groups = Group::AUTO_GROUPS[:trust_level_0]
+ SiteSetting.live_screen_share_allowed_groups = Group::AUTO_GROUPS[:trust_level_0]
queries = track_sql_queries { described_class.for_users(room, users) }
diff --git a/plugins/voice/spec/lib/voice/room_hashtag_data_source_spec.rb b/plugins/live/spec/lib/live/room_hashtag_data_source_spec.rb
similarity index 74%
rename from plugins/voice/spec/lib/voice/room_hashtag_data_source_spec.rb
rename to plugins/live/spec/lib/live/room_hashtag_data_source_spec.rb
index f815f0b63db..c377b979618 100644
--- a/plugins/voice/spec/lib/voice/room_hashtag_data_source_spec.rb
+++ b/plugins/live/spec/lib/live/room_hashtag_data_source_spec.rb
@@ -1,51 +1,29 @@
# frozen_string_literal: true
require "rails_helper"
-require_relative "../../../db/migrate/20241107000000_create_voice_rooms"
-require_relative "../../../db/migrate/20260220154336_add_cooked_description_to_voice_rooms"
-require_relative "../../../db/migrate/20260305162426_add_room_type_to_voice_rooms"
-require_relative "../../../db/migrate/20260612135211_add_video_enabled_to_voice_rooms"
-require_relative "../../../db/migrate/20260630183841_add_chat_settings_to_voice_rooms"
-RSpec.describe Voice::RoomHashtagDataSource do
+RSpec.describe Live::RoomHashtagDataSource do
before do
- ActiveRecord::Migration.suppress_messages do
- CreateVoiceRooms.new.change unless ActiveRecord::Base.connection.table_exists?(:voice_rooms)
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :cooked_description)
- AddCookedDescriptionToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :room_type)
- AddRoomTypeToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :video_enabled)
- AddVideoEnabledToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :chat_channel_id)
- AddChatSettingsToVoiceRooms.new.change
- end
- Voice::Room.reset_column_information
- end
-
- SiteSetting.voice_enabled = true
- SiteSetting.voice_allowed_groups = Group::AUTO_GROUPS[:trust_level_1].to_s
+ SiteSetting.live_enabled = true
+ SiteSetting.live_allowed_groups = Group::AUTO_GROUPS[:trust_level_1].to_s
# The default create-rooms groups include TL2, which makes any TL2 user a
# global room manager who can see every room — raise the bar so the
# visibility assertions below actually exercise the membership checks.
- SiteSetting.voice_create_room_allowed_groups = Group::AUTO_GROUPS[:trust_level_4].to_s
+ SiteSetting.live_create_room_allowed_groups = Group::AUTO_GROUPS[:trust_level_4].to_s
end
fab!(:creator) { Fabricate(:user, trust_level: TrustLevel[1], refresh_auto_groups: true) }
fab!(:user) { Fabricate(:user, trust_level: TrustLevel[1], refresh_auto_groups: true) }
fab!(:room) do
- Fabricate(:voice_room, name: "General", description: "Come hang out", public: true, creator:)
+ Fabricate(:live_room, name: "General", description: "Come hang out", public: true, creator:)
end
- fab!(:private_room) { Fabricate(:voice_room, name: "Secret Sessions", creator:) }
+ fab!(:private_room) { Fabricate(:live_room, name: "Secret Sessions", creator:) }
fab!(:stage_room) do
Fabricate(
- :voice_room,
+ :live_room,
name: "Town Hall",
public: true,
- room_type: Voice::Room::ROOM_TYPE_STAGE,
+ room_type: Live::Room::ROOM_TYPE_STAGE,
creator:,
)
end
@@ -54,7 +32,7 @@ RSpec.describe Voice::RoomHashtagDataSource do
def hashtag_hash(room)
{
- relative_url: "/voice/r/#{room.slug}",
+ relative_url: "/live/r/#{room.slug}",
text: room.name,
description: room.description,
icon: room.stage? ? "podcast" : "microphone-lines",
@@ -69,9 +47,9 @@ RSpec.describe Voice::RoomHashtagDataSource do
end
describe "#enabled?" do
- it "follows the voice_enabled setting" do
+ it "follows the live_enabled setting" do
expect(described_class.enabled?).to eq(true)
- SiteSetting.voice_enabled = false
+ SiteSetting.live_enabled = false
expect(described_class.enabled?).to eq(false)
end
end
@@ -103,7 +81,7 @@ RSpec.describe Voice::RoomHashtagDataSource do
"microphone-lines",
)
- private_room.update!(room_type: Voice::Room::ROOM_TYPE_STAGE)
+ private_room.update!(room_type: Live::Room::ROOM_TYPE_STAGE)
expect(described_class.lookup(Guardian.new(creator), ["secret-sessions"]).first.icon).to eq(
"podcast",
)
@@ -127,21 +105,21 @@ RSpec.describe Voice::RoomHashtagDataSource do
end
it "never returns ephemeral rooms" do
- ephemeral = Fabricate(:voice_ephemeral_room, name: "General Call", public: true, creator:)
+ ephemeral = Fabricate(:live_ephemeral_room, name: "General Call", public: true, creator:)
expect(described_class.lookup(guardian, [ephemeral.slug])).to be_empty
expect(described_class.search(guardian, "general call", 5)).to be_empty
end
- it "returns nothing for users outside voice_allowed_groups" do
- SiteSetting.voice_allowed_groups = Group::AUTO_GROUPS[:staff].to_s
+ it "returns nothing for users outside live_allowed_groups" do
+ SiteSetting.live_allowed_groups = Group::AUTO_GROUPS[:staff].to_s
expect(described_class.lookup(guardian, ["general"])).to be_empty
end
it "returns public rooms to anonymous users when anonymous visitors are admitted" do
expect(described_class.lookup(Guardian.new, ["general"])).to be_empty
- SiteSetting.voice_allowed_groups =
+ SiteSetting.live_allowed_groups =
"#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
expect(described_class.lookup(Guardian.new, %w[general secret-sessions]).map(&:slug)).to eq(
["general"],
@@ -214,7 +192,7 @@ RSpec.describe Voice::RoomHashtagDataSource do
cooked = PrettyText.cook("#general::room", user_id: user.id)
link = Nokogiri::HTML5.fragment(cooked).css("a.hashtag-cooked").first
- expect(link["href"]).to eq("/voice/r/general")
+ expect(link["href"]).to eq("/live/r/general")
expect(link["data-type"]).to eq("room")
expect(link["data-slug"]).to eq("general")
expect(link["data-id"]).to eq(room.id.to_s)
@@ -230,15 +208,15 @@ RSpec.describe Voice::RoomHashtagDataSource do
end
describe "chat hashtag configuration snapshot" do
- it "tracks the voice_enabled setting at runtime" do
+ it "tracks the live_enabled setting at runtime" do
skip "chat plugin not installed" unless defined?(::Chat)
- SiteSetting.voice_enabled = false
+ SiteSetting.live_enabled = false
expect(
Site.markdown_additional_options.dig("chat", :hashtag_configurations)["chat-composer"],
).not_to include("room")
- SiteSetting.voice_enabled = true
+ SiteSetting.live_enabled = true
expect(
Site.markdown_additional_options.dig("chat", :hashtag_configurations)["chat-composer"],
).to include("room")
diff --git a/plugins/voice/spec/lib/voice/user_status_manager_spec.rb b/plugins/live/spec/lib/live/user_status_manager_spec.rb
similarity index 60%
rename from plugins/voice/spec/lib/voice/user_status_manager_spec.rb
rename to plugins/live/spec/lib/live/user_status_manager_spec.rb
index ed1d02305f8..95fdbbd3285 100644
--- a/plugins/voice/spec/lib/voice/user_status_manager_spec.rb
+++ b/plugins/live/spec/lib/live/user_status_manager_spec.rb
@@ -2,28 +2,28 @@
require "rails_helper"
-RSpec.describe Voice::UserStatusManager do
+RSpec.describe Live::UserStatusManager do
fab!(:user)
- fab!(:room) { Fabricate(:voice_room, public: true) }
- fab!(:private_room) { Fabricate(:voice_room, public: false) }
+ fab!(:room) { Fabricate(:live_room, public: true) }
+ fab!(:private_room) { Fabricate(:live_room, public: false) }
before do
- SiteSetting.voice_enabled = true
+ SiteSetting.live_enabled = true
SiteSetting.enable_user_status = true
- SiteSetting.voice_auto_status_enabled = true
+ SiteSetting.live_auto_status_enabled = true
end
- describe ".set_voice_status" do
+ describe ".set_live_status" do
it "leaves agent status unchanged" do
bot = Fabricate(:user, id: -1400)
- described_class.set_voice_status(bot, room)
+ described_class.set_live_status(bot, room)
expect(bot.reload.user_status).to be_nil
end
it "sets the user's status with room name and no expiry" do
- described_class.set_voice_status(user, room)
+ described_class.set_live_status(user, room)
user.reload
expect(user.user_status.description).to eq("In #{room.name}")
@@ -32,34 +32,34 @@ RSpec.describe Voice::UserStatusManager do
end
it "does not republish an unchanged status" do
- described_class.set_voice_status(user, room)
+ described_class.set_live_status(user, room)
- messages = MessageBus.track_publish { described_class.set_voice_status(user, room) }
+ messages = MessageBus.track_publish { described_class.set_live_status(user, room) }
expect(messages).to be_empty
end
it "does not leak the name of a private room" do
- described_class.set_voice_status(user, private_room)
+ described_class.set_live_status(user, private_room)
user.reload
- expect(user.user_status.description).to eq("In a voice room")
+ expect(user.user_status.description).to eq("In a live room")
expect(user.user_status.description).not_to include(private_room.name)
end
- it "skips when user already has a non-Voice status" do
+ it "skips when user already has a non-Live status" do
user.set_status!("On vacation", "palm_tree")
- described_class.set_voice_status(user, room)
+ described_class.set_live_status(user, room)
user.reload
expect(user.user_status.emoji).to eq("palm_tree")
end
- it "overwrites an existing Voice status" do
+ it "overwrites an existing Live status" do
user.set_status!("In Old Room", "studio_microphone")
- described_class.set_voice_status(user, room)
+ described_class.set_live_status(user, room)
user.reload
expect(user.user_status.description).to eq("In #{room.name}")
@@ -68,7 +68,7 @@ RSpec.describe Voice::UserStatusManager do
it "rewrites a matching status that still carries an expiry" do
user.set_status!("In #{room.name}", "studio_microphone", 2.minutes.from_now)
- described_class.set_voice_status(user, room)
+ described_class.set_live_status(user, room)
expect(user.reload.user_status.ends_at).to be_nil
end
@@ -76,23 +76,23 @@ RSpec.describe Voice::UserStatusManager do
it "skips when enable_user_status is false" do
SiteSetting.enable_user_status = false
- described_class.set_voice_status(user, room)
+ described_class.set_live_status(user, room)
expect(user.user_status).to be_nil
end
- it "skips when voice_auto_status_enabled is false" do
- SiteSetting.voice_auto_status_enabled = false
+ it "skips when live_auto_status_enabled is false" do
+ SiteSetting.live_auto_status_enabled = false
- described_class.set_voice_status(user, room)
+ described_class.set_live_status(user, room)
expect(user.user_status).to be_nil
end
end
describe ".set_afk_status" do
- it "transitions to AFK status when Voice owns the current status" do
- described_class.set_voice_status(user, room)
+ it "transitions to AFK status when Live owns the current status" do
+ described_class.set_live_status(user, room)
described_class.set_afk_status(user, room)
user.reload
@@ -102,15 +102,15 @@ RSpec.describe Voice::UserStatusManager do
end
it "does not leak the name of a private room" do
- described_class.set_voice_status(user, private_room)
+ described_class.set_live_status(user, private_room)
described_class.set_afk_status(user, private_room)
user.reload
- expect(user.user_status.description).to eq("AFK in a voice room")
+ expect(user.user_status.description).to eq("AFK in a live room")
expect(user.user_status.description).not_to include(private_room.name)
end
- it "skips when the user has a non-Voice status" do
+ it "skips when the user has a non-Live status" do
user.set_status!("On vacation", "palm_tree")
described_class.set_afk_status(user, room)
@@ -126,44 +126,57 @@ RSpec.describe Voice::UserStatusManager do
end
end
- describe ".clear_voice_status" do
- it "clears status when Voice owns it" do
- described_class.set_voice_status(user, room)
- described_class.clear_voice_status(user)
+ describe ".clear_live_status" do
+ it "clears status when Live owns it" do
+ described_class.set_live_status(user, room)
+ described_class.clear_live_status(user)
user.reload
expect(user.user_status).to be_nil
end
it "clears AFK status" do
- described_class.set_voice_status(user, room)
+ described_class.set_live_status(user, room)
described_class.set_afk_status(user, room)
- described_class.clear_voice_status(user)
+ described_class.clear_live_status(user)
user.reload
expect(user.user_status).to be_nil
end
- it "does not clear a non-Voice status" do
+ it "does not clear a non-Live status" do
user.set_status!("On vacation", "palm_tree")
- described_class.clear_voice_status(user)
+ described_class.clear_live_status(user)
user.reload
expect(user.user_status.emoji).to eq("palm_tree")
end
it "does nothing when user has no status" do
- expect { described_class.clear_voice_status(user) }.not_to raise_error
+ expect { described_class.clear_live_status(user) }.not_to raise_error
end
end
describe ".clear_stale_statuses" do
fab!(:other_user, :user)
- it "clears Voice statuses of users not in the live set" do
- described_class.set_voice_status(user, room)
- described_class.set_voice_status(other_user, room)
+ it "clears statuses owned before the plugin rename" do
+ user.set_status!("In Watercooler", "studio_microphone")
+ other_user.set_status!("AFK in Watercooler", "zzz")
+ Discourse.redis.sadd("voice:status_owners", [user.id, other_user.id])
+ freeze_time(1.minute.from_now)
+
+ described_class.clear_stale_statuses([])
+
+ expect(user.reload.user_status).to be_nil
+ expect(other_user.reload.user_status).to be_nil
+ expect(Discourse.redis.smembers("voice:status_owners")).to be_empty
+ end
+
+ it "clears Live statuses of users not in the live set" do
+ described_class.set_live_status(user, room)
+ described_class.set_live_status(other_user, room)
described_class.set_afk_status(other_user, room)
freeze_time(1.minute.from_now)
@@ -174,7 +187,7 @@ RSpec.describe Voice::UserStatusManager do
end
it "clears everything when no one is live" do
- described_class.set_voice_status(user, room)
+ described_class.set_live_status(user, room)
freeze_time(1.minute.from_now)
described_class.clear_stale_statuses([])
@@ -183,14 +196,14 @@ RSpec.describe Voice::UserStatusManager do
end
it "leaves a freshly set status for the next sweep" do
- described_class.set_voice_status(user, room)
+ described_class.set_live_status(user, room)
described_class.clear_stale_statuses([])
expect(user.reload.user_status).to be_present
end
- it "does not touch non-Voice statuses" do
+ it "does not touch non-Live statuses" do
user.set_status!("On vacation", "palm_tree")
freeze_time(1.minute.from_now)
@@ -199,7 +212,7 @@ RSpec.describe Voice::UserStatusManager do
expect(user.reload.user_status.emoji).to eq("palm_tree")
end
- it "does not clear a manually set status that uses a Voice emoji" do
+ it "does not clear a manually set status that uses a Live emoji" do
user.set_status!("Sleeping", "zzz")
freeze_time(1.minute.from_now)
@@ -208,8 +221,8 @@ RSpec.describe Voice::UserStatusManager do
expect(user.reload.user_status.emoji).to eq("zzz")
end
- it "does not clear a manual status that replaced a Voice one" do
- described_class.set_voice_status(user, room)
+ it "does not clear a manual status that replaced a Live one" do
+ described_class.set_live_status(user, room)
user.set_status!("On vacation", "palm_tree")
freeze_time(1.minute.from_now)
@@ -219,7 +232,7 @@ RSpec.describe Voice::UserStatusManager do
end
it "skips when enable_user_status is false" do
- described_class.set_voice_status(user, room)
+ described_class.set_live_status(user, room)
SiteSetting.enable_user_status = false
freeze_time(1.minute.from_now)
@@ -229,30 +242,30 @@ RSpec.describe Voice::UserStatusManager do
end
end
- describe ".voice_status_active?" do
+ describe ".live_status_active?" do
it "returns true for studio_microphone emoji" do
user.set_status!("In Room", "studio_microphone", 2.minutes.from_now)
- expect(described_class.voice_status_active?(user)).to eq(true)
+ expect(described_class.live_status_active?(user)).to eq(true)
end
it "returns true for zzz emoji" do
user.set_status!("AFK in Room", "zzz", 2.minutes.from_now)
- expect(described_class.voice_status_active?(user)).to eq(true)
+ expect(described_class.live_status_active?(user)).to eq(true)
end
it "returns false for other emojis" do
user.set_status!("On vacation", "palm_tree")
- expect(described_class.voice_status_active?(user)).to eq(false)
+ expect(described_class.live_status_active?(user)).to eq(false)
end
it "returns false when user has no status" do
- expect(described_class.voice_status_active?(user)).to be_falsey
+ expect(described_class.live_status_active?(user)).to be_falsey
end
it "returns false when status is expired" do
user.set_status!("In Room", "studio_microphone", 1.minute.from_now)
freeze_time(2.minutes.from_now)
- expect(described_class.voice_status_active?(user)).to eq(false)
+ expect(described_class.live_status_active?(user)).to eq(false)
end
end
end
diff --git a/plugins/live/spec/migrations/rename_voice_to_live_spec.rb b/plugins/live/spec/migrations/rename_voice_to_live_spec.rb
new file mode 100644
index 00000000000..805a19cdcdc
--- /dev/null
+++ b/plugins/live/spec/migrations/rename_voice_to_live_spec.rb
@@ -0,0 +1,192 @@
+# frozen_string_literal: true
+
+require Rails.root.join("plugins/live/db/post_migrate/20261013160643_rename_voice_to_live.rb")
+
+RSpec.describe RenameVoiceToLive do
+ before do
+ @original_verbose = ActiveRecord::Migration.verbose
+ ActiveRecord::Migration.verbose = false
+
+ described_class::RENAMED_TABLES.each do |old_name, new_name|
+ DB.exec("ALTER TABLE #{new_name} RENAME TO #{old_name}")
+ DB.exec("ALTER INDEX #{new_name}_pkey RENAME TO #{old_name}_pkey")
+ DB.exec("ALTER SEQUENCE #{new_name}_id_seq RENAME TO #{old_name}_id_seq")
+ end
+ DB.exec("ALTER INDEX idx_live_sessions_orphaned RENAME TO idx_voice_sessions_orphaned")
+ DB.exec(<<~SQL)
+ ALTER TABLE voice_co_presences
+ RENAME CONSTRAINT chk_live_co_presences_user_order TO chk_voice_co_presences_user_order
+ SQL
+ end
+
+ after { ActiveRecord::Migration.verbose = @original_verbose }
+
+ def relation_names(pattern)
+ DB.query_single("SELECT relname FROM pg_class WHERE relname ~ ?", pattern)
+ end
+
+ it "renames the tables and their custom-named indexes and constraints" do
+ described_class.new.up
+
+ expect(relation_names("^voice_")).to be_empty
+ expect(relation_names("^live_")).to include(*described_class::RENAMED_TABLES.values.map(&:to_s))
+ expect(relation_names("^idx_live_sessions_orphaned$")).to be_present
+ expect(
+ DB.query_single(
+ "SELECT conname FROM pg_constraint WHERE conname = 'chk_live_co_presences_user_order'",
+ ),
+ ).to be_present
+ end
+
+ it "renames the tables' triggers and the functions they call" do
+ DB.exec(<<~SQL)
+ CREATE FUNCTION raise_voice_sessions_readonly() RETURNS trigger AS $$
+ BEGIN RETURN NEW; END
+ $$ LANGUAGE plpgsql;
+ CREATE TRIGGER voice_sessions_readonly BEFORE UPDATE ON voice_sessions
+ FOR EACH ROW EXECUTE FUNCTION raise_voice_sessions_readonly();
+ SQL
+
+ described_class.new.up
+
+ expect(
+ DB.query_single(
+ "SELECT t.tgname, p.proname FROM pg_trigger t JOIN pg_proc p ON p.oid = t.tgfoid WHERE t.tgrelid = 'live_sessions'::regclass AND NOT t.tgisinternal",
+ ),
+ ).to eq(%w[live_sessions_readonly raise_live_sessions_readonly])
+ end
+
+ it "leaves objects and settings of unrelated tables alone" do
+ DB.exec(<<~SQL)
+ CREATE TABLE voice_extras (id serial PRIMARY KEY, total integer CONSTRAINT voice_extras_total_check CHECK (total > 0));
+ CREATE INDEX idx_voice_extras_total ON voice_extras (total);
+ CREATE FUNCTION voice_extras_sum(a integer, b integer) RETURNS integer AS 'SELECT a + b' LANGUAGE sql;
+ INSERT INTO site_settings (name, data_type, value, created_at, updated_at)
+ VALUES ('voice_extras_enabled', #{SiteSettings::TypeSupervisor.types[:bool]}, 't', NOW(), NOW());
+ SQL
+
+ described_class.new.up
+
+ expect(relation_names("voice_extras")).to contain_exactly(
+ "voice_extras",
+ "voice_extras_pkey",
+ "voice_extras_id_seq",
+ "idx_voice_extras_total",
+ )
+ expect(
+ DB.query_single("SELECT conname FROM pg_constraint WHERE conname ~ 'extras_total_check'"),
+ ).to eq(["voice_extras_total_check"])
+ expect(DB.query_single("SELECT proname FROM pg_proc WHERE proname ~ 'extras_sum'")).to eq(
+ ["voice_extras_sum"],
+ )
+ expect(DB.query_single("SELECT name FROM site_settings WHERE name ~ 'extras_enabled'")).to eq(
+ ["voice_extras_enabled"],
+ )
+ end
+
+ it "renames site settings without clobbering ones already using the new name" do
+ insert_setting = ->(name, value) do
+ DB.exec(
+ "INSERT INTO site_settings (name, data_type, value, created_at, updated_at) VALUES (:name, :type, :value, NOW(), NOW())",
+ name:,
+ value:,
+ type: SiteSettings::TypeSupervisor.types[:bool],
+ )
+ end
+ insert_setting.call("voice_verbose_logging", "t")
+ insert_setting.call("voice_chat_enabled", "f")
+ insert_setting.call("live_chat_enabled", "t")
+
+ described_class.new.up
+
+ settings = DB.query("SELECT name, value FROM site_settings WHERE name ~ '^(voice|live)_'")
+ expect(settings.map { |s| [s.name, s.value] }).to contain_exactly(
+ %w[live_verbose_logging t],
+ %w[voice_chat_enabled f],
+ %w[live_chat_enabled t],
+ )
+ end
+
+ it "preserves voice in the rest of a setting name" do
+ DB.exec(
+ "INSERT INTO site_settings (name, data_type, value, created_at, updated_at) VALUES (?, ?, ?, NOW(), NOW())",
+ "voice_max_voice_quality",
+ SiteSettings::TypeSupervisor.types[:enum],
+ "standard",
+ )
+
+ described_class.new.up
+
+ expect(
+ DB.query_single("SELECT name, value FROM site_settings WHERE name LIKE '%max%quality'"),
+ ).to eq(%w[live_max_voice_quality standard])
+ end
+
+ it "moves upcoming change history to the new setting name" do
+ UpcomingChangeEvent.where(upcoming_change_name: %w[voice_enabled live_enabled]).delete_all
+ UpcomingChangeEvent.create!(event_type: :added, upcoming_change_name: "voice_enabled")
+
+ described_class.new.up
+
+ expect(
+ UpcomingChangeEvent.where(upcoming_change_name: "live_enabled").pluck(:event_type),
+ ).to eq(["added"])
+ expect(UpcomingChangeEvent.where(upcoming_change_name: "voice_enabled")).to be_empty
+ end
+
+ it "drops once-off upcoming change events the new name already has" do
+ UpcomingChangeEvent.where(upcoming_change_name: %w[voice_enabled live_enabled]).delete_all
+ UpcomingChangeEvent.create!(event_type: :added, upcoming_change_name: "voice_enabled")
+ UpcomingChangeEvent.create!(event_type: :added, upcoming_change_name: "live_enabled")
+
+ described_class.new.up
+
+ expect(UpcomingChangeEvent.where(upcoming_change_name: "live_enabled").count).to eq(1)
+ expect(UpcomingChangeEvent.where(upcoming_change_name: "voice_enabled")).to be_empty
+ end
+
+ context "with an existing session reviewable" do
+ fab!(:session, :live_session, refind: false)
+
+ it "preserves the target and reuses the reviewable for subsequent flags" do
+ reviewable = Fabricate(:reviewable)
+ DB.exec(
+ "UPDATE reviewables SET type = 'ReviewableVoiceUser', type_source = 'voice', target_type = 'Voice::Session', target_id = ? WHERE id = ?",
+ session.id,
+ reviewable.id,
+ )
+
+ described_class.new.up
+
+ migrated_reviewable = Reviewable.find(reviewable.id)
+ expect(migrated_reviewable).to be_a(ReviewableLiveUser)
+ expect(migrated_reviewable.type_source).to eq("live")
+ expect(migrated_reviewable.target).to eq(session)
+ expect(ReviewableLiveUser.needs_review!(created_by: session.user, target: session).id).to eq(
+ reviewable.id,
+ )
+ end
+ end
+
+ it "renames reviewables, plugin store rows, badge groupings and chat thread markers" do
+ reviewable = Fabricate(:reviewable)
+ DB.exec(
+ "UPDATE reviewables SET type = 'ReviewableVoiceUser', type_source = 'voice' WHERE id = ?",
+ reviewable.id,
+ )
+ PluginStore.set("voice", "livekit_agent_bot_id", 42)
+ BadgeGrouping.where(name: "Live").delete_all
+ grouping = BadgeGrouping.create!(name: "Voice", position: 99)
+ thread = Fabricate(:chat_thread)
+ thread.upsert_custom_fields("voice_room_id" => 7)
+
+ described_class.new.up
+
+ expect(
+ DB.query_single("SELECT type, type_source FROM reviewables WHERE id = ?", reviewable.id),
+ ).to eq(%w[ReviewableLiveUser live])
+ expect(PluginStore.get("live", "livekit_agent_bot_id")).to eq(42)
+ expect(grouping.reload.name).to eq("Live")
+ expect(thread.reload.custom_fields).to eq("live_room_id" => "7")
+ end
+end
diff --git a/plugins/voice/spec/models/voice/room_spec.rb b/plugins/live/spec/models/live/room_spec.rb
similarity index 73%
rename from plugins/voice/spec/models/voice/room_spec.rb
rename to plugins/live/spec/models/live/room_spec.rb
index ac6cbb35125..d20f7aed13f 100644
--- a/plugins/voice/spec/models/voice/room_spec.rb
+++ b/plugins/live/spec/models/live/room_spec.rb
@@ -1,33 +1,9 @@
# frozen_string_literal: true
require "rails_helper"
-require_relative "../../../db/migrate/20241107000000_create_voice_rooms"
-require_relative "../../../db/migrate/20260305162426_add_room_type_to_voice_rooms"
-require_relative "../../../db/migrate/20260612135211_add_video_enabled_to_voice_rooms"
-require_relative "../../../db/migrate/20260630183841_add_chat_settings_to_voice_rooms"
-require_relative "../../../db/migrate/20260728201053_add_max_quality_profile_to_voice_rooms"
-
-RSpec.describe Voice::Room do
- before do
- ActiveRecord::Migration.suppress_messages do
- CreateVoiceRooms.new.change unless ActiveRecord::Base.connection.table_exists?(:voice_rooms)
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :room_type)
- AddRoomTypeToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :video_enabled)
- AddVideoEnabledToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :chat_channel_id)
- AddChatSettingsToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :max_quality_profile)
- AddMaxQualityProfileToVoiceRooms.new.change
- end
- end
- Voice::Room.reset_column_information
- end
- fab!(:room, :voice_room)
+RSpec.describe Live::Room do
+ fab!(:room, :live_room)
describe ".visible_to" do
def visible_room_ids(guardian, room_ids)
@@ -35,18 +11,18 @@ RSpec.describe Voice::Room do
end
it "matches room visibility for public access, members, creators, and staff" do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_allowed_groups =
+ SiteSetting.live_enabled = true
+ SiteSetting.live_allowed_groups =
"#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
owner = Fabricate(:user)
member = Fabricate(:user)
staff = Fabricate(:admin)
- public_room = Fabricate(:voice_room, creator: owner, public: true)
- private_room = Fabricate(:voice_room, creator: owner, public: false)
+ public_room = Fabricate(:live_room, creator: owner, public: true)
+ private_room = Fabricate(:live_room, creator: owner, public: false)
private_room.room_memberships.create!(user: member)
- creator_only_room = Fabricate(:voice_room, creator: owner, public: false)
+ creator_only_room = Fabricate(:live_room, creator: owner, public: false)
creator_only_room.room_memberships.delete_all
- ephemeral_room = Fabricate(:voice_ephemeral_room, creator: owner, public: true)
+ ephemeral_room = Fabricate(:live_ephemeral_room, creator: owner, public: true)
room_ids = [public_room, private_room, creator_only_room, ephemeral_room].map(&:id)
expect(visible_room_ids(Guardian.new(nil), room_ids)).to contain_exactly(public_room.id)
@@ -65,32 +41,32 @@ RSpec.describe Voice::Room do
creator_only_room.id,
)
- SiteSetting.voice_allowed_groups = Group::AUTO_GROUPS[:anonymous_users].to_s
+ SiteSetting.live_allowed_groups = Group::AUTO_GROUPS[:anonymous_users].to_s
expect(visible_room_ids(member.guardian, room_ids)).to contain_exactly(public_room.id)
expect(visible_room_ids(staff.guardian, room_ids)).to contain_exactly(public_room.id)
- SiteSetting.voice_enabled = false
+ SiteSetting.live_enabled = false
expect(visible_room_ids(Guardian.new(nil), room_ids)).to be_empty
end
end
describe "slug generation" do
it "appends a random suffix for ephemeral rooms so generic names never collide" do
- persistent = Fabricate(:voice_room, name: "Call")
- ephemeral = Fabricate(:voice_ephemeral_room, name: "Call")
+ persistent = Fabricate(:live_room, name: "Call")
+ ephemeral = Fabricate(:live_ephemeral_room, name: "Call")
expect(persistent.slug).to eq("call")
expect(ephemeral.slug).to match(/\Acall-\h{8}\z/)
end
it "normalizes and keeps a user-provided slug" do
- custom = Fabricate(:voice_room, name: "Game Night", slug: "Friday Hangout")
+ custom = Fabricate(:live_room, name: "Game Night", slug: "Friday Hangout")
expect(custom.slug).to eq("friday-hangout")
end
it "rejects a provided slug that normalizes to nothing" do
- custom = Fabricate.build(:voice_room, name: "Game Night", slug: "!!!")
+ custom = Fabricate.build(:live_room, name: "Game Night", slug: "!!!")
expect(custom).not_to be_valid
expect(custom.errors[:slug]).to be_present
@@ -155,7 +131,7 @@ RSpec.describe Voice::Room do
end
it "accepts every known profile" do
- Voice::Room::QUALITY_PROFILES.each_value do |profile|
+ Live::Room::QUALITY_PROFILES.each_value do |profile|
room.max_quality_profile = profile
expect(room).to be_valid
end
diff --git a/plugins/voice/spec/models/voice/session_spec.rb b/plugins/live/spec/models/live/session_spec.rb
similarity index 86%
rename from plugins/voice/spec/models/voice/session_spec.rb
rename to plugins/live/spec/models/live/session_spec.rb
index 7f638faf1ba..0cfc9d22ac6 100644
--- a/plugins/voice/spec/models/voice/session_spec.rb
+++ b/plugins/live/spec/models/live/session_spec.rb
@@ -1,14 +1,14 @@
# frozen_string_literal: true
-RSpec.describe Voice::Session do
+RSpec.describe Live::Session do
fab!(:user)
- fab!(:room, :voice_room)
+ fab!(:room, :live_room)
describe "#accompanied_seconds" do
let(:started_at) { Time.zone.parse("2026-09-01 10:00") }
let(:session) do
Fabricate(
- :voice_session,
+ :live_session,
user: user,
room: room,
joined_at: started_at,
@@ -18,7 +18,7 @@ RSpec.describe Voice::Session do
def companion_session(from, to, in_room: room)
Fabricate(
- :voice_session,
+ :live_session,
user: Fabricate(:user),
room: in_room,
joined_at: started_at + from,
@@ -27,7 +27,7 @@ RSpec.describe Voice::Session do
end
it "returns zero when nobody else was in the room" do
- companion_session(0.hours, 4.hours, in_room: Fabricate(:voice_room))
+ companion_session(0.hours, 4.hours, in_room: Fabricate(:live_room))
expect(session.accompanied_seconds).to eq(0)
end
diff --git a/plugins/voice/spec/models/reviewable_voice_user_spec.rb b/plugins/live/spec/models/reviewable_live_user_spec.rb
similarity index 89%
rename from plugins/voice/spec/models/reviewable_voice_user_spec.rb
rename to plugins/live/spec/models/reviewable_live_user_spec.rb
index 2bdbe1e05b9..29b3eb54317 100644
--- a/plugins/voice/spec/models/reviewable_voice_user_spec.rb
+++ b/plugins/live/spec/models/reviewable_live_user_spec.rb
@@ -2,16 +2,16 @@
require "rails_helper"
-RSpec.describe ReviewableVoiceUser do
+RSpec.describe ReviewableLiveUser do
fab!(:moderator)
fab!(:flagger, :user)
fab!(:flagged_user, :user)
- fab!(:room, :voice_room)
- fab!(:session) { Fabricate(:voice_session, room: room, user: flagged_user) }
+ fab!(:room, :live_room)
+ fab!(:session) { Fabricate(:live_session, room: room, user: flagged_user) }
fab!(:reviewable) do
reviewable =
- ReviewableVoiceUser.needs_review!(
+ ReviewableLiveUser.needs_review!(
created_by: flagger,
target: session,
reviewable_by_moderator: true,
@@ -29,7 +29,7 @@ RSpec.describe ReviewableVoiceUser do
reviewable
end
- before { SiteSetting.voice_enabled = true }
+ before { SiteSetting.live_enabled = true }
describe "#build_actions" do
it "offers agree, suspend/silence, disagree and ignore to a moderator" do
@@ -118,27 +118,27 @@ RSpec.describe ReviewableVoiceUser do
SiteSetting.dsa_reporting_enabled = true
end
- it "creates no statement when agree_and_keep handles the voice user reviewable" do
+ it "creates no statement when agree_and_keep handles the live user reviewable" do
expect {
expect(reviewable.perform(moderator, :agree_and_keep)).to be_success
}.not_to change(DsaStatementOfRecord, :count)
end
- it "creates no statement when disagree handles the voice user reviewable" do
+ it "creates no statement when disagree handles the live user reviewable" do
expect { expect(reviewable.perform(moderator, :disagree)).to be_success }.not_to change(
DsaStatementOfRecord,
:count,
)
end
- it "creates no statement when ignore handles the voice user reviewable" do
+ it "creates no statement when ignore handles the live user reviewable" do
expect { expect(reviewable.perform(moderator, :ignore)).to be_success }.not_to change(
DsaStatementOfRecord,
:count,
)
end
- it "records a statement when agree_and_suspend handles the voice user reviewable" do
+ it "records a statement when agree_and_suspend handles the live user reviewable" do
expect {
reviewable.perform(
moderator,
@@ -153,7 +153,7 @@ RSpec.describe ReviewableVoiceUser do
expect(statement).to be_pending
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
- "decision_facts" => "The user reported during a voice call was suspended.",
+ "decision_facts" => "The user reported during a live call was suspended.",
"source_type" => "SOURCE_VOLUNTARY",
"decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
@@ -167,7 +167,7 @@ RSpec.describe ReviewableVoiceUser do
)
end
- it "records a statement when agree_and_silence handles the voice user reviewable" do
+ it "records a statement when agree_and_silence handles the live user reviewable" do
expect {
reviewable.perform(
moderator,
@@ -183,7 +183,7 @@ RSpec.describe ReviewableVoiceUser do
expect(statement.payload).to eq(
"territorial_scope" => DsaStatementOfRecord::TERRITORIAL_SCOPE,
"decision_facts" =>
- "The user reported during a voice call had their ability to participate restricted.",
+ "The user reported during a live call had their ability to participate restricted.",
"source_type" => "SOURCE_VOLUNTARY",
"decision_ground" => "DECISION_GROUND_INCOMPATIBLE_CONTENT",
"automated_detection" => "No",
diff --git a/plugins/voice/spec/plugin_spec.rb b/plugins/live/spec/plugin_spec.rb
similarity index 65%
rename from plugins/voice/spec/plugin_spec.rb
rename to plugins/live/spec/plugin_spec.rb
index fe2c331c198..11d62ccea7e 100644
--- a/plugins/voice/spec/plugin_spec.rb
+++ b/plugins/live/spec/plugin_spec.rb
@@ -1,13 +1,13 @@
# frozen_string_literal: true
RSpec.describe UserDestroyer do
- describe "voice cleanup" do
+ describe "live cleanup" do
fab!(:admin)
fab!(:user)
fab!(:other_user, :user)
- fab!(:room) { Fabricate(:voice_room, creator: user, public: true) }
+ fab!(:room) { Fabricate(:live_room, creator: user, public: true) }
- before { SiteSetting.voice_enabled = true }
+ before { SiteSetting.live_enabled = true }
it "moves the deleted user's rooms to the system user" do
UserDestroyer.new(admin).destroy(user)
@@ -16,10 +16,10 @@ RSpec.describe UserDestroyer do
end
it "removes memberships and co-presences but keeps sessions as history" do
- session = Fabricate(:voice_session, user: user, room: room)
+ session = Fabricate(:live_session, user: user, room: room)
ids = [user.id, other_user.id].minmax
co_presence =
- Voice::CoPresence.create!(
+ Live::CoPresence.create!(
user_id_1: ids.first,
user_id_2: ids.last,
date: Time.zone.today,
@@ -29,8 +29,8 @@ RSpec.describe UserDestroyer do
UserDestroyer.new(admin).destroy(user)
- expect(Voice::RoomMembership.where(user_id: user.id)).to be_empty
- expect(Voice::CoPresence.exists?(co_presence.id)).to eq(false)
+ expect(Live::RoomMembership.where(user_id: user.id)).to be_empty
+ expect(Live::CoPresence.exists?(co_presence.id)).to eq(false)
expect(session.reload.user_id).to eq(user.id)
end
end
diff --git a/plugins/voice/spec/requests/voice/admin_livekit_controller_spec.rb b/plugins/live/spec/requests/live/admin_livekit_controller_spec.rb
similarity index 76%
rename from plugins/voice/spec/requests/voice/admin_livekit_controller_spec.rb
rename to plugins/live/spec/requests/live/admin_livekit_controller_spec.rb
index dd8d4c8369e..90940348a15 100644
--- a/plugins/voice/spec/requests/voice/admin_livekit_controller_spec.rb
+++ b/plugins/live/spec/requests/live/admin_livekit_controller_spec.rb
@@ -1,50 +1,26 @@
# frozen_string_literal: true
require "rails_helper"
-require_relative "../../../db/migrate/20241107000000_create_voice_rooms"
-require_relative "../../../db/migrate/20260305162426_add_room_type_to_voice_rooms"
-require_relative "../../../db/migrate/20260612135211_add_video_enabled_to_voice_rooms"
-require_relative "../../../db/migrate/20260630183841_add_chat_settings_to_voice_rooms"
-require_relative "../../../db/migrate/20260709165411_add_livekit_enabled_to_voice_rooms"
-
-RSpec.describe Voice::AdminLivekitController do
- before do
- ActiveRecord::Migration.suppress_messages do
- CreateVoiceRooms.new.change unless ActiveRecord::Base.connection.table_exists?(:voice_rooms)
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :room_type)
- AddRoomTypeToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :video_enabled)
- AddVideoEnabledToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :chat_channel_id)
- AddChatSettingsToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :livekit_enabled)
- AddLivekitEnabledToVoiceRooms.new.change
- end
- end
- Voice::Room.reset_column_information
- end
+RSpec.describe Live::AdminLivekitController do
fab!(:admin)
fab!(:user)
fab!(:other_user, :user)
fab!(:ghost_user, :user)
- fab!(:room) { Fabricate(:voice_room, public: true) }
+ fab!(:room) { Fabricate(:live_room, public: true) }
- before { SiteSetting.voice_enabled = true }
+ before { SiteSetting.live_enabled = true }
after do
- Voice::ParticipantTracker.clear(room.id)
- Discourse.redis.del(Voice::Livekit::HealthCheck::LAST_PROBE_KEY)
- Discourse.redis.del(Voice::Livekit::LAST_WEBHOOK_KEY)
+ Live::ParticipantTracker.clear(room.id)
+ Discourse.redis.del(Live::Livekit::HealthCheck::LAST_PROBE_KEY)
+ Discourse.redis.del(Live::Livekit::LAST_WEBHOOK_KEY)
end
def configure_livekit!
- SiteSetting.voice_livekit_url = "wss://livekit.example.com"
- SiteSetting.voice_livekit_api_key = "lk_api_key"
- SiteSetting.voice_livekit_api_secret = "lk_api_secret"
+ SiteSetting.live_livekit_url = "wss://livekit.example.com"
+ SiteSetting.live_livekit_api_key = "lk_api_key"
+ SiteSetting.live_livekit_api_secret = "lk_api_secret"
end
def list_rooms_stub
@@ -56,11 +32,11 @@ RSpec.describe Voice::AdminLivekitController do
end
def get_status
- get "/admin/plugins/voice/livekit/status.json"
+ get "/admin/plugins/live/livekit/status.json"
end
def post_probe
- post "/admin/plugins/voice/livekit/probe.json"
+ post "/admin/plugins/live/livekit/probe.json"
end
describe "access control" do
@@ -85,7 +61,7 @@ RSpec.describe Voice::AdminLivekitController do
sign_in(admin)
get_status
expect(response.parsed_body["webhook_url"]).to eq(
- "#{Discourse.base_url}/voice/livekit/webhook",
+ "#{Discourse.base_url}/live/livekit/webhook",
)
end
end
@@ -113,7 +89,7 @@ RSpec.describe Voice::AdminLivekitController do
end
it "reports which settings are present on a half-configured install" do
- SiteSetting.voice_livekit_url = "wss://livekit.example.com"
+ SiteSetting.live_livekit_url = "wss://livekit.example.com"
get_status
@@ -158,7 +134,7 @@ RSpec.describe Voice::AdminLivekitController do
).with do |req|
token = req.headers["Authorization"].delete_prefix("Bearer ")
claims =
- JWT.decode(token, SiteSetting.voice_livekit_api_secret, true, algorithm: "HS256").first
+ JWT.decode(token, SiteSetting.live_livekit_api_secret, true, algorithm: "HS256").first
claims["iss"] == "lk_api_key" && claims["video"] == { "roomList" => true }
end,
).to have_been_made.once
@@ -188,8 +164,8 @@ RSpec.describe Voice::AdminLivekitController do
it "surfaces the stored probe result and the webhook freshness marker" do
list_rooms_stub.to_return(status: 200, body: { rooms: [] }.to_json)
freeze_time
- Voice::Livekit.touch_last_webhook!
- Jobs::VoiceLivekitProbe.new.execute({})
+ Live::Livekit.touch_last_webhook!
+ Jobs::LiveLivekitProbe.new.execute({})
get_status
@@ -213,14 +189,14 @@ RSpec.describe Voice::AdminLivekitController do
expect(probe["token"]).to eq("ok" => true)
expect(probe["server"]["latency_ms"]).to be_a(Integer)
expect(probe["server"]["room_count"]).to eq(0)
- expect(Voice::Livekit::HealthCheck.last_probe[:ok]).to eq(true)
+ expect(Live::Livekit::HealthCheck.last_probe[:ok]).to eq(true)
end
describe "pinned livekit rooms" do
before do
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
- Voice::ParticipantTracker.add(room.id, user.id)
- Voice::ParticipantTracker.add(room.id, other_user.id)
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
+ Live::ParticipantTracker.add(room.id, user.id)
+ Live::ParticipantTracker.add(room.id, other_user.id)
list_rooms_stub.to_return(status: 200, body: { rooms: [] }.to_json)
end
@@ -271,7 +247,7 @@ RSpec.describe Voice::AdminLivekitController do
it "includes bot identities without interpreting malformed identities as users" do
bot = Fabricate(:user, id: -1400)
- Voice::ParticipantTracker.add(room.id, bot.id)
+ Live::ParticipantTracker.add(room.id, bot.id)
list_participants_stub.to_return(
status: 200,
body: {
@@ -303,8 +279,8 @@ RSpec.describe Voice::AdminLivekitController do
end
it "ignores rooms pinned to mesh" do
- Voice::ParticipantTracker.clear_transport_pin(room.id)
- Voice::ParticipantTracker.pin_transport!(room.id, "mesh")
+ Live::ParticipantTracker.clear_transport_pin(room.id)
+ Live::ParticipantTracker.pin_transport!(room.id, "mesh")
get_status
@@ -315,9 +291,9 @@ RSpec.describe Voice::AdminLivekitController do
it "never leaks the API secret or key in the status payload or the site serializer" do
list_rooms_stub.to_return(status: 401, body: "invalid authorization token")
list_participants_stub.to_return(status: 401, body: "invalid authorization token")
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
- Voice::ParticipantTracker.add(room.id, user.id)
- Jobs::VoiceLivekitProbe.new.execute({})
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
+ Live::ParticipantTracker.add(room.id, user.id)
+ Jobs::LiveLivekitProbe.new.execute({})
get_status
expect(response.status).to eq(200)
diff --git a/plugins/voice/spec/requests/voice/admin_recordings_controller_spec.rb b/plugins/live/spec/requests/live/admin_recordings_controller_spec.rb
similarity index 52%
rename from plugins/voice/spec/requests/voice/admin_recordings_controller_spec.rb
rename to plugins/live/spec/requests/live/admin_recordings_controller_spec.rb
index 4c237d408d1..de7f439b049 100644
--- a/plugins/voice/spec/requests/voice/admin_recordings_controller_spec.rb
+++ b/plugins/live/spec/requests/live/admin_recordings_controller_spec.rb
@@ -1,103 +1,82 @@
# frozen_string_literal: true
require "rails_helper"
-require_relative "../../../db/migrate/20241107000000_create_voice_rooms"
-require_relative "../../../db/migrate/20260305162426_add_room_type_to_voice_rooms"
-require_relative "../../../db/migrate/20260612135211_add_video_enabled_to_voice_rooms"
-require_relative "../../../db/migrate/20260717172530_create_voice_recordings"
-
-RSpec.describe Voice::AdminRecordingsController do
- before do
- ActiveRecord::Migration.suppress_messages do
- CreateVoiceRooms.new.change unless ActiveRecord::Base.connection.table_exists?(:voice_rooms)
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :room_type)
- AddRoomTypeToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :video_enabled)
- AddVideoEnabledToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.table_exists?(:voice_recordings)
- CreateVoiceRecordings.new.change
- end
- end
- Voice::Room.reset_column_information
- Voice::Recording.reset_column_information
- end
+RSpec.describe Live::AdminRecordingsController do
fab!(:admin)
fab!(:user)
- fab!(:room) { Fabricate(:voice_room, public: true) }
+ fab!(:room) { Fabricate(:live_room, public: true) }
fab!(:recording) do
- Voice::Recording.create!(
+ Live::Recording.create!(
room: room,
started_by: user,
egress_id: "EG_1",
status: :completed,
- filepath: "voice/test-abc123",
- location: "https://cdn.example.com/voice/test-abc123.mp4",
+ filepath: "live/test-abc123",
+ location: "https://cdn.example.com/live/test-abc123.mp4",
duration_ms: 65_000,
started_at: 1.hour.ago,
ended_at: 59.minutes.ago,
)
end
- before { SiteSetting.voice_enabled = true }
+ before { SiteSetting.live_enabled = true }
describe "#index" do
it "lists recordings newest-first with room, requester, and file details for admins" do
- Voice::Recording.create!(
+ Live::Recording.create!(
room: room,
started_by: user,
egress_id: "EG_2",
- filepath: "voice/test-def456",
+ filepath: "live/test-def456",
started_at: 5.minutes.ago,
)
sign_in(admin)
- get "/admin/plugins/voice/recordings.json"
+ get "/admin/plugins/live/recordings.json"
expect(response.status).to eq(200)
payload = response.parsed_body
expect(payload["has_more"]).to eq(false)
expect(payload["last_webhook_at"]).to be_nil
- expect(payload["webhook_url"]).to eq("#{Discourse.base_url}/voice/livekit/webhook")
+ expect(payload["webhook_url"]).to eq("#{Discourse.base_url}/live/livekit/webhook")
expect(payload["recordings"].map { |row| row["egress_id"] }).to eq(%w[EG_2 EG_1])
completed = payload["recordings"].last
expect(completed["room_name"]).to eq(room.name)
expect(completed["started_by"]["username"]).to eq(user.username)
expect(completed["status"]).to eq("completed")
- expect(completed["location"]).to eq("https://cdn.example.com/voice/test-abc123.mp4")
+ expect(completed["location"]).to eq("https://cdn.example.com/live/test-abc123.mp4")
expect(completed["duration_ms"]).to eq(65_000)
end
it "reports received webhooks so the setup note can be hidden" do
freeze_time
- Voice::Livekit.touch_last_webhook!
+ Live::Livekit.touch_last_webhook!
sign_in(admin)
- get "/admin/plugins/voice/recordings.json"
+ get "/admin/plugins/live/recordings.json"
expect(Time.iso8601(response.parsed_body["last_webhook_at"]).to_i).to eq(Time.current.to_i)
end
it "paginates past the page size" do
- stub_const(Voice::AdminRecordingsController, "PAGE_SIZE", 1) do
+ stub_const(Live::AdminRecordingsController, "PAGE_SIZE", 1) do
sign_in(admin)
- Voice::Recording.create!(
+ Live::Recording.create!(
room: room,
started_by: user,
egress_id: "EG_2",
- filepath: "voice/test-def456",
+ filepath: "live/test-def456",
started_at: 5.minutes.ago,
)
- get "/admin/plugins/voice/recordings.json"
+ get "/admin/plugins/live/recordings.json"
expect(response.parsed_body["has_more"]).to eq(true)
expect(response.parsed_body["recordings"].size).to eq(1)
- get "/admin/plugins/voice/recordings.json?offset=1"
+ get "/admin/plugins/live/recordings.json?offset=1"
expect(response.parsed_body["has_more"]).to eq(false)
expect(response.parsed_body["recordings"].map { |row| row["egress_id"] }).to eq(["EG_1"])
end
@@ -106,7 +85,7 @@ RSpec.describe Voice::AdminRecordingsController do
it "is not available to regular users" do
sign_in(user)
- get "/admin/plugins/voice/recordings.json"
+ get "/admin/plugins/live/recordings.json"
expect(response.status).to eq(404)
end
diff --git a/plugins/voice/spec/requests/voice/admin_rooms_controller_spec.rb b/plugins/live/spec/requests/live/admin_rooms_controller_spec.rb
similarity index 61%
rename from plugins/voice/spec/requests/voice/admin_rooms_controller_spec.rb
rename to plugins/live/spec/requests/live/admin_rooms_controller_spec.rb
index 71dd12189be..8df13a00958 100644
--- a/plugins/voice/spec/requests/voice/admin_rooms_controller_spec.rb
+++ b/plugins/live/spec/requests/live/admin_rooms_controller_spec.rb
@@ -1,42 +1,26 @@
# frozen_string_literal: true
require "rails_helper"
-require_relative "../../../db/migrate/20241107000000_create_voice_rooms"
-require_relative "../../../db/migrate/20260630183841_add_chat_settings_to_voice_rooms"
-require_relative "../../../db/migrate/20260709165411_add_livekit_enabled_to_voice_rooms"
-
-RSpec.describe Voice::AdminRoomsController do
- before do
- ActiveRecord::Migration.suppress_messages do
- CreateVoiceRooms.new.change unless ActiveRecord::Base.connection.table_exists?(:voice_rooms)
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :chat_channel_id)
- AddChatSettingsToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :livekit_enabled)
- AddLivekitEnabledToVoiceRooms.new.change
- end
- end
- Voice::Room.reset_column_information
- end
+RSpec.describe Live::AdminRoomsController do
fab!(:admin)
fab!(:moderator)
fab!(:user)
- fab!(:room) { Fabricate(:voice_room, creator: admin, public: true, name: "Test Room") }
+ fab!(:room) { Fabricate(:live_room, creator: admin, public: true, name: "Test Room") }
fab!(:channel) { Fabricate(:chat_channel, threading_enabled: true) }
- before { SiteSetting.voice_enabled = true }
+ before { SiteSetting.live_enabled = true }
describe "#index" do
it "returns 403 for non-staff users" do
sign_in(user)
- get "/admin/plugins/voice/rooms.json"
+ get "/admin/plugins/live/rooms.json"
expect(response.status).to eq(404)
end
it "returns rooms for admin users" do
sign_in(admin)
- get "/admin/plugins/voice/rooms.json"
+ get "/admin/plugins/live/rooms.json"
expect(response.status).to eq(200)
expect(response.parsed_body["rooms"]).to be_an(Array)
@@ -47,13 +31,13 @@ RSpec.describe Voice::AdminRoomsController do
describe "#show" do
it "returns 403 for non-staff users" do
sign_in(user)
- get "/admin/plugins/voice/rooms/#{room.id}.json"
+ get "/admin/plugins/live/rooms/#{room.id}.json"
expect(response.status).to eq(404)
end
it "returns room details for admin users" do
sign_in(admin)
- get "/admin/plugins/voice/rooms/#{room.id}.json"
+ get "/admin/plugins/live/rooms/#{room.id}.json"
expect(response.status).to eq(200)
expect(response.parsed_body["room"]["id"]).to eq(room.id)
@@ -65,7 +49,7 @@ RSpec.describe Voice::AdminRoomsController do
room.update!(chat_channel_id: channel.id, chat_idle_minutes: 2)
sign_in(admin)
- get "/admin/plugins/voice/rooms/#{room.id}.json"
+ get "/admin/plugins/live/rooms/#{room.id}.json"
expect(response.status).to eq(200)
expect(response.parsed_body["room"]["chat_channel_id"]).to eq(channel.id)
@@ -74,7 +58,7 @@ RSpec.describe Voice::AdminRoomsController do
it "returns 404 for non-existent room" do
sign_in(admin)
- get "/admin/plugins/voice/rooms/99999.json"
+ get "/admin/plugins/live/rooms/99999.json"
expect(response.status).to eq(404)
end
end
@@ -82,7 +66,7 @@ RSpec.describe Voice::AdminRoomsController do
describe "#create" do
it "returns 403 for non-staff users" do
sign_in(user)
- post "/admin/plugins/voice/rooms.json", params: { room: { name: "New Room" } }
+ post "/admin/plugins/live/rooms.json", params: { room: { name: "New Room" } }
expect(response.status).to eq(404)
end
@@ -90,7 +74,7 @@ RSpec.describe Voice::AdminRoomsController do
sign_in(admin)
expect {
- post "/admin/plugins/voice/rooms.json",
+ post "/admin/plugins/live/rooms.json",
params: {
room: {
name: "New Room",
@@ -99,7 +83,7 @@ RSpec.describe Voice::AdminRoomsController do
max_participants: 10,
},
}
- }.to change { Voice::Room.count }.by(1)
+ }.to change { Live::Room.count }.by(1)
expect(response.status).to eq(201)
expect(response.parsed_body["room"]["name"]).to eq("New Room")
@@ -111,7 +95,7 @@ RSpec.describe Voice::AdminRoomsController do
it "creates a stage room when room_type is stage" do
sign_in(admin)
- post "/admin/plugins/voice/rooms.json",
+ post "/admin/plugins/live/rooms.json",
params: {
room: {
name: "Town Hall",
@@ -121,21 +105,21 @@ RSpec.describe Voice::AdminRoomsController do
expect(response.status).to eq(201)
expect(response.parsed_body["room"]["room_type"]).to eq("stage")
- expect(Voice::Room.find_by(name: "Town Hall").stage?).to eq(true)
+ expect(Live::Room.find_by(name: "Town Hall").stage?).to eq(true)
end
it "rejects an unknown room_type" do
sign_in(admin)
expect {
- post "/admin/plugins/voice/rooms.json",
+ post "/admin/plugins/live/rooms.json",
params: {
room: {
name: "Town Hall",
room_type: "arena",
},
}
- }.not_to change { Voice::Room.count }
+ }.not_to change { Live::Room.count }
expect(response.status).to eq(400)
end
@@ -143,7 +127,7 @@ RSpec.describe Voice::AdminRoomsController do
it "returns errors for invalid data" do
sign_in(admin)
- post "/admin/plugins/voice/rooms.json", params: { room: { name: "" } }
+ post "/admin/plugins/live/rooms.json", params: { room: { name: "" } }
expect(response.status).to eq(422)
expect(response.parsed_body["errors"]).to be_present
@@ -152,7 +136,7 @@ RSpec.describe Voice::AdminRoomsController do
it "validates max_participants range" do
sign_in(admin)
- post "/admin/plugins/voice/rooms.json",
+ post "/admin/plugins/live/rooms.json",
params: {
room: {
name: "New Room",
@@ -167,14 +151,14 @@ RSpec.describe Voice::AdminRoomsController do
describe "#update" do
it "returns 403 for non-staff users" do
sign_in(user)
- put "/admin/plugins/voice/rooms/#{room.id}.json", params: { room: { name: "Updated" } }
+ put "/admin/plugins/live/rooms/#{room.id}.json", params: { room: { name: "Updated" } }
expect(response.status).to eq(404)
end
it "updates a room for admin users" do
sign_in(admin)
- put "/admin/plugins/voice/rooms/#{room.id}.json",
+ put "/admin/plugins/live/rooms/#{room.id}.json",
params: {
room: {
name: "Updated Room",
@@ -193,7 +177,7 @@ RSpec.describe Voice::AdminRoomsController do
it "accepts a slug change" do
sign_in(admin)
- put "/admin/plugins/voice/rooms/#{room.id}.json", params: { room: { slug: "New Hangout" } }
+ put "/admin/plugins/live/rooms/#{room.id}.json", params: { room: { slug: "New Hangout" } }
expect(response.status).to eq(200)
expect(room.reload.slug).to eq("new-hangout")
@@ -202,22 +186,22 @@ RSpec.describe Voice::AdminRoomsController do
it "persists and serializes room_type so the edit form can prefill it" do
sign_in(admin)
- put "/admin/plugins/voice/rooms/#{room.id}.json", params: { room: { room_type: "stage" } }
+ put "/admin/plugins/live/rooms/#{room.id}.json", params: { room: { room_type: "stage" } }
expect(response.status).to eq(200)
expect(response.parsed_body["room"]["room_type"]).to eq("stage")
expect(room.reload.stage?).to eq(true)
- get "/admin/plugins/voice/rooms/#{room.id}.json"
+ get "/admin/plugins/live/rooms/#{room.id}.json"
expect(response.parsed_body["room"]["room_type"]).to eq("stage")
end
it "keeps a stage room's type when an update rejects an unknown room_type" do
sign_in(admin)
- room.update!(room_type: Voice::Room::ROOM_TYPE_STAGE)
+ room.update!(room_type: Live::Room::ROOM_TYPE_STAGE)
- put "/admin/plugins/voice/rooms/#{room.id}.json", params: { room: { room_type: "arena" } }
+ put "/admin/plugins/live/rooms/#{room.id}.json", params: { room: { room_type: "arena" } }
expect(response.status).to eq(400)
expect(room.reload.stage?).to eq(true)
@@ -226,7 +210,7 @@ RSpec.describe Voice::AdminRoomsController do
it "persists and serializes livekit_enabled" do
sign_in(admin)
- put "/admin/plugins/voice/rooms/#{room.id}.json", params: { room: { livekit_enabled: true } }
+ put "/admin/plugins/live/rooms/#{room.id}.json", params: { room: { livekit_enabled: true } }
expect(response.status).to eq(200)
expect(response.parsed_body["room"]["livekit_enabled"]).to eq(true)
@@ -236,7 +220,7 @@ RSpec.describe Voice::AdminRoomsController do
it "persists the chat settings fields" do
sign_in(admin)
- put "/admin/plugins/voice/rooms/#{room.id}.json",
+ put "/admin/plugins/live/rooms/#{room.id}.json",
params: {
room: {
chat_channel_id: channel.id,
@@ -255,14 +239,14 @@ RSpec.describe Voice::AdminRoomsController do
it "returns 404 for non-existent room" do
sign_in(admin)
- put "/admin/plugins/voice/rooms/99999.json", params: { room: { name: "Updated" } }
+ put "/admin/plugins/live/rooms/99999.json", params: { room: { name: "Updated" } }
expect(response.status).to eq(404)
end
it "returns errors for invalid data" do
sign_in(admin)
- put "/admin/plugins/voice/rooms/#{room.id}.json", params: { room: { name: "" } }
+ put "/admin/plugins/live/rooms/#{room.id}.json", params: { room: { name: "" } }
expect(response.status).to eq(422)
end
@@ -271,26 +255,26 @@ RSpec.describe Voice::AdminRoomsController do
describe "#destroy" do
it "returns 403 for non-staff users" do
sign_in(user)
- delete "/admin/plugins/voice/rooms/#{room.id}.json"
+ delete "/admin/plugins/live/rooms/#{room.id}.json"
expect(response.status).to eq(404)
end
it "deletes a room for admin users" do
sign_in(admin)
- expect { delete "/admin/plugins/voice/rooms/#{room.id}.json" }.to change {
- Voice::Room.count
+ expect { delete "/admin/plugins/live/rooms/#{room.id}.json" }.to change {
+ Live::Room.count
}.by(-1)
expect(response.status).to eq(204)
end
it "deletes a room that has session history and keeps the sessions" do
- session = Fabricate(:voice_session, user: user, room: room)
+ session = Fabricate(:live_session, user: user, room: room)
sign_in(admin)
- expect { delete "/admin/plugins/voice/rooms/#{room.id}.json" }.to change {
- Voice::Room.count
+ expect { delete "/admin/plugins/live/rooms/#{room.id}.json" }.to change {
+ Live::Room.count
}.by(-1)
expect(response.status).to eq(204)
@@ -299,23 +283,23 @@ RSpec.describe Voice::AdminRoomsController do
it "returns 404 for non-existent room" do
sign_in(admin)
- delete "/admin/plugins/voice/rooms/99999.json"
+ delete "/admin/plugins/live/rooms/99999.json"
expect(response.status).to eq(404)
end
it "deletes a livekit-pinned room from the SFU and clears the pin" do
sign_in(admin)
- SiteSetting.voice_livekit_url = "wss://livekit.example.com"
- SiteSetting.voice_livekit_api_key = "lk_api_key"
- SiteSetting.voice_livekit_api_secret = "lk_api_secret"
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
+ SiteSetting.live_livekit_url = "wss://livekit.example.com"
+ SiteSetting.live_livekit_api_key = "lk_api_key"
+ SiteSetting.live_livekit_api_secret = "lk_api_secret"
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
stub = stub_request(:post, "https://livekit.example.com/twirp/livekit.RoomService/DeleteRoom")
- delete "/admin/plugins/voice/rooms/#{room.id}.json"
+ delete "/admin/plugins/live/rooms/#{room.id}.json"
expect(response.status).to eq(204)
expect(stub).to have_been_requested
- expect(Voice::ParticipantTracker.pinned_transport(room.id)).to be_nil
+ expect(Live::ParticipantTracker.pinned_transport(room.id)).to be_nil
end
end
@@ -324,77 +308,77 @@ RSpec.describe Voice::AdminRoomsController do
fab!(:other_participant, :user)
before do
- Voice::ParticipantTracker.add(room.id, participant.id)
- Voice::ParticipantTracker.add(room.id, other_participant.id)
+ Live::ParticipantTracker.add(room.id, participant.id)
+ Live::ParticipantTracker.add(room.id, other_participant.id)
end
- after { Voice::ParticipantTracker.clear(room.id) }
+ after { Live::ParticipantTracker.clear(room.id) }
it "returns 404 for non-staff users" do
sign_in(user)
- post "/admin/plugins/voice/rooms/#{room.id}/end_call.json"
+ post "/admin/plugins/live/rooms/#{room.id}/end_call.json"
expect(response.status).to eq(404)
end
it "returns 404 for non-existent room" do
sign_in(admin)
- post "/admin/plugins/voice/rooms/99999/end_call.json"
+ post "/admin/plugins/live/rooms/99999/end_call.json"
expect(response.status).to eq(404)
end
it "kicks every participant and clears the transport pin" do
sign_in(admin)
- Voice::ParticipantTracker.pin_transport!(room.id, "mesh")
+ Live::ParticipantTracker.pin_transport!(room.id, "mesh")
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) do
- post "/admin/plugins/voice/rooms/#{room.id}/end_call.json"
+ MessageBus.track_publish(Live.room_channel(room.id)) do
+ post "/admin/plugins/live/rooms/#{room.id}/end_call.json"
end
expect(response.status).to eq(204)
kicks = messages.select { |message| message.data[:type] == "kicked" }
expect(kicks.map(&:user_ids)).to contain_exactly([participant.id], [other_participant.id])
- expect(Voice::ParticipantTracker.pinned_transport(room.id)).to be_nil
+ expect(Live::ParticipantTracker.pinned_transport(room.id)).to be_nil
end
it "also deletes the SFU room when the call is pinned to livekit" do
sign_in(admin)
- SiteSetting.voice_livekit_url = "wss://livekit.example.com"
- SiteSetting.voice_livekit_api_key = "lk_api_key"
- SiteSetting.voice_livekit_api_secret = "lk_api_secret"
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
+ SiteSetting.live_livekit_url = "wss://livekit.example.com"
+ SiteSetting.live_livekit_api_key = "lk_api_key"
+ SiteSetting.live_livekit_api_secret = "lk_api_secret"
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
stub =
stub_request(
:post,
"https://livekit.example.com/twirp/livekit.RoomService/DeleteRoom",
- ).with(body: { room: Voice::Livekit.room_name(room) }.to_json)
+ ).with(body: { room: Live::Livekit.room_name(room) }.to_json)
- post "/admin/plugins/voice/rooms/#{room.id}/end_call.json"
+ post "/admin/plugins/live/rooms/#{room.id}/end_call.json"
expect(response.status).to eq(204)
expect(stub).to have_been_requested
- expect(Voice::ParticipantTracker.pinned_transport(room.id)).to be_nil
+ expect(Live::ParticipantTracker.pinned_transport(room.id)).to be_nil
end
it "still ends the call when LiveKit is down" do
sign_in(admin)
- SiteSetting.voice_livekit_url = "wss://livekit.example.com"
- SiteSetting.voice_livekit_api_key = "lk_api_key"
- SiteSetting.voice_livekit_api_secret = "lk_api_secret"
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
+ SiteSetting.live_livekit_url = "wss://livekit.example.com"
+ SiteSetting.live_livekit_api_key = "lk_api_key"
+ SiteSetting.live_livekit_api_secret = "lk_api_secret"
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
stub_request(
:post,
"https://livekit.example.com/twirp/livekit.RoomService/DeleteRoom",
).to_timeout
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) do
- post "/admin/plugins/voice/rooms/#{room.id}/end_call.json"
+ MessageBus.track_publish(Live.room_channel(room.id)) do
+ post "/admin/plugins/live/rooms/#{room.id}/end_call.json"
end
expect(response.status).to eq(204)
expect(messages.count { |message| message.data[:type] == "kicked" }).to eq(2)
- expect(Voice::ParticipantTracker.pinned_transport(room.id)).to be_nil
+ expect(Live::ParticipantTracker.pinned_transport(room.id)).to be_nil
end
end
end
diff --git a/plugins/voice/spec/requests/voice/admin_stats_controller_spec.rb b/plugins/live/spec/requests/live/admin_stats_controller_spec.rb
similarity index 70%
rename from plugins/voice/spec/requests/voice/admin_stats_controller_spec.rb
rename to plugins/live/spec/requests/live/admin_stats_controller_spec.rb
index a34422e9b91..608a020db3e 100644
--- a/plugins/voice/spec/requests/voice/admin_stats_controller_spec.rb
+++ b/plugins/live/spec/requests/live/admin_stats_controller_spec.rb
@@ -1,23 +1,23 @@
# frozen_string_literal: true
-RSpec.describe Voice::AdminStatsController do
+RSpec.describe Live::AdminStatsController do
fab!(:admin)
fab!(:user)
- fab!(:room) { Fabricate(:voice_room, creator: admin, name: "Watercooler") }
- fab!(:room_2, :voice_room) { Fabricate(:voice_room, creator: admin, name: "Lounge") }
+ fab!(:room) { Fabricate(:live_room, creator: admin, name: "Watercooler") }
+ fab!(:room_2, :live_room) { Fabricate(:live_room, creator: admin, name: "Lounge") }
- before { SiteSetting.voice_enabled = true }
+ before { SiteSetting.live_enabled = true }
describe "#overview" do
it "rejects non-admin users" do
sign_in(user)
- get "/admin/plugins/voice/stats/overview.json"
+ get "/admin/plugins/live/stats/overview.json"
expect(response.status).to eq(404)
end
it "returns zeroes when there are no sessions" do
sign_in(admin)
- get "/admin/plugins/voice/stats/overview.json", params: { period: "weekly" }
+ get "/admin/plugins/live/stats/overview.json", params: { period: "weekly" }
expect(response.status).to eq(200)
body = response.parsed_body
@@ -27,17 +27,11 @@ RSpec.describe Voice::AdminStatsController do
end
it "returns aggregated stats for sessions in the period" do
- Fabricate(
- :voice_session,
- user: admin,
- room: room,
- joined_at: 2.hours.ago,
- left_at: 1.hour.ago,
- )
- Fabricate(:voice_session, user: user, room: room, joined_at: 3.hours.ago, left_at: 1.hour.ago)
+ Fabricate(:live_session, user: admin, room: room, joined_at: 2.hours.ago, left_at: 1.hour.ago)
+ Fabricate(:live_session, user: user, room: room, joined_at: 3.hours.ago, left_at: 1.hour.ago)
sign_in(admin)
- get "/admin/plugins/voice/stats/overview.json", params: { period: "weekly" }
+ get "/admin/plugins/live/stats/overview.json", params: { period: "weekly" }
expect(response.status).to eq(200)
body = response.parsed_body
@@ -48,7 +42,7 @@ RSpec.describe Voice::AdminStatsController do
it "excludes sessions outside the period" do
Fabricate(
- :voice_session,
+ :live_session,
user: admin,
room: room,
joined_at: 10.days.ago,
@@ -56,14 +50,14 @@ RSpec.describe Voice::AdminStatsController do
)
sign_in(admin)
- get "/admin/plugins/voice/stats/overview.json", params: { period: "weekly" }
+ get "/admin/plugins/live/stats/overview.json", params: { period: "weekly" }
expect(response.parsed_body["total_sessions"]).to eq(0)
end
it "defaults to 7 days for invalid period" do
Fabricate(
- :voice_session,
+ :live_session,
user: admin,
room: room,
joined_at: 2.days.ago,
@@ -71,7 +65,7 @@ RSpec.describe Voice::AdminStatsController do
)
sign_in(admin)
- get "/admin/plugins/voice/stats/overview.json", params: { period: "bogus" }
+ get "/admin/plugins/live/stats/overview.json", params: { period: "bogus" }
expect(response.status).to eq(200)
expect(response.parsed_body["total_sessions"]).to eq(1)
@@ -79,14 +73,14 @@ RSpec.describe Voice::AdminStatsController do
it "supports custom date ranges" do
Fabricate(
- :voice_session,
+ :live_session,
user: admin,
room: room,
joined_at: 20.days.ago,
left_at: 20.days.ago + 1.hour,
)
Fabricate(
- :voice_session,
+ :live_session,
user: user,
room: room,
joined_at: 2.days.ago,
@@ -94,7 +88,7 @@ RSpec.describe Voice::AdminStatsController do
)
sign_in(admin)
- get "/admin/plugins/voice/stats/overview.json",
+ get "/admin/plugins/live/stats/overview.json",
params: {
period: "custom",
start_date: 25.days.ago.to_date.to_s,
@@ -110,20 +104,14 @@ RSpec.describe Voice::AdminStatsController do
describe "#rooms" do
it "rejects non-admin users" do
sign_in(user)
- get "/admin/plugins/voice/stats/rooms.json"
+ get "/admin/plugins/live/stats/rooms.json"
expect(response.status).to eq(404)
end
it "returns rooms ranked by total time" do
+ Fabricate(:live_session, user: admin, room: room, joined_at: 3.hours.ago, left_at: 1.hour.ago)
Fabricate(
- :voice_session,
- user: admin,
- room: room,
- joined_at: 3.hours.ago,
- left_at: 1.hour.ago,
- )
- Fabricate(
- :voice_session,
+ :live_session,
user: user,
room: room_2,
joined_at: 2.hours.ago,
@@ -131,7 +119,7 @@ RSpec.describe Voice::AdminStatsController do
)
sign_in(admin)
- get "/admin/plugins/voice/stats/rooms.json", params: { period: "weekly" }
+ get "/admin/plugins/live/stats/rooms.json", params: { period: "weekly" }
expect(response.status).to eq(200)
rooms = response.parsed_body["rooms"]
@@ -142,9 +130,9 @@ RSpec.describe Voice::AdminStatsController do
end
it "keeps sessions of deleted rooms in the ranking with a null name" do
- doomed_room = Fabricate(:voice_room, creator: admin, name: "Doomed")
+ doomed_room = Fabricate(:live_room, creator: admin, name: "Doomed")
Fabricate(
- :voice_session,
+ :live_session,
user: user,
room: doomed_room,
joined_at: 2.hours.ago,
@@ -153,7 +141,7 @@ RSpec.describe Voice::AdminStatsController do
doomed_room.destroy!
sign_in(admin)
- get "/admin/plugins/voice/stats/rooms.json", params: { period: "weekly" }
+ get "/admin/plugins/live/stats/rooms.json", params: { period: "weekly" }
expect(response.status).to eq(200)
deleted_row = response.parsed_body["rooms"].find { |r| r["room_id"] == doomed_room.id }
@@ -166,20 +154,14 @@ RSpec.describe Voice::AdminStatsController do
describe "#users" do
it "rejects non-admin users" do
sign_in(user)
- get "/admin/plugins/voice/stats/users.json"
+ get "/admin/plugins/live/stats/users.json"
expect(response.status).to eq(404)
end
it "returns users ranked by total time" do
+ Fabricate(:live_session, user: admin, room: room, joined_at: 4.hours.ago, left_at: 1.hour.ago)
Fabricate(
- :voice_session,
- user: admin,
- room: room,
- joined_at: 4.hours.ago,
- left_at: 1.hour.ago,
- )
- Fabricate(
- :voice_session,
+ :live_session,
user: user,
room: room,
joined_at: 2.hours.ago,
@@ -187,7 +169,7 @@ RSpec.describe Voice::AdminStatsController do
)
sign_in(admin)
- get "/admin/plugins/voice/stats/users.json", params: { period: "weekly" }
+ get "/admin/plugins/live/stats/users.json", params: { period: "weekly" }
expect(response.status).to eq(200)
users = response.parsed_body["users"]
@@ -201,7 +183,7 @@ RSpec.describe Voice::AdminStatsController do
it "keeps sessions of deleted users in the ranking with a null username" do
doomed_user = Fabricate(:user)
Fabricate(
- :voice_session,
+ :live_session,
user: doomed_user,
room: room,
joined_at: 2.hours.ago,
@@ -210,7 +192,7 @@ RSpec.describe Voice::AdminStatsController do
UserDestroyer.new(admin).destroy(doomed_user)
sign_in(admin)
- get "/admin/plugins/voice/stats/users.json", params: { period: "weekly" }
+ get "/admin/plugins/live/stats/users.json", params: { period: "weekly" }
expect(response.status).to eq(200)
deleted_row = response.parsed_body["users"].find { |u| u["user_id"] == doomed_user.id }
diff --git a/plugins/voice/spec/requests/voice/agents_controller_spec.rb b/plugins/live/spec/requests/live/agents_controller_spec.rb
similarity index 69%
rename from plugins/voice/spec/requests/voice/agents_controller_spec.rb
rename to plugins/live/spec/requests/live/agents_controller_spec.rb
index 7b2e827d8cb..3d92e389dde 100644
--- a/plugins/voice/spec/requests/voice/agents_controller_spec.rb
+++ b/plugins/live/spec/requests/live/agents_controller_spec.rb
@@ -2,18 +2,18 @@
require "rails_helper"
-RSpec.describe Voice::AgentsController do
+RSpec.describe Live::AgentsController do
fab!(:admin)
fab!(:moderator)
fab!(:user) { Fabricate(:user, refresh_auto_groups: true) }
before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_livekit_url = "wss://test.livekit.cloud"
- SiteSetting.voice_livekit_api_key = "key"
- SiteSetting.voice_livekit_api_secret = "secret"
- SiteSetting.voice_livekit_agent_enabled = true
- Voice::Livekit::CloudAgentClient.clear_cache!
+ SiteSetting.live_enabled = true
+ SiteSetting.live_livekit_url = "wss://test.livekit.cloud"
+ SiteSetting.live_livekit_api_key = "key"
+ SiteSetting.live_livekit_api_secret = "secret"
+ SiteSetting.live_livekit_agent_enabled = true
+ Live::Livekit::CloudAgentClient.clear_cache!
@catalogue = { "CA_2" => "support", "CA_1" => "assistant", "CA_3" => "" }
@list =
stub_request(
@@ -33,11 +33,11 @@ RSpec.describe Voice::AgentsController do
describe "#index" do
it "lists the named deployed agents for a member of the invite groups" do
- SiteSetting.voice_livekit_agent_invite_allowed_groups =
+ SiteSetting.live_livekit_agent_invite_allowed_groups =
"#{Group::AUTO_GROUPS[:admins]}|#{Group::AUTO_GROUPS[:moderators]}"
sign_in(moderator)
- get "/voice/agents.json"
+ get "/live/agents.json"
expect(response.status).to eq(200)
expect(response.parsed_body["agents"]).to eq(
@@ -48,17 +48,17 @@ RSpec.describe Voice::AgentsController do
it "rejects users outside the invite groups" do
sign_in(moderator)
- get "/voice/agents.json"
+ get "/live/agents.json"
expect(response.status).to eq(403)
expect(@list).not_to have_been_requested
end
it "rejects requests while the agent feature is disabled" do
- SiteSetting.voice_livekit_agent_enabled = false
+ SiteSetting.live_livekit_agent_enabled = false
sign_in(admin)
- get "/voice/agents.json"
+ get "/live/agents.json"
expect(response.status).to eq(403)
expect(@list).not_to have_been_requested
@@ -66,13 +66,13 @@ RSpec.describe Voice::AgentsController do
it "re-reads the catalogue when asked to refresh" do
sign_in(admin)
- get "/voice/agents.json"
+ get "/live/agents.json"
@catalogue["CA_4"] = "trainer"
- get "/voice/agents.json"
+ get "/live/agents.json"
expect(response.parsed_body["agents"].map { |a| a["name"] }).to eq(%w[assistant support])
- get "/voice/agents.json", params: { refresh: true }
+ get "/live/agents.json", params: { refresh: true }
expect(response.parsed_body["agents"].map { |a| a["name"] }).to eq(
%w[assistant support trainer],
)
@@ -80,15 +80,15 @@ RSpec.describe Voice::AgentsController do
it "rate limits refreshes for non-staff inviters" do
RateLimiter.enable
- SiteSetting.voice_livekit_agent_invite_allowed_groups =
+ SiteSetting.live_livekit_agent_invite_allowed_groups =
"#{Group::AUTO_GROUPS[:admins]}|#{Group::AUTO_GROUPS[:trust_level_1]}"
sign_in(user)
- 6.times { RateLimiter.new(user, "voice-agent-list-refresh", 6, 1.minute).performed! }
+ 6.times { RateLimiter.new(user, "live-agent-list-refresh", 6, 1.minute).performed! }
- get "/voice/agents.json", params: { refresh: true }
+ get "/live/agents.json", params: { refresh: true }
expect(response.status).to eq(429)
- get "/voice/agents.json"
+ get "/live/agents.json"
expect(response.status).to eq(200)
end
@@ -99,10 +99,10 @@ RSpec.describe Voice::AgentsController do
).to_return(status: 503)
sign_in(admin)
- get "/voice/agents.json"
+ get "/live/agents.json"
expect(response.status).to eq(503)
- expect(response.parsed_body["errors"]).to eq([I18n.t("voice.errors.agent_list_failed")])
+ expect(response.parsed_body["errors"]).to eq([I18n.t("live.errors.agent_list_failed")])
end
end
end
diff --git a/plugins/voice/spec/requests/voice/calls_controller_spec.rb b/plugins/live/spec/requests/live/calls_controller_spec.rb
similarity index 60%
rename from plugins/voice/spec/requests/voice/calls_controller_spec.rb
rename to plugins/live/spec/requests/live/calls_controller_spec.rb
index 764dc8ceae1..f00c67618f5 100644
--- a/plugins/voice/spec/requests/voice/calls_controller_spec.rb
+++ b/plugins/live/spec/requests/live/calls_controller_spec.rb
@@ -1,14 +1,14 @@
# frozen_string_literal: true
-RSpec.describe Voice::CallsController do
+RSpec.describe Live::CallsController do
fab!(:caller) { Fabricate(:user, trust_level: TrustLevel[2]) }
fab!(:callee) { Fabricate(:user, trust_level: TrustLevel[2]) }
before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_allowed_groups =
+ SiteSetting.live_enabled = true
+ SiteSetting.live_allowed_groups =
"#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
- SiteSetting.voice_direct_calls_allowed_groups = Group::AUTO_GROUPS[:trust_level_2]
+ SiteSetting.live_direct_calls_allowed_groups = Group::AUTO_GROUPS[:trust_level_2]
end
describe "#create" do
@@ -16,17 +16,17 @@ RSpec.describe Voice::CallsController do
sign_in(caller)
messages =
- MessageBus.track_publish { post "/voice/calls.json", params: { username: callee.username } }
+ MessageBus.track_publish { post "/live/calls.json", params: { username: callee.username } }
alert_messages = messages.select { |m| m.channel == "/notification-alert/#{callee.id}" }
- ring_messages = messages.select { |m| m.channel == "/voice/call-ring/#{callee.id}" }
+ ring_messages = messages.select { |m| m.channel == "/live/call-ring/#{callee.id}" }
expect(response.status).to eq(200)
- room = Voice::Room.find(response.parsed_body["room"]["id"])
+ room = Live::Room.find(response.parsed_body["room"]["id"])
expect(room.ephemeral).to eq(true)
expect(room.public).to eq(false)
expect(room.name).to eq(
- I18n.t("voice.call.room_name", caller: caller.username, callee: callee.username),
+ I18n.t("live.call.room_name", caller: caller.username, callee: callee.username),
)
expect(room.moderator_ids).to contain_exactly(caller.id, callee.id)
@@ -34,11 +34,11 @@ RSpec.describe Voice::CallsController do
expect(ringing.map { |entry| entry["user"]["id"] }).to contain_exactly(callee.id)
expect(ringing.first["notified_at"]).to be_within(5).of(Time.current.to_i)
- invite = Voice::Invite.find_by(room_id: room.id, user_id: callee.id)
+ invite = Live::Invite.find_by(room_id: room.id, user_id: callee.id)
expect(invite.invited_by_id).to eq(caller.id)
notification = callee.notifications.order(:id).last
- expect(notification.notification_type).to eq(Notification.types[:voice_invitation])
+ expect(notification.notification_type).to eq(Notification.types[:live_invitation])
data = JSON.parse(notification.data)
expect(data["call"]).to eq(true)
expect(data["room_slug"]).to eq(room.slug)
@@ -46,7 +46,7 @@ RSpec.describe Voice::CallsController do
expect(alert_messages.size).to eq(1)
expect(alert_messages.first.data[:translated_title]).to eq(
- I18n.t("voice.call_notification.title", username: caller.username),
+ I18n.t("live.call_notification.title", username: caller.username),
)
expect(ring_messages.size).to eq(1)
@@ -55,12 +55,12 @@ RSpec.describe Voice::CallsController do
expect(ring.data[:room_id]).to eq(room.id)
expect(ring.data[:room_slug]).to eq(room.slug)
expect(ring.data[:caller_username]).to eq(caller.username)
- expect(ring.data[:ring_seconds]).to eq(Voice::RoomInviter::RING_SECONDS)
+ expect(ring.data[:ring_seconds]).to eq(Live::RoomInviter::RING_SECONDS)
expect(ring.data[:sent_at]).to be_within(5).of(Time.current.to_i)
ringing_event =
messages.find do |message|
- message.channel == "/voice/rooms/#{room.id}" && message.data[:type] == "ringing"
+ message.channel == "/live/rooms/#{room.id}" && message.data[:type] == "ringing"
end
expect(ringing_event).to be_present
expect(ringing_event.data[:user][:id]).to eq(callee.id)
@@ -70,40 +70,40 @@ RSpec.describe Voice::CallsController do
it "gives the callee a peer's powers: joining and pulling others into the call" do
sign_in(caller)
- post "/voice/calls.json", params: { username: callee.username }
+ post "/live/calls.json", params: { username: callee.username }
- room = Voice::Room.find(response.parsed_body["room"]["id"])
- expect(callee.guardian.can_join_voice_room?(room)).to eq(true)
- expect(callee.guardian.can_invite_to_voice_room?(room)).to eq(true)
+ room = Live::Room.find(response.parsed_body["room"]["id"])
+ expect(callee.guardian.can_join_live_room?(room)).to eq(true)
+ expect(callee.guardian.can_invite_to_live_room?(room)).to eq(true)
end
it "returns 404 for an unknown username" do
sign_in(caller)
- post "/voice/calls.json", params: { username: "no-such-user" }
+ post "/live/calls.json", params: { username: "no-such-user" }
expect(response.status).to eq(404)
- expect(Voice::Room.ephemeral.count).to eq(0)
+ expect(Live::Room.ephemeral.count).to eq(0)
end
it "rejects calling yourself" do
sign_in(caller)
- post "/voice/calls.json", params: { username: caller.username }
+ post "/live/calls.json", params: { username: caller.username }
expect(response.status).to eq(400)
- expect(Voice::Room.ephemeral.count).to eq(0)
+ expect(Live::Room.ephemeral.count).to eq(0)
end
it "rejects a callee outside the allowed groups" do
- SiteSetting.voice_allowed_groups = Group::AUTO_GROUPS[:trust_level_2]
+ SiteSetting.live_allowed_groups = Group::AUTO_GROUPS[:trust_level_2]
outsider = Fabricate(:user, trust_level: TrustLevel[0])
sign_in(caller)
- post "/voice/calls.json", params: { username: outsider.username }
+ post "/live/calls.json", params: { username: outsider.username }
expect(response.status).to eq(400)
- expect(Voice::Room.ephemeral.count).to eq(0)
+ expect(Live::Room.ephemeral.count).to eq(0)
end
context "when the callee's preferences screen out the caller" do
@@ -112,11 +112,11 @@ RSpec.describe Voice::CallsController do
it "returns 403 when the callee has muted the caller" do
MutedUser.create!(user_id: callee.id, muted_user_id: caller.id)
- post "/voice/calls.json", params: { username: callee.username }
+ post "/live/calls.json", params: { username: callee.username }
expect(response.status).to eq(403)
- expect(response.parsed_body["errors"]).to include(I18n.t("voice.errors.cannot_call_user"))
- expect(Voice::Room.ephemeral.count).to eq(0)
+ expect(response.parsed_body["errors"]).to include(I18n.t("live.errors.cannot_call_user"))
+ expect(Live::Room.ephemeral.count).to eq(0)
expect(callee.notifications.count).to eq(0)
end
@@ -127,38 +127,38 @@ RSpec.describe Voice::CallsController do
expiring_at: 1.day.from_now,
)
- post "/voice/calls.json", params: { username: callee.username }
+ post "/live/calls.json", params: { username: callee.username }
expect(response.status).to eq(403)
- expect(Voice::Room.ephemeral.count).to eq(0)
+ expect(Live::Room.ephemeral.count).to eq(0)
end
it "returns 403 when the callee does not accept personal messages" do
callee.user_option.update!(allow_private_messages: false)
- post "/voice/calls.json", params: { username: callee.username }
+ post "/live/calls.json", params: { username: callee.username }
expect(response.status).to eq(403)
- expect(Voice::Room.ephemeral.count).to eq(0)
+ expect(Live::Room.ephemeral.count).to eq(0)
end
it "returns 403 when the callee only accepts personal messages from a list that omits the caller" do
callee.user_option.update!(enable_allowed_pm_users: true)
- post "/voice/calls.json", params: { username: callee.username }
+ post "/live/calls.json", params: { username: callee.username }
expect(response.status).to eq(403)
- expect(Voice::Room.ephemeral.count).to eq(0)
+ expect(Live::Room.ephemeral.count).to eq(0)
end
it "connects the call when the caller is on the callee's allowed list" do
callee.user_option.update!(enable_allowed_pm_users: true)
AllowedPmUser.create!(user: callee, allowed_pm_user: caller)
- post "/voice/calls.json", params: { username: callee.username }
+ post "/live/calls.json", params: { username: callee.username }
expect(response.status).to eq(200)
- expect(Voice::Room.ephemeral.count).to eq(1)
+ expect(Live::Room.ephemeral.count).to eq(1)
end
end
@@ -167,10 +167,10 @@ RSpec.describe Voice::CallsController do
sign_in(caller)
messages =
- MessageBus.track_publish { post "/voice/calls.json", params: { username: callee.username } }
+ MessageBus.track_publish { post "/live/calls.json", params: { username: callee.username } }
expect(response.status).to eq(200)
- expect(messages.map(&:channel)).not_to include("/voice/call-ring/#{callee.id}")
+ expect(messages.map(&:channel)).not_to include("/live/call-ring/#{callee.id}")
# The caller still sees a normal outgoing ring so do-not-disturb status
# is not revealed; the call simply goes unanswered.
@@ -178,45 +178,45 @@ RSpec.describe Voice::CallsController do
expect(ringing.map { |entry| entry["user"]["id"] }).to contain_exactly(callee.id)
notification = callee.notifications.order(:id).last
- expect(notification.notification_type).to eq(Notification.types[:voice_invitation])
+ expect(notification.notification_type).to eq(Notification.types[:live_invitation])
end
it "lets staff call a user whose preferences would screen out other callers" do
- SiteSetting.voice_direct_calls_allowed_groups = Group::AUTO_GROUPS[:staff]
+ SiteSetting.live_direct_calls_allowed_groups = Group::AUTO_GROUPS[:staff]
admin = Fabricate(:admin)
MutedUser.create!(user_id: callee.id, muted_user_id: admin.id)
callee.user_option.update!(allow_private_messages: false)
sign_in(admin)
- post "/voice/calls.json", params: { username: callee.username }
+ post "/live/calls.json", params: { username: callee.username }
expect(response.status).to eq(200)
expect(callee.notifications.count).to eq(1)
end
it "returns 403 when the caller is outside the direct-call groups (the default)" do
- SiteSetting.voice_direct_calls_allowed_groups = ""
+ SiteSetting.live_direct_calls_allowed_groups = ""
sign_in(caller)
- post "/voice/calls.json", params: { username: callee.username }
+ post "/live/calls.json", params: { username: callee.username }
expect(response.status).to eq(403)
- expect(Voice::Room.ephemeral.count).to eq(0)
+ expect(Live::Room.ephemeral.count).to eq(0)
end
- it "returns 403 when the caller lacks voice-room access" do
- SiteSetting.voice_allowed_groups = Group::AUTO_GROUPS[:trust_level_2]
+ it "returns 403 when the caller lacks live-room access" do
+ SiteSetting.live_allowed_groups = Group::AUTO_GROUPS[:trust_level_2]
outsider = Fabricate(:user, trust_level: TrustLevel[0])
sign_in(outsider)
- post "/voice/calls.json", params: { username: callee.username }
+ post "/live/calls.json", params: { username: callee.username }
expect(response.status).to eq(403)
- expect(Voice::Room.ephemeral.count).to eq(0)
+ expect(Live::Room.ephemeral.count).to eq(0)
end
it "requires a logged-in user" do
- post "/voice/calls.json", params: { username: callee.username }
+ post "/live/calls.json", params: { username: callee.username }
expect(response.status).to eq(403)
end
@@ -228,37 +228,37 @@ RSpec.describe Voice::CallsController do
end
it "creates no ephemeral room once the daily invite budget is exhausted" do
- SiteSetting.voice_max_invites_per_day = 1
- RateLimiter.new(caller, "voice-invites-daily", 1, 1.day).performed!
+ SiteSetting.live_max_invites_per_day = 1
+ RateLimiter.new(caller, "live-invites-daily", 1, 1.day).performed!
- post "/voice/calls.json", params: { username: callee.username }
+ post "/live/calls.json", params: { username: callee.username }
expect(response.status).to eq(429)
- expect(Voice::Room.ephemeral.count).to eq(0)
+ expect(Live::Room.ephemeral.count).to eq(0)
expect(callee.notifications.count).to eq(0)
end
it "destroys the room instead of orphaning it when the ring fails" do
- allow(Voice::RoomInviter).to receive(:invite!).and_raise(
- RateLimiter::LimitExceeded.new(10, "voice-invites-daily"),
+ allow(Live::RoomInviter).to receive(:invite!).and_raise(
+ RateLimiter::LimitExceeded.new(10, "live-invites-daily"),
)
- post "/voice/calls.json", params: { username: callee.username }
+ post "/live/calls.json", params: { username: callee.username }
expect(response.status).to eq(429)
- expect(Voice::Room.ephemeral.count).to eq(0)
+ expect(Live::Room.ephemeral.count).to eq(0)
end
end
it "rejects the call when the caller has too many live ephemeral rooms" do
- stub_const(Voice::EphemeralRoomManager, :MAX_LIVE_ROOMS_PER_CREATOR, 1) do
- Voice::EphemeralRoomManager.create!(creator: caller, name: "Ongoing call")
+ stub_const(Live::EphemeralRoomManager, :MAX_LIVE_ROOMS_PER_CREATOR, 1) do
+ Live::EphemeralRoomManager.create!(creator: caller, name: "Ongoing call")
sign_in(caller)
- post "/voice/calls.json", params: { username: callee.username }
+ post "/live/calls.json", params: { username: callee.username }
expect(response.status).to eq(403)
- expect(Voice::Room.ephemeral.count).to eq(1)
+ expect(Live::Room.ephemeral.count).to eq(1)
end
end
end
diff --git a/plugins/voice/spec/requests/voice/chat_threads_controller_spec.rb b/plugins/live/spec/requests/live/chat_threads_controller_spec.rb
similarity index 62%
rename from plugins/voice/spec/requests/voice/chat_threads_controller_spec.rb
rename to plugins/live/spec/requests/live/chat_threads_controller_spec.rb
index 0dcafe6c6cc..b1491fd0917 100644
--- a/plugins/voice/spec/requests/voice/chat_threads_controller_spec.rb
+++ b/plugins/live/spec/requests/live/chat_threads_controller_spec.rb
@@ -1,45 +1,29 @@
# frozen_string_literal: true
require "rails_helper"
-require_relative "../../../db/migrate/20241107000000_create_voice_rooms"
-require_relative "../../../db/migrate/20260612135211_add_video_enabled_to_voice_rooms"
-require_relative "../../../db/migrate/20260630183841_add_chat_settings_to_voice_rooms"
-
-RSpec.describe Voice::ChatThreadsController do
- before do
- ActiveRecord::Migration.suppress_messages do
- CreateVoiceRooms.new.change unless ActiveRecord::Base.connection.table_exists?(:voice_rooms)
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :video_enabled)
- AddVideoEnabledToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :chat_channel_id)
- AddChatSettingsToVoiceRooms.new.change
- end
- end
- Voice::Room.reset_column_information
- end
+RSpec.describe Live::ChatThreadsController do
fab!(:user) { Fabricate(:user, trust_level: TrustLevel[2]) }
fab!(:channel) { Fabricate(:chat_channel, threading_enabled: true) }
- fab!(:room) { Fabricate(:voice_room, public: true, chat_channel_id: channel.id) }
+ fab!(:room) { Fabricate(:live_room, public: true, chat_channel_id: channel.id) }
fab!(:thread) { Fabricate(:chat_thread, channel: channel) }
before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_chat_enabled = true
+ SiteSetting.live_enabled = true
+ SiteSetting.live_chat_enabled = true
SiteSetting.chat_enabled = true
- SiteSetting.voice_allowed_groups =
+ SiteSetting.live_allowed_groups =
"#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
SiteSetting.chat_allowed_groups =
"#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
# Keep the signed-in user a plain member — not a global room manager — so
# room visibility is decided by membership, not the create-room privilege.
- SiteSetting.voice_create_room_allowed_groups = Group::AUTO_GROUPS[:trust_level_4].to_s
+ SiteSetting.live_create_room_allowed_groups = Group::AUTO_GROUPS[:trust_level_4].to_s
end
- def mark(chat_thread, voice_room)
- chat_thread.upsert_custom_fields(Voice::THREAD_ROOM_ID_FIELD => voice_room.id)
+ def mark(chat_thread, live_room)
+ chat_thread.upsert_custom_fields(Live::THREAD_ROOM_ID_FIELD => live_room.id)
chat_thread
end
@@ -47,7 +31,7 @@ RSpec.describe Voice::ChatThreadsController do
it "requires authentication" do
mark(thread, room)
- get "/voice/chat_threads/#{thread.id}.json"
+ get "/live/chat_threads/#{thread.id}.json"
expect(response.status).to eq(403)
end
@@ -58,7 +42,7 @@ RSpec.describe Voice::ChatThreadsController do
it "returns the room behind a marked, visible session thread" do
mark(thread, room)
- get "/voice/chat_threads/#{thread.id}.json"
+ get "/live/chat_threads/#{thread.id}.json"
expect(response.status).to eq(200)
expect(response.parsed_body).to eq(
@@ -74,12 +58,12 @@ RSpec.describe Voice::ChatThreadsController do
Fabricate(:chat_message, chat_channel: channel, thread: thread)
Discourse.redis.set("voice:room:#{room.id}:chat_thread", thread.id)
- get "/voice/chat_threads/#{thread.id}.json"
+ get "/live/chat_threads/#{thread.id}.json"
expect(response.status).to eq(200)
expect(response.parsed_body["chat_active"]).to eq(true)
ensure
- Voice::ChatSession.clear(room.id)
+ Live::ChatSession.clear(room.id)
end
it "reports a thread whose session rolled over to a newer thread as inactive" do
@@ -88,41 +72,41 @@ RSpec.describe Voice::ChatThreadsController do
Fabricate(:chat_message, chat_channel: channel, thread: newer_thread)
Discourse.redis.set("voice:room:#{room.id}:chat_thread", newer_thread.id)
- get "/voice/chat_threads/#{thread.id}.json"
+ get "/live/chat_threads/#{thread.id}.json"
expect(response.status).to eq(200)
expect(response.parsed_body["chat_active"]).to eq(false)
ensure
- Voice::ChatSession.clear(room.id)
+ Live::ChatSession.clear(room.id)
end
it "returns 404 for a thread that was never marked as a session thread" do
- get "/voice/chat_threads/#{thread.id}.json"
+ get "/live/chat_threads/#{thread.id}.json"
expect(response.status).to eq(404)
end
it "returns 404 for a thread id that does not exist" do
- get "/voice/chat_threads/#{Chat::Thread.maximum(:id).to_i + 1}.json"
+ get "/live/chat_threads/#{Chat::Thread.maximum(:id).to_i + 1}.json"
expect(response.status).to eq(404)
end
it "returns 404 when the marker points at a room linked to a different channel" do
other_channel = Fabricate(:chat_channel, threading_enabled: true)
- other_room = Fabricate(:voice_room, public: true, chat_channel_id: other_channel.id)
+ other_room = Fabricate(:live_room, public: true, chat_channel_id: other_channel.id)
mark(thread, other_room)
- get "/voice/chat_threads/#{thread.id}.json"
+ get "/live/chat_threads/#{thread.id}.json"
expect(response.status).to eq(404)
end
it "returns 404 for a marked thread whose room the user cannot see" do
- private_room = Fabricate(:voice_room, public: false, chat_channel_id: channel.id)
+ private_room = Fabricate(:live_room, public: false, chat_channel_id: channel.id)
mark(thread, private_room)
- get "/voice/chat_threads/#{thread.id}.json"
+ get "/live/chat_threads/#{thread.id}.json"
expect(response.status).to eq(404)
end
@@ -131,7 +115,7 @@ RSpec.describe Voice::ChatThreadsController do
mark(thread, room)
channel.update!(threading_enabled: false)
- get "/voice/chat_threads/#{thread.id}.json"
+ get "/live/chat_threads/#{thread.id}.json"
expect(response.status).to eq(404)
end
@@ -140,7 +124,7 @@ RSpec.describe Voice::ChatThreadsController do
mark(thread, room)
thread.original_message.trash!
- get "/voice/chat_threads/#{thread.id}.json"
+ get "/live/chat_threads/#{thread.id}.json"
expect(response.status).to eq(404)
end
@@ -150,7 +134,7 @@ RSpec.describe Voice::ChatThreadsController do
thread.original_message.trash!
sign_in(Fabricate(:admin))
- get "/voice/chat_threads/#{thread.id}.json"
+ get "/live/chat_threads/#{thread.id}.json"
expect(response.status).to eq(200)
end
@@ -158,19 +142,19 @@ RSpec.describe Voice::ChatThreadsController do
it "returns 404 when the user cannot preview the thread's channel" do
private_channel = Fabricate(:private_category_channel, threading_enabled: true)
private_thread = Fabricate(:chat_thread, channel: private_channel)
- visible_room = Fabricate(:voice_room, public: true, chat_channel_id: private_channel.id)
+ visible_room = Fabricate(:live_room, public: true, chat_channel_id: private_channel.id)
mark(private_thread, visible_room)
- get "/voice/chat_threads/#{private_thread.id}.json"
+ get "/live/chat_threads/#{private_thread.id}.json"
expect(response.status).to eq(404)
end
- it "returns 404 when voice chat is disabled" do
- SiteSetting.voice_chat_enabled = false
+ it "returns 404 when live chat is disabled" do
+ SiteSetting.live_chat_enabled = false
mark(thread, room)
- get "/voice/chat_threads/#{thread.id}.json"
+ get "/live/chat_threads/#{thread.id}.json"
expect(response.status).to eq(404)
end
@@ -179,7 +163,7 @@ RSpec.describe Voice::ChatThreadsController do
SiteSetting.chat_enabled = false
mark(thread, room)
- get "/voice/chat_threads/#{thread.id}.json"
+ get "/live/chat_threads/#{thread.id}.json"
expect(response.status).to eq(404)
end
diff --git a/plugins/voice/spec/requests/voice/invites_controller_spec.rb b/plugins/live/spec/requests/live/invites_controller_spec.rb
similarity index 66%
rename from plugins/voice/spec/requests/voice/invites_controller_spec.rb
rename to plugins/live/spec/requests/live/invites_controller_spec.rb
index 1d275fb6ee5..e7ba4a638a5 100644
--- a/plugins/voice/spec/requests/voice/invites_controller_spec.rb
+++ b/plugins/live/spec/requests/live/invites_controller_spec.rb
@@ -1,34 +1,18 @@
# frozen_string_literal: true
require "rails_helper"
-require_relative "../../../db/migrate/20241107000000_create_voice_rooms"
-require_relative "../../../db/migrate/20260305165400_create_voice_sessions"
-require_relative "../../../db/migrate/20260813160047_create_voice_invites"
-
-RSpec.describe Voice::InvitesController do
- before do
- ActiveRecord::Migration.suppress_messages do
- CreateVoiceRooms.new.change unless ActiveRecord::Base.connection.table_exists?(:voice_rooms)
- unless ActiveRecord::Base.connection.table_exists?(:voice_sessions)
- CreateVoiceSessions.new.change
- end
- unless ActiveRecord::Base.connection.table_exists?(:voice_invites)
- CreateVoiceInvites.new.change
- end
- end
- Voice::Room.reset_column_information
- end
+RSpec.describe Live::InvitesController do
fab!(:user) { Fabricate(:user, trust_level: TrustLevel[2]) }
fab!(:invitee) { Fabricate(:user, trust_level: TrustLevel[2]) }
fab!(:room_owner) { Fabricate(:user, trust_level: TrustLevel[2]) }
- fab!(:room) { Fabricate(:voice_room, creator: room_owner, public: true) }
- fab!(:private_room) { Fabricate(:voice_room, creator: room_owner, public: false) }
+ fab!(:room) { Fabricate(:live_room, creator: room_owner, public: true) }
+ fab!(:private_room) { Fabricate(:live_room, creator: room_owner, public: false) }
before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_allowed_groups =
+ SiteSetting.live_enabled = true
+ SiteSetting.live_allowed_groups =
"#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
- SiteSetting.voice_analytics_enabled = true
+ SiteSetting.live_analytics_enabled = true
end
describe "#create" do
@@ -37,19 +21,19 @@ RSpec.describe Voice::InvitesController do
messages =
MessageBus.track_publish("/notification-alert/#{invitee.id}") do
- post "/voice/rooms/#{room.id}/invites.json", params: { usernames: [invitee.username] }
+ post "/live/rooms/#{room.id}/invites.json", params: { usernames: [invitee.username] }
end
expect(response.status).to eq(200)
expect(response.parsed_body["invited_usernames"]).to eq([invitee.username])
- invite = Voice::Invite.find_by(room_id: room.id, user_id: invitee.id)
+ invite = Live::Invite.find_by(room_id: room.id, user_id: invitee.id)
expect(invite.invited_by_id).to eq(user.id)
- expect(invite.source).to eq(Voice::Invite::SOURCES[:notification])
+ expect(invite.source).to eq(Live::Invite::SOURCES[:notification])
expect(invite.redeemed_at).to be_nil
notification = invitee.notifications.order(:id).last
- expect(notification.notification_type).to eq(Notification.types[:voice_invitation])
+ expect(notification.notification_type).to eq(Notification.types[:live_invitation])
expect(notification.high_priority).to eq(true)
data = JSON.parse(notification.data)
expect(data["room_slug"]).to eq(room.slug)
@@ -58,7 +42,7 @@ RSpec.describe Voice::InvitesController do
expect(messages.size).to eq(1)
expect(messages.first.data[:post_url]).to eq(
- "/voice/r/#{room.slug}/invited-by/#{user.username_lower}",
+ "/live/r/#{room.slug}/invited-by/#{user.username_lower}",
)
end
@@ -66,30 +50,30 @@ RSpec.describe Voice::InvitesController do
sign_in(user)
2.times do
- post "/voice/rooms/#{room.id}/invites.json", params: { usernames: [invitee.username] }
+ post "/live/rooms/#{room.id}/invites.json", params: { usernames: [invitee.username] }
end
- expect(Voice::Invite.where(room_id: room.id, user_id: invitee.id).count).to eq(1)
+ expect(Live::Invite.where(room_id: room.id, user_id: invitee.id).count).to eq(1)
expect(
- invitee.notifications.where(notification_type: Notification.types[:voice_invitation]).count,
+ invitee.notifications.where(notification_type: Notification.types[:live_invitation]).count,
).to eq(1)
end
it "notifies again once an unredeemed invite is more than a day old" do
- invite = Voice::Invite.create!(room_id: room.id, user_id: invitee.id, invited_by_id: user.id)
+ invite = Live::Invite.create!(room_id: room.id, user_id: invitee.id, invited_by_id: user.id)
invite.update_columns(updated_at: 2.days.ago)
sign_in(user)
- post "/voice/rooms/#{room.id}/invites.json", params: { usernames: [invitee.username] }
+ post "/live/rooms/#{room.id}/invites.json", params: { usernames: [invitee.username] }
expect(
- invitee.notifications.where(notification_type: Notification.types[:voice_invitation]).count,
+ invitee.notifications.where(notification_type: Notification.types[:live_invitation]).count,
).to eq(1)
expect(invite.reload.updated_at).to be_within(1.minute).of(Time.current)
end
it "does not notify a redeemed invite again" do
- Voice::Invite.create!(
+ Live::Invite.create!(
room_id: room.id,
user_id: invitee.id,
invited_by_id: user.id,
@@ -98,7 +82,7 @@ RSpec.describe Voice::InvitesController do
)
sign_in(user)
- post "/voice/rooms/#{room.id}/invites.json", params: { usernames: [invitee.username] }
+ post "/live/rooms/#{room.id}/invites.json", params: { usernames: [invitee.username] }
expect(invitee.notifications.count).to eq(0)
end
@@ -107,7 +91,7 @@ RSpec.describe Voice::InvitesController do
MutedUser.create!(user_id: invitee.id, muted_user_id: user.id)
sign_in(user)
- post "/voice/rooms/#{room.id}/invites.json", params: { usernames: [invitee.username] }
+ post "/live/rooms/#{room.id}/invites.json", params: { usernames: [invitee.username] }
# Reported as invited so mute status can't be probed.
expect(response.parsed_body["invited_usernames"]).to eq([invitee.username])
@@ -118,7 +102,7 @@ RSpec.describe Voice::InvitesController do
invitee.user_option.update!(allow_private_messages: false)
sign_in(user)
- post "/voice/rooms/#{room.id}/invites.json", params: { usernames: [invitee.username] }
+ post "/live/rooms/#{room.id}/invites.json", params: { usernames: [invitee.username] }
expect(response.parsed_body["invited_usernames"]).to eq([invitee.username])
expect(invitee.notifications.count).to eq(0)
@@ -126,27 +110,27 @@ RSpec.describe Voice::InvitesController do
it "rate limits invite notifications per day" do
RateLimiter.enable
- SiteSetting.voice_max_invites_per_day = 1
+ SiteSetting.live_max_invites_per_day = 1
other_invitee = Fabricate(:user, trust_level: TrustLevel[2])
sign_in(user)
- post "/voice/rooms/#{room.id}/invites.json",
+ post "/live/rooms/#{room.id}/invites.json",
params: {
usernames: [invitee.username, other_invitee.username],
}
expect(response.status).to eq(429)
expect(
- Notification.where(notification_type: Notification.types[:voice_invitation]).count,
+ Notification.where(notification_type: Notification.types[:live_invitation]).count,
).to eq(1)
end
it "skips the inviter themselves and users outside the allowed groups" do
- SiteSetting.voice_allowed_groups = Group::AUTO_GROUPS[:trust_level_2]
+ SiteSetting.live_allowed_groups = Group::AUTO_GROUPS[:trust_level_2]
outsider = Fabricate(:user, trust_level: TrustLevel[0])
sign_in(user)
- post "/voice/rooms/#{room.id}/invites.json",
+ post "/live/rooms/#{room.id}/invites.json",
params: {
usernames: [user.username, outsider.username],
}
@@ -157,60 +141,60 @@ RSpec.describe Voice::InvitesController do
user.username,
outsider.username,
)
- expect(Voice::Invite.count).to eq(0)
+ expect(Live::Invite.count).to eq(0)
expect(outsider.notifications.count).to eq(0)
end
it "rejects a usernames list over the per-request maximum instead of truncating it" do
sign_in(user)
- usernames = (1..Voice::InvitesController::MAX_USERS_PER_REQUEST + 1).map { |i| "user#{i}" }
- post "/voice/rooms/#{room.id}/invites.json", params: { usernames: usernames }
+ usernames = (1..Live::InvitesController::MAX_USERS_PER_REQUEST + 1).map { |i| "user#{i}" }
+ post "/live/rooms/#{room.id}/invites.json", params: { usernames: usernames }
expect(response.status).to eq(400)
- expect(Voice::Invite.count).to eq(0)
+ expect(Live::Invite.count).to eq(0)
end
it "returns 403 when a non-manager invites to a private room" do
private_room.room_memberships.create!(
user: user,
- role: Voice::RoomMembership::ROLE_PARTICIPANT,
+ role: Live::RoomMembership::ROLE_PARTICIPANT,
)
sign_in(user)
- post "/voice/rooms/#{private_room.id}/invites.json", params: { usernames: [invitee.username] }
+ post "/live/rooms/#{private_room.id}/invites.json", params: { usernames: [invitee.username] }
expect(response.status).to eq(403)
- expect(Voice::Invite.count).to eq(0)
+ expect(Live::Invite.count).to eq(0)
end
it "grants a private-room invitee a participant membership" do
sign_in(room_owner)
- post "/voice/rooms/#{private_room.id}/invites.json", params: { usernames: [invitee.username] }
+ post "/live/rooms/#{private_room.id}/invites.json", params: { usernames: [invitee.username] }
expect(response.status).to eq(200)
membership = private_room.room_memberships.find_by(user_id: invitee.id)
- expect(membership.role).to eq(Voice::RoomMembership::ROLE_PARTICIPANT)
+ expect(membership.role).to eq(Live::RoomMembership::ROLE_PARTICIPANT)
end
it "requires a logged-in user" do
- post "/voice/rooms/#{room.id}/invites.json", params: { usernames: [invitee.username] }
+ post "/live/rooms/#{room.id}/invites.json", params: { usernames: [invitee.username] }
expect(response.status).to eq(403)
end
context "when the room is ephemeral" do
fab!(:call_room) do
- Fabricate(:voice_room, creator: room_owner, public: false, ephemeral: true)
+ Fabricate(:live_room, creator: room_owner, public: false, ephemeral: true)
end
it "sends a call-flavored notification and publishes a ring event to the invitee" do
sign_in(room_owner)
ring_messages =
- MessageBus.track_publish("/voice/call-ring/#{invitee.id}") do
- post "/voice/rooms/#{call_room.id}/invites.json",
+ MessageBus.track_publish("/live/call-ring/#{invitee.id}") do
+ post "/live/rooms/#{call_room.id}/invites.json",
params: {
usernames: [invitee.username],
}
@@ -231,17 +215,14 @@ RSpec.describe Voice::InvitesController do
sign_in(room_owner)
2.times do
- post "/voice/rooms/#{call_room.id}/invites.json",
- params: {
- usernames: [invitee.username],
- }
+ post "/live/rooms/#{call_room.id}/invites.json", params: { usernames: [invitee.username] }
end
expect(invitee.notifications.count).to eq(1)
- Voice::Invite.find_by(room_id: call_room.id, user_id: invitee.id).update_columns(
+ Live::Invite.find_by(room_id: call_room.id, user_id: invitee.id).update_columns(
updated_at: 2.minutes.ago,
)
- post "/voice/rooms/#{call_room.id}/invites.json", params: { usernames: [invitee.username] }
+ post "/live/rooms/#{call_room.id}/invites.json", params: { usernames: [invitee.username] }
expect(invitee.notifications.count).to eq(2)
end
@@ -256,21 +237,21 @@ RSpec.describe Voice::InvitesController do
before do
Fabricate(
- :voice_session,
+ :live_session,
user: user,
room: room,
joined_at: base_time - 2.hours,
left_at: base_time - 1.hour,
)
Fabricate(
- :voice_session,
+ :live_session,
user: closest_companion,
room: room,
joined_at: base_time - 2.hours,
left_at: base_time - 90.minutes,
)
Fabricate(
- :voice_session,
+ :live_session,
user: brief_companion,
room: room,
joined_at: base_time - 70.minutes,
@@ -280,17 +261,17 @@ RSpec.describe Voice::InvitesController do
it "returns companions from this room ordered by time spent together" do
# Time shared elsewhere must not leak into this room's suggestions.
- other_room = Fabricate(:voice_room, creator: room_owner, public: true)
+ other_room = Fabricate(:live_room, creator: room_owner, public: true)
stranger = Fabricate(:user, trust_level: TrustLevel[2])
Fabricate(
- :voice_session,
+ :live_session,
user: user,
room: other_room,
joined_at: 2.hours.ago,
left_at: 1.hour.ago,
)
Fabricate(
- :voice_session,
+ :live_session,
user: stranger,
room: other_room,
joined_at: 2.hours.ago,
@@ -299,7 +280,7 @@ RSpec.describe Voice::InvitesController do
sign_in(user)
- get "/voice/rooms/#{room.id}/invites/suggestions.json"
+ get "/live/rooms/#{room.id}/invites/suggestions.json"
expect(response.status).to eq(200)
suggestions = response.parsed_body["suggestions"]
@@ -314,21 +295,21 @@ RSpec.describe Voice::InvitesController do
brush_companion = Fabricate(:user, trust_level: TrustLevel[2])
# A dev-instance style pair: both "open" for weeks before being closed.
Fabricate(
- :voice_session,
+ :live_session,
user: user,
room: room,
joined_at: base_time - 28.days,
left_at: base_time - 1.day,
)
Fabricate(
- :voice_session,
+ :live_session,
user: stale_companion,
room: room,
joined_at: base_time - 28.days,
left_at: base_time - 1.day,
)
Fabricate(
- :voice_session,
+ :live_session,
user: brush_companion,
room: room,
joined_at: base_time - 62.minutes,
@@ -337,7 +318,7 @@ RSpec.describe Voice::InvitesController do
sign_in(user)
- get "/voice/rooms/#{room.id}/invites/suggestions.json"
+ get "/live/rooms/#{room.id}/invites/suggestions.json"
suggestions = response.parsed_body["suggestions"]
stale = suggestions.find { |suggestion| suggestion["username"] == stale_companion.username }
@@ -347,12 +328,12 @@ RSpec.describe Voice::InvitesController do
)
end
- it "excludes companions who no longer have access to voice rooms" do
- SiteSetting.voice_allowed_groups = Group::AUTO_GROUPS[:trust_level_2]
+ it "excludes companions who no longer have access to live rooms" do
+ SiteSetting.live_allowed_groups = Group::AUTO_GROUPS[:trust_level_2]
closest_companion.change_trust_level!(TrustLevel[0])
sign_in(user)
- get "/voice/rooms/#{room.id}/invites/suggestions.json"
+ get "/live/rooms/#{room.id}/invites/suggestions.json"
expect(response.parsed_body["suggestions"].map { |s| s["username"] }).to eq(
[brief_companion.username],
@@ -360,23 +341,23 @@ RSpec.describe Voice::InvitesController do
end
it "excludes companions who are already in the call" do
- Voice::ParticipantTracker.add(room.id, closest_companion.id)
+ Live::ParticipantTracker.add(room.id, closest_companion.id)
sign_in(user)
- get "/voice/rooms/#{room.id}/invites/suggestions.json"
+ get "/live/rooms/#{room.id}/invites/suggestions.json"
expect(response.parsed_body["suggestions"].map { |s| s["username"] }).to eq(
[brief_companion.username],
)
ensure
- Voice::ParticipantTracker.remove(room.id, closest_companion.id)
+ Live::ParticipantTracker.remove(room.id, closest_companion.id)
end
it "returns an empty list when analytics are disabled" do
- SiteSetting.voice_analytics_enabled = false
+ SiteSetting.live_analytics_enabled = false
sign_in(user)
- get "/voice/rooms/#{room.id}/invites/suggestions.json"
+ get "/live/rooms/#{room.id}/invites/suggestions.json"
expect(response.status).to eq(200)
expect(response.parsed_body["suggestions"]).to eq([])
diff --git a/plugins/live/spec/requests/live/legacy_routes_spec.rb b/plugins/live/spec/requests/live/legacy_routes_spec.rb
new file mode 100644
index 00000000000..e0560b899b9
--- /dev/null
+++ b/plugins/live/spec/requests/live/legacy_routes_spec.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+RSpec.describe "Pre-rename /voice routes" do
+ before { SiteSetting.live_enabled = true }
+
+ it "redirects room links to /live, keeping the query string" do
+ get "/voice/r/watercooler/invited-by/sam?join"
+
+ expect(response).to redirect_to("/live/r/watercooler/invited-by/sam?join")
+ end
+
+ it "keeps the subfolder prefix when redirecting" do
+ set_subfolder "/forum"
+
+ get "/voice/r/watercooler"
+
+ expect(response).to redirect_to("/forum/live/r/watercooler")
+ end
+
+ it "still routes LiveKit webhooks to the webhook controller" do
+ post "/voice/livekit/webhook",
+ params: "{}",
+ headers: {
+ "CONTENT_TYPE" => "application/webhook+json",
+ }
+
+ expect(response.status).to eq(403)
+ end
+end
diff --git a/plugins/voice/spec/requests/voice/livekit_webhooks_controller_spec.rb b/plugins/live/spec/requests/live/livekit_webhooks_controller_spec.rb
similarity index 59%
rename from plugins/voice/spec/requests/voice/livekit_webhooks_controller_spec.rb
rename to plugins/live/spec/requests/live/livekit_webhooks_controller_spec.rb
index 6873445b504..f7bacbe4646 100644
--- a/plugins/voice/spec/requests/voice/livekit_webhooks_controller_spec.rb
+++ b/plugins/live/spec/requests/live/livekit_webhooks_controller_spec.rb
@@ -1,53 +1,24 @@
# frozen_string_literal: true
require "rails_helper"
-require_relative "../../../db/migrate/20241107000000_create_voice_rooms"
-require_relative "../../../db/migrate/20260305162426_add_room_type_to_voice_rooms"
-require_relative "../../../db/migrate/20260612135211_add_video_enabled_to_voice_rooms"
-require_relative "../../../db/migrate/20260630183841_add_chat_settings_to_voice_rooms"
-require_relative "../../../db/migrate/20260709165411_add_livekit_enabled_to_voice_rooms"
-require_relative "../../../db/migrate/20260717172530_create_voice_recordings"
-
-RSpec.describe Voice::LivekitWebhooksController do
- before do
- ActiveRecord::Migration.suppress_messages do
- CreateVoiceRooms.new.change unless ActiveRecord::Base.connection.table_exists?(:voice_rooms)
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :room_type)
- AddRoomTypeToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :video_enabled)
- AddVideoEnabledToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :chat_channel_id)
- AddChatSettingsToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :livekit_enabled)
- AddLivekitEnabledToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.table_exists?(:voice_recordings)
- CreateVoiceRecordings.new.change
- end
- end
- Voice::Room.reset_column_information
- Voice::Recording.reset_column_information
- end
+RSpec.describe Live::LivekitWebhooksController do
fab!(:user)
- fab!(:room) { Fabricate(:voice_room, public: true) }
+ fab!(:room) { Fabricate(:live_room, public: true) }
before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_allowed_groups =
+ SiteSetting.live_enabled = true
+ SiteSetting.live_allowed_groups =
"#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
- SiteSetting.voice_livekit_url = "wss://livekit.example.com"
- SiteSetting.voice_livekit_api_key = "lk_api_key"
- SiteSetting.voice_livekit_api_secret = "lk_api_secret"
- SiteSetting.voice_livekit_room_policy = "all_rooms"
+ SiteSetting.live_livekit_url = "wss://livekit.example.com"
+ SiteSetting.live_livekit_api_key = "lk_api_key"
+ SiteSetting.live_livekit_api_secret = "lk_api_secret"
+ SiteSetting.live_livekit_room_policy = "all_rooms"
end
after do
- Voice::ParticipantTracker.clear(room.id)
- Discourse.redis.del(Voice::Livekit::LAST_WEBHOOK_KEY)
+ Live::ParticipantTracker.clear(room.id)
+ Discourse.redis.del(Live::Livekit::LAST_WEBHOOK_KEY)
end
def signed_headers(body, secret: "lk_api_secret", key: "lk_api_key", sha256: nil, exp: nil)
@@ -68,7 +39,7 @@ RSpec.describe Voice::LivekitWebhooksController do
# the test always counts as seen before the event.
def event_for(
event: "participant_left",
- room_name: Voice::Livekit.room_name(room),
+ room_name: Live::Livekit.room_name(room),
identity: user.id.to_s,
sid: "PA_test",
metadata: nil,
@@ -92,15 +63,15 @@ RSpec.describe Voice::LivekitWebhooksController do
def post_webhook(event = event_for, headers: nil)
body = event.to_json
- post "/voice/livekit/webhook", params: body, headers: headers || signed_headers(body)
+ post "/live/livekit/webhook", params: body, headers: headers || signed_headers(body)
end
describe "#create" do
it "reconciles a dashboard agent without letting stale events restore a kicked bot" do
- SiteSetting.voice_livekit_url = "wss://test.livekit.cloud"
- SiteSetting.voice_livekit_agent_enabled = true
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
- Voice::ParticipantTracker.add(room.id, user.id)
+ SiteSetting.live_livekit_url = "wss://test.livekit.cloud"
+ SiteSetting.live_livekit_agent_enabled = true
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
+ Live::ParticipantTracker.add(room.id, user.id)
dispatch = nil
stub_request(
:post,
@@ -144,39 +115,39 @@ RSpec.describe Voice::LivekitWebhooksController do
:post,
"https://test.livekit.cloud/twirp/livekit.AgentDispatchService/DeleteDispatch",
).to_return(status: 200, body: "{}")
- Voice::AgentDispatcher.dispatch!(room:, agent_name: "assistant")
- bot = Voice::AgentBot.user
+ Live::AgentDispatcher.dispatch!(room:, agent_name: "assistant")
+ bot = Live::AgentBot.user
post_webhook(event_for(event: "participant_joined", identity: "agent-test"))
expect(response.status).to eq(200)
- expect(Voice::ParticipantTracker.agent_user_ids(room.id)).to eq([bot.id])
+ expect(Live::ParticipantTracker.agent_user_ids(room.id)).to eq([bot.id])
post_webhook(event_for(identity: "agent-test", sid: "PA_old"))
- expect(Voice::ParticipantTracker.agent_user_ids(room.id)).to eq([bot.id])
+ expect(Live::ParticipantTracker.agent_user_ids(room.id)).to eq([bot.id])
- Voice::AgentManager.evict!(room:, user_id: bot.id)
+ Live::AgentManager.evict!(room:, user_id: bot.id)
post_webhook(event_for(event: "participant_joined", identity: "agent-test"))
- expect(Voice::ParticipantTracker.agent_user_ids(room.id)).to be_empty
+ expect(Live::ParticipantTracker.agent_user_ids(room.id)).to be_empty
end
context "with an invalid delivery" do
it "rejects a request with no Authorization token and records no delivery" do
body = event_for.to_json
- post "/voice/livekit/webhook",
+ post "/live/livekit/webhook",
params: body,
headers: {
"CONTENT_TYPE" => "application/webhook+json",
}
expect(response.status).to eq(403)
- expect(Voice::Livekit.last_webhook_at).to be_nil
+ expect(Live::Livekit.last_webhook_at).to be_nil
end
it "rejects a token signed with the wrong secret" do
body = event_for.to_json
- post "/voice/livekit/webhook",
+ post "/live/livekit/webhook",
params: body,
headers: signed_headers(body, secret: "not-the-secret")
@@ -186,9 +157,7 @@ RSpec.describe Voice::LivekitWebhooksController do
it "rejects an expired token" do
body = event_for.to_json
- post "/voice/livekit/webhook",
- params: body,
- headers: signed_headers(body, exp: 1.minute.ago)
+ post "/live/livekit/webhook", params: body, headers: signed_headers(body, exp: 1.minute.ago)
expect(response.status).to eq(403)
end
@@ -196,7 +165,7 @@ RSpec.describe Voice::LivekitWebhooksController do
it "rejects a token issued for a different API key" do
body = event_for.to_json
- post "/voice/livekit/webhook", params: body, headers: signed_headers(body, key: "other")
+ post "/live/livekit/webhook", params: body, headers: signed_headers(body, key: "other")
expect(response.status).to eq(403)
end
@@ -205,18 +174,18 @@ RSpec.describe Voice::LivekitWebhooksController do
signed_body = event_for.to_json
tampered_body = event_for(identity: "999").to_json
- post "/voice/livekit/webhook", params: tampered_body, headers: signed_headers(signed_body)
+ post "/live/livekit/webhook", params: tampered_body, headers: signed_headers(signed_body)
expect(response.status).to eq(403)
- expect(Voice::ParticipantTracker.pinned_transport(room.id)).to be_nil
+ expect(Live::ParticipantTracker.pinned_transport(room.id)).to be_nil
end
it "rejects everything when LiveKit is unconfigured" do
body = event_for.to_json
headers = signed_headers(body)
- SiteSetting.voice_livekit_api_secret = ""
+ SiteSetting.live_livekit_api_secret = ""
- post "/voice/livekit/webhook", params: body, headers: headers
+ post "/live/livekit/webhook", params: body, headers: headers
expect(response.status).to eq(403)
end
@@ -226,24 +195,24 @@ RSpec.describe Voice::LivekitWebhooksController do
post_webhook(event_for(event: "room_started"))
expect(response.status).to eq(200)
- expect(Voice::Livekit.last_webhook_at).to be_within(5.seconds).of(Time.now)
+ expect(Live::Livekit.last_webhook_at).to be_within(5.seconds).of(Time.now)
end
%w[participant_left participant_connection_aborted].each do |event_name|
context "with a #{event_name} event" do
it "expires the participant's presence, keeps their metadata, and broadcasts the change" do
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
- Voice::ParticipantTracker.add(room.id, user.id)
- Voice::ParticipantTracker.update_metadata(room.id, user.id, { role: "participant" })
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
+ Live::ParticipantTracker.add(room.id, user.id)
+ Live::ParticipantTracker.update_metadata(room.id, user.id, { role: "participant" })
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) do
+ MessageBus.track_publish(Live.room_channel(room.id)) do
post_webhook(event_for(event: event_name))
end
expect(response.status).to eq(200)
- expect(Voice::ParticipantTracker.user_ids(room.id)).not_to include(user.id)
- expect(Voice::ParticipantTracker.get_metadata(room.id, user.id)[:role]).to eq(
+ expect(Live::ParticipantTracker.user_ids(room.id)).not_to include(user.id)
+ expect(Live::ParticipantTracker.get_metadata(room.id, user.id)[:role]).to eq(
"participant",
)
expect(messages.map { |message| message.data[:type] }).to include("participants")
@@ -253,61 +222,61 @@ RSpec.describe Voice::LivekitWebhooksController do
context "with a participant_left event" do
it "leaves presence alone when it was refreshed after the event fired" do
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
- Voice::ParticipantTracker.add(room.id, user.id)
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
+ Live::ParticipantTracker.add(room.id, user.id)
post_webhook(event_for(created_at: 2.minutes.ago))
expect(response.status).to eq(200)
- expect(Voice::ParticipantTracker.user_ids(room.id)).to include(user.id)
+ expect(Live::ParticipantTracker.user_ids(room.id)).to include(user.id)
end
it "never creates presence for a participant who is not in the room" do
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
post_webhook
expect(response.status).to eq(200)
- expect(Voice::ParticipantTracker.user_ids(room.id)).to be_empty
+ expect(Live::ParticipantTracker.user_ids(room.id)).to be_empty
end
it "ignores rooms pinned to mesh" do
- Voice::ParticipantTracker.pin_transport!(room.id, "mesh")
- Voice::ParticipantTracker.add(room.id, user.id)
+ Live::ParticipantTracker.pin_transport!(room.id, "mesh")
+ Live::ParticipantTracker.add(room.id, user.id)
post_webhook
expect(response.status).to eq(200)
- expect(Voice::ParticipantTracker.user_ids(room.id)).to include(user.id)
+ expect(Live::ParticipantTracker.user_ids(room.id)).to include(user.id)
end
it "ignores rooms with no pinned transport" do
- Voice::ParticipantTracker.add(room.id, user.id)
+ Live::ParticipantTracker.add(room.id, user.id)
post_webhook
expect(response.status).to eq(200)
- expect(Voice::ParticipantTracker.user_ids(room.id)).to include(user.id)
+ expect(Live::ParticipantTracker.user_ids(room.id)).to include(user.id)
end
it "ignores events for rooms outside this site's namespace" do
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
- Voice::ParticipantTracker.add(room.id, user.id)
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
+ Live::ParticipantTracker.add(room.id, user.id)
post_webhook(event_for(room_name: "othersite-r#{room.id}"))
expect(response.status).to eq(200)
- expect(Voice::ParticipantTracker.user_ids(room.id)).to include(user.id)
+ expect(Live::ParticipantTracker.user_ids(room.id)).to include(user.id)
end
it "ignores a non-numeric participant identity" do
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
- Voice::ParticipantTracker.add(room.id, user.id)
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
+ Live::ParticipantTracker.add(room.id, user.id)
post_webhook(event_for(identity: "recorder-bot"))
expect(response.status).to eq(200)
- expect(Voice::ParticipantTracker.user_ids(room.id)).to include(user.id)
+ expect(Live::ParticipantTracker.user_ids(room.id)).to include(user.id)
end
it "leaves the session row open for CloseOrphanedSessions to close" do
@@ -316,17 +285,17 @@ RSpec.describe Voice::LivekitWebhooksController do
"https://livekit.example.com/twirp/livekit.RoomService/DeleteRoom",
).to_return(status: 200, body: "{}")
sign_in(user)
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
expect(response.status).to eq(200)
- session = Voice::Session.find_by(user_id: user.id, room_id: room.id)
+ session = Live::Session.find_by(user_id: user.id, room_id: room.id)
post_webhook
expect(response.status).to eq(200)
- expect(Voice::ParticipantTracker.user_ids(room.id)).not_to include(user.id)
+ expect(Live::ParticipantTracker.user_ids(room.id)).not_to include(user.id)
expect(session.reload.left_at).to be_nil
- Jobs::Voice::CloseOrphanedSessions.new.execute({})
+ Jobs::Live::CloseOrphanedSessions.new.execute({})
expect(session.reload.left_at).to be_present
end
@@ -334,8 +303,8 @@ RSpec.describe Voice::LivekitWebhooksController do
context "with a rejoined participant" do
before do
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
- Voice::ParticipantTracker.add(room.id, user.id)
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
+ Live::ParticipantTracker.add(room.id, user.id)
end
it "ignores the superseded session's late departure" do
@@ -343,7 +312,7 @@ RSpec.describe Voice::LivekitWebhooksController do
post_webhook(event_for(sid: "PA_old"))
expect(response.status).to eq(200)
- expect(Voice::ParticipantTracker.user_ids(room.id)).to include(user.id)
+ expect(Live::ParticipantTracker.user_ids(room.id)).to include(user.id)
end
it "expires presence when the departing session is the recorded one" do
@@ -351,43 +320,43 @@ RSpec.describe Voice::LivekitWebhooksController do
post_webhook(event_for(sid: "PA_new"))
expect(response.status).to eq(200)
- expect(Voice::ParticipantTracker.user_ids(room.id)).not_to include(user.id)
+ expect(Live::ParticipantTracker.user_ids(room.id)).not_to include(user.id)
end
it "expires presence when no session was recorded for the user" do
post_webhook(event_for(sid: "PA_old"))
expect(response.status).to eq(200)
- expect(Voice::ParticipantTracker.user_ids(room.id)).not_to include(user.id)
+ expect(Live::ParticipantTracker.user_ids(room.id)).not_to include(user.id)
end
end
context "with a room_finished event" do
it "clears the transport pin of a livekit room without touching presence" do
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
- Voice::ParticipantTracker.add(room.id, user.id)
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
+ Live::ParticipantTracker.add(room.id, user.id)
post_webhook(event_for(event: "room_finished"))
expect(response.status).to eq(200)
- expect(Voice::ParticipantTracker.pinned_transport(room.id)).to be_nil
- expect(Voice::ParticipantTracker.user_ids(room.id)).to include(user.id)
+ expect(Live::ParticipantTracker.pinned_transport(room.id)).to be_nil
+ expect(Live::ParticipantTracker.user_ids(room.id)).to include(user.id)
end
it "keeps a mesh room's pin" do
- Voice::ParticipantTracker.pin_transport!(room.id, "mesh")
+ Live::ParticipantTracker.pin_transport!(room.id, "mesh")
post_webhook(event_for(event: "room_finished"))
expect(response.status).to eq(200)
- expect(Voice::ParticipantTracker.pinned_transport(room.id)).to eq("mesh")
+ expect(Live::ParticipantTracker.pinned_transport(room.id)).to eq("mesh")
end
end
context "with an egress_ended event" do
def egress_event(
egress_id: "EG_1",
- room_name: Voice::Livekit.room_name(room),
+ room_name: Live::Livekit.room_name(room),
snake_case: false
)
egress_info =
@@ -407,8 +376,8 @@ RSpec.describe Voice::LivekitWebhooksController do
end
before do
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
- Voice::ParticipantTracker.set_recording(
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
+ Live::ParticipantTracker.set_recording(
room.id,
egress_id: "EG_1",
user_id: user.id,
@@ -419,10 +388,10 @@ RSpec.describe Voice::LivekitWebhooksController do
it "clears the recording state and broadcasts the end" do
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) { post_webhook(egress_event) }
+ MessageBus.track_publish(Live.room_channel(room.id)) { post_webhook(egress_event) }
expect(response.status).to eq(200)
- expect(Voice::RecordingManager.status(room.id)).to be_nil
+ expect(Live::RecordingManager.status(room.id)).to be_nil
recording_messages = messages.select { |message| message.data[:type] == "recording" }
expect(recording_messages.size).to eq(1)
expect(recording_messages.first.data[:recording]).to be_nil
@@ -432,38 +401,38 @@ RSpec.describe Voice::LivekitWebhooksController do
post_webhook(egress_event(snake_case: true))
expect(response.status).to eq(200)
- expect(Voice::RecordingManager.status(room.id)).to be_nil
+ expect(Live::RecordingManager.status(room.id)).to be_nil
end
it "ignores an egress that is not the active recording" do
post_webhook(egress_event(egress_id: "EG_other"))
expect(response.status).to eq(200)
- expect(Voice::RecordingManager.status(room.id)).to be_present
+ expect(Live::RecordingManager.status(room.id)).to be_present
end
it "ignores events for rooms outside this site's namespace" do
post_webhook(egress_event(room_name: "othersite-r#{room.id}"))
expect(response.status).to eq(200)
- expect(Voice::RecordingManager.status(room.id)).to be_present
+ expect(Live::RecordingManager.status(room.id)).to be_present
end
it "finalizes the recording row and PMs the requester the file location" do
recording =
- Voice::Recording.create!(
+ Live::Recording.create!(
room: room,
started_by: user,
egress_id: "EG_1",
- filepath: "voice/test-abc123",
+ filepath: "live/test-abc123",
started_at: 10.minutes.ago,
)
event = egress_event
event["egressInfo"]["fileResults"] = [
{
- "filename" => "voice/test-abc123.mp4",
- "location" => "https://cdn.example.com/voice/test-abc123.mp4",
+ "filename" => "live/test-abc123.mp4",
+ "location" => "https://cdn.example.com/live/test-abc123.mp4",
"duration" => (300 * 1_000_000_000).to_s,
"size" => "1000",
},
@@ -472,18 +441,18 @@ RSpec.describe Voice::LivekitWebhooksController do
expect(response.status).to eq(200)
expect(recording.reload.status).to eq("completed")
- expect(recording.location).to eq("https://cdn.example.com/voice/test-abc123.mp4")
+ expect(recording.location).to eq("https://cdn.example.com/live/test-abc123.mp4")
pm_topic =
Topic.private_messages_for_user(user).find_by(
- title: I18n.t("voice.recording_ready_pm.title", room_name: room.name),
+ title: I18n.t("live.recording_ready_pm.title", room_name: room.name),
)
expect(pm_topic.first_post.raw).to include(recording.location)
end
end
it "returns 404 when the plugin is disabled" do
- SiteSetting.voice_enabled = false
+ SiteSetting.live_enabled = false
post_webhook
diff --git a/plugins/voice/spec/requests/voice/page_controller_spec.rb b/plugins/live/spec/requests/live/page_controller_spec.rb
similarity index 51%
rename from plugins/voice/spec/requests/voice/page_controller_spec.rb
rename to plugins/live/spec/requests/live/page_controller_spec.rb
index fe3cacdcc00..dbc414dbca7 100644
--- a/plugins/voice/spec/requests/voice/page_controller_spec.rb
+++ b/plugins/live/spec/requests/live/page_controller_spec.rb
@@ -1,27 +1,15 @@
# frozen_string_literal: true
require "rails_helper"
-require_relative "../../../db/migrate/20241107000000_create_voice_rooms"
-require_relative "../../../db/migrate/20260612135211_add_video_enabled_to_voice_rooms"
-
-RSpec.describe Voice::PageController do
- before do
- ActiveRecord::Migration.suppress_messages do
- CreateVoiceRooms.new.change unless ActiveRecord::Base.connection.table_exists?(:voice_rooms)
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :video_enabled)
- AddVideoEnabledToVoiceRooms.new.change
- Voice::Room.reset_column_information
- end
- end
- end
+RSpec.describe Live::PageController do
fab!(:staff, :admin)
fab!(:user)
- fab!(:room) { Fabricate(:voice_room, creator: staff, public: true) }
+ fab!(:room) { Fabricate(:live_room, creator: staff, public: true) }
before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_allowed_groups =
+ SiteSetting.live_enabled = true
+ SiteSetting.live_allowed_groups =
"#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
end
@@ -29,7 +17,7 @@ RSpec.describe Voice::PageController do
it "renders the app shell for a visible room" do
sign_in(user)
- get "/voice/r/#{room.slug}"
+ get "/live/r/#{room.slug}"
expect(response.status).to eq(200)
expect(response.body).to include("discourse")
@@ -38,7 +26,7 @@ RSpec.describe Voice::PageController do
it "renders the app shell for an invite link carrying the inviter's username" do
sign_in(user)
- get "/voice/r/#{room.slug}/invited-by/#{staff.username_lower}"
+ get "/live/r/#{room.slug}/invited-by/#{staff.username_lower}"
expect(response.status).to eq(200)
end
@@ -47,7 +35,7 @@ RSpec.describe Voice::PageController do
staff.update!(username: "alice.smith")
sign_in(user)
- get "/voice/r/#{room.slug}/invited-by/#{staff.username_lower}"
+ get "/live/r/#{room.slug}/invited-by/#{staff.username_lower}"
expect(response.status).to eq(200)
end
@@ -55,30 +43,30 @@ RSpec.describe Voice::PageController do
it "returns 404 for an unknown slug" do
sign_in(user)
- get "/voice/r/not-a-room"
+ get "/live/r/not-a-room"
expect(response.status).to eq(404)
end
it "rejects users who cannot see the room" do
- private_room = Fabricate(:voice_room, creator: staff, public: false)
+ private_room = Fabricate(:live_room, creator: staff, public: false)
sign_in(user)
- get "/voice/r/#{private_room.slug}"
+ get "/live/r/#{private_room.slug}"
expect(response.status).to eq(403)
end
it "renders for anonymous visitors when anonymous visitors are admitted" do
- get "/voice/r/#{room.slug}"
+ get "/live/r/#{room.slug}"
expect(response.status).to eq(200)
end
it "rejects anonymous visitors when access is restricted to a group" do
- SiteSetting.voice_allowed_groups = "#{Group::AUTO_GROUPS[:trust_level_2]}"
+ SiteSetting.live_allowed_groups = "#{Group::AUTO_GROUPS[:trust_level_2]}"
- get "/voice/r/#{room.slug}"
+ get "/live/r/#{room.slug}"
expect(response.status).to eq(403)
end
diff --git a/plugins/voice/spec/requests/voice/room_agent_invitations_spec.rb b/plugins/live/spec/requests/live/room_agent_invitations_spec.rb
similarity index 61%
rename from plugins/voice/spec/requests/voice/room_agent_invitations_spec.rb
rename to plugins/live/spec/requests/live/room_agent_invitations_spec.rb
index 8442c7d22b9..89dac75fab8 100644
--- a/plugins/voice/spec/requests/voice/room_agent_invitations_spec.rb
+++ b/plugins/live/spec/requests/live/room_agent_invitations_spec.rb
@@ -2,20 +2,20 @@
require "rails_helper"
-RSpec.describe Voice::RoomsController do
+RSpec.describe Live::RoomsController do
fab!(:admin)
fab!(:moderator)
fab!(:user)
- fab!(:room) { Fabricate(:voice_room, public: true) }
+ fab!(:room) { Fabricate(:live_room, public: true) }
before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_livekit_url = "wss://test.livekit.cloud"
- SiteSetting.voice_livekit_api_key = "key"
- SiteSetting.voice_livekit_api_secret = "secret"
- SiteSetting.voice_livekit_agent_enabled = true
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
- Voice::ParticipantTracker.add(room.id, user.id)
+ SiteSetting.live_enabled = true
+ SiteSetting.live_livekit_url = "wss://test.livekit.cloud"
+ SiteSetting.live_livekit_api_key = "key"
+ SiteSetting.live_livekit_api_secret = "secret"
+ SiteSetting.live_livekit_agent_enabled = true
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
+ Live::ParticipantTracker.add(room.id, user.id)
@dispatch =
stub_request(
:post,
@@ -31,7 +31,7 @@ RSpec.describe Voice::RoomsController do
it "dispatches the chosen agent for an admin" do
sign_in(admin)
- post "/voice/rooms/#{room.id}/invite_agent.json", params: { agent_name: "assistant" }
+ post "/live/rooms/#{room.id}/invite_agent.json", params: { agent_name: "assistant" }
expect(response.status).to eq(201)
expect(response.parsed_body).to eq("dispatch_id" => "AD_test")
@@ -43,7 +43,7 @@ RSpec.describe Voice::RoomsController do
it "rejects missing, blank, oversized, and non-string names" do
sign_in(admin)
[nil, " ", "a" * 257, ["assistant"]].each do |name|
- post "/voice/rooms/#{room.id}/invite_agent.json", params: { agent_name: name }
+ post "/live/rooms/#{room.id}/invite_agent.json", params: { agent_name: name }
expect(response.status).to eq(400)
end
expect(@dispatch).not_to have_been_requested
@@ -52,18 +52,18 @@ RSpec.describe Voice::RoomsController do
it "rejects users outside the invite groups" do
[user, moderator].each do |actor|
sign_in(actor)
- post "/voice/rooms/#{room.id}/invite_agent.json", params: { agent_name: "assistant" }
+ post "/live/rooms/#{room.id}/invite_agent.json", params: { agent_name: "assistant" }
expect(response.status).to eq(403)
end
expect(@dispatch).not_to have_been_requested
end
it "dispatches for a non-admin in the invite groups" do
- SiteSetting.voice_livekit_agent_invite_allowed_groups =
+ SiteSetting.live_livekit_agent_invite_allowed_groups =
"#{Group::AUTO_GROUPS[:admins]}|#{Group::AUTO_GROUPS[:moderators]}"
sign_in(moderator)
- post "/voice/rooms/#{room.id}/invite_agent.json", params: { agent_name: "assistant" }
+ post "/live/rooms/#{room.id}/invite_agent.json", params: { agent_name: "assistant" }
expect(response.status).to eq(201)
expect(@dispatch).to have_been_requested.once
@@ -71,13 +71,13 @@ RSpec.describe Voice::RoomsController do
it "rejects invitations when disabled or the bot no longer exists" do
sign_in(admin)
- SiteSetting.voice_livekit_agent_enabled = false
- post "/voice/rooms/#{room.id}/invite_agent.json", params: { agent_name: "assistant" }
+ SiteSetting.live_livekit_agent_enabled = false
+ post "/live/rooms/#{room.id}/invite_agent.json", params: { agent_name: "assistant" }
expect(response.status).to eq(403)
- SiteSetting.voice_livekit_agent_enabled = true
- Voice::AgentBot.user.delete
- post "/voice/rooms/#{room.id}/invite_agent.json", params: { agent_name: "assistant" }
+ SiteSetting.live_livekit_agent_enabled = true
+ Live::AgentBot.user.delete
+ post "/live/rooms/#{room.id}/invite_agent.json", params: { agent_name: "assistant" }
expect(response.status).to eq(403)
expect(@dispatch).not_to have_been_requested
end
@@ -86,7 +86,7 @@ RSpec.describe Voice::RoomsController do
sign_in(admin)
room.update!(public: false)
- post "/voice/rooms/#{room.id}/invite_agent.json", params: { agent_name: "assistant" }
+ post "/live/rooms/#{room.id}/invite_agent.json", params: { agent_name: "assistant" }
expect(response.status).to eq(403)
expect(@dispatch).not_to have_been_requested
@@ -99,7 +99,7 @@ RSpec.describe Voice::RoomsController do
"https://test.livekit.cloud/twirp/livekit.AgentDispatchService/CreateDispatch",
).to_return(status: 503)
- post "/voice/rooms/#{room.id}/invite_agent.json", params: { agent_name: "assistant" }
+ post "/live/rooms/#{room.id}/invite_agent.json", params: { agent_name: "assistant" }
expect(response.status).to eq(503)
end
@@ -108,17 +108,17 @@ RSpec.describe Voice::RoomsController do
describe "#kick" do
it "allows the admin to immediately invite the bot again" do
sign_in(admin)
- post "/voice/rooms/#{room.id}/invite_agent.json", params: { agent_name: "assistant" }
- bot = Voice::AgentBot.user
+ post "/live/rooms/#{room.id}/invite_agent.json", params: { agent_name: "assistant" }
+ bot = Live::AgentBot.user
stub_request(
:post,
"https://test.livekit.cloud/twirp/livekit.RoomService/RemoveParticipant",
).to_return(status: 200, body: "{}")
- delete "/voice/rooms/#{room.id}/kick.json", params: { user_id: bot.id }
+ delete "/live/rooms/#{room.id}/kick.json", params: { user_id: bot.id }
expect(response.status).to eq(204)
- post "/voice/rooms/#{room.id}/invite_agent.json", params: { agent_name: "assistant" }
+ post "/live/rooms/#{room.id}/invite_agent.json", params: { agent_name: "assistant" }
expect(response.status).to eq(201)
expect(@dispatch).to have_been_requested.twice
end
diff --git a/plugins/voice/spec/requests/voice/room_memberships_controller_spec.rb b/plugins/live/spec/requests/live/room_memberships_controller_spec.rb
similarity index 59%
rename from plugins/voice/spec/requests/voice/room_memberships_controller_spec.rb
rename to plugins/live/spec/requests/live/room_memberships_controller_spec.rb
index a3df90bb7ea..4860b87ff38 100644
--- a/plugins/voice/spec/requests/voice/room_memberships_controller_spec.rb
+++ b/plugins/live/spec/requests/live/room_memberships_controller_spec.rb
@@ -1,55 +1,39 @@
# frozen_string_literal: true
require "rails_helper"
-require_relative "../../../db/migrate/20241107000000_create_voice_rooms"
-require_relative "../../../db/migrate/20260305162426_add_room_type_to_voice_rooms"
-require_relative "../../../db/migrate/20260612135211_add_video_enabled_to_voice_rooms"
-
-RSpec.describe Voice::RoomMembershipsController do
- before do
- ActiveRecord::Migration.suppress_messages do
- CreateVoiceRooms.new.change unless ActiveRecord::Base.connection.table_exists?(:voice_rooms)
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :room_type)
- AddRoomTypeToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :video_enabled)
- AddVideoEnabledToVoiceRooms.new.change
- end
- end
- Voice::Room.reset_column_information
- end
+RSpec.describe Live::RoomMembershipsController do
fab!(:staff, :admin)
fab!(:room_owner) { Fabricate(:user, trust_level: TrustLevel[2]) }
fab!(:room_moderator) { Fabricate(:user, trust_level: TrustLevel[2]) }
fab!(:member) { Fabricate(:user, trust_level: TrustLevel[2]) }
- # In voice_create_room_allowed_groups but with no tie to the room: being
+ # In live_create_room_allowed_groups but with no tie to the room: being
# allowed to create rooms must not grant control over other people's rooms.
fab!(:outsider) { Fabricate(:user, trust_level: TrustLevel[2]) }
fab!(:invitee) { Fabricate(:user, trust_level: TrustLevel[2]) }
- fab!(:room) { Fabricate(:voice_room, creator: room_owner, public: false) }
+ fab!(:room) { Fabricate(:live_room, creator: room_owner, public: false) }
fab!(:moderator_membership) do
- room.room_memberships.create!(user: room_moderator, role: Voice::RoomMembership::ROLE_MODERATOR)
+ room.room_memberships.create!(user: room_moderator, role: Live::RoomMembership::ROLE_MODERATOR)
end
fab!(:participant_membership) do
- room.room_memberships.create!(user: member, role: Voice::RoomMembership::ROLE_PARTICIPANT)
+ room.room_memberships.create!(user: member, role: Live::RoomMembership::ROLE_PARTICIPANT)
end
before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_allowed_groups =
+ SiteSetting.live_enabled = true
+ SiteSetting.live_allowed_groups =
"#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
- SiteSetting.voice_create_room_allowed_groups = "#{Group::AUTO_GROUPS[:trust_level_2]}"
+ SiteSetting.live_create_room_allowed_groups = "#{Group::AUTO_GROUPS[:trust_level_2]}"
end
describe "#index" do
it "returns 403 for a non-member who can create rooms" do
sign_in(outsider)
- get "/voice/rooms/#{room.id}/memberships.json"
+ get "/live/rooms/#{room.id}/memberships.json"
expect(response.status).to eq(403)
end
@@ -57,13 +41,13 @@ RSpec.describe Voice::RoomMembershipsController do
it "returns 403 for a plain participant member" do
sign_in(member)
- get "/voice/rooms/#{room.id}/memberships.json"
+ get "/live/rooms/#{room.id}/memberships.json"
expect(response.status).to eq(403)
end
it "returns 403 for anonymous visitors" do
- get "/voice/rooms/#{room.id}/memberships.json"
+ get "/live/rooms/#{room.id}/memberships.json"
expect(response.status).to eq(403)
end
@@ -71,7 +55,7 @@ RSpec.describe Voice::RoomMembershipsController do
it "returns the memberships to the room creator" do
sign_in(room_owner)
- get "/voice/rooms/#{room.id}/memberships.json"
+ get "/live/rooms/#{room.id}/memberships.json"
expect(response.status).to eq(200)
user_ids = response.parsed_body["memberships"].map { |membership| membership["user_id"] }
@@ -81,7 +65,7 @@ RSpec.describe Voice::RoomMembershipsController do
it "returns the memberships to a room moderator" do
sign_in(room_moderator)
- get "/voice/rooms/#{room.id}/memberships.json"
+ get "/live/rooms/#{room.id}/memberships.json"
expect(response.status).to eq(200)
end
@@ -89,7 +73,7 @@ RSpec.describe Voice::RoomMembershipsController do
it "returns the memberships to site staff" do
sign_in(staff)
- get "/voice/rooms/#{room.id}/memberships.json"
+ get "/live/rooms/#{room.id}/memberships.json"
expect(response.status).to eq(200)
end
@@ -100,7 +84,7 @@ RSpec.describe Voice::RoomMembershipsController do
sign_in(outsider)
expect {
- post "/voice/rooms/#{room.id}/memberships.json", params: { user_id: outsider.id }
+ post "/live/rooms/#{room.id}/memberships.json", params: { user_id: outsider.id }
}.not_to change { room.room_memberships.count }
expect(response.status).to eq(403)
@@ -109,7 +93,7 @@ RSpec.describe Voice::RoomMembershipsController do
it "returns 403 for a plain participant member" do
sign_in(member)
- post "/voice/rooms/#{room.id}/memberships.json", params: { user_id: invitee.id }
+ post "/live/rooms/#{room.id}/memberships.json", params: { user_id: invitee.id }
expect(response.status).to eq(403)
end
@@ -117,7 +101,7 @@ RSpec.describe Voice::RoomMembershipsController do
it "lets the creator add a member by user_id" do
sign_in(room_owner)
- post "/voice/rooms/#{room.id}/memberships.json", params: { user_id: invitee.id }
+ post "/live/rooms/#{room.id}/memberships.json", params: { user_id: invitee.id }
expect(response.status).to eq(200)
expect(room.room_memberships.find_by(user_id: invitee.id)).to be_participant
@@ -126,7 +110,7 @@ RSpec.describe Voice::RoomMembershipsController do
it "lets the creator add a member by username with a role" do
sign_in(room_owner)
- post "/voice/rooms/#{room.id}/memberships.json",
+ post "/live/rooms/#{room.id}/memberships.json",
params: {
username: invitee.username,
role: "moderator",
@@ -139,25 +123,25 @@ RSpec.describe Voice::RoomMembershipsController do
it "lets a room moderator add a member" do
sign_in(room_moderator)
- post "/voice/rooms/#{room.id}/memberships.json", params: { user_id: invitee.id }
+ post "/live/rooms/#{room.id}/memberships.json", params: { user_id: invitee.id }
expect(response.status).to eq(200)
end
it "clears a present listener's raised hand when granting them the speaker role" do
- room.update!(room_type: Voice::Room::ROOM_TYPE_STAGE)
- Voice::ParticipantTracker.add(room.id, member.id)
- Voice::ParticipantTracker.raise_hand(room.id, member.id)
+ room.update!(room_type: Live::Room::ROOM_TYPE_STAGE)
+ Live::ParticipantTracker.add(room.id, member.id)
+ Live::ParticipantTracker.raise_hand(room.id, member.id)
sign_in(room_owner)
- post "/voice/rooms/#{room.id}/memberships.json",
+ post "/live/rooms/#{room.id}/memberships.json",
params: {
user_id: member.id,
role: "speaker",
}
expect(response.status).to eq(200)
- metadata = Voice::ParticipantTracker.get_metadata(room.id, member.id)
+ metadata = Live::ParticipantTracker.get_metadata(room.id, member.id)
expect(metadata[:role]).to eq("speaker")
expect(metadata[:hand_raised_at]).to be_nil
end
@@ -168,7 +152,7 @@ RSpec.describe Voice::RoomMembershipsController do
sign_in(outsider)
expect {
- put "/voice/rooms/#{room.id}/memberships/#{participant_membership.id}.json",
+ put "/live/rooms/#{room.id}/memberships/#{participant_membership.id}.json",
params: {
role: "moderator",
}
@@ -180,7 +164,7 @@ RSpec.describe Voice::RoomMembershipsController do
it "lets the creator change a member's role" do
sign_in(room_owner)
- put "/voice/rooms/#{room.id}/memberships/#{participant_membership.id}.json",
+ put "/live/rooms/#{room.id}/memberships/#{participant_membership.id}.json",
params: {
role: "speaker",
}
@@ -191,48 +175,48 @@ RSpec.describe Voice::RoomMembershipsController do
it "updates the tracked role of a member present in the room" do
sign_in(room_owner)
- Voice::ParticipantTracker.add(room.id, member.id)
+ Live::ParticipantTracker.add(room.id, member.id)
- put "/voice/rooms/#{room.id}/memberships/#{participant_membership.id}.json",
+ put "/live/rooms/#{room.id}/memberships/#{participant_membership.id}.json",
params: {
role: "moderator",
}
expect(response.status).to eq(200)
- metadata = Voice::ParticipantTracker.get_metadata(room.id, member.id)
+ metadata = Live::ParticipantTracker.get_metadata(room.id, member.id)
expect(metadata[:role]).to eq("moderator")
end
it "clears a present listener's raised hand when promoting them to speaker" do
- room.update!(room_type: Voice::Room::ROOM_TYPE_STAGE)
- Voice::ParticipantTracker.add(room.id, member.id)
- Voice::ParticipantTracker.raise_hand(room.id, member.id)
+ room.update!(room_type: Live::Room::ROOM_TYPE_STAGE)
+ Live::ParticipantTracker.add(room.id, member.id)
+ Live::ParticipantTracker.raise_hand(room.id, member.id)
sign_in(room_owner)
- put "/voice/rooms/#{room.id}/memberships/#{participant_membership.id}.json",
+ put "/live/rooms/#{room.id}/memberships/#{participant_membership.id}.json",
params: {
role: "speaker",
}
expect(response.status).to eq(200)
- metadata = Voice::ParticipantTracker.get_metadata(room.id, member.id)
+ metadata = Live::ParticipantTracker.get_metadata(room.id, member.id)
expect(metadata[:role]).to eq("speaker")
expect(metadata[:hand_raised_at]).to be_nil
end
it "keeps a queued listener's raised hand when their role is set to participant" do
- room.update!(room_type: Voice::Room::ROOM_TYPE_STAGE)
- Voice::ParticipantTracker.add(room.id, member.id)
- Voice::ParticipantTracker.raise_hand(room.id, member.id)
+ room.update!(room_type: Live::Room::ROOM_TYPE_STAGE)
+ Live::ParticipantTracker.add(room.id, member.id)
+ Live::ParticipantTracker.raise_hand(room.id, member.id)
sign_in(room_owner)
- put "/voice/rooms/#{room.id}/memberships/#{participant_membership.id}.json",
+ put "/live/rooms/#{room.id}/memberships/#{participant_membership.id}.json",
params: {
role: "participant",
}
expect(response.status).to eq(200)
- metadata = Voice::ParticipantTracker.get_metadata(room.id, member.id)
+ metadata = Live::ParticipantTracker.get_metadata(room.id, member.id)
expect(metadata[:role]).to eq("participant")
expect(metadata[:hand_raised_at]).to be_a(Float)
end
@@ -243,7 +227,7 @@ RSpec.describe Voice::RoomMembershipsController do
sign_in(outsider)
expect {
- delete "/voice/rooms/#{room.id}/memberships/#{participant_membership.id}.json"
+ delete "/live/rooms/#{room.id}/memberships/#{participant_membership.id}.json"
}.not_to change { room.room_memberships.count }
expect(response.status).to eq(403)
@@ -252,25 +236,25 @@ RSpec.describe Voice::RoomMembershipsController do
it "returns 403 for a plain participant member removing another member" do
sign_in(member)
- delete "/voice/rooms/#{room.id}/memberships/#{moderator_membership.id}.json"
+ delete "/live/rooms/#{room.id}/memberships/#{moderator_membership.id}.json"
expect(response.status).to eq(403)
- expect(Voice::RoomMembership.exists?(moderator_membership.id)).to eq(true)
+ expect(Live::RoomMembership.exists?(moderator_membership.id)).to eq(true)
end
it "lets the creator remove a member" do
sign_in(room_owner)
- delete "/voice/rooms/#{room.id}/memberships/#{participant_membership.id}.json"
+ delete "/live/rooms/#{room.id}/memberships/#{participant_membership.id}.json"
expect(response.status).to eq(204)
- expect(Voice::RoomMembership.exists?(participant_membership.id)).to eq(false)
+ expect(Live::RoomMembership.exists?(participant_membership.id)).to eq(false)
end
it "lets site staff remove a member" do
sign_in(staff)
- delete "/voice/rooms/#{room.id}/memberships/#{participant_membership.id}.json"
+ delete "/live/rooms/#{room.id}/memberships/#{participant_membership.id}.json"
expect(response.status).to eq(204)
end
@@ -278,16 +262,16 @@ RSpec.describe Voice::RoomMembershipsController do
describe "livekit permission sync" do
before do
- SiteSetting.voice_livekit_url = "wss://livekit.example.com"
- SiteSetting.voice_livekit_api_key = "lk_api_key"
- SiteSetting.voice_livekit_api_secret = "lk_api_secret"
- room.update!(room_type: Voice::Room::ROOM_TYPE_STAGE)
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
- Voice::ParticipantTracker.add(room.id, member.id)
+ SiteSetting.live_livekit_url = "wss://livekit.example.com"
+ SiteSetting.live_livekit_api_key = "lk_api_key"
+ SiteSetting.live_livekit_api_secret = "lk_api_secret"
+ room.update!(room_type: Live::Room::ROOM_TYPE_STAGE)
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
+ Live::ParticipantTracker.add(room.id, member.id)
sign_in(room_owner)
end
- after { Voice::ParticipantTracker.clear(room.id) }
+ after { Live::ParticipantTracker.clear(room.id) }
def update_participant_stub
stub_request(:post, "https://livekit.example.com/twirp/livekit.RoomService/UpdateParticipant")
@@ -296,7 +280,7 @@ RSpec.describe Voice::RoomMembershipsController do
it "grants publishing on the SFU when a present stage listener is promoted" do
update_participant_stub
- put "/voice/rooms/#{room.id}/memberships/#{participant_membership.id}.json",
+ put "/live/rooms/#{room.id}/memberships/#{participant_membership.id}.json",
params: {
role: "speaker",
}
@@ -315,10 +299,10 @@ RSpec.describe Voice::RoomMembershipsController do
end
it "revokes publishing on the SFU when a present speaker's membership is removed" do
- participant_membership.update!(role: Voice::RoomMembership::ROLE_SPEAKER)
+ participant_membership.update!(role: Live::RoomMembership::ROLE_SPEAKER)
update_participant_stub
- delete "/voice/rooms/#{room.id}/memberships/#{participant_membership.id}.json"
+ delete "/live/rooms/#{room.id}/memberships/#{participant_membership.id}.json"
expect(response.status).to eq(204)
expect(
@@ -335,7 +319,7 @@ RSpec.describe Voice::RoomMembershipsController do
it "still succeeds when LiveKit is down" do
update_participant_stub.to_timeout
- put "/voice/rooms/#{room.id}/memberships/#{participant_membership.id}.json",
+ put "/live/rooms/#{room.id}/memberships/#{participant_membership.id}.json",
params: {
role: "speaker",
}
@@ -345,11 +329,11 @@ RSpec.describe Voice::RoomMembershipsController do
end
it "makes zero HTTP calls for a mesh room" do
- Voice::ParticipantTracker.clear_transport_pin(room.id)
- Voice::ParticipantTracker.pin_transport!(room.id, "mesh")
+ Live::ParticipantTracker.clear_transport_pin(room.id)
+ Live::ParticipantTracker.pin_transport!(room.id, "mesh")
stub = update_participant_stub
- put "/voice/rooms/#{room.id}/memberships/#{participant_membership.id}.json",
+ put "/live/rooms/#{room.id}/memberships/#{participant_membership.id}.json",
params: {
role: "speaker",
}
@@ -359,10 +343,10 @@ RSpec.describe Voice::RoomMembershipsController do
end
it "makes zero HTTP calls when the member is not in the call" do
- Voice::ParticipantTracker.remove(room.id, member.id)
+ Live::ParticipantTracker.remove(room.id, member.id)
stub = update_participant_stub
- put "/voice/rooms/#{room.id}/memberships/#{participant_membership.id}.json",
+ put "/live/rooms/#{room.id}/memberships/#{participant_membership.id}.json",
params: {
role: "speaker",
}
diff --git a/plugins/voice/spec/requests/voice/rooms_controller_flag_spec.rb b/plugins/live/spec/requests/live/rooms_controller_flag_spec.rb
similarity index 61%
rename from plugins/voice/spec/requests/voice/rooms_controller_flag_spec.rb
rename to plugins/live/spec/requests/live/rooms_controller_flag_spec.rb
index 6eb2114fc22..059c8a96324 100644
--- a/plugins/voice/spec/requests/voice/rooms_controller_flag_spec.rb
+++ b/plugins/live/spec/requests/live/rooms_controller_flag_spec.rb
@@ -2,16 +2,16 @@
require "rails_helper"
-RSpec.describe Voice::RoomsController do
+RSpec.describe Live::RoomsController do
fab!(:flagger) { Fabricate(:user, trust_level: TrustLevel[2]) }
fab!(:flagged_user) { Fabricate(:user, trust_level: TrustLevel[2]) }
- fab!(:room) { Fabricate(:voice_room, public: true) }
+ fab!(:room) { Fabricate(:live_room, public: true) }
- fab!(:session) { Fabricate(:voice_session, room: room, user: flagged_user, left_at: nil) }
+ fab!(:session) { Fabricate(:live_session, room: room, user: flagged_user, left_at: nil) }
before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_allowed_groups =
+ SiteSetting.live_enabled = true
+ SiteSetting.live_allowed_groups =
"#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
Group.refresh_automatic_groups!
end
@@ -26,7 +26,7 @@ RSpec.describe Voice::RoomsController do
end
it "requires the user to be logged in" do
- post "/voice/rooms/#{room.id}/flag.json", params: params
+ post "/live/rooms/#{room.id}/flag.json", params: params
expect(response.status).to eq(403)
end
@@ -34,13 +34,13 @@ RSpec.describe Voice::RoomsController do
it "creates a reviewable targeting the user's session and a companion PM to moderators" do
sign_in(flagger)
- expect { post "/voice/rooms/#{room.id}/flag.json", params: params }.to change {
- ReviewableVoiceUser.count
+ expect { post "/live/rooms/#{room.id}/flag.json", params: params }.to change {
+ ReviewableLiveUser.count
}.by(1).and change { Topic.private_messages.count }.by(1)
expect(response.status).to eq(200)
- reviewable = ReviewableVoiceUser.last
+ reviewable = ReviewableLiveUser.last
expect(reviewable.target).to eq(session)
expect(reviewable.target_created_by).to eq(flagged_user)
expect(reviewable.created_by).to eq(flagger)
@@ -56,80 +56,80 @@ RSpec.describe Voice::RoomsController do
it "rejects flag types other than notify_moderators" do
sign_in(flagger)
- post "/voice/rooms/#{room.id}/flag.json",
+ post "/live/rooms/#{room.id}/flag.json",
params: params.merge(flag_type_id: ReviewableScore.types[:spam])
expect(response.status).to eq(400)
- expect(ReviewableVoiceUser.count).to eq(0)
+ expect(ReviewableLiveUser.count).to eq(0)
end
it "rejects a flag without a message" do
sign_in(flagger)
- post "/voice/rooms/#{room.id}/flag.json", params: params.merge(message: "")
+ post "/live/rooms/#{room.id}/flag.json", params: params.merge(message: "")
expect(response.status).to eq(400)
- expect(ReviewableVoiceUser.count).to eq(0)
+ expect(ReviewableLiveUser.count).to eq(0)
end
it "rejects flagging yourself" do
sign_in(flagger)
- post "/voice/rooms/#{room.id}/flag.json", params: params.merge(user_id: flagger.id)
+ post "/live/rooms/#{room.id}/flag.json", params: params.merge(user_id: flagger.id)
expect(response.status).to eq(403)
end
it "rejects flagging a user who never joined the room" do
- other_room = Fabricate(:voice_room, public: true)
+ other_room = Fabricate(:live_room, public: true)
sign_in(flagger)
- post "/voice/rooms/#{other_room.id}/flag.json", params: params
+ post "/live/rooms/#{other_room.id}/flag.json", params: params
expect(response.status).to eq(422)
expect(response.parsed_body["errors"]).to include(
- I18n.t("voice.errors.flag_target_never_joined"),
+ I18n.t("live.errors.flag_target_never_joined"),
)
end
it "rejects a second flag while the flagger already has a pending one" do
sign_in(flagger)
- post "/voice/rooms/#{room.id}/flag.json", params: params
+ post "/live/rooms/#{room.id}/flag.json", params: params
expect(response.status).to eq(200)
- post "/voice/rooms/#{room.id}/flag.json", params: params
+ post "/live/rooms/#{room.id}/flag.json", params: params
expect(response.status).to eq(422)
- expect(response.parsed_body["errors"]).to include(I18n.t("voice.errors.flag_already_handled"))
- expect(ReviewableVoiceUser.count).to eq(1)
+ expect(response.parsed_body["errors"]).to include(I18n.t("live.errors.flag_already_handled"))
+ expect(ReviewableLiveUser.count).to eq(1)
end
it "lets another user add a score to the existing reviewable" do
other_flagger = Fabricate(:user, trust_level: TrustLevel[2])
sign_in(flagger)
- post "/voice/rooms/#{room.id}/flag.json", params: params
+ post "/live/rooms/#{room.id}/flag.json", params: params
sign_in(other_flagger)
- post "/voice/rooms/#{room.id}/flag.json", params: params
+ post "/live/rooms/#{room.id}/flag.json", params: params
expect(response.status).to eq(200)
- expect(ReviewableVoiceUser.count).to eq(1)
- expect(ReviewableVoiceUser.last.reviewable_scores.map(&:user_id)).to contain_exactly(
+ expect(ReviewableLiveUser.count).to eq(1)
+ expect(ReviewableLiveUser.last.reviewable_scores.map(&:user_id)).to contain_exactly(
flagger.id,
other_flagger.id,
)
end
it "rejects flagging in a private room the flagger cannot join" do
- private_room = Fabricate(:voice_room, public: false)
- Fabricate(:voice_session, room: private_room, user: flagged_user, left_at: nil)
+ private_room = Fabricate(:live_room, public: false)
+ Fabricate(:live_session, room: private_room, user: flagged_user, left_at: nil)
sign_in(flagger)
- post "/voice/rooms/#{private_room.id}/flag.json", params: params
+ post "/live/rooms/#{private_room.id}/flag.json", params: params
expect(response.status).to eq(403)
- expect(ReviewableVoiceUser.count).to eq(0)
+ expect(ReviewableLiveUser.count).to eq(0)
end
end
end
diff --git a/plugins/voice/spec/requests/voice/rooms_controller_livekit_spec.rb b/plugins/live/spec/requests/live/rooms_controller_livekit_spec.rb
similarity index 55%
rename from plugins/voice/spec/requests/voice/rooms_controller_livekit_spec.rb
rename to plugins/live/spec/requests/live/rooms_controller_livekit_spec.rb
index b2a5061f25c..101244fb2b1 100644
--- a/plugins/voice/spec/requests/voice/rooms_controller_livekit_spec.rb
+++ b/plugins/live/spec/requests/live/rooms_controller_livekit_spec.rb
@@ -1,56 +1,32 @@
# frozen_string_literal: true
require "rails_helper"
-require_relative "../../../db/migrate/20241107000000_create_voice_rooms"
-require_relative "../../../db/migrate/20260305162426_add_room_type_to_voice_rooms"
-require_relative "../../../db/migrate/20260612135211_add_video_enabled_to_voice_rooms"
-require_relative "../../../db/migrate/20260630183841_add_chat_settings_to_voice_rooms"
-require_relative "../../../db/migrate/20260709165411_add_livekit_enabled_to_voice_rooms"
-
-RSpec.describe Voice::RoomsController do
- before do
- ActiveRecord::Migration.suppress_messages do
- CreateVoiceRooms.new.change unless ActiveRecord::Base.connection.table_exists?(:voice_rooms)
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :room_type)
- AddRoomTypeToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :video_enabled)
- AddVideoEnabledToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :chat_channel_id)
- AddChatSettingsToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :livekit_enabled)
- AddLivekitEnabledToVoiceRooms.new.change
- end
- end
- Voice::Room.reset_column_information
- end
+RSpec.describe Live::RoomsController do
fab!(:user)
fab!(:other_user, :user)
- fab!(:room) { Fabricate(:voice_room, public: true) }
+ fab!(:room) { Fabricate(:live_room, public: true) }
before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_allowed_groups =
+ SiteSetting.live_enabled = true
+ SiteSetting.live_allowed_groups =
"#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
end
- after { Voice::ParticipantTracker.clear(room.id) }
+ after { Live::ParticipantTracker.clear(room.id) }
def configure_livekit!
- SiteSetting.voice_livekit_url = "wss://livekit.example.com"
- SiteSetting.voice_livekit_api_key = "lk_api_key"
- SiteSetting.voice_livekit_api_secret = "lk_api_secret"
- SiteSetting.voice_livekit_room_policy = "all_rooms"
+ SiteSetting.live_livekit_url = "wss://livekit.example.com"
+ SiteSetting.live_livekit_api_key = "lk_api_key"
+ SiteSetting.live_livekit_api_secret = "lk_api_secret"
+ SiteSetting.live_livekit_room_policy = "all_rooms"
end
describe "#join" do
before { sign_in(user) }
it "resolves to mesh with no livekit payload when unconfigured" do
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
expect(response.status).to eq(200)
expect(response.parsed_body.keys).to contain_exactly(
@@ -65,7 +41,7 @@ RSpec.describe Voice::RoomsController do
it "resolves to livekit with a url and a decodable token when configured" do
configure_livekit!
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
expect(response.status).to eq(200)
expect(response.parsed_body["transport"]).to eq("livekit")
@@ -74,31 +50,31 @@ RSpec.describe Voice::RoomsController do
payload =
JWT.decode(
response.parsed_body["livekit"]["token"],
- SiteSetting.voice_livekit_api_secret,
+ SiteSetting.live_livekit_api_secret,
true,
algorithm: "HS256",
).first
expect(payload["sub"]).to eq(user.id.to_s)
- expect(payload["video"]["room"]).to eq(Voice::Livekit.room_name(room))
+ expect(payload["video"]["room"]).to eq(Live::Livekit.room_name(room))
end
it "never leaks the api secret in the response" do
configure_livekit!
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
- expect(response.body).not_to include(SiteSetting.voice_livekit_api_secret)
+ expect(response.body).not_to include(SiteSetting.live_livekit_api_secret)
end
it "holds the pinned transport across a config change" do
configure_livekit!
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
expect(response.parsed_body["transport"]).to eq("livekit")
- SiteSetting.voice_livekit_room_policy = "disabled"
+ SiteSetting.live_livekit_room_policy = "disabled"
sign_in(other_user)
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
expect(response.parsed_body["transport"]).to eq("livekit")
expect(response.parsed_body["livekit"]["token"]).to be_present
@@ -106,81 +82,81 @@ RSpec.describe Voice::RoomsController do
it "re-resolves the transport once the room has emptied" do
configure_livekit!
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
expect(response.parsed_body["transport"]).to eq("livekit")
- SiteSetting.voice_livekit_room_policy = "disabled"
+ SiteSetting.live_livekit_room_policy = "disabled"
# The last leave also deletes the now-empty room from the SFU.
stub_request(:post, "https://livekit.example.com/twirp/livekit.RoomService/DeleteRoom")
- delete "/voice/rooms/#{room.id}/leave.json"
- expect(Voice::ParticipantTracker.pinned_transport(room.id)).to be_nil
+ delete "/live/rooms/#{room.id}/leave.json"
+ expect(Live::ParticipantTracker.pinned_transport(room.id)).to be_nil
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
expect(response.parsed_body["transport"]).to eq("mesh")
end
it "fails the join with a 503 when the token cannot be minted" do
configure_livekit!
- Voice::Livekit.stubs(:mint_token).raises(Voice::Livekit::MintError.new("boom"))
+ Live::Livekit.stubs(:mint_token).raises(Live::Livekit::MintError.new("boom"))
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
expect(response.status).to eq(503)
- expect(response.parsed_body["errors"]).to include(I18n.t("voice.errors.livekit_unavailable"))
- expect(Voice::ParticipantTracker.user_ids(room.id)).to be_empty
+ expect(response.parsed_body["errors"]).to include(I18n.t("live.errors.livekit_unavailable"))
+ expect(Live::ParticipantTracker.user_ids(room.id)).to be_empty
end
it "falls back to mesh on mint failure only when opted in and the room is empty" do
configure_livekit!
- SiteSetting.voice_livekit_mesh_fallback = true
- Voice::Livekit.stubs(:mint_token).raises(Voice::Livekit::MintError.new("boom"))
+ SiteSetting.live_livekit_mesh_fallback = true
+ Live::Livekit.stubs(:mint_token).raises(Live::Livekit::MintError.new("boom"))
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
expect(response.status).to eq(200)
expect(response.parsed_body["transport"]).to eq("mesh")
- expect(Voice::ParticipantTracker.pinned_transport(room.id)).to eq("mesh")
+ expect(Live::ParticipantTracker.pinned_transport(room.id)).to eq("mesh")
end
it "never falls back on mint failure while the room is occupied on livekit" do
configure_livekit!
- SiteSetting.voice_livekit_mesh_fallback = true
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
- Voice::ParticipantTracker.add(room.id, other_user.id)
- Voice::Livekit.stubs(:mint_token).raises(Voice::Livekit::MintError.new("boom"))
+ SiteSetting.live_livekit_mesh_fallback = true
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
+ Live::ParticipantTracker.add(room.id, other_user.id)
+ Live::Livekit.stubs(:mint_token).raises(Live::Livekit::MintError.new("boom"))
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
expect(response.status).to eq(503)
- expect(Voice::ParticipantTracker.pinned_transport(room.id)).to eq("livekit")
+ expect(Live::ParticipantTracker.pinned_transport(room.id)).to eq("livekit")
end
it "cleans up an agent-only call before falling back to mesh" do
configure_livekit!
- SiteSetting.voice_livekit_mesh_fallback = true
+ SiteSetting.live_livekit_mesh_fallback = true
bot_id = Fabricate(:user, id: -1400).id
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
- Voice::ParticipantTracker.add(room.id, bot_id)
- Voice::Livekit.stubs(:mint_token).raises(Voice::Livekit::MintError.new("boom"))
- Voice::Livekit::RoomServiceClient.expects(:remove_participant).with(room, bot_id)
- Voice::Livekit::RoomServiceClient.expects(:delete_room).with(room)
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
+ Live::ParticipantTracker.add(room.id, bot_id)
+ Live::Livekit.stubs(:mint_token).raises(Live::Livekit::MintError.new("boom"))
+ Live::Livekit::RoomServiceClient.expects(:remove_participant).with(room, bot_id)
+ Live::Livekit::RoomServiceClient.expects(:delete_room).with(room)
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
expect(response.status).to eq(200)
expect(response.parsed_body["transport"]).to eq("mesh")
- expect(Voice::ParticipantTracker.user_ids(room.id)).to contain_exactly(user.id)
- expect(Voice::ParticipantTracker.pinned_transport(room.id)).to eq("mesh")
+ expect(Live::ParticipantTracker.user_ids(room.id)).to contain_exactly(user.id)
+ expect(Live::ParticipantTracker.pinned_transport(room.id)).to eq("mesh")
end
it "fails a livekit-pinned join when the config was half-deleted" do
configure_livekit!
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
- Voice::ParticipantTracker.add(room.id, other_user.id)
- SiteSetting.voice_livekit_api_secret = ""
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
+ Live::ParticipantTracker.add(room.id, other_user.id)
+ SiteSetting.live_livekit_api_secret = ""
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
expect(response.status).to eq(503)
end
@@ -190,9 +166,9 @@ RSpec.describe Voice::RoomsController do
before { configure_livekit! }
it "requires login" do
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
- post "/voice/rooms/#{room.id}/livekit_token.json"
+ post "/live/rooms/#{room.id}/livekit_token.json"
expect(response.status).to eq(403)
end
@@ -200,17 +176,17 @@ RSpec.describe Voice::RoomsController do
it "refuses a token for a new participant when the room is full" do
full_room_participant = Fabricate(:user)
room.update!(max_participants: 2)
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
- Voice::ParticipantTracker.add(room.id, other_user.id)
- Voice::ParticipantTracker.add(room.id, full_room_participant.id)
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
+ Live::ParticipantTracker.add(room.id, other_user.id)
+ Live::ParticipantTracker.add(room.id, full_room_participant.id)
sign_in(user)
- post "/voice/rooms/#{room.id}/livekit_token.json"
+ post "/live/rooms/#{room.id}/livekit_token.json"
expect(response.status).to eq(422)
- expect(response.parsed_body["errors"]).to include(I18n.t("voice.errors.room_full"))
+ expect(response.parsed_body["errors"]).to include(I18n.t("live.errors.room_full"))
expect(response.parsed_body).not_to have_key("token")
- expect(Voice::ParticipantTracker.user_ids(room.id)).to contain_exactly(
+ expect(Live::ParticipantTracker.user_ids(room.id)).to contain_exactly(
other_user.id,
full_room_participant.id,
)
@@ -218,16 +194,16 @@ RSpec.describe Voice::RoomsController do
it "reissues a token, re-adds lapsed presence, and mints a fresh participant session" do
sign_in(user)
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
- post "/voice/rooms/#{room.id}/livekit_token.json"
+ post "/live/rooms/#{room.id}/livekit_token.json"
expect(response.status).to eq(200)
expect(response.parsed_body["url"]).to eq("wss://livekit.example.com")
expect(response.parsed_body["token"]).to be_present
- expect(Voice::ParticipantTracker.user_ids(room.id)).to include(user.id)
+ expect(Live::ParticipantTracker.user_ids(room.id)).to include(user.id)
expect(
- Voice::ParticipantTracker.valid_participant_session?(
+ Live::ParticipantTracker.valid_participant_session?(
room.id,
user.id,
response.parsed_body["participant_session_id"],
@@ -237,33 +213,33 @@ RSpec.describe Voice::RoomsController do
it "re-establishes presence even for a user who recently left" do
sign_in(user)
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
- Voice::ParticipantTracker.mark_left(room.id, user.id)
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
+ Live::ParticipantTracker.mark_left(room.id, user.id)
- post "/voice/rooms/#{room.id}/livekit_token.json"
+ post "/live/rooms/#{room.id}/livekit_token.json"
expect(response.status).to eq(200)
- expect(Voice::ParticipantTracker.user_ids(room.id)).to include(user.id)
- expect(Voice::ParticipantTracker.recently_left?(room.id, user.id)).to eq(false)
+ expect(Live::ParticipantTracker.user_ids(room.id)).to include(user.id)
+ expect(Live::ParticipantTracker.recently_left?(room.id, user.id)).to eq(false)
end
it "returns 410 when the room instance ended or runs on mesh" do
sign_in(user)
- post "/voice/rooms/#{room.id}/livekit_token.json"
+ post "/live/rooms/#{room.id}/livekit_token.json"
expect(response.status).to eq(410)
- Voice::ParticipantTracker.pin_transport!(room.id, "mesh")
- post "/voice/rooms/#{room.id}/livekit_token.json"
+ Live::ParticipantTracker.pin_transport!(room.id, "mesh")
+ post "/live/rooms/#{room.id}/livekit_token.json"
expect(response.status).to eq(410)
end
it "returns 503 when the pinned room's token cannot be minted" do
sign_in(user)
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
- SiteSetting.voice_livekit_api_secret = ""
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
+ SiteSetting.live_livekit_api_secret = ""
- post "/voice/rooms/#{room.id}/livekit_token.json"
+ post "/live/rooms/#{room.id}/livekit_token.json"
expect(response.status).to eq(503)
end
@@ -271,14 +247,14 @@ RSpec.describe Voice::RoomsController do
it "rate limits repeated mints" do
RateLimiter.enable
sign_in(user)
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
10.times do
- post "/voice/rooms/#{room.id}/livekit_token.json"
+ post "/live/rooms/#{room.id}/livekit_token.json"
expect(response.status).to eq(200)
end
- post "/voice/rooms/#{room.id}/livekit_token.json"
+ post "/live/rooms/#{room.id}/livekit_token.json"
expect(response.status).to eq(429)
end
end
@@ -288,13 +264,13 @@ RSpec.describe Voice::RoomsController do
it "refreshes the transport pin ttl" do
configure_livekit!
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
participant_session_id = response.parsed_body["participant_session_id"]
- key = "#{Voice::ParticipantTracker::KEY_NAMESPACE}:#{room.id}:transport"
+ key = "#{Live::ParticipantTracker::KEY_NAMESPACE}:#{room.id}:transport"
Discourse.redis.expire(key, 1)
- post "/voice/rooms/#{room.id}/heartbeat.json",
+ post "/live/rooms/#{room.id}/heartbeat.json",
params: {
participant_session_id: participant_session_id,
}
@@ -310,15 +286,15 @@ RSpec.describe Voice::RoomsController do
it "evicts the kicked user's media session from a livekit-pinned room" do
configure_livekit!
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
- Voice::ParticipantTracker.add(room.id, other_user.id)
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
+ Live::ParticipantTracker.add(room.id, other_user.id)
stub =
stub_request(
:post,
"https://livekit.example.com/twirp/livekit.RoomService/RemoveParticipant",
- ).with(body: { identity: other_user.id.to_s, room: Voice::Livekit.room_name(room) }.to_json)
+ ).with(body: { identity: other_user.id.to_s, room: Live::Livekit.room_name(room) }.to_json)
- delete "/voice/rooms/#{room.id}/kick.json", params: { user_id: other_user.id }
+ delete "/live/rooms/#{room.id}/kick.json", params: { user_id: other_user.id }
expect(response.status).to eq(204)
expect(stub).to have_been_requested
@@ -326,25 +302,25 @@ RSpec.describe Voice::RoomsController do
it "still succeeds when LiveKit is down" do
configure_livekit!
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
- Voice::ParticipantTracker.add(room.id, other_user.id)
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
+ Live::ParticipantTracker.add(room.id, other_user.id)
stub_request(
:post,
"https://livekit.example.com/twirp/livekit.RoomService/RemoveParticipant",
).to_timeout
- delete "/voice/rooms/#{room.id}/kick.json", params: { user_id: other_user.id }
+ delete "/live/rooms/#{room.id}/kick.json", params: { user_id: other_user.id }
expect(response.status).to eq(204)
end
it "makes zero HTTP calls for a mesh room" do
configure_livekit!
- Voice::ParticipantTracker.pin_transport!(room.id, "mesh")
- Voice::ParticipantTracker.add(room.id, other_user.id)
+ Live::ParticipantTracker.pin_transport!(room.id, "mesh")
+ Live::ParticipantTracker.add(room.id, other_user.id)
stub = stub_request(:post, %r{\Ahttps://livekit\.example\.com/twirp/})
- delete "/voice/rooms/#{room.id}/kick.json", params: { user_id: other_user.id }
+ delete "/live/rooms/#{room.id}/kick.json", params: { user_id: other_user.id }
expect(response.status).to eq(204)
expect(stub).not_to have_been_requested
@@ -358,26 +334,26 @@ RSpec.describe Voice::RoomsController do
it "deletes a livekit-pinned room from the SFU and clears the pin" do
configure_livekit!
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
stub =
stub_request(
:post,
"https://livekit.example.com/twirp/livekit.RoomService/DeleteRoom",
- ).with(body: { room: Voice::Livekit.room_name(room) }.to_json)
+ ).with(body: { room: Live::Livekit.room_name(room) }.to_json)
- delete "/voice/rooms/#{room.id}.json"
+ delete "/live/rooms/#{room.id}.json"
expect(response.status).to eq(200)
expect(stub).to have_been_requested
- expect(Voice::ParticipantTracker.pinned_transport(room.id)).to be_nil
+ expect(Live::ParticipantTracker.pinned_transport(room.id)).to be_nil
end
it "makes zero HTTP calls for a mesh room" do
configure_livekit!
- Voice::ParticipantTracker.pin_transport!(room.id, "mesh")
+ Live::ParticipantTracker.pin_transport!(room.id, "mesh")
stub = stub_request(:post, %r{\Ahttps://livekit\.example\.com/twirp/})
- delete "/voice/rooms/#{room.id}.json"
+ delete "/live/rooms/#{room.id}.json"
expect(response.status).to eq(200)
expect(stub).not_to have_been_requested
@@ -391,32 +367,32 @@ RSpec.describe Voice::RoomsController do
end
it "deletes the SFU room when the last participant leaves" do
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
expect(response.parsed_body["transport"]).to eq("livekit")
stub =
stub_request(
:post,
"https://livekit.example.com/twirp/livekit.RoomService/DeleteRoom",
- ).with(body: { room: Voice::Livekit.room_name(room) }.to_json)
+ ).with(body: { room: Live::Livekit.room_name(room) }.to_json)
- delete "/voice/rooms/#{room.id}/leave.json"
+ delete "/live/rooms/#{room.id}/leave.json"
expect(response.status).to eq(204)
expect(stub).to have_been_requested
- expect(Voice::ParticipantTracker.pinned_transport(room.id)).to be_nil
+ expect(Live::ParticipantTracker.pinned_transport(room.id)).to be_nil
end
it "keeps the SFU room while other participants remain" do
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
- Voice::ParticipantTracker.add(room.id, other_user.id)
- post "/voice/rooms/#{room.id}/join.json"
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
+ Live::ParticipantTracker.add(room.id, other_user.id)
+ post "/live/rooms/#{room.id}/join.json"
stub = stub_request(:post, %r{\Ahttps://livekit\.example\.com/twirp/})
- delete "/voice/rooms/#{room.id}/leave.json"
+ delete "/live/rooms/#{room.id}/leave.json"
expect(response.status).to eq(204)
expect(stub).not_to have_been_requested
- expect(Voice::ParticipantTracker.pinned_transport(room.id)).to eq("livekit")
+ expect(Live::ParticipantTracker.pinned_transport(room.id)).to eq("livekit")
end
end
@@ -425,10 +401,10 @@ RSpec.describe Voice::RoomsController do
it "rejects signaling in a livekit-pinned room" do
configure_livekit!
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
participant_session_id = response.parsed_body["participant_session_id"]
- post "/voice/rooms/#{room.id}/signal.json",
+ post "/live/rooms/#{room.id}/signal.json",
params: {
payload: {
recipient_id: other_user.id,
@@ -439,18 +415,18 @@ RSpec.describe Voice::RoomsController do
}
expect(response.status).to eq(422)
- expect(response.parsed_body["errors"]).to include(I18n.t("voice.errors.livekit_no_signaling"))
+ expect(response.parsed_body["errors"]).to include(I18n.t("live.errors.livekit_no_signaling"))
end
it "still relays signals in a mesh room" do
- Voice::ParticipantTracker.add(room.id, other_user.id)
- Voice::ParticipantTracker.create_participant_session!(room.id, other_user.id)
- post "/voice/rooms/#{room.id}/join.json"
+ Live::ParticipantTracker.add(room.id, other_user.id)
+ Live::ParticipantTracker.create_participant_session!(room.id, other_user.id)
+ post "/live/rooms/#{room.id}/join.json"
participant_session_id = response.parsed_body["participant_session_id"]
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) do
- post "/voice/rooms/#{room.id}/signal.json",
+ MessageBus.track_publish(Live.room_channel(room.id)) do
+ post "/live/rooms/#{room.id}/signal.json",
params: {
payload: {
recipient_id: other_user.id,
@@ -467,47 +443,47 @@ RSpec.describe Voice::RoomsController do
end
describe "per-room policy" do
- fab!(:managed_room) { Fabricate(:voice_room, creator: user, public: true) }
+ fab!(:managed_room) { Fabricate(:live_room, creator: user, public: true) }
before do
configure_livekit!
- SiteSetting.voice_livekit_room_policy = "per_room"
+ SiteSetting.live_livekit_room_policy = "per_room"
end
- after { Voice::ParticipantTracker.clear(managed_room.id) }
+ after { Live::ParticipantTracker.clear(managed_room.id) }
describe "#join" do
before { sign_in(user) }
it "resolves the transport from the room's flag" do
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
expect(response.parsed_body["transport"]).to eq("mesh")
managed_room.update!(livekit_enabled: true)
- post "/voice/rooms/#{managed_room.id}/join.json"
+ post "/live/rooms/#{managed_room.id}/join.json"
expect(response.parsed_body["transport"]).to eq("livekit")
end
it "keeps a live livekit call on livekit when the flag is disabled mid-call" do
managed_room.update!(livekit_enabled: true)
- post "/voice/rooms/#{managed_room.id}/join.json"
+ post "/live/rooms/#{managed_room.id}/join.json"
expect(response.parsed_body["transport"]).to eq("livekit")
managed_room.update!(livekit_enabled: false)
sign_in(other_user)
- post "/voice/rooms/#{managed_room.id}/join.json"
+ post "/live/rooms/#{managed_room.id}/join.json"
expect(response.parsed_body["transport"]).to eq("livekit")
end
it "keeps a live mesh call on mesh when the flag is enabled mid-call" do
- post "/voice/rooms/#{managed_room.id}/join.json"
+ post "/live/rooms/#{managed_room.id}/join.json"
expect(response.parsed_body["transport"]).to eq("mesh")
managed_room.update!(livekit_enabled: true)
sign_in(other_user)
- post "/voice/rooms/#{managed_room.id}/join.json"
+ post "/live/rooms/#{managed_room.id}/join.json"
expect(response.parsed_body["transport"]).to eq("mesh")
expect(response.parsed_body["livekit"]).to be_nil
end
@@ -515,10 +491,10 @@ RSpec.describe Voice::RoomsController do
describe "#create" do
it "accepts livekit_enabled" do
- SiteSetting.voice_create_room_allowed_groups = "#{Group::AUTO_GROUPS[:trust_level_2]}"
+ SiteSetting.live_create_room_allowed_groups = "#{Group::AUTO_GROUPS[:trust_level_2]}"
sign_in(Fabricate(:user, trust_level: TrustLevel[2]))
- post "/voice/rooms.json",
+ post "/live/rooms.json",
params: {
room: {
name: "Town hall",
@@ -528,7 +504,7 @@ RSpec.describe Voice::RoomsController do
}
expect(response.status).to eq(200)
- expect(Voice::Room.find_by(name: "Town hall").livekit_enabled).to eq(true)
+ expect(Live::Room.find_by(name: "Town hall").livekit_enabled).to eq(true)
end
end
@@ -536,7 +512,7 @@ RSpec.describe Voice::RoomsController do
it "lets a room manager toggle the flag" do
sign_in(user)
- put "/voice/rooms/#{managed_room.id}.json", params: { room: { livekit_enabled: true } }
+ put "/live/rooms/#{managed_room.id}.json", params: { room: { livekit_enabled: true } }
expect(response.status).to eq(200)
expect(managed_room.reload.livekit_enabled).to eq(true)
@@ -544,15 +520,15 @@ RSpec.describe Voice::RoomsController do
end
it "accepts a stale form's flag but the resolver ignores it once the policy changed" do
- SiteSetting.voice_livekit_room_policy = "disabled"
+ SiteSetting.live_livekit_room_policy = "disabled"
sign_in(user)
- put "/voice/rooms/#{managed_room.id}.json", params: { room: { livekit_enabled: true } }
+ put "/live/rooms/#{managed_room.id}.json", params: { room: { livekit_enabled: true } }
expect(response.status).to eq(200)
expect(managed_room.reload.livekit_enabled).to eq(true)
- post "/voice/rooms/#{managed_room.id}/join.json"
+ post "/live/rooms/#{managed_room.id}/join.json"
expect(response.parsed_body["transport"]).to eq("mesh")
end
end
@@ -560,11 +536,11 @@ RSpec.describe Voice::RoomsController do
describe "#show" do
it "serializes the flag to managers only" do
sign_in(user)
- get "/voice/rooms/#{managed_room.id}.json"
+ get "/live/rooms/#{managed_room.id}.json"
expect(response.parsed_body["room"]).to have_key("livekit_enabled")
sign_in(other_user)
- get "/voice/rooms/#{managed_room.id}.json"
+ get "/live/rooms/#{managed_room.id}.json"
expect(response.parsed_body["room"]).not_to have_key("livekit_enabled")
end
end
@@ -574,7 +550,7 @@ RSpec.describe Voice::RoomsController do
before { sign_in(user) }
it "predicts mesh when livekit is unconfigured" do
- get "/voice/rooms/#{room.id}.json"
+ get "/live/rooms/#{room.id}.json"
expect(response.parsed_body["room"]["expected_transport"]).to eq("mesh")
end
@@ -582,18 +558,18 @@ RSpec.describe Voice::RoomsController do
it "predicts livekit when configured and allowed for the room" do
configure_livekit!
- get "/voice/rooms/#{room.id}.json"
+ get "/live/rooms/#{room.id}.json"
expect(response.parsed_body["room"]["expected_transport"]).to eq("livekit")
end
it "reports the pinned transport of a live call over the current resolution" do
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
expect(response.parsed_body["transport"]).to eq("mesh")
configure_livekit!
- get "/voice/rooms/#{room.id}.json"
+ get "/live/rooms/#{room.id}.json"
expect(response.parsed_body["room"]["expected_transport"]).to eq("mesh")
end
diff --git a/plugins/live/spec/requests/live/rooms_controller_recording_spec.rb b/plugins/live/spec/requests/live/rooms_controller_recording_spec.rb
new file mode 100644
index 00000000000..9bccdf94e3d
--- /dev/null
+++ b/plugins/live/spec/requests/live/rooms_controller_recording_spec.rb
@@ -0,0 +1,155 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+
+RSpec.describe Live::RoomsController do
+ fab!(:creator, :user)
+ fab!(:participant, :user)
+ fab!(:room) { Fabricate(:live_room, public: true, creator: creator) }
+
+ before do
+ SiteSetting.live_enabled = true
+ SiteSetting.live_allowed_groups =
+ "#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
+ SiteSetting.live_livekit_url = "wss://livekit.example.com"
+ SiteSetting.live_livekit_api_key = "lk_api_key"
+ SiteSetting.live_livekit_api_secret = "lk_api_secret"
+ SiteSetting.live_livekit_room_policy = "all_rooms"
+ SiteSetting.live_livekit_recording_enabled = true
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
+ end
+
+ after { Live::ParticipantTracker.clear(room.id) }
+
+ def stub_start(egress_id: "EG_1")
+ stub_request(
+ :post,
+ "https://livekit.example.com/twirp/livekit.Egress/StartRoomCompositeEgress",
+ ).to_return(body: { egressId: egress_id }.to_json)
+ end
+
+ def stub_stop
+ stub_request(:post, "https://livekit.example.com/twirp/livekit.Egress/StopEgress").to_return(
+ body: "{}",
+ )
+ end
+
+ describe "#start_recording" do
+ it "starts a recording and returns its room-wide status to a room manager" do
+ sign_in(creator)
+ stub_start
+
+ post "/live/rooms/#{room.id}/recording.json"
+
+ expect(response.status).to eq(200)
+ expect(response.parsed_body["recording"]["started_by"]["id"]).to eq(creator.id)
+ expect(Live::RecordingManager.status(room.id)).to be_present
+ end
+
+ it "rejects a participant who cannot manage the room" do
+ sign_in(participant)
+ stub = stub_start
+
+ post "/live/rooms/#{room.id}/recording.json"
+
+ expect(response.status).to eq(403)
+ expect(stub).not_to have_been_requested
+ end
+
+ it "rejects the request when recordings are disabled" do
+ sign_in(creator)
+ SiteSetting.live_livekit_recording_enabled = false
+
+ post "/live/rooms/#{room.id}/recording.json"
+
+ expect(response.status).to eq(422)
+ expect(response.parsed_body["errors"]).to include(I18n.t("live.errors.recording_unavailable"))
+ end
+
+ it "rejects the request for a mesh call" do
+ sign_in(creator)
+ Live::ParticipantTracker.clear_transport_pin(room.id)
+ Live::ParticipantTracker.pin_transport!(room.id, "mesh")
+
+ post "/live/rooms/#{room.id}/recording.json"
+
+ expect(response.status).to eq(422)
+ end
+
+ it "returns 422 when the egress fails to start" do
+ sign_in(creator)
+ stub_request(
+ :post,
+ "https://livekit.example.com/twirp/livekit.Egress/StartRoomCompositeEgress",
+ ).to_return(status: 500, body: "boom")
+
+ post "/live/rooms/#{room.id}/recording.json"
+
+ expect(response.status).to eq(422)
+ expect(Live::RecordingManager.status(room.id)).to be_nil
+ end
+ end
+
+ describe "#stop_recording" do
+ before do
+ sign_in(creator)
+ stub_start
+ post "/live/rooms/#{room.id}/recording.json"
+ end
+
+ it "stops the recording for a room manager" do
+ stub_stop
+
+ delete "/live/rooms/#{room.id}/recording.json"
+
+ expect(response.status).to eq(204)
+ expect(Live::RecordingManager.status(room.id)).to be_nil
+ end
+
+ it "rejects a participant who cannot manage the room" do
+ sign_in(participant)
+ stub = stub_stop
+
+ delete "/live/rooms/#{room.id}/recording.json"
+
+ expect(response.status).to eq(403)
+ expect(stub).not_to have_been_requested
+ expect(Live::RecordingManager.status(room.id)).to be_present
+ end
+
+ it "returns 422 when nothing is being recorded" do
+ stub_stop
+ delete "/live/rooms/#{room.id}/recording.json"
+
+ delete "/live/rooms/#{room.id}/recording.json"
+
+ expect(response.status).to eq(422)
+ expect(response.parsed_body["errors"]).to include(I18n.t("live.errors.recording_not_active"))
+ end
+ end
+
+ describe "#show" do
+ it "serializes an active recording for any viewer" do
+ sign_in(creator)
+ stub_start
+ post "/live/rooms/#{room.id}/recording.json"
+
+ sign_in(participant)
+ get "/live/rooms/#{room.id}.json"
+
+ expect(response.status).to eq(200)
+ expect(response.parsed_body["room"]["recording"]["started_by"]["username"]).to eq(
+ creator.username,
+ )
+ end
+
+ it "omits the recording field when nothing is being recorded" do
+ sign_in(participant)
+
+ get "/live/rooms/#{room.id}.json"
+
+ expect(response.status).to eq(200)
+ expect(response.parsed_body["room"]).not_to have_key("recording")
+ end
+ end
+end
diff --git a/plugins/voice/spec/requests/voice/rooms_controller_speak_requests_spec.rb b/plugins/live/spec/requests/live/rooms_controller_speak_requests_spec.rb
similarity index 53%
rename from plugins/voice/spec/requests/voice/rooms_controller_speak_requests_spec.rb
rename to plugins/live/spec/requests/live/rooms_controller_speak_requests_spec.rb
index 60a4d857392..6840f84909d 100644
--- a/plugins/voice/spec/requests/voice/rooms_controller_speak_requests_spec.rb
+++ b/plugins/live/spec/requests/live/rooms_controller_speak_requests_spec.rb
@@ -1,59 +1,43 @@
# frozen_string_literal: true
require "rails_helper"
-require_relative "../../../db/migrate/20241107000000_create_voice_rooms"
-require_relative "../../../db/migrate/20260305162426_add_room_type_to_voice_rooms"
-require_relative "../../../db/migrate/20260612135211_add_video_enabled_to_voice_rooms"
-
-RSpec.describe Voice::RoomsController do
- before do
- ActiveRecord::Migration.suppress_messages do
- CreateVoiceRooms.new.change unless ActiveRecord::Base.connection.table_exists?(:voice_rooms)
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :room_type)
- AddRoomTypeToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :video_enabled)
- AddVideoEnabledToVoiceRooms.new.change
- end
- end
- Voice::Room.reset_column_information
- end
+RSpec.describe Live::RoomsController do
fab!(:staff, :admin)
fab!(:room_owner) { Fabricate(:user, trust_level: TrustLevel[2]) }
fab!(:listener) { Fabricate(:user, trust_level: TrustLevel[2]) }
fab!(:other_listener) { Fabricate(:user, trust_level: TrustLevel[2]) }
fab!(:room_speaker) { Fabricate(:user, trust_level: TrustLevel[2]) }
fab!(:room_moderator) { Fabricate(:user, trust_level: TrustLevel[2]) }
- fab!(:room) { Fabricate(:voice_room, creator: room_owner, public: true) }
+ fab!(:room) { Fabricate(:live_room, creator: room_owner, public: true) }
fab!(:speaker_membership) do
- room.room_memberships.create!(user: room_speaker, role: Voice::RoomMembership::ROLE_SPEAKER)
+ room.room_memberships.create!(user: room_speaker, role: Live::RoomMembership::ROLE_SPEAKER)
end
fab!(:moderator_membership) do
- room.room_memberships.create!(user: room_moderator, role: Voice::RoomMembership::ROLE_MODERATOR)
+ room.room_memberships.create!(user: room_moderator, role: Live::RoomMembership::ROLE_MODERATOR)
end
before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_allowed_groups =
+ SiteSetting.live_enabled = true
+ SiteSetting.live_allowed_groups =
"#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
- SiteSetting.voice_create_room_allowed_groups = "#{Group::AUTO_GROUPS[:trust_level_2]}"
- room.update!(room_type: Voice::Room::ROOM_TYPE_STAGE)
- Voice::ParticipantTracker.add(room.id, listener.id)
+ SiteSetting.live_create_room_allowed_groups = "#{Group::AUTO_GROUPS[:trust_level_2]}"
+ room.update!(room_type: Live::Room::ROOM_TYPE_STAGE)
+ Live::ParticipantTracker.add(room.id, listener.id)
@listener_session_id =
- Voice::ParticipantTracker.create_participant_session!(room.id, listener.id)
+ Live::ParticipantTracker.create_participant_session!(room.id, listener.id)
end
- after { Voice::ParticipantTracker.clear(room.id) }
+ after { Live::ParticipantTracker.clear(room.id) }
describe "#request_to_speak" do
it "raises a present stage listener's hand and broadcasts the raise plus the roster" do
sign_in(listener)
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) do
- post "/voice/rooms/#{room.id}/request_to_speak.json",
+ MessageBus.track_publish(Live.room_channel(room.id)) do
+ post "/live/rooms/#{room.id}/request_to_speak.json",
params: {
participant_session_id: @listener_session_id,
}
@@ -61,7 +45,7 @@ RSpec.describe Voice::RoomsController do
expect(response.status).to eq(204)
- metadata = Voice::ParticipantTracker.get_metadata(room.id, listener.id)
+ metadata = Live::ParticipantTracker.get_metadata(room.id, listener.id)
expect(metadata[:hand_raised_at]).to be_a(Float)
hand_message = messages.find { |message| message.data[:type] == "hand_raise" }
@@ -77,59 +61,59 @@ RSpec.describe Voice::RoomsController do
it "keeps the original timestamp and publishes nothing on a repeat request" do
sign_in(listener)
- post "/voice/rooms/#{room.id}/request_to_speak.json",
+ post "/live/rooms/#{room.id}/request_to_speak.json",
params: {
participant_session_id: @listener_session_id,
}
- original = Voice::ParticipantTracker.get_metadata(room.id, listener.id)[:hand_raised_at]
+ original = Live::ParticipantTracker.get_metadata(room.id, listener.id)[:hand_raised_at]
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) do
- post "/voice/rooms/#{room.id}/request_to_speak.json",
+ MessageBus.track_publish(Live.room_channel(room.id)) do
+ post "/live/rooms/#{room.id}/request_to_speak.json",
params: {
participant_session_id: @listener_session_id,
}
end
expect(response.status).to eq(204)
- expect(Voice::ParticipantTracker.get_metadata(room.id, listener.id)[:hand_raised_at]).to eq(
+ expect(Live::ParticipantTracker.get_metadata(room.id, listener.id)[:hand_raised_at]).to eq(
original,
)
expect(messages).to be_empty
end
it "returns 403 for a stage speaker, who can already speak" do
- Voice::ParticipantTracker.add(room.id, room_speaker.id)
+ Live::ParticipantTracker.add(room.id, room_speaker.id)
sign_in(room_speaker)
- post "/voice/rooms/#{room.id}/request_to_speak.json"
+ post "/live/rooms/#{room.id}/request_to_speak.json"
expect(response.status).to eq(403)
end
it "returns 403 for a room moderator, who can already speak" do
- Voice::ParticipantTracker.add(room.id, room_moderator.id)
+ Live::ParticipantTracker.add(room.id, room_moderator.id)
sign_in(room_moderator)
- post "/voice/rooms/#{room.id}/request_to_speak.json"
+ post "/live/rooms/#{room.id}/request_to_speak.json"
expect(response.status).to eq(403)
end
it "returns 403 for an admin, who can already speak" do
- Voice::ParticipantTracker.add(room.id, staff.id)
+ Live::ParticipantTracker.add(room.id, staff.id)
sign_in(staff)
- post "/voice/rooms/#{room.id}/request_to_speak.json"
+ post "/live/rooms/#{room.id}/request_to_speak.json"
expect(response.status).to eq(403)
end
it "returns 403 in an open room, where everyone can already speak" do
- room.update!(room_type: Voice::Room::ROOM_TYPE_OPEN)
+ room.update!(room_type: Live::Room::ROOM_TYPE_OPEN)
sign_in(listener)
- post "/voice/rooms/#{room.id}/request_to_speak.json"
+ post "/live/rooms/#{room.id}/request_to_speak.json"
expect(response.status).to eq(403)
end
@@ -137,25 +121,23 @@ RSpec.describe Voice::RoomsController do
it "returns 403 with a session message for a stage listener who is not in the call" do
# Leaving revokes the participant session, so the retained session id no
# longer authorizes a hand raise.
- Voice::ParticipantTracker.remove(room.id, listener.id)
+ Live::ParticipantTracker.remove(room.id, listener.id)
sign_in(listener)
- post "/voice/rooms/#{room.id}/request_to_speak.json",
+ post "/live/rooms/#{room.id}/request_to_speak.json",
params: {
participant_session_id: @listener_session_id,
}
expect(response.status).to eq(403)
expect(response.parsed_body["errors"]).to include(
- I18n.t("voice.errors.participant_session_required"),
+ I18n.t("live.errors.participant_session_required"),
)
- expect(
- Voice::ParticipantTracker.get_metadata(room.id, listener.id)[:hand_raised_at],
- ).to be_nil
+ expect(Live::ParticipantTracker.get_metadata(room.id, listener.id)[:hand_raised_at]).to be_nil
end
it "requires authentication" do
- post "/voice/rooms/#{room.id}/request_to_speak.json"
+ post "/live/rooms/#{room.id}/request_to_speak.json"
expect(response.status).to eq(403)
end
@@ -163,21 +145,19 @@ RSpec.describe Voice::RoomsController do
describe "#withdraw_request_to_speak" do
it "lowers the caller's raised hand and broadcasts the withdrawal plus the roster" do
- Voice::ParticipantTracker.raise_hand(room.id, listener.id)
+ Live::ParticipantTracker.raise_hand(room.id, listener.id)
sign_in(listener)
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) do
- delete "/voice/rooms/#{room.id}/request_to_speak.json",
+ MessageBus.track_publish(Live.room_channel(room.id)) do
+ delete "/live/rooms/#{room.id}/request_to_speak.json",
params: {
participant_session_id: @listener_session_id,
}
end
expect(response.status).to eq(204)
- expect(
- Voice::ParticipantTracker.get_metadata(room.id, listener.id)[:hand_raised_at],
- ).to be_nil
+ expect(Live::ParticipantTracker.get_metadata(room.id, listener.id)[:hand_raised_at]).to be_nil
hand_message = messages.find { |message| message.data[:type] == "hand_raise" }
expect(hand_message).to be_present
@@ -192,8 +172,8 @@ RSpec.describe Voice::RoomsController do
sign_in(listener)
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) do
- delete "/voice/rooms/#{room.id}/request_to_speak.json",
+ MessageBus.track_publish(Live.room_channel(room.id)) do
+ delete "/live/rooms/#{room.id}/request_to_speak.json",
params: {
participant_session_id: @listener_session_id,
}
@@ -204,18 +184,16 @@ RSpec.describe Voice::RoomsController do
end
it "lets the room creator dismiss another participant's raised hand" do
- Voice::ParticipantTracker.raise_hand(room.id, listener.id)
+ Live::ParticipantTracker.raise_hand(room.id, listener.id)
sign_in(room_owner)
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) do
- delete "/voice/rooms/#{room.id}/request_to_speak.json", params: { user_id: listener.id }
+ MessageBus.track_publish(Live.room_channel(room.id)) do
+ delete "/live/rooms/#{room.id}/request_to_speak.json", params: { user_id: listener.id }
end
expect(response.status).to eq(204)
- expect(
- Voice::ParticipantTracker.get_metadata(room.id, listener.id)[:hand_raised_at],
- ).to be_nil
+ expect(Live::ParticipantTracker.get_metadata(room.id, listener.id)[:hand_raised_at]).to be_nil
hand_message = messages.find { |message| message.data[:type] == "hand_raise" }
expect(hand_message).to be_present
@@ -225,26 +203,24 @@ RSpec.describe Voice::RoomsController do
end
it "lets site staff dismiss another participant's raised hand" do
- Voice::ParticipantTracker.raise_hand(room.id, listener.id)
+ Live::ParticipantTracker.raise_hand(room.id, listener.id)
sign_in(staff)
- delete "/voice/rooms/#{room.id}/request_to_speak.json", params: { user_id: listener.id }
+ delete "/live/rooms/#{room.id}/request_to_speak.json", params: { user_id: listener.id }
expect(response.status).to eq(204)
- expect(
- Voice::ParticipantTracker.get_metadata(room.id, listener.id)[:hand_raised_at],
- ).to be_nil
+ expect(Live::ParticipantTracker.get_metadata(room.id, listener.id)[:hand_raised_at]).to be_nil
end
it "returns 403 when a plain participant tries to dismiss someone else's hand" do
- Voice::ParticipantTracker.raise_hand(room.id, listener.id)
- Voice::ParticipantTracker.add(room.id, other_listener.id)
+ Live::ParticipantTracker.raise_hand(room.id, listener.id)
+ Live::ParticipantTracker.add(room.id, other_listener.id)
sign_in(other_listener)
- delete "/voice/rooms/#{room.id}/request_to_speak.json", params: { user_id: listener.id }
+ delete "/live/rooms/#{room.id}/request_to_speak.json", params: { user_id: listener.id }
expect(response.status).to eq(403)
- expect(Voice::ParticipantTracker.get_metadata(room.id, listener.id)[:hand_raised_at]).to be_a(
+ expect(Live::ParticipantTracker.get_metadata(room.id, listener.id)[:hand_raised_at]).to be_a(
Float,
)
end
diff --git a/plugins/voice/spec/requests/voice/rooms_controller_spec.rb b/plugins/live/spec/requests/live/rooms_controller_spec.rb
similarity index 71%
rename from plugins/voice/spec/requests/voice/rooms_controller_spec.rb
rename to plugins/live/spec/requests/live/rooms_controller_spec.rb
index cba2d8cb52a..577a6fc45a6 100644
--- a/plugins/voice/spec/requests/voice/rooms_controller_spec.rb
+++ b/plugins/live/spec/requests/live/rooms_controller_spec.rb
@@ -1,61 +1,41 @@
# frozen_string_literal: true
require "rails_helper"
-require_relative "../../../db/migrate/20241107000000_create_voice_rooms"
-require_relative "../../../db/migrate/20260612135211_add_video_enabled_to_voice_rooms"
-require_relative "../../../db/migrate/20260630183841_add_chat_settings_to_voice_rooms"
-require_relative "../../../db/migrate/20260813160047_create_voice_invites"
-
-RSpec.describe Voice::RoomsController do
- before do
- ActiveRecord::Migration.suppress_messages do
- CreateVoiceRooms.new.change unless ActiveRecord::Base.connection.table_exists?(:voice_rooms)
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :video_enabled)
- AddVideoEnabledToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :chat_channel_id)
- AddChatSettingsToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.table_exists?(:voice_invites)
- CreateVoiceInvites.new.change
- end
- end
- Voice::Room.reset_column_information
- end
+RSpec.describe Live::RoomsController do
fab!(:staff, :admin)
fab!(:user) { Fabricate(:user, trust_level: TrustLevel[2]) }
fab!(:other_participant) { Fabricate(:user, trust_level: TrustLevel[2]) }
- fab!(:room) { Fabricate(:voice_room, creator: staff, public: true) }
+ fab!(:room) { Fabricate(:live_room, creator: staff, public: true) }
fab!(:room_owner) { Fabricate(:user, trust_level: TrustLevel[2]) }
fab!(:private_room_member) { Fabricate(:user, trust_level: TrustLevel[2]) }
- fab!(:private_room) { Fabricate(:voice_room, creator: room_owner, public: false) }
+ fab!(:private_room) { Fabricate(:live_room, creator: room_owner, public: false) }
fab!(:private_room_membership) do
private_room.room_memberships.create!(
user: private_room_member,
- role: Voice::RoomMembership::ROLE_PARTICIPANT,
+ role: Live::RoomMembership::ROLE_PARTICIPANT,
)
end
before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_allowed_groups =
+ SiteSetting.live_enabled = true
+ SiteSetting.live_allowed_groups =
"#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
- SiteSetting.voice_create_room_allowed_groups = "#{Group::AUTO_GROUPS[:trust_level_2]}"
+ SiteSetting.live_create_room_allowed_groups = "#{Group::AUTO_GROUPS[:trust_level_2]}"
end
# Presence plus the server-attested participant session that signal,
# heartbeat, and state require. Returns the session id to send back.
def establish_presence!(target_room, target_user)
- Voice::ParticipantTracker.add(target_room.id, target_user.id)
- Voice::ParticipantTracker.create_participant_session!(target_room.id, target_user.id)
+ Live::ParticipantTracker.add(target_room.id, target_user.id)
+ Live::ParticipantTracker.create_participant_session!(target_room.id, target_user.id)
end
describe "#index" do
it "returns rooms visible to the user" do
sign_in(user)
- get "/voice/rooms.json"
+ get "/live/rooms.json"
expect(response.status).to eq(200)
expect(response.parsed_body["rooms"]).to be_present
@@ -64,7 +44,7 @@ RSpec.describe Voice::RoomsController do
it "returns message-bus positions for gap-free subscriptions" do
sign_in(user)
- get "/voice/rooms.json"
+ get "/live/rooms.json"
expect(response.parsed_body["index_message_bus_last_id"]).to be_a(Integer)
expect(response.parsed_body["rooms"].first["message_bus_last_id"]).to be_a(Integer)
@@ -72,9 +52,9 @@ RSpec.describe Voice::RoomsController do
it "returns preloaded participant and recording state" do
sign_in(user)
- Voice::ParticipantTracker.add(room.id, other_participant.id)
- Voice::ParticipantTracker.update_metadata(room.id, other_participant.id, muted: true)
- Voice::ParticipantTracker.set_recording(
+ Live::ParticipantTracker.add(room.id, other_participant.id)
+ Live::ParticipantTracker.update_metadata(room.id, other_participant.id, muted: true)
+ Live::ParticipantTracker.set_recording(
room.id,
egress_id: "EG_1",
user_id: staff.id,
@@ -82,7 +62,7 @@ RSpec.describe Voice::RoomsController do
started_at: 123.0,
)
- get "/voice/rooms.json"
+ get "/live/rooms.json"
listed_room = response.parsed_body["rooms"].find { |candidate| candidate["id"] == room.id }
expect(listed_room["active_participants"]).to contain_exactly(
@@ -96,38 +76,38 @@ RSpec.describe Voice::RoomsController do
},
)
ensure
- Voice::ParticipantTracker.clear(room.id)
+ Live::ParticipantTracker.clear(room.id)
end
it "does not add membership queries as the directory grows" do
sign_in(user)
- get "/voice/rooms.json"
+ get "/live/rooms.json"
initial_queries =
- track_sql_queries { get "/voice/rooms.json" }.grep(/voice_room_memberships/).size
+ track_sql_queries { get "/live/rooms.json" }.grep(/live_room_memberships/).size
- 4.times { Fabricate(:voice_room, creator: Fabricate(:user), public: true) }
+ 4.times { Fabricate(:live_room, creator: Fabricate(:user), public: true) }
expanded_queries =
- track_sql_queries { get "/voice/rooms.json" }.grep(/voice_room_memberships/).size
+ track_sql_queries { get "/live/rooms.json" }.grep(/live_room_memberships/).size
expect(expanded_queries).to eq(initial_queries)
end
it "does not add chat channel queries as the directory grows" do
- SiteSetting.voice_chat_enabled = true
+ SiteSetting.live_chat_enabled = true
SiteSetting.chat_enabled = true
room.update!(chat_channel_id: Fabricate(:chat_channel, threading_enabled: true).id)
sign_in(staff)
initial_queries =
- track_sql_queries { get "/voice/rooms.json" }.grep(/FROM "chat_channels"/).size
+ track_sql_queries { get "/live/rooms.json" }.grep(/FROM "chat_channels"/).size
4.times do
channel = Fabricate(:chat_channel, threading_enabled: true)
- Fabricate(:voice_room, creator: Fabricate(:user), public: true, chat_channel_id: channel.id)
+ Fabricate(:live_room, creator: Fabricate(:user), public: true, chat_channel_id: channel.id)
end
expanded_queries =
- track_sql_queries { get "/voice/rooms.json" }.grep(/FROM "chat_channels"/).size
+ track_sql_queries { get "/live/rooms.json" }.grep(/FROM "chat_channels"/).size
expect(initial_queries).to eq(1)
expect(expanded_queries).to eq(initial_queries)
@@ -136,7 +116,7 @@ RSpec.describe Voice::RoomsController do
it "hides non-public rooms from non-members who can create rooms" do
sign_in(user)
- get "/voice/rooms.json"
+ get "/live/rooms.json"
expect(response.status).to eq(200)
room_ids = response.parsed_body["rooms"].map { |listed_room| listed_room["id"] }
@@ -147,7 +127,7 @@ RSpec.describe Voice::RoomsController do
it "includes non-public rooms for their members" do
sign_in(private_room_member)
- get "/voice/rooms.json"
+ get "/live/rooms.json"
room_ids = response.parsed_body["rooms"].map { |listed_room| listed_room["id"] }
expect(room_ids).to include(room.id, private_room.id)
@@ -156,17 +136,17 @@ RSpec.describe Voice::RoomsController do
it "includes non-public rooms for site staff" do
sign_in(staff)
- get "/voice/rooms.json"
+ get "/live/rooms.json"
room_ids = response.parsed_body["rooms"].map { |listed_room| listed_room["id"] }
expect(room_ids).to include(private_room.id)
end
it "never lists ephemeral rooms, even to their members or staff" do
- ephemeral = Fabricate(:voice_ephemeral_room, creator: staff, public: true)
+ ephemeral = Fabricate(:live_ephemeral_room, creator: staff, public: true)
sign_in(staff)
- get "/voice/rooms.json"
+ get "/live/rooms.json"
room_ids = response.parsed_body["rooms"].map { |listed_room| listed_room["id"] }
expect(room_ids).not_to include(ephemeral.id)
@@ -174,7 +154,7 @@ RSpec.describe Voice::RoomsController do
context "when anonymous" do
it "returns only public rooms when access is open to everyone" do
- get "/voice/rooms.json"
+ get "/live/rooms.json"
expect(response.status).to eq(200)
room_ids = response.parsed_body["rooms"].map { |r| r["id"] }
@@ -184,9 +164,9 @@ RSpec.describe Voice::RoomsController do
end
it "returns no rooms when access is restricted to a group" do
- SiteSetting.voice_allowed_groups = "#{Group::AUTO_GROUPS[:trust_level_2]}"
+ SiteSetting.live_allowed_groups = "#{Group::AUTO_GROUPS[:trust_level_2]}"
- get "/voice/rooms.json"
+ get "/live/rooms.json"
expect(response.status).to eq(200)
expect(response.parsed_body["rooms"]).to be_empty
@@ -196,10 +176,10 @@ RSpec.describe Voice::RoomsController do
describe "#show" do
it "serves an ephemeral room directly, even though it is never listed" do
- ephemeral = Fabricate(:voice_ephemeral_room, creator: staff, public: true)
+ ephemeral = Fabricate(:live_ephemeral_room, creator: staff, public: true)
sign_in(user)
- get "/voice/rooms/#{ephemeral.id}.json"
+ get "/live/rooms/#{ephemeral.id}.json"
expect(response.status).to eq(200)
expect(response.parsed_body["room"]["ephemeral"]).to eq(true)
@@ -208,7 +188,7 @@ RSpec.describe Voice::RoomsController do
it "returns 403 for a non-member who can create rooms" do
sign_in(user)
- get "/voice/rooms/#{private_room.id}.json"
+ get "/live/rooms/#{private_room.id}.json"
expect(response.status).to eq(403)
end
@@ -216,7 +196,7 @@ RSpec.describe Voice::RoomsController do
it "returns the room to a member" do
sign_in(private_room_member)
- get "/voice/rooms/#{private_room.id}.json"
+ get "/live/rooms/#{private_room.id}.json"
expect(response.status).to eq(200)
expect(response.parsed_body["room"]["id"]).to eq(private_room.id)
@@ -225,13 +205,13 @@ RSpec.describe Voice::RoomsController do
it "returns the room to site staff who aren't members" do
sign_in(staff)
- get "/voice/rooms/#{private_room.id}.json"
+ get "/live/rooms/#{private_room.id}.json"
expect(response.status).to eq(200)
end
it "returns 403 to anonymous visitors for non-public rooms" do
- get "/voice/rooms/#{private_room.id}.json"
+ get "/live/rooms/#{private_room.id}.json"
expect(response.status).to eq(403)
end
@@ -241,7 +221,7 @@ RSpec.describe Voice::RoomsController do
it "allows trusted user to create a room" do
sign_in(user)
- post "/voice/rooms.json", params: { room: { name: "Game Night", public: true } }
+ post "/live/rooms.json", params: { room: { name: "Game Night", public: true } }
expect(response.status).to eq(200)
expect(response.parsed_body["room"]["name"]).to eq("Game Night")
@@ -250,7 +230,7 @@ RSpec.describe Voice::RoomsController do
it "accepts an optional slug and generates one when it is blank" do
sign_in(user)
- post "/voice/rooms.json",
+ post "/live/rooms.json",
params: {
room: {
name: "Game Night",
@@ -261,17 +241,17 @@ RSpec.describe Voice::RoomsController do
expect(response.status).to eq(200)
expect(response.parsed_body["room"]["slug"]).to eq("friday-hangout")
- post "/voice/rooms.json", params: { room: { name: "Movie Night", slug: "", public: true } }
+ post "/live/rooms.json", params: { room: { name: "Movie Night", slug: "", public: true } }
expect(response.status).to eq(200)
expect(response.parsed_body["room"]["slug"]).to eq("movie-night")
end
it "does not count ephemeral rooms against the per-user room limit" do
- SiteSetting.voice_max_rooms_per_user = 1
- Fabricate(:voice_ephemeral_room, creator: user)
+ SiteSetting.live_max_rooms_per_user = 1
+ Fabricate(:live_ephemeral_room, creator: user)
sign_in(user)
- post "/voice/rooms.json", params: { room: { name: "Game Night", public: true } }
+ post "/live/rooms.json", params: { room: { name: "Game Night", public: true } }
expect(response.status).to eq(200)
end
@@ -280,7 +260,7 @@ RSpec.describe Voice::RoomsController do
low_trust_user = Fabricate(:user, trust_level: TrustLevel[0])
sign_in(low_trust_user)
- post "/voice/rooms.json", params: { room: { name: "Game Night", public: true } }
+ post "/live/rooms.json", params: { room: { name: "Game Night", public: true } }
expect(response.status).to eq(403)
end
@@ -290,56 +270,56 @@ RSpec.describe Voice::RoomsController do
it "returns a participant session id and rotates it on rejoin" do
sign_in(user)
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
first_session_id = response.parsed_body["participant_session_id"]
expect(first_session_id).to be_present
expect(
- Voice::ParticipantTracker.valid_participant_session?(room.id, user.id, first_session_id),
+ Live::ParticipantTracker.valid_participant_session?(room.id, user.id, first_session_id),
).to eq(true)
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
second_session_id = response.parsed_body["participant_session_id"]
expect(second_session_id).to be_present
expect(second_session_id).not_to eq(first_session_id)
expect(
- Voice::ParticipantTracker.valid_participant_session?(room.id, user.id, first_session_id),
+ Live::ParticipantTracker.valid_participant_session?(room.id, user.id, first_session_id),
).to eq(false)
end
it "treats a repeated join carrying the live session as idempotent" do
sign_in(user)
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
session_id = response.parsed_body["participant_session_id"]
- expect(Voice::Session.where(user: user, room: room).count).to eq(1)
+ expect(Live::Session.where(user: user, room: room).count).to eq(1)
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) do
- post "/voice/rooms/#{room.id}/join.json", params: { participant_session_id: session_id }
+ MessageBus.track_publish(Live.room_channel(room.id)) do
+ post "/live/rooms/#{room.id}/join.json", params: { participant_session_id: session_id }
end
expect(response.status).to eq(200)
expect(response.parsed_body["participant_session_id"]).to eq(session_id)
expect(
- Voice::ParticipantTracker.valid_participant_session?(room.id, user.id, session_id),
+ Live::ParticipantTracker.valid_participant_session?(room.id, user.id, session_id),
).to eq(true)
- expect(Voice::Session.where(user: user, room: room).count).to eq(1)
+ expect(Live::Session.where(user: user, room: room).count).to eq(1)
expect(messages.select { |message| message.data[:type] == "participants" }).to be_empty
end
it "reuses the open analytics session and skips join side effects for a present user omitting the session id" do
- SiteSetting.voice_analytics_enabled = true
+ SiteSetting.live_analytics_enabled = true
sign_in(user)
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
first_session_id = response.parsed_body["participant_session_id"]
- analytics_id = Voice::Session.find_by(user: user, room: room).id
+ analytics_id = Live::Session.find_by(user: user, room: room).id
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) do
- 5.times { post "/voice/rooms/#{room.id}/join.json" }
+ MessageBus.track_publish(Live.room_channel(room.id)) do
+ 5.times { post "/live/rooms/#{room.id}/join.json" }
end
expect(response.status).to eq(200)
@@ -347,7 +327,7 @@ RSpec.describe Voice::RoomsController do
# holds signaling authority...
expect(response.parsed_body["participant_session_id"]).not_to eq(first_session_id)
# ...but replayed joins are not an analytics-row or broadcast factory.
- sessions = Voice::Session.where(user: user, room: room)
+ sessions = Live::Session.where(user: user, room: room)
expect(sessions.count).to eq(1)
expect(sessions.first.id).to eq(analytics_id)
expect(sessions.first.left_at).to be_nil
@@ -357,19 +337,19 @@ RSpec.describe Voice::RoomsController do
it "mints a fresh session and analytics session on a genuine rejoin after leave" do
sign_in(user)
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
first_session_id = response.parsed_body["participant_session_id"]
- delete "/voice/rooms/#{room.id}/leave.json",
+ delete "/live/rooms/#{room.id}/leave.json",
params: {
participant_session_id: first_session_id,
}
- post "/voice/rooms/#{room.id}/join.json", params: { participant_session_id: first_session_id }
+ post "/live/rooms/#{room.id}/join.json", params: { participant_session_id: first_session_id }
expect(response.status).to eq(200)
expect(response.parsed_body["participant_session_id"]).not_to eq(first_session_id)
- expect(Voice::Session.where(user: user, room: room).count).to eq(2)
+ expect(Live::Session.where(user: user, room: room).count).to eq(2)
end
it "returns 422 when the room is at its own participant limit" do
@@ -378,20 +358,20 @@ RSpec.describe Voice::RoomsController do
establish_presence!(room, other_participant)
sign_in(user)
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
expect(response.status).to eq(422)
- expect(response.parsed_body["errors"]).to include(I18n.t("voice.errors.room_full"))
- expect(Voice::ParticipantTracker.user_ids(room.id)).not_to include(user.id)
+ expect(response.parsed_body["errors"]).to include(I18n.t("live.errors.room_full"))
+ expect(Live::ParticipantTracker.user_ids(room.id)).not_to include(user.id)
end
it "returns 422 when the room is at the site-wide participant ceiling" do
- SiteSetting.voice_max_room_participants = 2
+ SiteSetting.live_max_room_participants = 2
establish_presence!(room, staff)
establish_presence!(room, other_participant)
sign_in(user)
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
expect(response.status).to eq(422)
end
@@ -402,24 +382,24 @@ RSpec.describe Voice::RoomsController do
establish_presence!(room, user)
sign_in(user)
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
expect(response.status).to eq(200)
- expect(Voice::ParticipantTracker.user_ids(room.id)).to include(user.id)
+ expect(Live::ParticipantTracker.user_ids(room.id)).to include(user.id)
end
it "frees the slots of participants whose presence expired" do
room.update!(max_participants: 2)
establish_presence!(room, staff)
establish_presence!(room, other_participant)
- key = "#{Voice::ParticipantTracker::KEY_NAMESPACE}:#{room.id}:participants"
+ key = "#{Live::ParticipantTracker::KEY_NAMESPACE}:#{room.id}:participants"
Discourse.redis.zadd(key, 1.hour.ago.to_f, staff.id)
sign_in(user)
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
expect(response.status).to eq(200)
- expect(Voice::ParticipantTracker.user_ids(room.id)).to contain_exactly(
+ expect(Live::ParticipantTracker.user_ids(room.id)).to contain_exactly(
other_participant.id,
user.id,
)
@@ -428,50 +408,50 @@ RSpec.describe Voice::RoomsController do
it "returns 403 when a non-member who can create rooms joins a private room" do
sign_in(user)
- post "/voice/rooms/#{private_room.id}/join.json"
+ post "/live/rooms/#{private_room.id}/join.json"
expect(response.status).to eq(403)
- expect(Voice::ParticipantTracker.user_ids(private_room.id)).not_to include(user.id)
+ expect(Live::ParticipantTracker.user_ids(private_room.id)).not_to include(user.id)
end
it "lets a member join a private room" do
sign_in(private_room_member)
- post "/voice/rooms/#{private_room.id}/join.json"
+ post "/live/rooms/#{private_room.id}/join.json"
expect(response.status).to eq(200)
- expect(Voice::ParticipantTracker.user_ids(private_room.id)).to include(private_room_member.id)
+ expect(Live::ParticipantTracker.user_ids(private_room.id)).to include(private_room_member.id)
end
it "lets site staff join a private room they aren't a member of" do
sign_in(staff)
- post "/voice/rooms/#{private_room.id}/join.json"
+ post "/live/rooms/#{private_room.id}/join.json"
expect(response.status).to eq(200)
end
it "redeems a pending invite when joining with the inviter's username" do
invite =
- Voice::Invite.create!(
+ Live::Invite.create!(
room_id: room.id,
user_id: user.id,
invited_by_id: other_participant.id,
- source: Voice::Invite::SOURCES[:notification],
+ source: Live::Invite::SOURCES[:notification],
)
sign_in(user)
- post "/voice/rooms/#{room.id}/join.json", params: { invited_by: other_participant.username }
+ post "/live/rooms/#{room.id}/join.json", params: { invited_by: other_participant.username }
expect(response.status).to eq(200)
expect(invite.reload.redeemed_at).to be_present
end
it "marks the room's unread invitation notifications read on join, leaving other rooms' alone" do
- Voice::RoomInviter.invite!(room: room, inviter: other_participant, users: [user])
- Voice::RoomInviter.invite!(room: private_room, inviter: room_owner, users: [user])
+ Live::RoomInviter.invite!(room: room, inviter: other_participant, users: [user])
+ Live::RoomInviter.invite!(room: private_room, inviter: room_owner, users: [user])
invitation_notifications =
- user.notifications.where(notification_type: Notification.types[:voice_invitation])
+ user.notifications.where(notification_type: Notification.types[:live_invitation])
room_notification =
invitation_notifications.find { |notification| notification.data_hash[:room_id] == room.id }
other_room_notification =
@@ -480,7 +460,7 @@ RSpec.describe Voice::RoomsController do
end
sign_in(user)
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
expect(response.status).to eq(200)
expect(room_notification.reload.read).to eq(true)
@@ -491,13 +471,13 @@ RSpec.describe Voice::RoomsController do
sign_in(user)
2.times do
- post "/voice/rooms/#{room.id}/join.json", params: { invited_by: other_participant.username }
- delete "/voice/rooms/#{room.id}/leave.json"
+ post "/live/rooms/#{room.id}/join.json", params: { invited_by: other_participant.username }
+ delete "/live/rooms/#{room.id}/leave.json"
end
- invites = Voice::Invite.where(room_id: room.id, user_id: user.id)
+ invites = Live::Invite.where(room_id: room.id, user_id: user.id)
expect(invites.count).to eq(1)
- expect(invites.first.source).to eq(Voice::Invite::SOURCES[:link])
+ expect(invites.first.source).to eq(Live::Invite::SOURCES[:link])
expect(invites.first.invited_by_id).to eq(other_participant.id)
expect(invites.first.redeemed_at).to be_present
end
@@ -505,19 +485,19 @@ RSpec.describe Voice::RoomsController do
it "does not let users credit themselves through their own invite link" do
sign_in(user)
- post "/voice/rooms/#{room.id}/join.json", params: { invited_by: user.username }
+ post "/live/rooms/#{room.id}/join.json", params: { invited_by: user.username }
expect(response.status).to eq(200)
- expect(Voice::Invite.count).to eq(0)
+ expect(Live::Invite.count).to eq(0)
end
it "returns the ICE configuration with per-user TURN credentials" do
- SiteSetting.voice_stun_servers = ""
- SiteSetting.voice_turn_secret = "coturn-shared-secret"
- SiteSetting.voice_turn_secret_servers = "turn:turn.example.com:3478"
+ SiteSetting.live_stun_servers = ""
+ SiteSetting.live_turn_secret = "coturn-shared-secret"
+ SiteSetting.live_turn_secret_servers = "turn:turn.example.com:3478"
sign_in(user)
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
expect(response.status).to eq(200)
@@ -539,7 +519,7 @@ RSpec.describe Voice::RoomsController do
it "tracks users when they join a room" do
sign_in(user)
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
expect(response.status).to eq(200)
json = response.parsed_body
@@ -548,11 +528,11 @@ RSpec.describe Voice::RoomsController do
it "broadcasts participants to the allowed groups, anonymous subscribers included" do
sign_in(user)
- Voice::ParticipantTracker.add(room.id, other_participant.id)
+ Live::ParticipantTracker.add(room.id, other_participant.id)
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) do
- post "/voice/rooms/#{room.id}/join.json"
+ MessageBus.track_publish(Live.room_channel(room.id)) do
+ post "/live/rooms/#{room.id}/join.json"
end
expect(response.status).to eq(200)
@@ -568,13 +548,13 @@ RSpec.describe Voice::RoomsController do
context "with user status integration" do
before do
SiteSetting.enable_user_status = true
- SiteSetting.voice_auto_status_enabled = true
+ SiteSetting.live_auto_status_enabled = true
end
it "sets user status on join" do
sign_in(user)
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
user.reload
expect(user.user_status.emoji).to eq("studio_microphone")
@@ -585,7 +565,7 @@ RSpec.describe Voice::RoomsController do
sign_in(user)
user.set_status!("Busy", "no_entry")
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
user.reload
expect(user.user_status.emoji).to eq("no_entry")
@@ -594,7 +574,7 @@ RSpec.describe Voice::RoomsController do
it "skips status when skip_status param is sent" do
sign_in(user)
- post "/voice/rooms/#{room.id}/join.json", params: { skip_status: true }
+ post "/live/rooms/#{room.id}/join.json", params: { skip_status: true }
user.reload
expect(user.user_status).to be_nil
@@ -605,27 +585,27 @@ RSpec.describe Voice::RoomsController do
describe "#leave" do
before do
SiteSetting.enable_user_status = true
- SiteSetting.voice_auto_status_enabled = true
+ SiteSetting.live_auto_status_enabled = true
end
- it "clears Voice status on leave" do
+ it "clears Live status on leave" do
sign_in(user)
- Voice::ParticipantTracker.add(room.id, user.id)
+ Live::ParticipantTracker.add(room.id, user.id)
user.set_status!("In #{room.name}", "studio_microphone", 2.minutes.from_now)
- delete "/voice/rooms/#{room.id}/leave.json"
+ delete "/live/rooms/#{room.id}/leave.json"
expect(response.status).to eq(204)
user.reload
expect(user.user_status).to be_nil
end
- it "preserves non-Voice status on leave" do
+ it "preserves non-Live status on leave" do
sign_in(user)
- Voice::ParticipantTracker.add(room.id, user.id)
+ Live::ParticipantTracker.add(room.id, user.id)
user.set_status!("On vacation", "palm_tree")
- delete "/voice/rooms/#{room.id}/leave.json"
+ delete "/live/rooms/#{room.id}/leave.json"
expect(response.status).to eq(204)
user.reload
@@ -634,58 +614,58 @@ RSpec.describe Voice::RoomsController do
it "keeps the user out when a racing heartbeat lands after the leave" do
sign_in(user)
- Voice::ParticipantTracker.add(room.id, user.id)
+ Live::ParticipantTracker.add(room.id, user.id)
- delete "/voice/rooms/#{room.id}/leave.json"
- post "/voice/rooms/#{room.id}/heartbeat.json"
+ delete "/live/rooms/#{room.id}/leave.json"
+ post "/live/rooms/#{room.id}/heartbeat.json"
expect(response.status).to eq(204)
- expect(Voice::ParticipantTracker.user_ids(room.id)).not_to include(user.id)
+ expect(Live::ParticipantTracker.user_ids(room.id)).not_to include(user.id)
end
it "lets the user rejoin immediately after leaving" do
sign_in(user)
- Voice::ParticipantTracker.add(room.id, user.id)
+ Live::ParticipantTracker.add(room.id, user.id)
- delete "/voice/rooms/#{room.id}/leave.json"
- post "/voice/rooms/#{room.id}/join.json"
+ delete "/live/rooms/#{room.id}/leave.json"
+ post "/live/rooms/#{room.id}/join.json"
expect(response.status).to eq(200)
- expect(Voice::ParticipantTracker.user_ids(room.id)).to include(user.id)
+ expect(Live::ParticipantTracker.user_ids(room.id)).to include(user.id)
end
it "ignores a leave carrying a session that a newer join superseded" do
sign_in(user)
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
stale_session_id = response.parsed_body["participant_session_id"]
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
current_session_id = response.parsed_body["participant_session_id"]
- delete "/voice/rooms/#{room.id}/leave.json",
+ delete "/live/rooms/#{room.id}/leave.json",
params: {
participant_session_id: stale_session_id,
}
expect(response.status).to eq(204)
- expect(Voice::ParticipantTracker.user_ids(room.id)).to include(user.id)
+ expect(Live::ParticipantTracker.user_ids(room.id)).to include(user.id)
expect(
- Voice::ParticipantTracker.valid_participant_session?(room.id, user.id, current_session_id),
+ Live::ParticipantTracker.valid_participant_session?(room.id, user.id, current_session_id),
).to eq(true)
end
it "removes presence when the leave carries the current session" do
sign_in(user)
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
session_id = response.parsed_body["participant_session_id"]
- delete "/voice/rooms/#{room.id}/leave.json", params: { participant_session_id: session_id }
+ delete "/live/rooms/#{room.id}/leave.json", params: { participant_session_id: session_id }
expect(response.status).to eq(204)
- expect(Voice::ParticipantTracker.user_ids(room.id)).not_to include(user.id)
- expect(Voice::ParticipantTracker.participant_session?(room.id, user.id)).to eq(false)
+ expect(Live::ParticipantTracker.user_ids(room.id)).not_to include(user.id)
+ expect(Live::ParticipantTracker.participant_session?(room.id, user.id)).to eq(false)
end
end
@@ -695,37 +675,37 @@ RSpec.describe Voice::RoomsController do
session_id = establish_presence!(room, user)
# The heartbeat lapsed (laptop asleep) but the session TTL has not.
- key = "#{Voice::ParticipantTracker::KEY_NAMESPACE}:#{room.id}:participants"
+ key = "#{Live::ParticipantTracker::KEY_NAMESPACE}:#{room.id}:participants"
Discourse.redis.zadd(key, 1.hour.ago.to_f, user.id)
- post "/voice/rooms/#{room.id}/heartbeat.json", params: { participant_session_id: session_id }
+ post "/live/rooms/#{room.id}/heartbeat.json", params: { participant_session_id: session_id }
expect(response.status).to eq(204)
- expect(Voice::ParticipantTracker.user_ids(room.id)).to include(user.id)
+ expect(Live::ParticipantTracker.user_ids(room.id)).to include(user.id)
end
it "rejects a heartbeat without a participant session and creates no presence" do
sign_in(user)
- post "/voice/rooms/#{room.id}/heartbeat.json"
+ post "/live/rooms/#{room.id}/heartbeat.json"
expect(response.status).to eq(403)
- expect(Voice::ParticipantTracker.user_ids(room.id)).not_to include(user.id)
+ expect(Live::ParticipantTracker.user_ids(room.id)).not_to include(user.id)
end
it "broadcasts the participant list when a stale participant has dropped out" do
sign_in(user)
session_id = establish_presence!(room, user)
- Voice::ParticipantTracker.add(room.id, other_participant.id)
+ Live::ParticipantTracker.add(room.id, other_participant.id)
# other_participant left abruptly (refresh/close) and their heartbeat lapsed.
- key = "#{Voice::ParticipantTracker::KEY_NAMESPACE}:#{room.id}:participants"
+ key = "#{Live::ParticipantTracker::KEY_NAMESPACE}:#{room.id}:participants"
Discourse.redis.zadd(key, 1.hour.ago.to_f, other_participant.id)
published = []
allow(MessageBus).to receive(:publish) { |channel, data, _opts| published << data }
- post "/voice/rooms/#{room.id}/heartbeat.json", params: { participant_session_id: session_id }
+ post "/live/rooms/#{room.id}/heartbeat.json", params: { participant_session_id: session_id }
expect(response.status).to eq(204)
participants_message = published.find { |data| data[:type] == "participants" }
@@ -737,12 +717,12 @@ RSpec.describe Voice::RoomsController do
sign_in(user)
session_id = establish_presence!(room, user)
# Prime the stored fingerprint so the next heartbeat sees no change.
- Voice::RoomBroadcaster.publish_participants_if_changed(room)
+ Live::RoomBroadcaster.publish_participants_if_changed(room)
published = []
allow(MessageBus).to receive(:publish) { |channel, data, _opts| published << data }
- post "/voice/rooms/#{room.id}/heartbeat.json", params: { participant_session_id: session_id }
+ post "/live/rooms/#{room.id}/heartbeat.json", params: { participant_session_id: session_id }
expect(response.status).to eq(204)
expect(published.find { |data| data[:type] == "participants" }).to be_nil
@@ -751,15 +731,15 @@ RSpec.describe Voice::RoomsController do
context "with user status integration" do
before do
SiteSetting.enable_user_status = true
- SiteSetting.voice_auto_status_enabled = true
+ SiteSetting.live_auto_status_enabled = true
sign_in(user)
@participant_session_id = establish_presence!(room, user)
- Voice::ParticipantTracker.update_metadata(room.id, user.id, { role: "participant" })
- Voice::UserStatusManager.set_voice_status(user, room)
+ Live::ParticipantTracker.update_metadata(room.id, user.id, { role: "participant" })
+ Live::UserStatusManager.set_live_status(user, room)
end
it "keeps the status without an expiry across heartbeats" do
- post "/voice/rooms/#{room.id}/heartbeat.json",
+ post "/live/rooms/#{room.id}/heartbeat.json",
params: {
participant_session_id: @participant_session_id,
}
@@ -772,7 +752,7 @@ RSpec.describe Voice::RoomsController do
it "does not republish an unchanged status on heartbeat" do
messages =
MessageBus.track_publish do
- post "/voice/rooms/#{room.id}/heartbeat.json",
+ post "/live/rooms/#{room.id}/heartbeat.json",
params: {
participant_session_id: @participant_session_id,
}
@@ -782,7 +762,7 @@ RSpec.describe Voice::RoomsController do
end
it "transitions to AFK status" do
- post "/voice/rooms/#{room.id}/heartbeat.json",
+ post "/live/rooms/#{room.id}/heartbeat.json",
params: {
idle_state: "afk",
participant_session_id: @participant_session_id,
@@ -794,9 +774,9 @@ RSpec.describe Voice::RoomsController do
end
it "transitions back from AFK to active status" do
- Voice::UserStatusManager.set_afk_status(user, room)
+ Live::UserStatusManager.set_afk_status(user, room)
- post "/voice/rooms/#{room.id}/heartbeat.json",
+ post "/live/rooms/#{room.id}/heartbeat.json",
params: {
idle_state: "active",
participant_session_id: @participant_session_id,
@@ -808,14 +788,14 @@ RSpec.describe Voice::RoomsController do
end
it "skips status refresh when skip_status metadata is set" do
- Voice::ParticipantTracker.update_metadata(
+ Live::ParticipantTracker.update_metadata(
room.id,
user.id,
{ role: "participant", skip_status: true },
)
user.clear_status!
- post "/voice/rooms/#{room.id}/heartbeat.json",
+ post "/live/rooms/#{room.id}/heartbeat.json",
params: {
participant_session_id: @participant_session_id,
}
@@ -827,7 +807,7 @@ RSpec.describe Voice::RoomsController do
end
describe "#kick" do
- before { Voice::ParticipantTracker.add(room.id, other_participant.id) }
+ before { Live::ParticipantTracker.add(room.id, other_participant.id) }
it "allows room manager to kick participants" do
sign_in(staff)
@@ -837,10 +817,10 @@ RSpec.describe Voice::RoomsController do
published << [channel, data, opts]
}
- delete "/voice/rooms/#{room.id}/kick.json", params: { user_id: other_participant.id }
+ delete "/live/rooms/#{room.id}/kick.json", params: { user_id: other_participant.id }
expect(response.status).to eq(204)
- expect(Voice::ParticipantTracker.user_ids(room.id)).not_to include(other_participant.id)
+ expect(Live::ParticipantTracker.user_ids(room.id)).not_to include(other_participant.id)
kick_message = published.find { |(_, data)| data[:type] == "kicked" }
expect(kick_message).to be_present
@@ -851,7 +831,7 @@ RSpec.describe Voice::RoomsController do
low_trust_user = Fabricate(:user, trust_level: TrustLevel[0])
sign_in(low_trust_user)
- delete "/voice/rooms/#{room.id}/kick.json", params: { user_id: other_participant.id }
+ delete "/live/rooms/#{room.id}/kick.json", params: { user_id: other_participant.id }
expect(response.status).to eq(403)
end
@@ -859,18 +839,18 @@ RSpec.describe Voice::RoomsController do
it "prevents kicking oneself" do
sign_in(staff)
- delete "/voice/rooms/#{room.id}/kick.json", params: { user_id: staff.id }
+ delete "/live/rooms/#{room.id}/kick.json", params: { user_id: staff.id }
expect(response.status).to eq(400)
end
- it "clears kicked user's Voice status" do
+ it "clears kicked user's Live status" do
SiteSetting.enable_user_status = true
- SiteSetting.voice_auto_status_enabled = true
+ SiteSetting.live_auto_status_enabled = true
sign_in(staff)
other_participant.set_status!("In #{room.name}", "studio_microphone", 2.minutes.from_now)
- delete "/voice/rooms/#{room.id}/kick.json", params: { user_id: other_participant.id }
+ delete "/live/rooms/#{room.id}/kick.json", params: { user_id: other_participant.id }
expect(response.status).to eq(204)
other_participant.reload
@@ -879,21 +859,21 @@ RSpec.describe Voice::RoomsController do
it "keeps the kicked user out when their racing heartbeat lands after the kick" do
sign_in(staff)
- delete "/voice/rooms/#{room.id}/kick.json", params: { user_id: other_participant.id }
+ delete "/live/rooms/#{room.id}/kick.json", params: { user_id: other_participant.id }
sign_in(other_participant)
- post "/voice/rooms/#{room.id}/heartbeat.json"
+ post "/live/rooms/#{room.id}/heartbeat.json"
expect(response.status).to eq(204)
- expect(Voice::ParticipantTracker.user_ids(room.id)).not_to include(other_participant.id)
+ expect(Live::ParticipantTracker.user_ids(room.id)).not_to include(other_participant.id)
end
it "prevents kicking the room creator" do
sign_in(staff)
- other_room = Fabricate(:voice_room, creator: user, public: true)
- Voice::ParticipantTracker.add(other_room.id, user.id)
+ other_room = Fabricate(:live_room, creator: user, public: true)
+ Live::ParticipantTracker.add(other_room.id, user.id)
- delete "/voice/rooms/#{other_room.id}/kick.json", params: { user_id: user.id }
+ delete "/live/rooms/#{other_room.id}/kick.json", params: { user_id: user.id }
expect(response.status).to eq(400)
end
@@ -910,7 +890,7 @@ RSpec.describe Voice::RoomsController do
published << [channel, data, opts]
}
- post "/voice/rooms/#{room.id}/toggle_mute.json",
+ post "/live/rooms/#{room.id}/toggle_mute.json",
params: {
muted: true,
participant_session_id: @participant_session_id,
@@ -918,7 +898,7 @@ RSpec.describe Voice::RoomsController do
expect(response.status).to eq(204)
- metadata = Voice::ParticipantTracker.get_metadata(room.id, user.id)
+ metadata = Live::ParticipantTracker.get_metadata(room.id, user.id)
expect(metadata[:is_muted]).to eq(true)
participants_message = published.find { |(_, data)| data[:type] == "participants" }
@@ -929,9 +909,9 @@ RSpec.describe Voice::RoomsController do
it "unmutes when muted is false" do
sign_in(user)
- Voice::ParticipantTracker.update_metadata(room.id, user.id, { is_muted: true })
+ Live::ParticipantTracker.update_metadata(room.id, user.id, { is_muted: true })
- post "/voice/rooms/#{room.id}/toggle_mute.json",
+ post "/live/rooms/#{room.id}/toggle_mute.json",
params: {
muted: false,
participant_session_id: @participant_session_id,
@@ -939,14 +919,14 @@ RSpec.describe Voice::RoomsController do
expect(response.status).to eq(204)
- metadata = Voice::ParticipantTracker.get_metadata(room.id, user.id)
+ metadata = Live::ParticipantTracker.get_metadata(room.id, user.id)
expect(metadata[:is_muted]).to eq(false)
end
it "sets deafened metadata" do
sign_in(user)
- post "/voice/rooms/#{room.id}/toggle_mute.json",
+ post "/live/rooms/#{room.id}/toggle_mute.json",
params: {
muted: true,
deafened: true,
@@ -955,13 +935,13 @@ RSpec.describe Voice::RoomsController do
expect(response.status).to eq(204)
- metadata = Voice::ParticipantTracker.get_metadata(room.id, user.id)
+ metadata = Live::ParticipantTracker.get_metadata(room.id, user.id)
expect(metadata[:is_muted]).to eq(true)
expect(metadata[:is_deafened]).to eq(true)
end
it "requires authentication" do
- post "/voice/rooms/#{room.id}/toggle_mute.json", params: { muted: true }
+ post "/live/rooms/#{room.id}/toggle_mute.json", params: { muted: true }
expect(response.status).to eq(403)
end
@@ -974,10 +954,10 @@ RSpec.describe Voice::RoomsController do
end
it "rejects a state change without a participant session" do
- post "/voice/rooms/#{room.id}/state.json", params: { watching: true }
+ post "/live/rooms/#{room.id}/state.json", params: { watching: true }
expect(response.status).to eq(403)
- expect(Voice::ParticipantTracker.get_metadata(room.id, user.id)[:watching_video]).to be_nil
+ expect(Live::ParticipantTracker.get_metadata(room.id, user.id)[:watching_video]).to be_nil
end
it "sets video metadata and broadcasts participants" do
@@ -986,7 +966,7 @@ RSpec.describe Voice::RoomsController do
published << [channel, data, opts]
}
- post "/voice/rooms/#{room.id}/state.json",
+ post "/live/rooms/#{room.id}/state.json",
params: {
video: true,
participant_session_id: @participant_session_id,
@@ -994,7 +974,7 @@ RSpec.describe Voice::RoomsController do
expect(response.status).to eq(204)
- metadata = Voice::ParticipantTracker.get_metadata(room.id, user.id)
+ metadata = Live::ParticipantTracker.get_metadata(room.id, user.id)
expect(metadata[:is_video_on]).to eq(true)
participants_message = published.find { |(_, data)| data[:type] == "participants" }
@@ -1004,7 +984,7 @@ RSpec.describe Voice::RoomsController do
end
it "sets screen sharing and watching metadata" do
- post "/voice/rooms/#{room.id}/state.json",
+ post "/live/rooms/#{room.id}/state.json",
params: {
screen: true,
watching: true,
@@ -1013,36 +993,36 @@ RSpec.describe Voice::RoomsController do
expect(response.status).to eq(204)
- metadata = Voice::ParticipantTracker.get_metadata(room.id, user.id)
+ metadata = Live::ParticipantTracker.get_metadata(room.id, user.id)
expect(metadata[:is_screen_sharing]).to eq(true)
expect(metadata[:watching_video]).to eq(true)
end
it "sets and clears the transcribing flag" do
- post "/voice/rooms/#{room.id}/state.json",
+ post "/live/rooms/#{room.id}/state.json",
params: {
transcribing: true,
participant_session_id: @participant_session_id,
}
expect(response.status).to eq(204)
- metadata = Voice::ParticipantTracker.get_metadata(room.id, user.id)
+ metadata = Live::ParticipantTracker.get_metadata(room.id, user.id)
expect(metadata[:is_transcribing]).to eq(true)
- post "/voice/rooms/#{room.id}/state.json",
+ post "/live/rooms/#{room.id}/state.json",
params: {
transcribing: false,
participant_session_id: @participant_session_id,
}
- metadata = Voice::ParticipantTracker.get_metadata(room.id, user.id)
+ metadata = Live::ParticipantTracker.get_metadata(room.id, user.id)
expect(metadata[:is_transcribing]).to eq(false)
end
it "rejects video when no group is allowed to share a camera" do
- SiteSetting.voice_video_allowed_groups = ""
+ SiteSetting.live_video_allowed_groups = ""
- post "/voice/rooms/#{room.id}/state.json",
+ post "/live/rooms/#{room.id}/state.json",
params: {
video: true,
participant_session_id: @participant_session_id,
@@ -1052,9 +1032,9 @@ RSpec.describe Voice::RoomsController do
end
it "rejects screen sharing when no group is allowed to share a screen" do
- SiteSetting.voice_screen_share_allowed_groups = ""
+ SiteSetting.live_screen_share_allowed_groups = ""
- post "/voice/rooms/#{room.id}/state.json",
+ post "/live/rooms/#{room.id}/state.json",
params: {
screen: true,
participant_session_id: @participant_session_id,
@@ -1064,22 +1044,22 @@ RSpec.describe Voice::RoomsController do
end
it "allows a camera when only screen sharing is disallowed" do
- SiteSetting.voice_screen_share_allowed_groups = ""
+ SiteSetting.live_screen_share_allowed_groups = ""
- post "/voice/rooms/#{room.id}/state.json",
+ post "/live/rooms/#{room.id}/state.json",
params: {
video: true,
participant_session_id: @participant_session_id,
}
expect(response.status).to eq(204)
- expect(Voice::ParticipantTracker.get_metadata(room.id, user.id)[:is_video_on]).to eq(true)
+ expect(Live::ParticipantTracker.get_metadata(room.id, user.id)[:is_video_on]).to eq(true)
end
it "rejects video when the room has video disabled" do
room.update!(video_enabled: false)
- post "/voice/rooms/#{room.id}/state.json",
+ post "/live/rooms/#{room.id}/state.json",
params: {
video: true,
participant_session_id: @participant_session_id,
@@ -1089,9 +1069,9 @@ RSpec.describe Voice::RoomsController do
end
it "rejects video from a stage listener" do
- room.update!(room_type: Voice::Room::ROOM_TYPE_STAGE)
+ room.update!(room_type: Live::Room::ROOM_TYPE_STAGE)
- post "/voice/rooms/#{room.id}/state.json",
+ post "/live/rooms/#{room.id}/state.json",
params: {
video: true,
participant_session_id: @participant_session_id,
@@ -1101,9 +1081,9 @@ RSpec.describe Voice::RoomsController do
end
it "rejects screen share from a stage listener" do
- room.update!(room_type: Voice::Room::ROOM_TYPE_STAGE)
+ room.update!(room_type: Live::Room::ROOM_TYPE_STAGE)
- post "/voice/rooms/#{room.id}/state.json",
+ post "/live/rooms/#{room.id}/state.json",
params: {
screen: true,
participant_session_id: @participant_session_id,
@@ -1113,25 +1093,25 @@ RSpec.describe Voice::RoomsController do
end
it "allows video from a stage speaker" do
- room.update!(room_type: Voice::Room::ROOM_TYPE_STAGE)
- room.room_memberships.create!(user: user, role: Voice::RoomMembership::ROLE_SPEAKER)
+ room.update!(room_type: Live::Room::ROOM_TYPE_STAGE)
+ room.room_memberships.create!(user: user, role: Live::RoomMembership::ROLE_SPEAKER)
- post "/voice/rooms/#{room.id}/state.json",
+ post "/live/rooms/#{room.id}/state.json",
params: {
video: true,
participant_session_id: @participant_session_id,
}
expect(response.status).to eq(204)
- metadata = Voice::ParticipantTracker.get_metadata(room.id, user.id)
+ metadata = Live::ParticipantTracker.get_metadata(room.id, user.id)
expect(metadata[:is_video_on]).to eq(true)
end
it "allows screen share from a stage speaker" do
- room.update!(room_type: Voice::Room::ROOM_TYPE_STAGE)
- room.room_memberships.create!(user: user, role: Voice::RoomMembership::ROLE_SPEAKER)
+ room.update!(room_type: Live::Room::ROOM_TYPE_STAGE)
+ room.room_memberships.create!(user: user, role: Live::RoomMembership::ROLE_SPEAKER)
- post "/voice/rooms/#{room.id}/state.json",
+ post "/live/rooms/#{room.id}/state.json",
params: {
screen: true,
participant_session_id: @participant_session_id,
@@ -1141,15 +1121,15 @@ RSpec.describe Voice::RoomsController do
end
it "rejects video when the publisher limit is reached" do
- SiteSetting.voice_video_max_publishers = 2
+ SiteSetting.live_video_max_publishers = 2
publishers = Fabricate.times(2, :user)
publishers.each do |publisher|
- Voice::ParticipantTracker.add(room.id, publisher.id)
- Voice::ParticipantTracker.update_metadata(room.id, publisher.id, { is_video_on: true })
+ Live::ParticipantTracker.add(room.id, publisher.id)
+ Live::ParticipantTracker.update_metadata(room.id, publisher.id, { is_video_on: true })
end
- post "/voice/rooms/#{room.id}/state.json",
+ post "/live/rooms/#{room.id}/state.json",
params: {
video: true,
participant_session_id: @participant_session_id,
@@ -1159,14 +1139,14 @@ RSpec.describe Voice::RoomsController do
end
it "allows an existing publisher to keep publishing at the limit" do
- SiteSetting.voice_video_max_publishers = 2
+ SiteSetting.live_video_max_publishers = 2
publisher = Fabricate(:user)
- Voice::ParticipantTracker.add(room.id, publisher.id)
- Voice::ParticipantTracker.update_metadata(room.id, publisher.id, { is_video_on: true })
- Voice::ParticipantTracker.update_metadata(room.id, user.id, { is_video_on: true })
+ Live::ParticipantTracker.add(room.id, publisher.id)
+ Live::ParticipantTracker.update_metadata(room.id, publisher.id, { is_video_on: true })
+ Live::ParticipantTracker.update_metadata(room.id, user.id, { is_video_on: true })
- post "/voice/rooms/#{room.id}/state.json",
+ post "/live/rooms/#{room.id}/state.json",
params: {
video: true,
participant_session_id: @participant_session_id,
@@ -1176,22 +1156,22 @@ RSpec.describe Voice::RoomsController do
end
it "allows turning video off even when video is disallowed" do
- Voice::ParticipantTracker.update_metadata(room.id, user.id, { is_video_on: true })
+ Live::ParticipantTracker.update_metadata(room.id, user.id, { is_video_on: true })
room.update!(video_enabled: false)
- post "/voice/rooms/#{room.id}/state.json",
+ post "/live/rooms/#{room.id}/state.json",
params: {
video: false,
participant_session_id: @participant_session_id,
}
expect(response.status).to eq(204)
- metadata = Voice::ParticipantTracker.get_metadata(room.id, user.id)
+ metadata = Live::ParticipantTracker.get_metadata(room.id, user.id)
expect(metadata[:is_video_on]).to eq(false)
end
it "rejects a request with no supported state field" do
- post "/voice/rooms/#{room.id}/state.json",
+ post "/live/rooms/#{room.id}/state.json",
params: {
participant_session_id: @participant_session_id,
something_else: true,
@@ -1201,15 +1181,15 @@ RSpec.describe Voice::RoomsController do
end
it "publishes nothing when the request changes no state" do
- post "/voice/rooms/#{room.id}/state.json",
+ post "/live/rooms/#{room.id}/state.json",
params: {
muted: true,
participant_session_id: @participant_session_id,
}
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) do
- post "/voice/rooms/#{room.id}/state.json",
+ MessageBus.track_publish(Live.room_channel(room.id)) do
+ post "/live/rooms/#{room.id}/state.json",
params: {
muted: true,
participant_session_id: @participant_session_id,
@@ -1221,14 +1201,14 @@ RSpec.describe Voice::RoomsController do
end
it "still updates mute state through the toggle_mute alias" do
- post "/voice/rooms/#{room.id}/toggle_mute.json",
+ post "/live/rooms/#{room.id}/toggle_mute.json",
params: {
muted: true,
participant_session_id: @participant_session_id,
}
expect(response.status).to eq(204)
- metadata = Voice::ParticipantTracker.get_metadata(room.id, user.id)
+ metadata = Live::ParticipantTracker.get_metadata(room.id, user.id)
expect(metadata[:is_muted]).to eq(true)
end
end
@@ -1237,7 +1217,7 @@ RSpec.describe Voice::RoomsController do
it "lets a room manager toggle video_enabled" do
sign_in(staff)
- put "/voice/rooms/#{room.id}.json", params: { room: { video_enabled: false } }
+ put "/live/rooms/#{room.id}.json", params: { room: { video_enabled: false } }
expect(response.status).to eq(200)
expect(room.reload.video_enabled).to eq(false)
@@ -1248,7 +1228,7 @@ RSpec.describe Voice::RoomsController do
sign_in(user)
expect {
- put "/voice/rooms/#{private_room.id}.json", params: { room: { name: "Hijacked" } }
+ put "/live/rooms/#{private_room.id}.json", params: { room: { name: "Hijacked" } }
}.not_to change { private_room.reload.name }
expect(response.status).to eq(403)
@@ -1257,7 +1237,7 @@ RSpec.describe Voice::RoomsController do
it "returns 403 for a plain participant member" do
sign_in(private_room_member)
- put "/voice/rooms/#{private_room.id}.json", params: { room: { name: "Hijacked" } }
+ put "/live/rooms/#{private_room.id}.json", params: { room: { name: "Hijacked" } }
expect(response.status).to eq(403)
end
@@ -1265,7 +1245,7 @@ RSpec.describe Voice::RoomsController do
it "lets the creator update their room" do
sign_in(room_owner)
- put "/voice/rooms/#{private_room.id}.json", params: { room: { name: "New name" } }
+ put "/live/rooms/#{private_room.id}.json", params: { room: { name: "New name" } }
expect(response.status).to eq(200)
expect(private_room.reload.name).to eq("New name")
@@ -1274,17 +1254,17 @@ RSpec.describe Voice::RoomsController do
it "lets a room manager change the slug" do
sign_in(room_owner)
- put "/voice/rooms/#{private_room.id}.json", params: { room: { slug: "New Hangout" } }
+ put "/live/rooms/#{private_room.id}.json", params: { room: { slug: "New Hangout" } }
expect(response.status).to eq(200)
expect(private_room.reload.slug).to eq("new-hangout")
end
it "keeps a stage room's type when an update sends an unknown room_type" do
- private_room.update!(room_type: Voice::Room::ROOM_TYPE_STAGE)
+ private_room.update!(room_type: Live::Room::ROOM_TYPE_STAGE)
sign_in(room_owner)
- put "/voice/rooms/#{private_room.id}.json", params: { room: { room_type: "arena" } }
+ put "/live/rooms/#{private_room.id}.json", params: { room: { room_type: "arena" } }
expect(response.status).to eq(400)
expect(private_room.reload.stage?).to eq(true)
@@ -1293,18 +1273,18 @@ RSpec.describe Voice::RoomsController do
it "stores max_quality_profile by name and serializes it back" do
sign_in(room_owner)
- put "/voice/rooms/#{private_room.id}.json", params: { room: { max_quality_profile: "high" } }
+ put "/live/rooms/#{private_room.id}.json", params: { room: { max_quality_profile: "high" } }
expect(response.status).to eq(200)
- expect(private_room.reload.max_quality_profile).to eq(Voice::Room::QUALITY_PROFILES["high"])
+ expect(private_room.reload.max_quality_profile).to eq(Live::Room::QUALITY_PROFILES["high"])
expect(response.parsed_body["room"]["max_quality_profile"]).to eq("high")
end
it "clears the room-level quality cap when set to site_default" do
- private_room.update!(max_quality_profile: Voice::Room::QUALITY_PROFILES["standard"])
+ private_room.update!(max_quality_profile: Live::Room::QUALITY_PROFILES["standard"])
sign_in(room_owner)
- put "/voice/rooms/#{private_room.id}.json",
+ put "/live/rooms/#{private_room.id}.json",
params: {
room: {
max_quality_profile: "site_default",
@@ -1320,27 +1300,27 @@ RSpec.describe Voice::RoomsController do
it "returns 403 for a non-member who can create rooms" do
sign_in(user)
- delete "/voice/rooms/#{private_room.id}.json"
+ delete "/live/rooms/#{private_room.id}.json"
expect(response.status).to eq(403)
- expect(Voice::Room.exists?(private_room.id)).to eq(true)
+ expect(Live::Room.exists?(private_room.id)).to eq(true)
end
it "lets the creator destroy their room" do
sign_in(room_owner)
- delete "/voice/rooms/#{private_room.id}.json"
+ delete "/live/rooms/#{private_room.id}.json"
expect(response.status).to eq(200)
- expect(Voice::Room.exists?(private_room.id)).to eq(false)
+ expect(Live::Room.exists?(private_room.id)).to eq(false)
end
it "broadcasts the destroy to the members the room had" do
sign_in(room_owner)
messages =
- MessageBus.track_publish(Voice.room_index_channel) do
- delete "/voice/rooms/#{private_room.id}.json"
+ MessageBus.track_publish(Live.room_index_channel) do
+ delete "/live/rooms/#{private_room.id}.json"
end
expect(response.status).to eq(200)
@@ -1351,12 +1331,12 @@ RSpec.describe Voice::RoomsController do
end
describe "#participants" do
- before { Voice::ParticipantTracker.add(private_room.id, private_room_member.id) }
+ before { Live::ParticipantTracker.add(private_room.id, private_room_member.id) }
it "returns 403 for a non-member who can create rooms" do
sign_in(user)
- get "/voice/rooms/#{private_room.id}/participants.json"
+ get "/live/rooms/#{private_room.id}/participants.json"
expect(response.status).to eq(403)
end
@@ -1364,7 +1344,7 @@ RSpec.describe Voice::RoomsController do
it "returns the participant list to a member" do
sign_in(private_room_member)
- get "/voice/rooms/#{private_room.id}/participants.json"
+ get "/live/rooms/#{private_room.id}/participants.json"
expect(response.status).to eq(200)
participant_ids = response.parsed_body["participants"].map { |p| p["id"] }
@@ -1372,11 +1352,11 @@ RSpec.describe Voice::RoomsController do
end
it "carries each participant's media entitlements, like the broadcast roster" do
- SiteSetting.voice_video_allowed_groups = Group::AUTO_GROUPS[:logged_in_users]
- SiteSetting.voice_screen_share_allowed_groups = ""
+ SiteSetting.live_video_allowed_groups = Group::AUTO_GROUPS[:logged_in_users]
+ SiteSetting.live_screen_share_allowed_groups = ""
sign_in(private_room_member)
- get "/voice/rooms/#{private_room.id}/participants.json"
+ get "/live/rooms/#{private_room.id}/participants.json"
entry = response.parsed_body["participants"].find { |p| p["id"] == private_room_member.id }
expect(entry).to include("can_publish_video" => true, "can_screen_share" => false)
@@ -1387,10 +1367,10 @@ RSpec.describe Voice::RoomsController do
it "returns 403 for a non-member who can create rooms" do
sign_in(user)
- post "/voice/rooms/#{private_room.id}/heartbeat.json"
+ post "/live/rooms/#{private_room.id}/heartbeat.json"
expect(response.status).to eq(403)
- expect(Voice::ParticipantTracker.user_ids(private_room.id)).not_to include(user.id)
+ expect(Live::ParticipantTracker.user_ids(private_room.id)).not_to include(user.id)
end
end
@@ -1398,7 +1378,7 @@ RSpec.describe Voice::RoomsController do
it "returns 403 for a non-member who can create rooms" do
sign_in(user)
- post "/voice/rooms/#{private_room.id}/signal.json",
+ post "/live/rooms/#{private_room.id}/signal.json",
params: {
payload: {
type: "offer",
@@ -1412,32 +1392,29 @@ RSpec.describe Voice::RoomsController do
end
describe "#kick on a private room" do
- before { Voice::ParticipantTracker.add(private_room.id, private_room_member.id) }
+ before { Live::ParticipantTracker.add(private_room.id, private_room_member.id) }
it "returns 403 for a non-member who can create rooms" do
sign_in(user)
- delete "/voice/rooms/#{private_room.id}/kick.json",
- params: {
- user_id: private_room_member.id,
- }
+ delete "/live/rooms/#{private_room.id}/kick.json", params: { user_id: private_room_member.id }
expect(response.status).to eq(403)
- expect(Voice::ParticipantTracker.user_ids(private_room.id)).to include(private_room_member.id)
+ expect(Live::ParticipantTracker.user_ids(private_room.id)).to include(private_room_member.id)
end
end
describe "#join with metadata" do
it "includes is_muted and is_deafened in active_participants when metadata exists" do
sign_in(user)
- Voice::ParticipantTracker.add(room.id, other_participant.id)
- Voice::ParticipantTracker.update_metadata(
+ Live::ParticipantTracker.add(room.id, other_participant.id)
+ Live::ParticipantTracker.update_metadata(
room.id,
other_participant.id,
{ is_muted: true, is_deafened: true },
)
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
expect(response.status).to eq(200)
participants = response.parsed_body["room"]["active_participants"]
@@ -1456,7 +1433,7 @@ RSpec.describe Voice::RoomsController do
end
it "rejects missing payloads" do
- post "/voice/rooms/#{room.id}/signal.json",
+ post "/live/rooms/#{room.id}/signal.json",
params: {
payload: {
},
@@ -1475,8 +1452,8 @@ RSpec.describe Voice::RoomsController do
}
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) do
- post "/voice/rooms/#{room.id}/signal.json",
+ MessageBus.track_publish(Live.room_channel(room.id)) do
+ post "/live/rooms/#{room.id}/signal.json",
params: {
payload: {
type: "candidate",
@@ -1505,8 +1482,8 @@ RSpec.describe Voice::RoomsController do
it "accepts batched events payloads" do
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) do
- post "/voice/rooms/#{room.id}/signal.json",
+ MessageBus.track_publish(Live.room_channel(room.id)) do
+ post "/live/rooms/#{room.id}/signal.json",
params: {
payload: {
recipient_id: staff.id,
@@ -1541,8 +1518,8 @@ RSpec.describe Voice::RoomsController do
it "relays multi-recipient batched messages" do
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) do
- post "/voice/rooms/#{room.id}/signal.json",
+ MessageBus.track_publish(Live.room_channel(room.id)) do
+ post "/live/rooms/#{room.id}/signal.json",
params: {
payload: {
messages: [
@@ -1589,8 +1566,8 @@ RSpec.describe Voice::RoomsController do
end
def post_signal_payload(payload)
- MessageBus.track_publish(Voice.room_channel(room.id)) do
- post "/voice/rooms/#{room.id}/signal.json",
+ MessageBus.track_publish(Live.room_channel(room.id)) do
+ post "/live/rooms/#{room.id}/signal.json",
params: {
payload: payload,
participant_session_id: @participant_session_id,
@@ -1649,7 +1626,7 @@ RSpec.describe Voice::RoomsController do
end
it "rejects an oversized sdp" do
- oversized = "a" * (Voice::SignalValidator::MAX_SDP_BYTES + 1)
+ oversized = "a" * (Live::SignalValidator::MAX_SDP_BYTES + 1)
messages =
post_signal_payload({ recipient_id: staff.id, events: [{ type: "offer", sdp: oversized }] })
@@ -1658,7 +1635,7 @@ RSpec.describe Voice::RoomsController do
end
it "rejects an oversized candidate" do
- oversized = "a" * (Voice::SignalValidator::MAX_CANDIDATE_BYTES + 1)
+ oversized = "a" * (Live::SignalValidator::MAX_CANDIDATE_BYTES + 1)
messages =
post_signal_payload(
{
@@ -1673,7 +1650,7 @@ RSpec.describe Voice::RoomsController do
it "rejects a batch with more events than one recipient may receive" do
events =
- (Voice::SignalValidator::MAX_EVENTS_PER_RECIPIENT + 1).times.map do |seq|
+ (Live::SignalValidator::MAX_EVENTS_PER_RECIPIENT + 1).times.map do |seq|
candidate_event(seq)
end
messages = post_signal_payload({ recipient_id: staff.id, events: events })
@@ -1776,14 +1753,14 @@ RSpec.describe Voice::RoomsController do
def recipient_sessions!(count)
(1..count).map do |i|
fake_id = 100_000 + i
- Voice::ParticipantTracker.create_participant_session!(room.id, fake_id)
+ Live::ParticipantTracker.create_participant_session!(room.id, fake_id)
fake_id
end
end
def post_burst(recipient_ids, events_per_recipient)
- MessageBus.track_publish(Voice.room_channel(room.id)) do
- post "/voice/rooms/#{room.id}/signal.json",
+ MessageBus.track_publish(Live.room_channel(room.id)) do
+ post "/live/rooms/#{room.id}/signal.json",
params: {
payload: {
messages:
@@ -1815,7 +1792,7 @@ RSpec.describe Voice::RoomsController do
it "rejects sustained signaling before any MessageBus work happens" do
recipient_ids = recipient_sessions!(49)
max_events =
- Voice::SignalValidator::MAX_EVENTS_PER_RECIPIENT.times.map { |seq| candidate_event(seq) }
+ Live::SignalValidator::MAX_EVENTS_PER_RECIPIENT.times.map { |seq| candidate_event(seq) }
4.times do
post_burst(recipient_ids, max_events)
@@ -1829,11 +1806,11 @@ RSpec.describe Voice::RoomsController do
end
it "limits a room's aggregate signaling across users" do
- stub_const(Voice::RoomsController, :SIGNAL_EVENTS_PER_ROOM_PER_MINUTE, 40) do
+ stub_const(Live::RoomsController, :SIGNAL_EVENTS_PER_ROOM_PER_MINUTE, 40) do
staff_session_id = establish_presence!(room, staff)
recipient_sessions!(1)
- post "/voice/rooms/#{room.id}/signal.json",
+ post "/live/rooms/#{room.id}/signal.json",
params: {
payload: {
recipient_id: 100_001,
@@ -1846,8 +1823,8 @@ RSpec.describe Voice::RoomsController do
sign_in(staff)
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) do
- post "/voice/rooms/#{room.id}/signal.json",
+ MessageBus.track_publish(Live.room_channel(room.id)) do
+ post "/live/rooms/#{room.id}/signal.json",
params: {
payload: {
recipient_id: 100_001,
@@ -1867,7 +1844,7 @@ RSpec.describe Voice::RoomsController do
sign_in(other_participant)
30.times do
- post "/voice/rooms/#{room.id}/signal.json",
+ post "/live/rooms/#{room.id}/signal.json",
params: {
payload: {
recipient_id: user.id,
@@ -1878,7 +1855,7 @@ RSpec.describe Voice::RoomsController do
expect(response.status).to eq(403)
end
- post "/voice/rooms/#{room.id}/signal.json",
+ post "/live/rooms/#{room.id}/signal.json",
params: {
payload: {
recipient_id: user.id,
@@ -1893,7 +1870,7 @@ RSpec.describe Voice::RoomsController do
describe "#signal participant session enforcement" do
def post_signal(sender_room, session_id, recipient:)
- post "/voice/rooms/#{sender_room.id}/signal.json",
+ post "/live/rooms/#{sender_room.id}/signal.json",
params: {
payload: {
type: "offer",
@@ -1910,11 +1887,11 @@ RSpec.describe Voice::RoomsController do
# early offer.
sign_in(user)
establish_presence!(room, other_participant)
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
session_id = response.parsed_body["participant_session_id"]
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) do
+ MessageBus.track_publish(Live.room_channel(room.id)) do
post_signal(room, session_id, recipient: other_participant)
end
@@ -1928,7 +1905,7 @@ RSpec.describe Voice::RoomsController do
establish_presence!(room, other_participant)
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) do
+ MessageBus.track_publish(Live.room_channel(room.id)) do
post_signal(room, nil, recipient: other_participant)
end
@@ -1940,14 +1917,14 @@ RSpec.describe Voice::RoomsController do
sign_in(user)
establish_presence!(room, other_participant)
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
stale_session_id = response.parsed_body["participant_session_id"]
- delete "/voice/rooms/#{room.id}/leave.json"
- post "/voice/rooms/#{room.id}/join.json"
+ delete "/live/rooms/#{room.id}/leave.json"
+ post "/live/rooms/#{room.id}/join.json"
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) do
+ MessageBus.track_publish(Live.room_channel(room.id)) do
post_signal(room, stale_session_id, recipient: other_participant)
end
@@ -1958,15 +1935,15 @@ RSpec.describe Voice::RoomsController do
it "revokes signaling authority when the user is kicked" do
sign_in(user)
establish_presence!(room, other_participant)
- post "/voice/rooms/#{room.id}/join.json"
+ post "/live/rooms/#{room.id}/join.json"
session_id = response.parsed_body["participant_session_id"]
sign_in(staff)
- delete "/voice/rooms/#{room.id}/kick.json", params: { user_id: user.id }
+ delete "/live/rooms/#{room.id}/kick.json", params: { user_id: user.id }
sign_in(user)
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) do
+ MessageBus.track_publish(Live.room_channel(room.id)) do
post_signal(room, session_id, recipient: other_participant)
end
@@ -1980,8 +1957,8 @@ RSpec.describe Voice::RoomsController do
establish_presence!(room, staff)
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) do
- post "/voice/rooms/#{room.id}/signal.json",
+ MessageBus.track_publish(Live.room_channel(room.id)) do
+ post "/live/rooms/#{room.id}/signal.json",
params: {
payload: {
messages: [
@@ -2007,11 +1984,11 @@ RSpec.describe Voice::RoomsController do
establish_presence!(room, user)
sign_in(user)
- delete "/voice/rooms/#{room.id}/leave.json"
+ delete "/live/rooms/#{room.id}/leave.json"
sign_in(other_participant)
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) do
+ MessageBus.track_publish(Live.room_channel(room.id)) do
post_signal(room, session_id, recipient: user)
end
@@ -2031,12 +2008,12 @@ RSpec.describe Voice::RoomsController do
end
after do
- Voice::ChatSession.clear(room.id)
- Voice::ParticipantTracker.clear(room.id)
+ Live::ChatSession.clear(room.id)
+ Live::ParticipantTracker.clear(room.id)
end
def join_room!(joining_user)
- Voice::ParticipantTracker.add(room.id, joining_user.id)
+ Live::ParticipantTracker.add(room.id, joining_user.id)
end
describe "chat fields in the serialized room" do
@@ -2046,7 +2023,7 @@ RSpec.describe Voice::RoomsController do
it "hides all chat fields from a signed-in non-participant" do
sign_in(viewer)
- get "/voice/rooms/#{room.id}.json"
+ get "/live/rooms/#{room.id}.json"
room_json = response.parsed_body["room"]
expect(room_json.keys).not_to include(
@@ -2057,7 +2034,7 @@ RSpec.describe Voice::RoomsController do
end
it "hides all chat fields from the anonymously-scoped directory broadcast" do
- json = Voice::RoomSerializer.new(room, scope: Guardian.new(nil), root: false).as_json
+ json = Live::RoomSerializer.new(room, scope: Guardian.new(nil), root: false).as_json
expect(json.keys).not_to include(:chat_available, :chat_channel_id, :chat_idle_minutes)
end
@@ -2066,7 +2043,7 @@ RSpec.describe Voice::RoomsController do
sign_in(viewer)
join_room!(viewer)
- get "/voice/rooms/#{room.id}.json"
+ get "/live/rooms/#{room.id}.json"
room_json = response.parsed_body["room"]
expect(room_json["chat_available"]).to eq(true)
@@ -2076,7 +2053,7 @@ RSpec.describe Voice::RoomsController do
it "exposes the chat settings to a manager" do
sign_in(staff)
- get "/voice/rooms/#{room.id}.json"
+ get "/live/rooms/#{room.id}.json"
room_json = response.parsed_body["room"]
expect(room_json["chat_available"]).to eq(true)
@@ -2090,7 +2067,7 @@ RSpec.describe Voice::RoomsController do
sign_in(user)
join_room!(user)
- get "/voice/rooms/#{room.id}/chat_session.json"
+ get "/live/rooms/#{room.id}/chat_session.json"
expect(response.status).to eq(200)
expect(response.parsed_body["channel_id"]).to eq(channel.id)
@@ -2102,7 +2079,7 @@ RSpec.describe Voice::RoomsController do
sign_in(user)
join_room!(user)
- get "/voice/rooms/#{room.id}/chat_session.json"
+ get "/live/rooms/#{room.id}/chat_session.json"
expect(response.status).to eq(403)
end
@@ -2112,21 +2089,21 @@ RSpec.describe Voice::RoomsController do
sign_in(user)
join_room!(user)
- get "/voice/rooms/#{room.id}/chat_session.json"
+ get "/live/rooms/#{room.id}/chat_session.json"
expect(response.status).to eq(403)
end
- it "returns 403 when signed in but not present in the voice room" do
+ it "returns 403 when signed in but not present in the live room" do
sign_in(user)
- get "/voice/rooms/#{room.id}/chat_session.json"
+ get "/live/rooms/#{room.id}/chat_session.json"
expect(response.status).to eq(403)
end
it "requires authentication" do
- get "/voice/rooms/#{room.id}/chat_session.json"
+ get "/live/rooms/#{room.id}/chat_session.json"
expect(response.status).to eq(403)
end
@@ -2134,7 +2111,7 @@ RSpec.describe Voice::RoomsController do
describe "#ensure_chat_session" do
it "requires authentication" do
- post "/voice/rooms/#{room.id}/chat_session.json"
+ post "/live/rooms/#{room.id}/chat_session.json"
expect(response.status).to eq(403)
end
@@ -2142,11 +2119,11 @@ RSpec.describe Voice::RoomsController do
it "returns 403 with the room's own message when signed in but not present" do
sign_in(user)
- post "/voice/rooms/#{room.id}/chat_session.json"
+ post "/live/rooms/#{room.id}/chat_session.json"
expect(response.status).to eq(403)
expect(response.parsed_body["errors"]).to include(
- I18n.t("voice.errors.chat_requires_presence"),
+ I18n.t("live.errors.chat_requires_presence"),
)
end
@@ -2154,7 +2131,7 @@ RSpec.describe Voice::RoomsController do
sign_in(user)
join_room!(user)
- post "/voice/rooms/#{room.id}/chat_session.json"
+ post "/live/rooms/#{room.id}/chat_session.json"
expect(response.status).to eq(200)
expect(response.parsed_body["channel_id"]).to eq(channel.id)
@@ -2170,7 +2147,7 @@ RSpec.describe Voice::RoomsController do
describe "#chat_message" do
it "requires authentication" do
- post "/voice/rooms/#{room.id}/chat_message.json", params: { message: "hi" }
+ post "/live/rooms/#{room.id}/chat_message.json", params: { message: "hi" }
expect(response.status).to eq(403)
end
@@ -2178,11 +2155,11 @@ RSpec.describe Voice::RoomsController do
it "returns 403 with the room's own message when signed in but not present" do
sign_in(user)
- post "/voice/rooms/#{room.id}/chat_message.json", params: { message: "hi" }
+ post "/live/rooms/#{room.id}/chat_message.json", params: { message: "hi" }
expect(response.status).to eq(403)
expect(response.parsed_body["errors"]).to include(
- I18n.t("voice.errors.chat_requires_presence"),
+ I18n.t("live.errors.chat_requires_presence"),
)
end
@@ -2190,7 +2167,7 @@ RSpec.describe Voice::RoomsController do
sign_in(user)
join_room!(user)
- post "/voice/rooms/#{room.id}/chat_message.json", params: { message: "hello everyone" }
+ post "/live/rooms/#{room.id}/chat_message.json", params: { message: "hello everyone" }
expect(response.status).to eq(200)
thread_id = response.parsed_body["thread_id"]
@@ -2201,19 +2178,19 @@ RSpec.describe Voice::RoomsController do
expect(thread.original_message.message).to eq("In ##{room.slug}::room - hello everyone")
expect(thread.original_message.user_id).to eq(user.id)
- get "/voice/rooms/#{room.id}/chat_session.json"
+ get "/live/rooms/#{room.id}/chat_session.json"
expect(response.parsed_body["thread_id"]).to eq(thread_id)
end
it "delivers a racing message to the live thread instead of a new one" do
sign_in(user)
join_room!(user)
- post "/voice/rooms/#{room.id}/chat_message.json", params: { message: "first" }
+ post "/live/rooms/#{room.id}/chat_message.json", params: { message: "first" }
thread_id = response.parsed_body["thread_id"]
sign_in(other_participant)
join_room!(other_participant)
- post "/voice/rooms/#{room.id}/chat_message.json", params: { message: "second" }
+ post "/live/rooms/#{room.id}/chat_message.json", params: { message: "second" }
expect(response.parsed_body["thread_id"]).to eq(thread_id)
expect(Chat::Thread.find(thread_id).replies.last.message).to eq("second")
@@ -2225,12 +2202,12 @@ RSpec.describe Voice::RoomsController do
sign_in(user)
join_room!(user)
- post "/voice/rooms/#{room.id}/chat_message.json", params: { message: "one" }
+ post "/live/rooms/#{room.id}/chat_message.json", params: { message: "one" }
expect(response.status).to eq(200)
# A second message within the window would be free if this endpoint
# skipped chat's limiter; it must be capped like normal chat.
- post "/voice/rooms/#{room.id}/chat_message.json", params: { message: "two" }
+ post "/live/rooms/#{room.id}/chat_message.json", params: { message: "two" }
expect(response.status).to eq(429)
end
@@ -2239,7 +2216,7 @@ RSpec.describe Voice::RoomsController do
sign_in(user)
join_room!(user)
- post "/voice/rooms/#{room.id}/chat_message.json", params: { message: "hello" }
+ post "/live/rooms/#{room.id}/chat_message.json", params: { message: "hello" }
expect(response.status).to eq(422)
expect(response.parsed_body["errors"].join).to match(/threading/i)
diff --git a/plugins/voice/spec/serializers/voice/room_serializer_spec.rb b/plugins/live/spec/serializers/live/room_serializer_spec.rb
similarity index 85%
rename from plugins/voice/spec/serializers/voice/room_serializer_spec.rb
rename to plugins/live/spec/serializers/live/room_serializer_spec.rb
index 0ae3052cc87..6cfde855437 100644
--- a/plugins/voice/spec/serializers/voice/room_serializer_spec.rb
+++ b/plugins/live/spec/serializers/live/room_serializer_spec.rb
@@ -1,12 +1,12 @@
# frozen_string_literal: true
-RSpec.describe Voice::RoomSerializer do
+RSpec.describe Live::RoomSerializer do
fab!(:user)
- fab!(:room) { Fabricate(:voice_room, public: true) }
+ fab!(:room) { Fabricate(:live_room, public: true) }
before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_allowed_groups =
+ SiteSetting.live_enabled = true
+ SiteSetting.live_allowed_groups =
"#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
end
@@ -18,15 +18,15 @@ RSpec.describe Voice::RoomSerializer do
fab!(:speaker, :user)
before do
- Voice::ParticipantTracker.add(room.id, user.id)
- Voice::ParticipantTracker.add(room.id, speaker.id)
+ Live::ParticipantTracker.add(room.id, user.id)
+ Live::ParticipantTracker.add(room.id, speaker.id)
end
# Mesh receivers decide what to play from the sender's entry, so every
# participant carries its own entitlements — including in the
# anonymously-scoped broadcasts.
it "stamps each participant with their own capabilities" do
- SiteSetting.voice_screen_share_allowed_groups = ""
+ SiteSetting.live_screen_share_allowed_groups = ""
participants = serialize(Guardian.new(nil))[:active_participants]
@@ -47,7 +47,7 @@ RSpec.describe Voice::RoomSerializer do
describe "media publish rights" do
it "reports each capability separately" do
- SiteSetting.voice_screen_share_allowed_groups = ""
+ SiteSetting.live_screen_share_allowed_groups = ""
payload = serialize(user.guardian)
diff --git a/plugins/live/spec/serializers/live_user_card_serializer_spec.rb b/plugins/live/spec/serializers/live_user_card_serializer_spec.rb
new file mode 100644
index 00000000000..f826fbce167
--- /dev/null
+++ b/plugins/live/spec/serializers/live_user_card_serializer_spec.rb
@@ -0,0 +1,51 @@
+# frozen_string_literal: true
+
+RSpec.describe UserCardSerializer do
+ fab!(:viewer) { Fabricate(:user, trust_level: TrustLevel[2]) }
+ fab!(:target) { Fabricate(:user, trust_level: TrustLevel[2]) }
+
+ before do
+ SiteSetting.live_enabled = true
+ SiteSetting.live_allowed_groups =
+ "#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
+ end
+
+ def serialize(user, scope_user)
+ described_class.new(user, scope: scope_user.guardian, root: false).as_json
+ end
+
+ describe "#live_can_call" do
+ it "is true for a callable user when the viewer may start direct calls, false for oneself" do
+ SiteSetting.live_direct_calls_allowed_groups = Group::AUTO_GROUPS[:trust_level_2]
+
+ expect(serialize(target, viewer)[:live_can_call]).to eq(true)
+ expect(serialize(viewer, viewer)[:live_can_call]).to eq(false)
+ end
+
+ it "is false for a target outside the live-room groups" do
+ SiteSetting.live_allowed_groups = Group::AUTO_GROUPS[:trust_level_2]
+ SiteSetting.live_direct_calls_allowed_groups = Group::AUTO_GROUPS[:trust_level_2]
+ outsider = Fabricate(:user, trust_level: TrustLevel[0])
+
+ expect(serialize(outsider, viewer)[:live_can_call]).to eq(false)
+ end
+
+ it "is false when the target has muted the viewer" do
+ SiteSetting.live_direct_calls_allowed_groups = Group::AUTO_GROUPS[:trust_level_2]
+ MutedUser.create!(user_id: target.id, muted_user_id: viewer.id)
+
+ expect(serialize(target, viewer)[:live_can_call]).to eq(false)
+ end
+
+ it "is false when the target does not accept personal messages from the viewer" do
+ SiteSetting.live_direct_calls_allowed_groups = Group::AUTO_GROUPS[:trust_level_2]
+ target.user_option.update!(allow_private_messages: false)
+
+ expect(serialize(target, viewer)[:live_can_call]).to eq(false)
+ end
+
+ it "is omitted entirely when direct calls are disabled (the default)" do
+ expect(serialize(target, viewer)).not_to have_key(:live_can_call)
+ end
+ end
+end
diff --git a/plugins/live/spec/serializers/site_serializer_spec.rb b/plugins/live/spec/serializers/site_serializer_spec.rb
new file mode 100644
index 00000000000..7672b261efe
--- /dev/null
+++ b/plugins/live/spec/serializers/site_serializer_spec.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+RSpec.describe SiteSerializer do
+ fab!(:user)
+
+ before { SiteSetting.live_enabled = true }
+
+ def live_video_available
+ described_class.new(Site.new(user.guardian), scope: user.guardian, root: false).as_json[
+ :live_video_available
+ ]
+ end
+
+ describe "#live_video_available" do
+ it "is true when either capability has groups" do
+ SiteSetting.live_video_allowed_groups = ""
+ SiteSetting.live_screen_share_allowed_groups = Group::AUTO_GROUPS[:trust_level_1]
+
+ expect(live_video_available).to eq(true)
+ end
+
+ it "is false when neither capability has groups" do
+ SiteSetting.live_video_allowed_groups = ""
+ SiteSetting.live_screen_share_allowed_groups = ""
+
+ expect(live_video_available).to eq(false)
+ end
+ end
+end
diff --git a/plugins/voice/spec/services/voice/agent_bot_spec.rb b/plugins/live/spec/services/live/agent_bot_spec.rb
similarity index 59%
rename from plugins/voice/spec/services/voice/agent_bot_spec.rb
rename to plugins/live/spec/services/live/agent_bot_spec.rb
index 6862e7b5fd2..afd778c8688 100644
--- a/plugins/voice/spec/services/voice/agent_bot_spec.rb
+++ b/plugins/live/spec/services/live/agent_bot_spec.rb
@@ -2,17 +2,17 @@
require "rails_helper"
-RSpec.describe Voice::AgentBot do
+RSpec.describe Live::AgentBot do
before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_livekit_url = "wss://test.livekit.cloud"
- SiteSetting.voice_livekit_api_key = "key"
- SiteSetting.voice_livekit_api_secret = "secret"
+ SiteSetting.live_enabled = true
+ SiteSetting.live_livekit_url = "wss://test.livekit.cloud"
+ SiteSetting.live_livekit_api_key = "key"
+ SiteSetting.live_livekit_api_secret = "secret"
end
describe ".ensure!" do
it "creates a bot when enabled and reuses it when enabled again" do
- SiteSetting.voice_livekit_agent_enabled = true
+ SiteSetting.live_livekit_agent_enabled = true
bot = described_class.user
expect(bot.username).to eq("livekit_agent_bot")
@@ -20,16 +20,16 @@ RSpec.describe Voice::AgentBot do
expect(bot).to be_active
expect(bot).not_to be_staff
expect(described_class).to be_available
- SiteSetting.voice_livekit_agent_enabled = false
+ SiteSetting.live_livekit_agent_enabled = false
expect(described_class).not_to be_available
- SiteSetting.voice_livekit_agent_enabled = true
+ SiteSetting.live_livekit_agent_enabled = true
expect(described_class.user.id).to eq(bot.id)
end
it "refuses to take over an existing username" do
user = Fabricate(:user, username: "livekit_agent_bot")
- expect { SiteSetting.voice_livekit_agent_enabled = true }.to raise_error(
+ expect { SiteSetting.live_livekit_agent_enabled = true }.to raise_error(
Discourse::InvalidParameters,
)
expect(described_class.user).to be_nil
@@ -37,8 +37,8 @@ RSpec.describe Voice::AgentBot do
end
it "requires a configured Cloud project" do
- SiteSetting.voice_livekit_url = "wss://livekit.example.com"
- expect { SiteSetting.voice_livekit_agent_enabled = true }.to raise_error(
+ SiteSetting.live_livekit_url = "wss://livekit.example.com"
+ expect { SiteSetting.live_livekit_agent_enabled = true }.to raise_error(
Discourse::InvalidParameters,
)
expect(described_class.user).to be_nil
diff --git a/plugins/voice/spec/services/voice/agent_dispatcher_spec.rb b/plugins/live/spec/services/live/agent_dispatcher_spec.rb
similarity index 70%
rename from plugins/voice/spec/services/voice/agent_dispatcher_spec.rb
rename to plugins/live/spec/services/live/agent_dispatcher_spec.rb
index 986e1b672ae..84bf7a7255f 100644
--- a/plugins/voice/spec/services/voice/agent_dispatcher_spec.rb
+++ b/plugins/live/spec/services/live/agent_dispatcher_spec.rb
@@ -2,19 +2,19 @@
require "rails_helper"
-RSpec.describe Voice::AgentDispatcher do
+RSpec.describe Live::AgentDispatcher do
fab!(:user)
- fab!(:room) { Fabricate(:voice_room, public: true) }
- let(:bot) { Voice::AgentBot.user }
+ fab!(:room) { Fabricate(:live_room, public: true) }
+ let(:bot) { Live::AgentBot.user }
before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_livekit_url = "wss://test.livekit.cloud"
- SiteSetting.voice_livekit_api_key = "key"
- SiteSetting.voice_livekit_api_secret = "secret"
- SiteSetting.voice_livekit_agent_enabled = true
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
- Voice::ParticipantTracker.add(room.id, user.id)
+ SiteSetting.live_enabled = true
+ SiteSetting.live_livekit_url = "wss://test.livekit.cloud"
+ SiteSetting.live_livekit_api_key = "key"
+ SiteSetting.live_livekit_api_secret = "secret"
+ SiteSetting.live_livekit_agent_enabled = true
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
+ Live::ParticipantTracker.add(room.id, user.id)
@dispatch = nil
stub_request(
:post,
@@ -70,10 +70,10 @@ RSpec.describe Voice::AgentDispatcher do
it "maps the provider-attested job identity to the authorized bot and applies its permissions" do
expect(described_class.dispatch!(room:, agent_name: "assistant")).to eq("AD_test")
- Voice::AgentManager.reconcile(room)
+ Live::AgentManager.reconcile(room)
- expect(Voice::ParticipantTracker.agent_user_ids(room.id)).to eq([bot.id])
- expect(Voice::ParticipantTracker.get_metadata(room.id, bot.id)).to include(
+ expect(Live::ParticipantTracker.agent_user_ids(room.id)).to eq([bot.id])
+ expect(Live::ParticipantTracker.get_metadata(room.id, bot.id)).to include(
livekit_identity: "agent-test",
external_agent: true,
role: "speaker",
@@ -87,51 +87,51 @@ RSpec.describe Voice::AgentDispatcher do
),
),
).to have_been_requested
- expect(Voice::Session.where(user_id: bot.id)).to be_empty
+ expect(Live::Session.where(user_id: bot.id)).to be_empty
end
it "rejects invitations to empty, mesh, and private rooms" do
- other_room = Fabricate(:voice_room, public: false)
+ other_room = Fabricate(:live_room, public: false)
expect {
described_class.dispatch!(room: other_room, agent_name: "assistant")
- }.to raise_error(Voice::AgentManager::AuthorizationError)
- Voice::ParticipantTracker.remove(room.id, user.id)
+ }.to raise_error(Live::AgentManager::AuthorizationError)
+ Live::ParticipantTracker.remove(room.id, user.id)
expect { described_class.dispatch!(room:, agent_name: "assistant") }.to raise_error(
- Voice::AgentManager::AuthorizationError,
+ Live::AgentManager::AuthorizationError,
)
- Voice::ParticipantTracker.add(room.id, user.id)
- Voice::ParticipantTracker.clear_transport_pin(room.id)
- Voice::ParticipantTracker.pin_transport!(room.id, "mesh")
+ Live::ParticipantTracker.add(room.id, user.id)
+ Live::ParticipantTracker.clear_transport_pin(room.id)
+ Live::ParticipantTracker.pin_transport!(room.id, "mesh")
expect { described_class.dispatch!(room:, agent_name: "assistant") }.to raise_error(
- Voice::AgentManager::AuthorizationError,
+ Live::AgentManager::AuthorizationError,
)
- Voice::ParticipantTracker.clear_transport_pin(room.id)
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
+ Live::ParticipantTracker.clear_transport_pin(room.id)
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
expect(@dispatch).to be_nil
end
it "rejects participant-supplied identity claims and unrelated dispatches" do
described_class.dispatch!(room:, agent_name: "assistant")
@participants = [{ identity: "impostor", kind: "AGENT", metadata: @dispatch["metadata"] }]
- Voice::AgentManager.reconcile(room)
- expect(Voice::ParticipantTracker.agent_user_ids(room.id)).to be_empty
+ Live::AgentManager.reconcile(room)
+ expect(Live::ParticipantTracker.agent_user_ids(room.id)).to be_empty
@participants = [{ identity: "agent-test", kind: "AGENT" }]
@dispatch["id"] = "AD_unrelated"
- Voice::AgentManager.reconcile(room)
- expect(Voice::ParticipantTracker.agent_user_ids(room.id)).to be_empty
+ Live::AgentManager.reconcile(room)
+ expect(Live::ParticipantTracker.agent_user_ids(room.id)).to be_empty
end
it "requires an active agent job and an agent participant before admitting media" do
described_class.dispatch!(room:, agent_name: "assistant")
@dispatch["state"]["jobs"][0]["state"]["status"] = "JS_FAILED"
- Voice::AgentManager.reconcile(room)
- expect(Voice::ParticipantTracker.agent_user_ids(room.id)).to be_empty
+ Live::AgentManager.reconcile(room)
+ expect(Live::ParticipantTracker.agent_user_ids(room.id)).to be_empty
@dispatch["state"]["jobs"][0]["state"]["status"] = "JS_RUNNING"
@participants[0][:kind] = "STANDARD"
- Voice::AgentManager.reconcile(room)
- expect(Voice::ParticipantTracker.agent_user_ids(room.id)).to be_empty
+ Live::AgentManager.reconcile(room)
+ expect(Live::ParticipantTracker.agent_user_ids(room.id)).to be_empty
end
it "withholds roster admission if provider permission enforcement fails" do
@@ -141,9 +141,9 @@ RSpec.describe Voice::AgentDispatcher do
"https://test.livekit.cloud/twirp/livekit.RoomService/UpdateParticipant",
).to_return(status: 503)
- Voice::AgentManager.reconcile(room)
+ Live::AgentManager.reconcile(room)
- expect(Voice::ParticipantTracker.agent_user_ids(room.id)).to be_empty
+ expect(Live::ParticipantTracker.agent_user_ids(room.id)).to be_empty
end
it "rejects a snapshot revoked while provider permissions are being updated" do
@@ -152,13 +152,13 @@ RSpec.describe Voice::AgentDispatcher do
:post,
"https://test.livekit.cloud/twirp/livekit.RoomService/UpdateParticipant",
).to_return do
- Voice::AgentManager.evict!(room:, user_id: bot.id)
+ Live::AgentManager.evict!(room:, user_id: bot.id)
{ status: 200, body: "{}" }
end
- Voice::AgentManager.reconcile(room)
+ Live::AgentManager.reconcile(room)
- expect(Voice::ParticipantTracker.agent_user_ids(room.id)).to be_empty
+ expect(Live::ParticipantTracker.agent_user_ids(room.id)).to be_empty
expect(
a_request(
:post,
@@ -175,9 +175,9 @@ RSpec.describe Voice::AgentDispatcher do
expect(@delete).to have_been_requested.once
@dispatch = previous
- Voice::AgentManager.reconcile(room)
+ Live::AgentManager.reconcile(room)
- expect(Voice::ParticipantTracker.agent_user_ids(room.id)).to be_empty
+ expect(Live::ParticipantTracker.agent_user_ids(room.id)).to be_empty
end
it "deletes an in-flight dispatch if authorization is revoked during creation" do
@@ -185,16 +185,16 @@ RSpec.describe Voice::AgentDispatcher do
:post,
"https://test.livekit.cloud/twirp/livekit.AgentDispatchService/CreateDispatch",
).to_return do
- Voice::AgentManager.evict!(room:, user_id: bot.id)
+ Live::AgentManager.evict!(room:, user_id: bot.id)
{ status: 200, body: { id: "AD_late" }.to_json }
end
expect { described_class.dispatch!(room:, agent_name: "assistant") }.to raise_error(
- Voice::AgentManager::AuthorizationError,
+ Live::AgentManager::AuthorizationError,
)
expect(@delete.with(body: hash_including("dispatch_id" => "AD_late"))).to have_been_requested
- expect(Voice::ParticipantTracker.agent_user_ids(room.id)).to be_empty
+ expect(Live::ParticipantTracker.agent_user_ids(room.id)).to be_empty
end
it "recovers and deletes a remotely created dispatch after its response times out" do
@@ -209,7 +209,7 @@ RSpec.describe Voice::AgentDispatcher do
described_class::DispatchError,
)
- Voice::AgentManager.reconcile(room)
+ Live::AgentManager.reconcile(room)
expect(
@delete.with(body: hash_including("dispatch_id" => "AD_timeout")),
@@ -231,16 +231,16 @@ RSpec.describe Voice::AgentDispatcher do
it "removes local admission immediately and retries failed dispatch deletion after a kick" do
described_class.dispatch!(room:, agent_name: "assistant")
- Voice::AgentManager.reconcile(room)
+ Live::AgentManager.reconcile(room)
@delete =
stub_request(
:post,
"https://test.livekit.cloud/twirp/livekit.AgentDispatchService/DeleteDispatch",
).to_return(status: 503).then.to_return(status: 200, body: "{}")
- Voice::AgentManager.evict!(room:, user_id: bot.id)
+ Live::AgentManager.evict!(room:, user_id: bot.id)
- expect(Voice::ParticipantTracker.agent_user_ids(room.id)).to be_empty
+ expect(Live::ParticipantTracker.agent_user_ids(room.id)).to be_empty
expect(described_class.pending?(room.id)).to eq(true)
expect(
a_request(
@@ -248,32 +248,32 @@ RSpec.describe Voice::AgentDispatcher do
"https://test.livekit.cloud/twirp/livekit.RoomService/RemoveParticipant",
).with(body: hash_including("identity" => "agent-test")),
).to have_been_made.once
- Voice::AgentManager.reconcile(room)
+ Live::AgentManager.reconcile(room)
expect(described_class.pending?(room.id)).to eq(false)
expect(@delete).to have_been_requested.twice
end
it "revokes active admission when the feature is disabled" do
described_class.dispatch!(room:, agent_name: "assistant")
- Voice::AgentManager.reconcile(room)
+ Live::AgentManager.reconcile(room)
- SiteSetting.voice_livekit_agent_enabled = false
- Voice::AgentManager.reconcile(room)
+ SiteSetting.live_livekit_agent_enabled = false
+ Live::AgentManager.reconcile(room)
- expect(Voice::ParticipantTracker.agent_user_ids(room.id)).to be_empty
+ expect(Live::ParticipantTracker.agent_user_ids(room.id)).to be_empty
expect(@delete).to have_been_requested.once
end
it "stops the dispatch when the last human leaves" do
described_class.dispatch!(room:, agent_name: "assistant")
- Voice::AgentManager.reconcile(room)
- Voice::ParticipantTracker.remove(room.id, user.id)
+ Live::AgentManager.reconcile(room)
+ Live::ParticipantTracker.remove(room.id, user.id)
- Voice::AgentManager.evict_agents_in_room!(room)
+ Live::AgentManager.evict_agents_in_room!(room)
expect(@delete).to have_been_requested.once
expect(described_class.pending?(room.id)).to eq(false)
- expect(Voice::ParticipantTracker.agent_user_ids(room.id)).to be_empty
+ expect(Live::ParticipantTracker.agent_user_ids(room.id)).to be_empty
end
end
end
diff --git a/plugins/voice/spec/services/voice/agent_manager_spec.rb b/plugins/live/spec/services/live/agent_manager_spec.rb
similarity index 57%
rename from plugins/voice/spec/services/voice/agent_manager_spec.rb
rename to plugins/live/spec/services/live/agent_manager_spec.rb
index 10ba6ee6108..6fed05fc19d 100644
--- a/plugins/voice/spec/services/voice/agent_manager_spec.rb
+++ b/plugins/live/spec/services/live/agent_manager_spec.rb
@@ -2,20 +2,20 @@
require "rails_helper"
-RSpec.describe Voice::AgentManager do
+RSpec.describe Live::AgentManager do
fab!(:user)
- fab!(:room) { Fabricate(:voice_room, public: true) }
- fab!(:other_room) { Fabricate(:voice_room, public: true) }
+ fab!(:room) { Fabricate(:live_room, public: true) }
+ fab!(:other_room) { Fabricate(:live_room, public: true) }
before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_livekit_url = "wss://test.livekit.cloud"
- SiteSetting.voice_livekit_api_key = "key"
- SiteSetting.voice_livekit_api_secret = "secret"
- SiteSetting.voice_livekit_agent_enabled = true
- [room, other_room].each do |voice_room|
- Voice::ParticipantTracker.pin_transport!(voice_room.id, "livekit")
- Voice::ParticipantTracker.add(voice_room.id, user.id)
+ SiteSetting.live_enabled = true
+ SiteSetting.live_livekit_url = "wss://test.livekit.cloud"
+ SiteSetting.live_livekit_api_key = "key"
+ SiteSetting.live_livekit_api_secret = "secret"
+ SiteSetting.live_livekit_agent_enabled = true
+ [room, other_room].each do |live_room|
+ Live::ParticipantTracker.pin_transport!(live_room.id, "livekit")
+ Live::ParticipantTracker.add(live_room.id, user.id)
end
stub_request(
:post,
@@ -25,13 +25,13 @@ RSpec.describe Voice::AgentManager do
describe ".evict_agents_in_room!" do
it "revokes an admission proof before a dispatch is saved without revoking other rooms" do
- bot_id = Voice::AgentBot.user.id
+ bot_id = Live::AgentBot.user.id
session_id = described_class.authorize_session!(room:, agent_name: "assistant")
other_session_id =
described_class.authorize_session!(room: other_room, agent_name: "assistant")
described_class.evict_agents_in_room!(room)
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
expect(
described_class.authorized_session(room:, user_id: bot_id, metadata: session_id),
diff --git a/plugins/voice/spec/services/voice/badge_backfill_spec.rb b/plugins/live/spec/services/live/badge_backfill_spec.rb
similarity index 88%
rename from plugins/voice/spec/services/voice/badge_backfill_spec.rb
rename to plugins/live/spec/services/live/badge_backfill_spec.rb
index ee9e26b9f12..41d186c5a7b 100644
--- a/plugins/voice/spec/services/voice/badge_backfill_spec.rb
+++ b/plugins/live/spec/services/live/badge_backfill_spec.rb
@@ -4,13 +4,13 @@ require "rails_helper"
RSpec.describe BadgeGranter, ".backfill" do
fab!(:user)
- fab!(:room, :voice_room)
+ fab!(:room, :live_room)
before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_badges_enabled = true
- SeedFu.seed(Rails.root.join("plugins/voice/db/fixtures"))
- Voice::BadgeGranterHooks.enable_all!
+ SiteSetting.live_enabled = true
+ SiteSetting.live_badges_enabled = true
+ SeedFu.seed(Rails.root.join("plugins/live/db/fixtures"))
+ Live::BadgeGranterHooks.enable_all!
end
def backfill(badge_name)
@@ -22,7 +22,7 @@ RSpec.describe BadgeGranter, ".backfill" do
end
def create_session(user_id:, room_id: room.id, joined_at:, duration: 10.minutes)
- Voice::Session.create!(
+ Live::Session.create!(
user_id: user_id,
room_id: room_id,
joined_at: joined_at,
@@ -34,7 +34,7 @@ RSpec.describe BadgeGranter, ".backfill" do
# be real users; the grantee does, since core joins the users table.
def create_co_presence(user_id, partner_id, total_seconds:, date: Date.current)
first, second = [user_id, partner_id].sort
- Voice::CoPresence.create!(
+ Live::CoPresence.create!(
user_id_1: first,
user_id_2: second,
date: date,
@@ -56,7 +56,7 @@ RSpec.describe BadgeGranter, ".backfill" do
end
it "counts an open session up to now" do
- Voice::Session.create!(user: user, room: room, joined_at: 61.minutes.ago, left_at: nil)
+ Live::Session.create!(user: user, room: room, joined_at: 61.minutes.ago, left_at: nil)
backfill("Rookie")
@@ -66,7 +66,7 @@ RSpec.describe BadgeGranter, ".backfill" do
it "keeps the badge once the sessions that earned it are purged" do
create_session(user_id: user.id, joined_at: 2.hours.ago, duration: 1.hour)
backfill("Rookie")
- Voice::Session.delete_all
+ Live::Session.delete_all
backfill("Rookie")
@@ -104,11 +104,11 @@ RSpec.describe BadgeGranter, ".backfill" do
describe "exploration" do
it "grants Explorer for five distinct rooms, ignoring ephemeral ones" do
- rooms = Array.new(4) { Fabricate(:voice_room) }
+ rooms = Array.new(4) { Fabricate(:live_room) }
rooms.each do |visited|
2.times { create_session(user_id: user.id, room_id: visited.id, joined_at: 1.day.ago) }
end
- call_room = Fabricate(:voice_ephemeral_room)
+ call_room = Fabricate(:live_ephemeral_room)
create_session(user_id: user.id, room_id: call_room.id, joined_at: 1.day.ago)
backfill("Explorer")
expect(holders_of("Explorer")).to be_empty
@@ -125,7 +125,7 @@ RSpec.describe BadgeGranter, ".backfill" do
create_session(user_id: user.id, joined_at: (day + 1).days.ago.change(hour: 12))
create_session(user_id: user.id, joined_at: (day + 1).days.ago.change(hour: 14))
end
- create_session(user_id: user.id, room_id: Fabricate(:voice_room).id, joined_at: 1.hour.ago)
+ create_session(user_id: user.id, room_id: Fabricate(:live_room).id, joined_at: 1.hour.ago)
backfill("Patron")
expect(holders_of("Patron")).to be_empty
@@ -136,13 +136,13 @@ RSpec.describe BadgeGranter, ".backfill" do
end
describe "hosting" do
- fab!(:hosted_room, :voice_room) { Fabricate(:voice_room, creator: user) }
+ fab!(:hosted_room, :live_room) { Fabricate(:live_room, creator: user) }
it "grants Crowd Puller for fifty distinct visitors, ignoring repeat, self and call joins" do
49.times do |index|
create_session(user_id: 100_000 + index, room_id: hosted_room.id, joined_at: 1.day.ago)
end
- call_room = Fabricate(:voice_ephemeral_room, creator: user)
+ call_room = Fabricate(:live_ephemeral_room, creator: user)
create_session(user_id: 300_000, room_id: call_room.id, joined_at: 1.day.ago)
5.times { create_session(user_id: 100_000, room_id: hosted_room.id, joined_at: 1.hour.ago) }
5.times { create_session(user_id: user.id, room_id: hosted_room.id, joined_at: 1.hour.ago) }
@@ -157,7 +157,7 @@ RSpec.describe BadgeGranter, ".backfill" do
describe "inviting" do
def create_invite(invitee_id, redeemed: true)
- Voice::Invite.create!(
+ Live::Invite.create!(
room_id: room.id,
user_id: invitee_id,
invited_by_id: user.id,
@@ -168,8 +168,8 @@ RSpec.describe BadgeGranter, ".backfill" do
it "grants Connector for ten distinct redeemed invitees" do
9.times { |index| create_invite(100_000 + index) }
create_invite(200_000, redeemed: false)
- Voice::Invite.create!(
- room_id: Fabricate(:voice_room).id,
+ Live::Invite.create!(
+ room_id: Fabricate(:live_room).id,
user_id: 100_000,
invited_by_id: user.id,
redeemed_at: Time.current,
diff --git a/plugins/voice/spec/services/voice/badge_granter_hooks_spec.rb b/plugins/live/spec/services/live/badge_granter_hooks_spec.rb
similarity index 78%
rename from plugins/voice/spec/services/voice/badge_granter_hooks_spec.rb
rename to plugins/live/spec/services/live/badge_granter_hooks_spec.rb
index 3fb9e264887..a6659599478 100644
--- a/plugins/voice/spec/services/voice/badge_granter_hooks_spec.rb
+++ b/plugins/live/spec/services/live/badge_granter_hooks_spec.rb
@@ -2,28 +2,28 @@
require "rails_helper"
-RSpec.describe Voice::BadgeGranterHooks do
+RSpec.describe Live::BadgeGranterHooks do
fab!(:user) { Fabricate(:user, trust_level: TrustLevel[2]) }
- fab!(:room, :voice_room) { Fabricate(:voice_room, public: true, max_participants: 3) }
+ fab!(:room, :live_room) { Fabricate(:live_room, public: true, max_participants: 3) }
before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_badges_enabled = true
- SiteSetting.voice_analytics_enabled = true
- SeedFu.seed(Rails.root.join("plugins/voice/db/fixtures"))
+ SiteSetting.live_enabled = true
+ SiteSetting.live_badges_enabled = true
+ SiteSetting.live_analytics_enabled = true
+ SeedFu.seed(Rails.root.join("plugins/live/db/fixtures"))
described_class.enable_all!
end
describe ".on_leave" do
def build_session(joined_at:, left_at:)
- Voice::Session.create!(user: user, room: room, joined_at: joined_at, left_at: left_at)
+ Live::Session.create!(user: user, room: room, joined_at: joined_at, left_at: left_at)
end
describe "Mic Check" do
fab!(:other, :user)
it "grants after 30 seconds spent with someone else in the room" do
- Fabricate(:voice_session, user: other, room: room, joined_at: 2.minutes.ago)
+ Fabricate(:live_session, user: other, room: room, joined_at: 2.minutes.ago)
session = build_session(joined_at: 1.minute.ago, left_at: Time.current)
described_class.on_leave(user, session)
@@ -32,7 +32,7 @@ RSpec.describe Voice::BadgeGranterHooks do
end
it "does not grant when the other person was present for under 30 seconds" do
- Fabricate(:voice_session, user: other, room: room, joined_at: 20.seconds.ago)
+ Fabricate(:live_session, user: other, room: room, joined_at: 20.seconds.ago)
session = build_session(joined_at: 1.minute.ago, left_at: Time.current)
described_class.on_leave(user, session)
@@ -90,7 +90,7 @@ RSpec.describe Voice::BadgeGranterHooks do
fab!(:companion, :user)
it "grants when 4+ hours of the session were spent with someone else" do
- Fabricate(:voice_session, user: companion, room: room, joined_at: 4.5.hours.ago)
+ Fabricate(:live_session, user: companion, room: room, joined_at: 4.5.hours.ago)
session = build_session(joined_at: 5.hours.ago, left_at: Time.current)
described_class.on_leave(user, session)
@@ -105,7 +105,7 @@ RSpec.describe Voice::BadgeGranterHooks do
end
it "does not grant when company stayed under 4 hours" do
- Fabricate(:voice_session, user: companion, room: room, joined_at: 3.hours.ago)
+ Fabricate(:live_session, user: companion, room: room, joined_at: 3.hours.ago)
session = build_session(joined_at: 5.hours.ago, left_at: Time.current)
described_class.on_leave(user, session)
@@ -114,7 +114,7 @@ RSpec.describe Voice::BadgeGranterHooks do
end
it "does nothing when badges are disabled" do
- SiteSetting.voice_badges_enabled = false
+ SiteSetting.live_badges_enabled = false
session = build_session(joined_at: 5.hours.ago, left_at: Time.current)
described_class.on_leave(user, session)
@@ -123,7 +123,7 @@ RSpec.describe Voice::BadgeGranterHooks do
end
it "does nothing when session has no left_at" do
- session = Voice::Session.create!(user: user, room: room, joined_at: 5.hours.ago)
+ session = Live::Session.create!(user: user, room: room, joined_at: 5.hours.ago)
described_class.on_leave(user, session)
expect(user.badges).to be_empty
@@ -155,7 +155,7 @@ RSpec.describe Voice::BadgeGranterHooks do
it "falls back to the site-wide cap when the room has no max_participants" do
room.update!(max_participants: nil)
- SiteSetting.voice_max_room_participants = 2
+ SiteSetting.live_max_room_participants = 2
other = Fabricate(:user)
described_class.on_join(user, room, User.where(id: [user.id]))
@@ -170,7 +170,7 @@ RSpec.describe Voice::BadgeGranterHooks do
fab!(:stranger, :user)
it "grants when user has no co-presence history with anyone in the room" do
- Voice::ParticipantTracker.add(room.id, stranger.id)
+ Live::ParticipantTracker.add(room.id, stranger.id)
participants = User.where(id: [user.id, stranger.id])
described_class.on_join(user, room, participants)
@@ -180,7 +180,7 @@ RSpec.describe Voice::BadgeGranterHooks do
it "does not grant when user has co-presence history" do
ids = [user.id, stranger.id].sort
- Voice::CoPresence.create!(
+ Live::CoPresence.create!(
user_id_1: ids.first,
user_id_2: ids.last,
date: Date.current,
@@ -212,7 +212,7 @@ RSpec.describe Voice::BadgeGranterHooks do
end
it "does nothing when badges are disabled" do
- SiteSetting.voice_badges_enabled = false
+ SiteSetting.live_badges_enabled = false
described_class.on_room_create(user)
@@ -220,7 +220,7 @@ RSpec.describe Voice::BadgeGranterHooks do
end
it "does nothing when analytics are disabled" do
- SiteSetting.voice_analytics_enabled = false
+ SiteSetting.live_analytics_enabled = false
described_class.on_room_create(user)
@@ -232,7 +232,7 @@ RSpec.describe Voice::BadgeGranterHooks do
fab!(:invitee) { Fabricate(:user, trust_level: TrustLevel[2]) }
def redeemed_invite
- Voice::Invite.create!(
+ Live::Invite.create!(
room_id: room.id,
user_id: invitee.id,
invited_by_id: user.id,
@@ -248,7 +248,7 @@ RSpec.describe Voice::BadgeGranterHooks do
end
it "does nothing when badges are disabled" do
- SiteSetting.voice_badges_enabled = false
+ SiteSetting.live_badges_enabled = false
described_class.on_invite_redeemed(redeemed_invite)
@@ -257,32 +257,32 @@ RSpec.describe Voice::BadgeGranterHooks do
end
describe "fixture seeding" do
- def voice_badges
- Badge.joins(:badge_grouping).where(badge_groupings: { name: "Voice" })
+ def live_badges
+ Badge.joins(:badge_grouping).where(badge_groupings: { name: "Live" })
end
it "creates all badges enabled" do
- expect(voice_badges.count).to eq(27)
- expect(voice_badges.where(enabled: false).count).to eq(0)
+ expect(live_badges.count).to eq(27)
+ expect(live_badges.where(enabled: false).count).to eq(0)
end
it "never auto-revokes scheduled badges" do
- expect(voice_badges.where.not(query: nil)).to all(have_attributes(auto_revoke: false))
+ expect(live_badges.where.not(query: nil)).to all(have_attributes(auto_revoke: false))
end
- it "creates the Voice badge grouping" do
- expect(BadgeGrouping.exists?(name: "Voice")).to eq(true)
+ it "creates the Live badge grouping" do
+ expect(BadgeGrouping.exists?(name: "Live")).to eq(true)
end
it "is idempotent" do
- expect { SeedFu.seed(Rails.root.join("plugins/voice/db/fixtures")) }.not_to change {
+ expect { SeedFu.seed(Rails.root.join("plugins/live/db/fixtures")) }.not_to change {
Badge.count
}
end
it "sets SQL queries on scheduled badges" do
- expect(Badge.find_by(name: "Rookie").query).to include("voice_sessions")
- expect(Badge.find_by(name: "Social Butterfly").query).to include("voice_co_presences")
+ expect(Badge.find_by(name: "Rookie").query).to include("live_sessions")
+ expect(Badge.find_by(name: "Social Butterfly").query).to include("live_co_presences")
end
it "does not set queries on instant badges" do
@@ -292,7 +292,7 @@ RSpec.describe Voice::BadgeGranterHooks do
end
it "allows gold badges to be used as title" do
- gold_badges = voice_badges.where(badge_type_id: BadgeType::Gold)
+ gold_badges = live_badges.where(badge_type_id: BadgeType::Gold)
expect(gold_badges).to all(have_attributes(allow_title: true))
end
end
@@ -300,11 +300,11 @@ RSpec.describe Voice::BadgeGranterHooks do
describe ".enable_all!" do
before { described_class.disable_all! }
- it "enables all Voice badges and schedules a backfill for the scheduled ones" do
+ it "enables all Live badges and schedules a backfill for the scheduled ones" do
described_class.enable_all!
- voice_badges = Badge.joins(:badge_grouping).where(badge_groupings: { name: "Voice" })
- expect(voice_badges.where(enabled: false).count).to eq(0)
+ live_badges = Badge.joins(:badge_grouping).where(badge_groupings: { name: "Live" })
+ expect(live_badges.where(enabled: false).count).to eq(0)
expect_job_enqueued(
job: :backfill_badge,
args: {
@@ -321,11 +321,11 @@ RSpec.describe Voice::BadgeGranterHooks do
end
describe ".disable_all!" do
- it "disables all Voice badges" do
+ it "disables all Live badges" do
described_class.disable_all!
- voice_badges = Badge.joins(:badge_grouping).where(badge_groupings: { name: "Voice" })
- expect(voice_badges.where(enabled: true).count).to eq(0)
+ live_badges = Badge.joins(:badge_grouping).where(badge_groupings: { name: "Live" })
+ expect(live_badges.where(enabled: true).count).to eq(0)
end
end
end
diff --git a/plugins/voice/spec/services/voice/chat_session_spec.rb b/plugins/live/spec/services/live/chat_session_spec.rb
similarity index 86%
rename from plugins/voice/spec/services/voice/chat_session_spec.rb
rename to plugins/live/spec/services/live/chat_session_spec.rb
index c6f19d8d918..ebec5fd0a02 100644
--- a/plugins/voice/spec/services/voice/chat_session_spec.rb
+++ b/plugins/live/spec/services/live/chat_session_spec.rb
@@ -1,32 +1,16 @@
# frozen_string_literal: true
require "rails_helper"
-require_relative "../../../db/migrate/20241107000000_create_voice_rooms"
-require_relative "../../../db/migrate/20260612135211_add_video_enabled_to_voice_rooms"
-require_relative "../../../db/migrate/20260630183841_add_chat_settings_to_voice_rooms"
-
-RSpec.describe Voice::ChatSession do
- before do
- ActiveRecord::Migration.suppress_messages do
- CreateVoiceRooms.new.change unless ActiveRecord::Base.connection.table_exists?(:voice_rooms)
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :video_enabled)
- AddVideoEnabledToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :chat_channel_id)
- AddChatSettingsToVoiceRooms.new.change
- end
- end
- Voice::Room.reset_column_information
- end
+RSpec.describe Live::ChatSession do
fab!(:user) { Fabricate(:user, trust_level: TrustLevel[2]) }
fab!(:other) { Fabricate(:user, trust_level: TrustLevel[2]) }
fab!(:channel) { Fabricate(:chat_channel, threading_enabled: true) }
- fab!(:room) { Fabricate(:voice_room, public: true) }
+ fab!(:room) { Fabricate(:live_room, public: true) }
before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_chat_enabled = true
+ SiteSetting.live_enabled = true
+ SiteSetting.live_chat_enabled = true
SiteSetting.chat_enabled = true
SiteSetting.chat_allowed_groups =
"#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
@@ -76,8 +60,8 @@ RSpec.describe Voice::ChatSession do
describe ".available_for_rooms" do
it "loads linked channels once and returns availability by room" do
other_channel = Fabricate(:chat_channel, threading_enabled: true)
- other_room = Fabricate(:voice_room, public: true, chat_channel_id: other_channel.id)
- unlinked_room = Fabricate(:voice_room, public: true)
+ other_room = Fabricate(:live_room, public: true, chat_channel_id: other_channel.id)
+ unlinked_room = Fabricate(:live_room, public: true)
availability = nil
queries =
@@ -93,7 +77,7 @@ RSpec.describe Voice::ChatSession do
it "denies a channel in a category the user cannot access" do
restricted_channel =
Fabricate(:private_category_channel, group: Fabricate(:group), threading_enabled: true)
- restricted_room = Fabricate(:voice_room, public: true, chat_channel_id: restricted_channel.id)
+ restricted_room = Fabricate(:live_room, public: true, chat_channel_id: restricted_channel.id)
availability = described_class.available_for_rooms([room, restricted_room], user.guardian)
@@ -136,7 +120,7 @@ RSpec.describe Voice::ChatSession do
described_class.start!(room, user)
- expect(published.select { |ch, _, _| ch == Voice.room_chat_channel(room.id) }).to be_empty
+ expect(published.select { |ch, _, _| ch == Live.room_chat_channel(room.id) }).to be_empty
end
end
@@ -148,9 +132,9 @@ RSpec.describe Voice::ChatSession do
expect(thread.channel_id).to eq(channel.id)
expect(thread.title).to eq("Voice chat in #{room.name}")
expect(thread.original_message.message).to eq("In ##{room.slug}::room - hello everyone")
- expect(thread.original_message.cooked).to include("/voice/r/#{room.slug}")
+ expect(thread.original_message.cooked).to include("/live/r/#{room.slug}")
expect(thread.original_message.user_id).to eq(user.id)
- expect(thread.custom_fields[Voice::THREAD_ROOM_ID_FIELD]).to eq(room.id.to_s)
+ expect(thread.custom_fields[Live::THREAD_ROOM_ID_FIELD]).to eq(room.id.to_s)
end
it "inserts a first message containing interpolation tokens literally" do
@@ -188,11 +172,11 @@ RSpec.describe Voice::ChatSession do
described_class.post_message!(room, user, "first")
described_class.post_message!(room, other, "second")
- chat_events = published.select { |ch, _, _| ch == Voice.room_chat_channel(room.id) }
+ chat_events = published.select { |ch, _, _| ch == Live.room_chat_channel(room.id) }
expect(chat_events.size).to eq(1)
end
- # publish_state's audience is the room's (anyone who can see the voice
+ # publish_state's audience is the room's (anyone who can see the live
# room), which can be broader than who's authorized for the linked chat
# channel — so the payload itself must never carry message content or
# thread/channel identifiers. Clients re-fetch through the guarded
@@ -203,7 +187,7 @@ RSpec.describe Voice::ChatSession do
described_class.post_message!(room, user, "sensitive content")
- chat_events = published.select { |ch, _, _| ch == Voice.room_chat_channel(room.id) }
+ chat_events = published.select { |ch, _, _| ch == Live.room_chat_channel(room.id) }
expect(chat_events).to be_present
chat_events.each { |_, data, _| expect(data).to eq({ type: "updated" }) }
end
@@ -224,7 +208,7 @@ RSpec.describe Voice::ChatSession do
first = described_class.post_message!(room, user, "first")
# Later messages flow through chat's own API; liveness must still follow
- # them even though Voice never sees the posts.
+ # them even though Live never sees the posts.
freeze_time(20.minutes.from_now) { post_reply!(first[:thread_id], user, "still chatting") }
freeze_time(30.minutes.from_now) do
@@ -281,7 +265,7 @@ RSpec.describe Voice::ChatSession do
# The chat plugin blocks an identical message posted seconds apart; that
# reason must reach the caller, not be masked as a generic access error.
expect { described_class.post_message!(room, user, "dup") }.to raise_error(
- Voice::ChatSession::Error,
+ Live::ChatSession::Error,
/identical message/i,
)
end
@@ -293,7 +277,7 @@ RSpec.describe Voice::ChatSession do
room.reload
expect { described_class.post_message!(room, user, "hello") }.to raise_error(
- Voice::ChatSession::Error,
+ Live::ChatSession::Error,
/threading/i,
)
diff --git a/plugins/voice/spec/services/voice/default_room_seeder_multisite_spec.rb b/plugins/live/spec/services/live/default_room_seeder_multisite_spec.rb
similarity index 63%
rename from plugins/voice/spec/services/voice/default_room_seeder_multisite_spec.rb
rename to plugins/live/spec/services/live/default_room_seeder_multisite_spec.rb
index f524e83000f..a5352cd10eb 100644
--- a/plugins/voice/spec/services/voice/default_room_seeder_multisite_spec.rb
+++ b/plugins/live/spec/services/live/default_room_seeder_multisite_spec.rb
@@ -1,22 +1,22 @@
# frozen_string_literal: true
-RSpec.describe Voice::DefaultRoomSeeder, type: :multisite do
+RSpec.describe Live::DefaultRoomSeeder, type: :multisite do
it "keeps schema readiness isolated by site" do
described_class.instance_variable_set(:@schema_ready, nil)
- SiteSetting.voice_enabled = true
+ SiteSetting.live_enabled = true
described_class.ensure!
test_multisite_connection("second") do
- SiteSetting.voice_enabled = true
- ActiveRecord::Base.connection.remove_column(:voice_rooms, :ephemeral)
+ SiteSetting.live_enabled = true
+ ActiveRecord::Base.connection.remove_column(:live_rooms, :ephemeral)
expect { described_class.ensure! }.not_to raise_error
end
ensure
described_class.instance_variable_set(:@schema_ready, nil)
test_multisite_connection("second") do
- ActiveRecord::Base.connection.schema_cache.clear_data_source_cache!("voice_rooms")
+ ActiveRecord::Base.connection.schema_cache.clear_data_source_cache!("live_rooms")
end
- Voice::Room.reset_column_information
+ Live::Room.reset_column_information
end
end
diff --git a/plugins/live/spec/services/live/default_room_seeder_spec.rb b/plugins/live/spec/services/live/default_room_seeder_spec.rb
new file mode 100644
index 00000000000..2c5227fb03a
--- /dev/null
+++ b/plugins/live/spec/services/live/default_room_seeder_spec.rb
@@ -0,0 +1,48 @@
+# frozen_string_literal: true
+require "rails_helper"
+
+RSpec.describe Live::DefaultRoomSeeder do
+ before { wipe_rooms! }
+
+ it "creates a Watercooler room when live is enabled and no rooms exist" do
+ SiteSetting.live_enabled = true
+ wipe_rooms!
+
+ expect { described_class.ensure! }.to change { Live::Room.count }.by(1)
+
+ room = Live::Room.first
+ expect(room.name).to eq("Watercooler")
+ expect(room.public).to eq(true)
+ end
+
+ it "does nothing if live is disabled" do
+ SiteSetting.live_enabled = false
+
+ expect { described_class.ensure! }.not_to change { Live::Room.count }
+ end
+
+ it "still seeds when only ephemeral rooms exist" do
+ SiteSetting.live_enabled = true
+ wipe_rooms!
+ Fabricate(:live_ephemeral_room, creator: Fabricate(:admin))
+
+ expect { described_class.ensure! }.to change { Live::Room.persistent.count }.by(1)
+ end
+
+ it "does nothing if rooms already exist without checking pending migrations" do
+ SiteSetting.live_enabled = true
+ wipe_rooms!
+ Fabricate(:live_room, name: "Existing", creator: Fabricate(:admin))
+
+ described_class.ensure!
+ queries = track_sql_queries { described_class.ensure! }
+
+ expect(Live::Room.count).to eq(1)
+ expect(queries.grep(/pg_class|schema_migrations/)).to be_empty
+ end
+
+ def wipe_rooms!
+ Live::RoomMembership.delete_all
+ Live::Room.delete_all
+ end
+end
diff --git a/plugins/voice/spec/services/voice/directory_broadcaster_spec.rb b/plugins/live/spec/services/live/directory_broadcaster_spec.rb
similarity index 75%
rename from plugins/voice/spec/services/voice/directory_broadcaster_spec.rb
rename to plugins/live/spec/services/live/directory_broadcaster_spec.rb
index de482897e6d..b77551805a2 100644
--- a/plugins/voice/spec/services/voice/directory_broadcaster_spec.rb
+++ b/plugins/live/spec/services/live/directory_broadcaster_spec.rb
@@ -1,13 +1,13 @@
# frozen_string_literal: true
-RSpec.describe Voice::DirectoryBroadcaster do
- before { SiteSetting.voice_enabled = true }
+RSpec.describe Live::DirectoryBroadcaster do
+ before { SiteSetting.live_enabled = true }
it "omits user-specific permissions and membership from shared room updates" do
- room = Fabricate(:voice_room, public: true)
+ room = Fabricate(:live_room, public: true)
messages =
- MessageBus.track_publish(Voice.room_index_channel) do
+ MessageBus.track_publish(Live.room_index_channel) do
described_class.broadcast(action: :updated, room: room)
end
@@ -17,12 +17,12 @@ RSpec.describe Voice::DirectoryBroadcaster do
end
it "reaches anonymous subscribers through the anonymous_users pseudogroup when they are admitted" do
- SiteSetting.voice_allowed_groups =
+ SiteSetting.live_allowed_groups =
"#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
- room = Fabricate(:voice_room, public: true)
+ room = Fabricate(:live_room, public: true)
messages =
- MessageBus.track_publish(Voice.room_index_channel) do
+ MessageBus.track_publish(Live.room_index_channel) do
described_class.broadcast(action: :updated, room: room)
end
@@ -44,11 +44,11 @@ RSpec.describe Voice::DirectoryBroadcaster do
end
it "excludes anonymous subscribers when allowed groups are logged_in_users" do
- SiteSetting.voice_allowed_groups = Group::AUTO_GROUPS[:logged_in_users].to_s
- room = Fabricate(:voice_room, public: true)
+ SiteSetting.live_allowed_groups = Group::AUTO_GROUPS[:logged_in_users].to_s
+ room = Fabricate(:live_room, public: true)
messages =
- MessageBus.track_publish(Voice.room_index_channel) do
+ MessageBus.track_publish(Live.room_index_channel) do
described_class.broadcast(action: :updated, room: room)
end
@@ -76,11 +76,11 @@ RSpec.describe Voice::DirectoryBroadcaster do
end
it "targets the anonymous_users pseudogroup when only anonymous access is configured" do
- SiteSetting.voice_allowed_groups = Group::AUTO_GROUPS[:anonymous_users].to_s
- room = Fabricate(:voice_room, public: true)
+ SiteSetting.live_allowed_groups = Group::AUTO_GROUPS[:anonymous_users].to_s
+ room = Fabricate(:live_room, public: true)
messages =
- MessageBus.track_publish(Voice.room_index_channel) do
+ MessageBus.track_publish(Live.room_index_channel) do
described_class.broadcast(action: :updated, room: room)
end
@@ -89,10 +89,10 @@ RSpec.describe Voice::DirectoryBroadcaster do
end
it "targets members for private room events" do
- room = Fabricate(:voice_room, public: false)
+ room = Fabricate(:live_room, public: false)
messages =
- MessageBus.track_publish(Voice.room_index_channel) do
+ MessageBus.track_publish(Live.room_index_channel) do
described_class.broadcast(action: :updated, room: room)
end
@@ -100,12 +100,12 @@ RSpec.describe Voice::DirectoryBroadcaster do
end
it "never publishes events for ephemeral rooms" do
- room = Fabricate(:voice_ephemeral_room, public: true)
- SiteSetting.voice_allowed_groups =
+ room = Fabricate(:live_ephemeral_room, public: true)
+ SiteSetting.live_allowed_groups =
"#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
messages =
- MessageBus.track_publish(Voice.room_index_channel) do
+ MessageBus.track_publish(Live.room_index_channel) do
described_class.broadcast(action: :created, room: room)
end
diff --git a/plugins/voice/spec/services/voice/ephemeral_room_manager_spec.rb b/plugins/live/spec/services/live/ephemeral_room_manager_spec.rb
similarity index 72%
rename from plugins/voice/spec/services/voice/ephemeral_room_manager_spec.rb
rename to plugins/live/spec/services/live/ephemeral_room_manager_spec.rb
index fc74c341e7b..07cce00c6d7 100644
--- a/plugins/voice/spec/services/voice/ephemeral_room_manager_spec.rb
+++ b/plugins/live/spec/services/live/ephemeral_room_manager_spec.rb
@@ -1,10 +1,10 @@
# frozen_string_literal: true
-RSpec.describe Voice::EphemeralRoomManager do
+RSpec.describe Live::EphemeralRoomManager do
fab!(:creator, :user)
fab!(:member, :user)
- before { SiteSetting.voice_enabled = true }
+ before { SiteSetting.live_enabled = true }
describe ".create!" do
it "creates an ephemeral room with the creator as moderator and members as participants" do
@@ -18,7 +18,7 @@ RSpec.describe Voice::EphemeralRoomManager do
end
it "generates slugs that never collide with existing rooms of the same name" do
- persistent = Fabricate(:voice_room, name: "Call")
+ persistent = Fabricate(:live_room, name: "Call")
first = described_class.create!(creator: creator, name: "Call")
second = described_class.create!(creator: creator, name: "Call")
@@ -30,7 +30,7 @@ RSpec.describe Voice::EphemeralRoomManager do
room = described_class.create!(creator: creator, name: "Call", moderators: [member, creator])
expect(room.moderator_ids).to contain_exactly(creator.id, member.id)
- expect(member.guardian.can_manage_voice_room?(room)).to eq(true)
+ expect(member.guardian.can_manage_live_room?(room)).to eq(true)
end
it "keeps the moderator role for a user listed as both moderator and member" do
@@ -52,7 +52,7 @@ RSpec.describe Voice::EphemeralRoomManager do
expect { described_class.create!(creator: creator, name: "One too many") }.to raise_error(
Discourse::InvalidAccess,
)
- expect(Voice::Room.ephemeral.where(creator_id: creator.id).count).to eq(2)
+ expect(Live::Room.ephemeral.where(creator_id: creator.id).count).to eq(2)
end
end
@@ -70,7 +70,7 @@ RSpec.describe Voice::EphemeralRoomManager do
creator: creator,
name: "Event stage",
public: true,
- room_type: Voice::Room::ROOM_TYPE_STAGE,
+ room_type: Live::Room::ROOM_TYPE_STAGE,
)
expect(room.public).to eq(true)
@@ -79,7 +79,7 @@ RSpec.describe Voice::EphemeralRoomManager do
it "does not broadcast a directory event" do
messages =
- MessageBus.track_publish(Voice.room_index_channel) do
+ MessageBus.track_publish(Live.room_index_channel) do
described_class.create!(creator: creator, name: "Call", members: [member])
end
@@ -88,39 +88,39 @@ RSpec.describe Voice::EphemeralRoomManager do
end
describe ".cleanup!" do
- fab!(:persistent_room, :voice_room)
+ fab!(:persistent_room, :live_room)
- before { SiteSetting.voice_ephemeral_room_ttl_minutes = 30 }
+ before { SiteSetting.live_ephemeral_room_ttl_minutes = 30 }
it "destroys an ephemeral room empty past the TTL and clears its live state" do
- room = Fabricate(:voice_ephemeral_room, last_occupied_at: 31.minutes.ago)
- Voice::ParticipantTracker.pin_transport!(room.id, "mesh")
+ room = Fabricate(:live_ephemeral_room, last_occupied_at: 31.minutes.ago)
+ Live::ParticipantTracker.pin_transport!(room.id, "mesh")
described_class.cleanup!
- expect(Voice::Room.exists?(room.id)).to eq(false)
- expect(Voice::ParticipantTracker.pinned_transport(room.id)).to be_nil
+ expect(Live::Room.exists?(room.id)).to eq(false)
+ expect(Live::ParticipantTracker.pinned_transport(room.id)).to be_nil
end
it "uses created_at when the room was never occupied" do
- room = Fabricate(:voice_ephemeral_room, last_occupied_at: nil, created_at: 31.minutes.ago)
+ room = Fabricate(:live_ephemeral_room, last_occupied_at: nil, created_at: 31.minutes.ago)
described_class.cleanup!
- expect(Voice::Room.exists?(room.id)).to eq(false)
+ expect(Live::Room.exists?(room.id)).to eq(false)
end
it "keeps an ephemeral room emptied more recently than the TTL" do
- room = Fabricate(:voice_ephemeral_room, last_occupied_at: 5.minutes.ago)
+ room = Fabricate(:live_ephemeral_room, last_occupied_at: 5.minutes.ago)
described_class.cleanup!
- expect(Voice::Room.exists?(room.id)).to eq(true)
+ expect(Live::Room.exists?(room.id)).to eq(true)
end
it "resets the clock on an occupied ephemeral room instead of destroying it" do
- room = Fabricate(:voice_ephemeral_room, last_occupied_at: 31.minutes.ago)
- Voice::ParticipantTracker.add(room.id, Fabricate(:user).id)
+ room = Fabricate(:live_ephemeral_room, last_occupied_at: 31.minutes.ago)
+ Live::ParticipantTracker.add(room.id, Fabricate(:user).id)
described_class.cleanup!
@@ -130,16 +130,16 @@ RSpec.describe Voice::EphemeralRoomManager do
it "never touches persistent rooms" do
persistent_room.update_column(:last_occupied_at, 2.days.ago)
- expect { described_class.cleanup! }.not_to change { Voice::Room.persistent.count }
+ expect { described_class.cleanup! }.not_to change { Live::Room.persistent.count }
end
end
describe ".destroy!" do
it "refuses to tear down a persistent room" do
- room = Fabricate(:voice_room)
+ room = Fabricate(:live_room)
expect { described_class.destroy!(room) }.to raise_error(Discourse::InvalidParameters)
- expect(Voice::Room.exists?(room.id)).to eq(true)
+ expect(Live::Room.exists?(room.id)).to eq(true)
end
end
end
diff --git a/plugins/voice/spec/services/voice/participant_tracker_spec.rb b/plugins/live/spec/services/live/participant_tracker_spec.rb
similarity index 98%
rename from plugins/voice/spec/services/voice/participant_tracker_spec.rb
rename to plugins/live/spec/services/live/participant_tracker_spec.rb
index 632e237c074..ab2b49142f9 100644
--- a/plugins/voice/spec/services/voice/participant_tracker_spec.rb
+++ b/plugins/live/spec/services/live/participant_tracker_spec.rb
@@ -1,11 +1,11 @@
# frozen_string_literal: true
-RSpec.describe Voice::ParticipantTracker do
- fab!(:room, :voice_room)
+RSpec.describe Live::ParticipantTracker do
+ fab!(:room, :live_room)
fab!(:user1, :user)
fab!(:user2, :user)
- before { SiteSetting.voice_enabled = true }
+ before { SiteSetting.live_enabled = true }
after { described_class.clear(room.id) }
@@ -193,7 +193,7 @@ RSpec.describe Voice::ParticipantTracker do
described_class.pin_transport!(room.id, "livekit")
ttl = Discourse.redis.ttl("#{described_class::KEY_NAMESPACE}:#{room.id}:transport")
- expect(ttl).to be_between(1, SiteSetting.voice_participant_ttl_seconds * 2)
+ expect(ttl).to be_between(1, SiteSetting.live_participant_ttl_seconds * 2)
end
end
@@ -305,7 +305,7 @@ RSpec.describe Voice::ParticipantTracker do
end
describe ".room_states" do
- fab!(:other_room, :voice_room)
+ fab!(:other_room, :live_room)
after { described_class.clear(other_room.id) }
diff --git a/plugins/voice/spec/services/voice/recording_manager_spec.rb b/plugins/live/spec/services/live/recording_manager_spec.rb
similarity index 69%
rename from plugins/voice/spec/services/voice/recording_manager_spec.rb
rename to plugins/live/spec/services/live/recording_manager_spec.rb
index b0ac20e7185..d1fb4d1b5aa 100644
--- a/plugins/voice/spec/services/voice/recording_manager_spec.rb
+++ b/plugins/live/spec/services/live/recording_manager_spec.rb
@@ -1,42 +1,21 @@
# frozen_string_literal: true
require "rails_helper"
-require_relative "../../../db/migrate/20241107000000_create_voice_rooms"
-require_relative "../../../db/migrate/20260305162426_add_room_type_to_voice_rooms"
-require_relative "../../../db/migrate/20260612135211_add_video_enabled_to_voice_rooms"
-require_relative "../../../db/migrate/20260717172530_create_voice_recordings"
-
-RSpec.describe Voice::RecordingManager do
- before do
- ActiveRecord::Migration.suppress_messages do
- CreateVoiceRooms.new.change unless ActiveRecord::Base.connection.table_exists?(:voice_rooms)
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :room_type)
- AddRoomTypeToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :video_enabled)
- AddVideoEnabledToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.table_exists?(:voice_recordings)
- CreateVoiceRecordings.new.change
- end
- end
- Voice::Room.reset_column_information
- Voice::Recording.reset_column_information
- end
+RSpec.describe Live::RecordingManager do
fab!(:moderator, :user)
- fab!(:room) { Fabricate(:voice_room, public: true) }
+ fab!(:room) { Fabricate(:live_room, public: true) }
before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_livekit_url = "wss://livekit.example.com"
- SiteSetting.voice_livekit_api_key = "lk_api_key"
- SiteSetting.voice_livekit_api_secret = "lk_api_secret"
- SiteSetting.voice_livekit_recording_enabled = true
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
+ SiteSetting.live_enabled = true
+ SiteSetting.live_livekit_url = "wss://livekit.example.com"
+ SiteSetting.live_livekit_api_key = "lk_api_key"
+ SiteSetting.live_livekit_api_secret = "lk_api_secret"
+ SiteSetting.live_livekit_recording_enabled = true
+ Live::ParticipantTracker.pin_transport!(room.id, "livekit")
end
- after { Voice::ParticipantTracker.clear(room.id) }
+ after { Live::ParticipantTracker.clear(room.id) }
def stub_start(egress_id: "EG_1", status: 200, response_key: "egressId")
stub_request(
@@ -65,17 +44,17 @@ RSpec.describe Voice::RecordingManager do
stub_start
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) do
+ MessageBus.track_publish(Live.room_channel(room.id)) do
result = described_class.start!(room, moderator)
expect(result[:started_by]).to eq(id: moderator.id, username: moderator.username)
end
- recording = Voice::Recording.find_by(egress_id: "EG_1")
+ recording = Live::Recording.find_by(egress_id: "EG_1")
expect(recording.room_id).to eq(room.id)
expect(recording.started_by_id).to eq(moderator.id)
expect(recording.status).to eq("recording")
expect(recording.filepath).to match(
- /\A#{Regexp.escape(SiteSetting.voice_livekit_recording_filepath)}-\h{16}\z/,
+ /\A#{Regexp.escape(SiteSetting.live_livekit_recording_filepath)}-\h{16}\z/,
)
recording_messages = messages.select { |message| message.data[:type] == "recording" }
@@ -88,7 +67,7 @@ RSpec.describe Voice::RecordingManager do
described_class.start!(room, moderator)
- filepath = Voice::Recording.find_by(egress_id: "EG_1").filepath
+ filepath = Live::Recording.find_by(egress_id: "EG_1").filepath
expect(
a_request(
:post,
@@ -102,25 +81,25 @@ RSpec.describe Voice::RecordingManager do
described_class.start!(room, moderator)
- expect(Voice::Recording.find_by(egress_id: "EG_1")).to be_present
+ expect(Live::Recording.find_by(egress_id: "EG_1")).to be_present
end
it "refuses when recordings are disabled" do
- SiteSetting.voice_livekit_recording_enabled = false
+ SiteSetting.live_livekit_recording_enabled = false
expect { described_class.start!(room, moderator) }.to raise_error(
described_class::Error,
- I18n.t("voice.errors.recording_unavailable"),
+ I18n.t("live.errors.recording_unavailable"),
)
end
it "refuses for a call not pinned to livekit" do
- Voice::ParticipantTracker.clear_transport_pin(room.id)
- Voice::ParticipantTracker.pin_transport!(room.id, "mesh")
+ Live::ParticipantTracker.clear_transport_pin(room.id)
+ Live::ParticipantTracker.pin_transport!(room.id, "mesh")
expect { described_class.start!(room, moderator) }.to raise_error(
described_class::Error,
- I18n.t("voice.errors.recording_unavailable"),
+ I18n.t("live.errors.recording_unavailable"),
)
end
@@ -130,7 +109,7 @@ RSpec.describe Voice::RecordingManager do
expect { described_class.start!(room, moderator) }.to raise_error(
described_class::Error,
- I18n.t("voice.errors.recording_already_active"),
+ I18n.t("live.errors.recording_already_active"),
)
end
@@ -138,15 +117,15 @@ RSpec.describe Voice::RecordingManager do
stub_start(status: 500)
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) do
+ MessageBus.track_publish(Live.room_channel(room.id)) do
expect { described_class.start!(room, moderator) }.to raise_error(
described_class::Error,
- I18n.t("voice.errors.recording_failed"),
+ I18n.t("live.errors.recording_failed"),
)
end
expect(described_class.status(room.id)).to be_nil
- expect(Voice::Recording.count).to eq(0)
+ expect(Live::Recording.count).to eq(0)
expect(messages).to be_empty
end
end
@@ -158,7 +137,7 @@ RSpec.describe Voice::RecordingManager do
stub_stop
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) { described_class.stop!(room) }
+ MessageBus.track_publish(Live.room_channel(room.id)) { described_class.stop!(room) }
expect(described_class.status(room.id)).to be_nil
recording_messages = messages.select { |message| message.data[:type] == "recording" }
@@ -169,7 +148,7 @@ RSpec.describe Voice::RecordingManager do
it "refuses when nothing is being recorded" do
expect { described_class.stop!(room) }.to raise_error(
described_class::Error,
- I18n.t("voice.errors.recording_not_active"),
+ I18n.t("live.errors.recording_not_active"),
)
end
@@ -180,7 +159,7 @@ RSpec.describe Voice::RecordingManager do
expect { described_class.stop!(room) }.to raise_error(
described_class::Error,
- I18n.t("voice.errors.recording_stop_failed"),
+ I18n.t("live.errors.recording_stop_failed"),
)
expect(described_class.status(room.id)).to be_present
end
@@ -192,20 +171,20 @@ RSpec.describe Voice::RecordingManager do
described_class.start!(room, moderator)
file = {
- "filename" => "voice/watercooler.mp4",
- "location" => "https://cdn.example.com/voice/watercooler.mp4",
+ "filename" => "live/watercooler.mp4",
+ "location" => "https://cdn.example.com/live/watercooler.mp4",
"duration" => (65 * 1_000_000_000).to_s,
"size" => "12345678",
}
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) do
+ MessageBus.track_publish(Live.room_channel(room.id)) do
described_class.handle_egress_ended(room, egress_info(file: file))
end
- recording = Voice::Recording.find_by(egress_id: "EG_1")
+ recording = Live::Recording.find_by(egress_id: "EG_1")
expect(recording.status).to eq("completed")
- expect(recording.location).to eq("https://cdn.example.com/voice/watercooler.mp4")
+ expect(recording.location).to eq("https://cdn.example.com/live/watercooler.mp4")
expect(recording.duration_ms).to eq(65_000)
expect(recording.size_bytes).to eq(12_345_678)
expect(recording.ended_at).to be_present
@@ -215,24 +194,24 @@ RSpec.describe Voice::RecordingManager do
pm_topic =
Topic.private_messages_for_user(moderator).find_by(
- title: I18n.t("voice.recording_ready_pm.title", room_name: room.name),
+ title: I18n.t("live.recording_ready_pm.title", room_name: room.name),
)
expect(pm_topic).to be_present
expect(pm_topic.first_post.raw).to include(
- "https://cdn.example.com/voice/watercooler.mp4",
+ "https://cdn.example.com/live/watercooler.mp4",
).and include("1:05")
end
it "PMs the storage path when the egress reports no URL" do
stub_start
described_class.start!(room, moderator)
- recording = Voice::Recording.find_by(egress_id: "EG_1")
+ recording = Live::Recording.find_by(egress_id: "EG_1")
described_class.handle_egress_ended(room, egress_info)
pm_topic =
Topic.private_messages_for_user(moderator).find_by(
- title: I18n.t("voice.recording_ready_pm.title", room_name: room.name),
+ title: I18n.t("live.recording_ready_pm.title", room_name: room.name),
)
expect(pm_topic.first_post.raw).to include(recording.filepath)
end
@@ -243,7 +222,7 @@ RSpec.describe Voice::RecordingManager do
described_class.handle_egress_ended(room, egress_info(error: "could not connect", file: nil))
- expect(Voice::Recording.find_by(egress_id: "EG_1").status).to eq("failed")
+ expect(Live::Recording.find_by(egress_id: "EG_1").status).to eq("failed")
expect(Topic.private_messages_for_user(moderator)).to be_empty
end
@@ -260,28 +239,28 @@ RSpec.describe Voice::RecordingManager do
},
)
- expect(Voice::Recording.find_by(egress_id: "EG_1")).to be_completed
+ expect(Live::Recording.find_by(egress_id: "EG_1")).to be_completed
end
it "finalizes the row even when the live room state is already gone" do
stub_start
described_class.start!(room, moderator)
- Voice::ParticipantTracker.clear_transport_pin(room.id)
+ Live::ParticipantTracker.clear_transport_pin(room.id)
described_class.handle_egress_ended(room, egress_info)
- expect(Voice::Recording.find_by(egress_id: "EG_1").status).to eq("completed")
+ expect(Live::Recording.find_by(egress_id: "EG_1").status).to eq("completed")
expect(Topic.private_messages_for_user(moderator).count).to eq(1)
end
it "ignores an egress that was never tracked" do
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) do
+ MessageBus.track_publish(Live.room_channel(room.id)) do
described_class.handle_egress_ended(room, egress_info(egress_id: "EG_unknown"))
end
expect(messages).to be_empty
- expect(Voice::Recording.count).to eq(0)
+ expect(Live::Recording.count).to eq(0)
end
it "does not finalize twice or resend the PM for an already-finalized egress" do
@@ -319,7 +298,7 @@ RSpec.describe Voice::RecordingManager do
described_class.reconcile_pending!
- recording = Voice::Recording.find_by(egress_id: "EG_1")
+ recording = Live::Recording.find_by(egress_id: "EG_1")
expect(recording.status).to eq("completed")
expect(recording.location).to eq("https://cdn.example.com/test.mp4")
expect(described_class.status(room.id)).to be_nil
@@ -333,19 +312,19 @@ RSpec.describe Voice::RecordingManager do
described_class.reconcile_pending!
- expect(Voice::Recording.find_by(egress_id: "EG_1").status).to eq("recording")
+ expect(Live::Recording.find_by(egress_id: "EG_1").status).to eq("recording")
expect(described_class.status(room.id)).to be_present
end
it "writes off an old row the egress service no longer remembers, without a PM" do
stub_start
described_class.start!(room, moderator)
- Voice::Recording.find_by(egress_id: "EG_1").update!(started_at: 25.hours.ago)
+ Live::Recording.find_by(egress_id: "EG_1").update!(started_at: 25.hours.ago)
stub_list(items: [])
described_class.reconcile_pending!
- expect(Voice::Recording.find_by(egress_id: "EG_1").status).to eq("failed")
+ expect(Live::Recording.find_by(egress_id: "EG_1").status).to eq("failed")
expect(Topic.private_messages_for_user(moderator)).to be_empty
end
@@ -356,7 +335,7 @@ RSpec.describe Voice::RecordingManager do
described_class.reconcile_pending!
- expect(Voice::Recording.find_by(egress_id: "EG_1").status).to eq("recording")
+ expect(Live::Recording.find_by(egress_id: "EG_1").status).to eq("recording")
end
it "keeps a stuck row when the egress service is unreachable" do
@@ -365,7 +344,7 @@ RSpec.describe Voice::RecordingManager do
stub_request(:post, "https://livekit.example.com/twirp/livekit.Egress/ListEgress").to_timeout
expect { described_class.reconcile_pending! }.not_to raise_error
- expect(Voice::Recording.find_by(egress_id: "EG_1").status).to eq("recording")
+ expect(Live::Recording.find_by(egress_id: "EG_1").status).to eq("recording")
end
end
@@ -373,7 +352,7 @@ RSpec.describe Voice::RecordingManager do
stub_start
described_class.start!(room, moderator)
- Voice::ParticipantTracker.clear_transport_pin(room.id)
+ Live::ParticipantTracker.clear_transport_pin(room.id)
expect(described_class.status(room.id)).to be_nil
end
diff --git a/plugins/voice/spec/services/voice/room_broadcaster_spec.rb b/plugins/live/spec/services/live/room_broadcaster_spec.rb
similarity index 70%
rename from plugins/voice/spec/services/voice/room_broadcaster_spec.rb
rename to plugins/live/spec/services/live/room_broadcaster_spec.rb
index f3f00df1e0d..f0a937401e4 100644
--- a/plugins/voice/spec/services/voice/room_broadcaster_spec.rb
+++ b/plugins/live/spec/services/live/room_broadcaster_spec.rb
@@ -1,19 +1,19 @@
# frozen_string_literal: true
-RSpec.describe Voice::RoomBroadcaster do
+RSpec.describe Live::RoomBroadcaster do
fab!(:participant, :user)
- fab!(:room) { Fabricate(:voice_room, public: true) }
+ fab!(:room) { Fabricate(:live_room, public: true) }
- before { SiteSetting.voice_enabled = true }
+ before { SiteSetting.live_enabled = true }
describe ".publish_participants" do
it "reaches anonymous subscribers through the anonymous_users pseudogroup when they are admitted" do
- SiteSetting.voice_allowed_groups =
+ SiteSetting.live_allowed_groups =
"#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
- Voice::ParticipantTracker.add(room.id, participant.id)
+ Live::ParticipantTracker.add(room.id, participant.id)
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) do
+ MessageBus.track_publish(Live.room_channel(room.id)) do
described_class.publish_participants(room)
end
@@ -33,11 +33,11 @@ RSpec.describe Voice::RoomBroadcaster do
end
it "targets logged-in subscribers, never anonymous ones, when allowed groups are logged_in_users" do
- SiteSetting.voice_allowed_groups = Group::AUTO_GROUPS[:logged_in_users].to_s
- Voice::ParticipantTracker.add(room.id, participant.id)
+ SiteSetting.live_allowed_groups = Group::AUTO_GROUPS[:logged_in_users].to_s
+ Live::ParticipantTracker.add(room.id, participant.id)
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) do
+ MessageBus.track_publish(Live.room_channel(room.id)) do
described_class.publish_participants(room)
end
@@ -54,11 +54,11 @@ RSpec.describe Voice::RoomBroadcaster do
it "targets allowed groups plus current participants when access is restricted" do
group = Fabricate(:group)
- SiteSetting.voice_allowed_groups = group.id.to_s
- Voice::ParticipantTracker.add(room.id, participant.id)
+ SiteSetting.live_allowed_groups = group.id.to_s
+ Live::ParticipantTracker.add(room.id, participant.id)
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) do
+ MessageBus.track_publish(Live.room_channel(room.id)) do
described_class.publish_participants(room)
end
@@ -67,11 +67,11 @@ RSpec.describe Voice::RoomBroadcaster do
end
it "targets members plus current participants for private rooms" do
- private_room = Fabricate(:voice_room, public: false)
- Voice::ParticipantTracker.add(private_room.id, participant.id)
+ private_room = Fabricate(:live_room, public: false)
+ Live::ParticipantTracker.add(private_room.id, participant.id)
messages =
- MessageBus.track_publish(Voice.room_channel(private_room.id)) do
+ MessageBus.track_publish(Live.room_channel(private_room.id)) do
described_class.publish_participants(private_room)
end
@@ -79,12 +79,12 @@ RSpec.describe Voice::RoomBroadcaster do
end
it "stamps each participant with their own media entitlements" do
- SiteSetting.voice_video_allowed_groups = Group::AUTO_GROUPS[:logged_in_users]
- SiteSetting.voice_screen_share_allowed_groups = ""
- Voice::ParticipantTracker.add(room.id, participant.id)
+ SiteSetting.live_video_allowed_groups = Group::AUTO_GROUPS[:logged_in_users]
+ SiteSetting.live_screen_share_allowed_groups = ""
+ Live::ParticipantTracker.add(room.id, participant.id)
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) do
+ MessageBus.track_publish(Live.room_channel(room.id)) do
described_class.publish_participants(room)
end
@@ -98,12 +98,12 @@ RSpec.describe Voice::RoomBroadcaster do
fab!(:second_participant, :user)
it "publishes the hand event to exactly the tracked participants" do
- Voice::ParticipantTracker.add(room.id, participant.id)
- Voice::ParticipantTracker.add(room.id, second_participant.id)
+ Live::ParticipantTracker.add(room.id, participant.id)
+ Live::ParticipantTracker.add(room.id, second_participant.id)
raised_at = Time.now.to_f
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) do
+ MessageBus.track_publish(Live.room_channel(room.id)) do
described_class.publish_hand_raise(
room,
participant.id,
@@ -128,7 +128,7 @@ RSpec.describe Voice::RoomBroadcaster do
it "does not publish when the room has no participants" do
messages =
- MessageBus.track_publish(Voice.room_channel(room.id)) do
+ MessageBus.track_publish(Live.room_channel(room.id)) do
described_class.publish_hand_raise(
room,
participant.id,
diff --git a/plugins/voice/spec/services/voice/room_directory_preloader_multisite_spec.rb b/plugins/live/spec/services/live/room_directory_preloader_multisite_spec.rb
similarity index 63%
rename from plugins/voice/spec/services/voice/room_directory_preloader_multisite_spec.rb
rename to plugins/live/spec/services/live/room_directory_preloader_multisite_spec.rb
index a0617b674b3..bbf3bc221c3 100644
--- a/plugins/voice/spec/services/voice/room_directory_preloader_multisite_spec.rb
+++ b/plugins/live/spec/services/live/room_directory_preloader_multisite_spec.rb
@@ -1,37 +1,37 @@
# frozen_string_literal: true
-RSpec.describe Voice::RoomDirectoryPreloader, type: :multisite do
+RSpec.describe Live::RoomDirectoryPreloader, type: :multisite do
let(:room_id) { 9_000_000 + SecureRandom.random_number(100_000) }
after do
%w[default second].each do |site|
RailsMultisite::ConnectionManagement.with_connection(site) do
- Voice::ParticipantTracker.clear(room_id)
+ Live::ParticipantTracker.clear(room_id)
end
end
end
it "keeps batched Redis and MessageBus room state isolated by site" do
- channel = Voice.room_channel(room_id)
- Voice::ParticipantTracker.add(room_id, 101)
- Voice::ParticipantTracker.update_metadata(room_id, 101, muted: true)
- Voice::ParticipantTracker.pin_transport!(room_id, "mesh")
+ channel = Live.room_channel(room_id)
+ Live::ParticipantTracker.add(room_id, 101)
+ Live::ParticipantTracker.update_metadata(room_id, 101, muted: true)
+ Live::ParticipantTracker.pin_transport!(room_id, "mesh")
default_message_id = MessageBus.publish(channel, type: "participants")
test_multisite_connection("second") do
- second_state = Voice::ParticipantTracker.room_states([room_id]).fetch(room_id)
+ second_state = Live::ParticipantTracker.room_states([room_id]).fetch(room_id)
expect(second_state.participant_ids).to be_empty
expect(second_state.participant_metadata).to be_empty
expect(second_state.pinned_transport).to be_nil
expect(MessageBus.last_ids(channel).fetch(channel)).to eq(0)
- Voice::ParticipantTracker.add(room_id, 202)
- Voice::ParticipantTracker.pin_transport!(room_id, "livekit")
+ Live::ParticipantTracker.add(room_id, 202)
+ Live::ParticipantTracker.pin_transport!(room_id, "livekit")
MessageBus.publish(channel, type: "participants")
end
- default_state = Voice::ParticipantTracker.room_states([room_id]).fetch(room_id)
+ default_state = Live::ParticipantTracker.room_states([room_id]).fetch(room_id)
expect(default_state.participant_ids).to eq([101])
expect(default_state.participant_metadata).to eq(101 => { muted: true })
expect(default_state.pinned_transport).to eq("mesh")
diff --git a/plugins/voice/spec/services/voice/room_directory_preloader_spec.rb b/plugins/live/spec/services/live/room_directory_preloader_spec.rb
similarity index 73%
rename from plugins/voice/spec/services/voice/room_directory_preloader_spec.rb
rename to plugins/live/spec/services/live/room_directory_preloader_spec.rb
index c62f2809a05..8abed6f7432 100644
--- a/plugins/voice/spec/services/voice/room_directory_preloader_spec.rb
+++ b/plugins/live/spec/services/live/room_directory_preloader_spec.rb
@@ -1,19 +1,19 @@
# frozen_string_literal: true
-RSpec.describe Voice::RoomDirectoryPreloader do
- fab!(:first_room, :voice_room)
- fab!(:second_room, :voice_room)
+RSpec.describe Live::RoomDirectoryPreloader do
+ fab!(:first_room, :live_room)
+ fab!(:second_room, :live_room)
fab!(:first_user, :user)
fab!(:second_user, :user)
before do
- SiteSetting.voice_enabled = true
- Voice::ParticipantTracker.add(first_room.id, first_user.id)
- Voice::ParticipantTracker.add(first_room.id, second_user.id)
- Voice::ParticipantTracker.add(second_room.id, first_user.id)
- Voice::ParticipantTracker.update_metadata(first_room.id, first_user.id, muted: true)
- Voice::ParticipantTracker.pin_transport!(first_room.id, "livekit")
- Voice::ParticipantTracker.set_recording(
+ SiteSetting.live_enabled = true
+ Live::ParticipantTracker.add(first_room.id, first_user.id)
+ Live::ParticipantTracker.add(first_room.id, second_user.id)
+ Live::ParticipantTracker.add(second_room.id, first_user.id)
+ Live::ParticipantTracker.update_metadata(first_room.id, first_user.id, muted: true)
+ Live::ParticipantTracker.pin_transport!(first_room.id, "livekit")
+ Live::ParticipantTracker.set_recording(
first_room.id,
egress_id: "EG_1",
user_id: first_user.id,
@@ -23,8 +23,8 @@ RSpec.describe Voice::RoomDirectoryPreloader do
end
after do
- Voice::ParticipantTracker.clear(first_room.id)
- Voice::ParticipantTracker.clear(second_room.id)
+ Live::ParticipantTracker.clear(first_room.id)
+ Live::ParticipantTracker.clear(second_room.id)
end
it "preloads live room state and participant users for the directory" do
diff --git a/plugins/live/spec/services/live/statistics_spec.rb b/plugins/live/spec/services/live/statistics_spec.rb
new file mode 100644
index 00000000000..dd704270001
--- /dev/null
+++ b/plugins/live/spec/services/live/statistics_spec.rb
@@ -0,0 +1,41 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+
+RSpec.describe Live::Statistics do
+ fab!(:user)
+ fab!(:room, :live_room)
+
+ before do
+ freeze_time
+ SiteSetting.live_enabled = true
+ SiteSetting.live_analytics_enabled = true
+ end
+
+ it "counts each participant once across rooms and repeat visits in the last seven days" do
+ Fabricate(:live_session, user: user, room: room, joined_at: 1.day.ago)
+ Fabricate(:live_session, user: user, joined_at: 2.days.ago)
+ Fabricate(:live_session, room: room, joined_at: 6.days.ago, left_at: nil)
+ Fabricate(:live_session, room: room, joined_at: 7.days.ago)
+ Fabricate(:live_session, room: room, joined_at: 8.days.ago)
+
+ expect(described_class.about_users).to eq("7_days": 2)
+ expect(About.fetch_stats[:live_users_7_days]).to eq(2)
+ end
+
+ it "returns zero when nobody joined recently" do
+ expect(described_class.about_users).to eq("7_days": 0)
+ end
+
+ it "omits the statistic when live is disabled" do
+ SiteSetting.live_enabled = false
+
+ expect(About.fetch_stats).not_to have_key(:live_users_7_days)
+ end
+
+ it "omits the statistic when analytics are disabled" do
+ SiteSetting.live_analytics_enabled = false
+
+ expect(About.fetch_stats).not_to have_key(:live_users_7_days)
+ end
+end
diff --git a/plugins/voice/spec/support/voice_fake_media.rb b/plugins/live/spec/support/live_fake_media.rb
similarity index 79%
rename from plugins/voice/spec/support/voice_fake_media.rb
rename to plugins/live/spec/support/live_fake_media.rb
index 580e87b2731..2be254936d8 100644
--- a/plugins/voice/spec/support/voice_fake_media.rb
+++ b/plugins/live/spec/support/live_fake_media.rb
@@ -2,27 +2,27 @@
require "json"
-module VoiceFakeMedia
+module LiveFakeMedia
DEFAULT_VIDEO_FEEDS = [
- { label: "Voice fake camera A", width: 640, height: 360, color: "#2563eb", accent: "#f97316" },
- { label: "Voice fake camera B", width: 640, height: 360, color: "#16a34a", accent: "#7c3aed" },
- { label: "Voice fake camera C", width: 640, height: 360, color: "#dc2626", accent: "#0891b2" },
+ { label: "Live fake camera A", width: 640, height: 360, color: "#2563eb", accent: "#f97316" },
+ { label: "Live fake camera B", width: 640, height: 360, color: "#16a34a", accent: "#7c3aed" },
+ { label: "Live fake camera C", width: 640, height: 360, color: "#dc2626", accent: "#0891b2" },
].freeze
- def install_voice_fake_media(video_feeds: DEFAULT_VIDEO_FEEDS)
+ def install_live_fake_media(video_feeds: DEFAULT_VIDEO_FEEDS)
feeds_json = JSON.generate(video_feeds)
page.driver.with_playwright_page do |playwright_page|
playwright_page.add_init_script(script: <<~JS)
(() => {
- if (window.__voiceFakeMediaInstalled) {
+ if (window.__liveFakeMediaInstalled) {
return;
}
- window.__voiceFakeMediaInstalled = true;
- window.__voiceFakeMediaStreams = [];
- window.__voiceFakeMediaVideoFeeds = #{feeds_json};
- window.__voiceFakeMediaVideoFeedIndex = 0;
+ window.__liveFakeMediaInstalled = true;
+ window.__liveFakeMediaStreams = [];
+ window.__liveFakeMediaVideoFeeds = #{feeds_json};
+ window.__liveFakeMediaVideoFeedIndex = 0;
const mediaDevices = navigator.mediaDevices || {};
Object.defineProperty(navigator, "mediaDevices", {
@@ -31,9 +31,9 @@ module VoiceFakeMedia
});
function nextVideoFeed() {
- const feeds = window.__voiceFakeMediaVideoFeeds;
- const index = window.__voiceFakeMediaVideoFeedIndex % feeds.length;
- window.__voiceFakeMediaVideoFeedIndex += 1;
+ const feeds = window.__liveFakeMediaVideoFeeds;
+ const index = window.__liveFakeMediaVideoFeedIndex % feeds.length;
+ window.__liveFakeMediaVideoFeedIndex += 1;
return feeds[index];
}
@@ -83,12 +83,12 @@ module VoiceFakeMedia
drawFrame();
const timer = window.setInterval(drawFrame, 100);
const stream = canvas.captureStream(10);
- stream.__voiceFakeMediaLabel = label;
+ stream.__liveFakeMediaLabel = label;
stream.getTracks().forEach((track) => {
- track.__voiceFakeMediaLabel = label;
+ track.__liveFakeMediaLabel = label;
cleanupWhenTrackStops(track, () => window.clearInterval(timer));
});
- window.__voiceFakeMediaStreams.push(stream);
+ window.__liveFakeMediaStreams.push(stream);
return stream;
}
@@ -110,7 +110,7 @@ module VoiceFakeMedia
audioContext.close();
});
});
- window.__voiceFakeMediaStreams.push(destination.stream);
+ window.__liveFakeMediaStreams.push(destination.stream);
return destination.stream;
}
@@ -127,7 +127,7 @@ module VoiceFakeMedia
if (constraints.video) {
const videoStream = createVideoStream(nextVideoFeed());
- stream.__voiceFakeMediaLabel = videoStream.__voiceFakeMediaLabel;
+ stream.__liveFakeMediaLabel = videoStream.__liveFakeMediaLabel;
addTracks(stream, videoStream);
}
@@ -136,7 +136,7 @@ module VoiceFakeMedia
mediaDevices.getDisplayMedia = async () => {
return createVideoStream({
- label: "Voice fake screen",
+ label: "Live fake screen",
width: 1024,
height: 576,
color: "#16a34a",
@@ -145,9 +145,9 @@ module VoiceFakeMedia
};
mediaDevices.enumerateDevices = async () => {
- return window.__voiceFakeMediaVideoFeeds.map((feed, index) => ({
- deviceId: `voice-fake-camera-${index}`,
- groupId: `voice-fake-group-${index}`,
+ return window.__liveFakeMediaVideoFeeds.map((feed, index) => ({
+ deviceId: `live-fake-camera-${index}`,
+ groupId: `live-fake-group-${index}`,
kind: "videoinput",
label: feed.label,
toJSON() {
@@ -160,7 +160,7 @@ module VoiceFakeMedia
end
end
- def voice_media_track_count(selector, kind: :video, timeout: 5)
+ def live_media_track_count(selector, kind: :video, timeout: 5)
page.evaluate_async_script(<<~JS, selector, kind.to_s, timeout * 1000)
const [selector, kind, timeoutMs, done] = arguments;
const startedAt = performance.now();
@@ -183,7 +183,7 @@ module VoiceFakeMedia
JS
end
- def voice_media_track_live?(selector, kind: :video, timeout: 5)
+ def live_media_track_live?(selector, kind: :video, timeout: 5)
page.evaluate_async_script(<<~JS, selector, kind.to_s, timeout * 1000)
const [selector, kind, timeoutMs, done] = arguments;
const startedAt = performance.now();
@@ -211,4 +211,4 @@ module VoiceFakeMedia
end
end
-RSpec.configure { |config| config.include VoiceFakeMedia, type: :system }
+RSpec.configure { |config| config.include LiveFakeMedia, type: :system }
diff --git a/plugins/voice/spec/system/admin_voice_rooms_spec.rb b/plugins/live/spec/system/admin_live_rooms_spec.rb
similarity index 55%
rename from plugins/voice/spec/system/admin_voice_rooms_spec.rb
rename to plugins/live/spec/system/admin_live_rooms_spec.rb
index 1c37b8ee451..872627ac84e 100644
--- a/plugins/voice/spec/system/admin_voice_rooms_spec.rb
+++ b/plugins/live/spec/system/admin_live_rooms_spec.rb
@@ -1,21 +1,21 @@
# frozen_string_literal: true
-describe "Admin voice rooms" do
+describe "Admin live rooms" do
fab!(:admin)
fab!(:creator, :user)
- fab!(:room) { Fabricate(:voice_room, name: "Town hall", creator:) }
+ fab!(:room) { Fabricate(:live_room, name: "Town hall", creator:) }
let(:user_card) { PageObjects::Components::UserCard.new }
before do
- SiteSetting.voice_enabled = true
+ SiteSetting.live_enabled = true
sign_in(admin)
end
it "shows the room creator and opens their user card" do
- visit("/admin/plugins/voice/voice-rooms")
+ visit("/admin/plugins/live/live-rooms")
- creator_link = find(".voice-rooms__creator-link", text: creator.username)
+ creator_link = find(".live-rooms__creator-link", text: creator.username)
creator_link.click
expect(user_card).to be_showing_user(creator.username)
diff --git a/plugins/live/spec/system/back_to_live_room_spec.rb b/plugins/live/spec/system/back_to_live_room_spec.rb
new file mode 100644
index 00000000000..05bd2ee3a88
--- /dev/null
+++ b/plugins/live/spec/system/back_to_live_room_spec.rb
@@ -0,0 +1,70 @@
+# frozen_string_literal: true
+
+require_relative "../support/live_fake_media"
+
+describe "Back to live room button" do
+ include ThemeScreenshotMarker
+
+ fab!(:user)
+ fab!(:channel, :chat_channel) { Fabricate(:chat_channel, threading_enabled: true) }
+
+ fab!(:room) do
+ Fabricate(:live_room, name: "Team Room", public: true, chat_channel_id: channel.id)
+ end
+
+ let(:chat_page) { PageObjects::Pages::Chat.new }
+ let(:channel_page) { PageObjects::Pages::ChatChannel.new }
+ let(:chat_drawer_page) { PageObjects::Pages::ChatDrawer.new }
+ let(:back_to_live_room) { PageObjects::Components::LiveBackToLiveRoom.new }
+
+ before do
+ SiteSetting.live_enabled = true
+ SiteSetting.live_mesh_privacy_warning_enabled = false
+ SiteSetting.live_chat_enabled = true
+ SiteSetting.live_allowed_groups =
+ "#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
+ chat_system_bootstrap(user, [channel])
+ sign_in(user)
+ install_live_fake_media
+ end
+
+ it "takes the user from a session thread straight into its live room" do
+ session = Live::ChatSession.post_message!(room, user, "hi from the room")
+ thread = Chat::Thread.find(session[:thread_id])
+
+ chat_page.visit_thread(thread)
+
+ expect(back_to_live_room).to have_back_to_room_button
+ screenshot_marker(label: "back-to-live-room-full-page", only: :desktop)
+ back_to_live_room.click
+
+ expect(page).to have_current_path("/live/r/#{room.slug}", ignore_query: true)
+
+ # The click joins the call directly — no interstitial join button — and,
+ # since this session is still live, arrives with its chat panel open.
+ expect(page).to have_button(I18n.t("js.live.room.leave"))
+ expect(page).to have_no_button(I18n.t("js.live.room.join"))
+ expect(page).to have_css(".live-chat")
+ end
+
+ it "shows the button on the drawer thread header" do
+ Live::ChatSession.post_message!(room, user, "hi from the room")
+ session = Live::ChatSession.post_message!(room, user, "and a reply")
+ thread = Chat::Thread.find(session[:thread_id])
+
+ chat_drawer_page.visit_channel(channel)
+ channel_page.message_thread_indicator(thread.original_message).click
+
+ expect(chat_drawer_page).to have_open_thread(thread)
+ expect(back_to_live_room).to have_back_to_room_button
+ screenshot_marker(label: "back-to-live-room-drawer", only: :desktop)
+ end
+
+ it "hides the button on a thread that is not a live-room session" do
+ thread = Fabricate(:chat_thread, channel: channel)
+
+ chat_page.visit_thread(thread)
+
+ expect(back_to_live_room).to have_no_back_to_room_button
+ end
+end
diff --git a/plugins/live/spec/system/configure_livekit_agent_spec.rb b/plugins/live/spec/system/configure_livekit_agent_spec.rb
new file mode 100644
index 00000000000..a589b9a5e3d
--- /dev/null
+++ b/plugins/live/spec/system/configure_livekit_agent_spec.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+describe "Configure a LiveKit agent" do
+ fab!(:admin)
+ let(:settings_page) { PageObjects::Pages::AdminSiteSettings.new }
+
+ before do
+ SiteSetting.live_enabled = true
+ SiteSetting.live_livekit_url = "wss://test.livekit.cloud"
+ SiteSetting.live_livekit_api_key = "key"
+ SiteSetting.live_livekit_api_secret = "secret"
+ sign_in(admin)
+ end
+
+ it "lets an admin enable the bot without configuring an agent name" do
+ settings_page.visit("live_livekit_agent")
+ expect(settings_page).to have_setting("live_livekit_agent_enabled")
+ expect(settings_page).to have_setting("live_livekit_agent_invite_allowed_groups")
+ expect(page).to have_content("Live livekit agent enabled")
+ # The description embeds a {{setting:...}} token that renders as a link,
+ # so only a token-free fragment can be matched literally.
+ expect(page).to have_content("to invite a LiveKit Cloud agent to public live rooms")
+
+ settings_page.toggle_bool_setting("live_livekit_agent_enabled")
+
+ page.refresh
+ expect(settings_page.bool_setting_checkbox("live_livekit_agent_enabled")).to be_checked
+ end
+end
diff --git a/plugins/live/spec/system/live_admin_navigation_spec.rb b/plugins/live/spec/system/live_admin_navigation_spec.rb
new file mode 100644
index 00000000000..cb064032623
--- /dev/null
+++ b/plugins/live/spec/system/live_admin_navigation_spec.rb
@@ -0,0 +1,37 @@
+# frozen_string_literal: true
+
+RSpec.describe "Live admin navigation" do
+ fab!(:admin)
+
+ before do
+ SiteSetting.live_enabled = true
+ sign_in(admin)
+ end
+
+ it "highlights only the current configuration tab" do
+ visit("/admin/plugins/live/settings")
+
+ tabs = ".admin-plugin-config-page__top-nav-item"
+ expect(page).to have_css(tabs, count: 4)
+ expect(page).to have_css("#{tabs}.active", count: 1)
+ expect(page).to have_css(
+ "#{tabs}.active",
+ text: I18n.t("admin_js.admin.plugins.change_settings_short"),
+ )
+
+ %w[dashboard_title rooms_title recordings_title].each do |label|
+ title = I18n.t("js.live.admin.#{label}")
+ find(tabs, text: title, exact_text: true).click
+
+ expect(page).to have_css("#{tabs}.active", count: 1)
+ expect(page).to have_css("#{tabs}.active", text: title)
+ end
+
+ find(tabs, text: I18n.t("admin_js.admin.plugins.change_settings_short"), exact_text: true).click
+ expect(page).to have_css("#{tabs}.active", count: 1)
+ expect(page).to have_css(
+ "#{tabs}.active",
+ text: I18n.t("admin_js.admin.plugins.change_settings_short"),
+ )
+ end
+end
diff --git a/plugins/voice/spec/system/voice_chat_sidebar_spec.rb b/plugins/live/spec/system/live_chat_sidebar_spec.rb
similarity index 69%
rename from plugins/voice/spec/system/voice_chat_sidebar_spec.rb
rename to plugins/live/spec/system/live_chat_sidebar_spec.rb
index c1414c145ad..b58d439dd3a 100644
--- a/plugins/voice/spec/system/voice_chat_sidebar_spec.rb
+++ b/plugins/live/spec/system/live_chat_sidebar_spec.rb
@@ -1,23 +1,23 @@
# frozen_string_literal: true
-require_relative "page_objects/components/voice_sidebar"
+require_relative "page_objects/components/live_sidebar"
-describe "Voice rooms in the chat sidebar" do
+describe "Live rooms in the chat sidebar" do
let(:chat_rooms_sidebar) do
- PageObjects::Components::VoiceSidebar.new(section_name: "voice-rooms-chat")
+ PageObjects::Components::LiveSidebar.new(section_name: "live-rooms-chat")
end
- let(:main_rooms_sidebar) { PageObjects::Components::VoiceSidebar.new }
+ let(:main_rooms_sidebar) { PageObjects::Components::LiveSidebar.new }
let(:chat_page) { PageObjects::Pages::Chat.new }
fab!(:user)
fab!(:admin)
fab!(:channel, :category_channel)
- fab!(:room) { Fabricate(:voice_room, name: "Watercooler", creator: admin, public: true) }
+ fab!(:room) { Fabricate(:live_room, name: "Watercooler", creator: admin, public: true) }
before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_mesh_privacy_warning_enabled = false
- SiteSetting.voice_allowed_groups =
+ SiteSetting.live_enabled = true
+ SiteSetting.live_mesh_privacy_warning_enabled = false
+ SiteSetting.live_allowed_groups =
"#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
chat_system_bootstrap(user, [channel])
sign_in(user)
@@ -30,7 +30,7 @@ describe "Voice rooms in the chat sidebar" do
)
end
- it "shows the voice rooms in the full-screen chat sidebar" do
+ it "shows the live rooms in the full-screen chat sidebar" do
chat_page.visit_channel(channel)
expect(chat_rooms_sidebar).to be_visible
diff --git a/plugins/voice/spec/system/voice_livekit_spec.rb b/plugins/live/spec/system/live_livekit_spec.rb
similarity index 61%
rename from plugins/voice/spec/system/voice_livekit_spec.rb
rename to plugins/live/spec/system/live_livekit_spec.rb
index 5bf2c81018d..329fedefc86 100644
--- a/plugins/voice/spec/system/voice_livekit_spec.rb
+++ b/plugins/live/spec/system/live_livekit_spec.rb
@@ -1,18 +1,18 @@
# frozen_string_literal: true
-require_relative "../support/voice_fake_media"
+require_relative "../support/live_fake_media"
# Exercises a real LiveKit server end-to-end, so it only runs when one is
# reachable. Start a disposable dev server and point the spec at it:
#
# docker run --rm -p 7880:7880 livekit/livekit-server --dev
#
-# VOICE_LIVEKIT_TEST_URL=ws://localhost:7880 \
-# bin/rspec plugins/voice/spec/system/voice_livekit_spec.rb
+# LIVE_LIVEKIT_TEST_URL=ws://localhost:7880 \
+# bin/rspec plugins/live/spec/system/live_livekit_spec.rb
#
# The --dev server uses the API key "devkey" with secret "secret"; set
-# VOICE_LIVEKIT_TEST_KEY / VOICE_LIVEKIT_TEST_SECRET to target a server
-# with real credentials. Without VOICE_LIVEKIT_TEST_URL the whole file is
+# LIVE_LIVEKIT_TEST_KEY / LIVE_LIVEKIT_TEST_SECRET to target a server
+# with real credentials. Without LIVE_LIVEKIT_TEST_URL the whole file is
# excluded, keeping CI runs byte-identical to before it existed.
#
# NOTE: outside CI, core pins every test browser to one fixed
@@ -25,27 +25,27 @@ require_relative "../support/voice_fake_media"
# getUserMedia here — the service acquires media itself (through the fakes)
# and hands the SDK finished MediaStreamTracks via publishTrack, exactly as
# it hands them to RTCPeerConnection on the mesh path.
-describe "Voice LiveKit rooms", if: ENV["VOICE_LIVEKIT_TEST_URL"] do
+describe "Live LiveKit rooms", if: ENV["LIVE_LIVEKIT_TEST_URL"] do
fab!(:admin)
fab!(:alice) { Fabricate(:user, trust_level: TrustLevel[2]) }
fab!(:bob) { Fabricate(:user, trust_level: TrustLevel[2]) }
- fab!(:room) { Fabricate(:voice_room, name: "LiveKit Room", creator: admin, public: true) }
+ fab!(:room) { Fabricate(:live_room, name: "LiveKit Room", creator: admin, public: true) }
before do
alice.activate
bob.activate
Group.refresh_automatic_groups!
- SiteSetting.voice_enabled = true
- SiteSetting.voice_mesh_privacy_warning_enabled = false
- SiteSetting.voice_allowed_groups =
+ SiteSetting.live_enabled = true
+ SiteSetting.live_mesh_privacy_warning_enabled = false
+ SiteSetting.live_allowed_groups =
"#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
# The policy validator requires url + key + secret to be present first.
- SiteSetting.voice_livekit_url = ENV["VOICE_LIVEKIT_TEST_URL"]
- SiteSetting.voice_livekit_api_key = ENV.fetch("VOICE_LIVEKIT_TEST_KEY", "devkey")
- SiteSetting.voice_livekit_api_secret = ENV.fetch("VOICE_LIVEKIT_TEST_SECRET", "secret")
- SiteSetting.voice_livekit_room_policy = "all_rooms"
+ SiteSetting.live_livekit_url = ENV["LIVE_LIVEKIT_TEST_URL"]
+ SiteSetting.live_livekit_api_key = ENV.fetch("LIVE_LIVEKIT_TEST_KEY", "devkey")
+ SiteSetting.live_livekit_api_secret = ENV.fetch("LIVE_LIVEKIT_TEST_SECRET", "secret")
+ SiteSetting.live_livekit_room_policy = "all_rooms"
end
# Records WebSocket URLs so the spec can prove the browser really connected
@@ -53,11 +53,11 @@ describe "Voice LiveKit rooms", if: ENV["VOICE_LIVEKIT_TEST_URL"] do
# a stale client bundle once ran this whole flow green on mesh.
def install_sfu_connection_probe
page.driver.with_playwright_page { |pw| pw.add_init_script(script: <<~JS) }
- window.__voiceWsUrls = [];
+ window.__liveWsUrls = [];
const NativeWebSocket = window.WebSocket;
window.WebSocket = new Proxy(NativeWebSocket, {
construct(target, args) {
- window.__voiceWsUrls.push(String(args[0]));
+ window.__liveWsUrls.push(String(args[0]));
return new target(...args);
},
});
@@ -66,15 +66,15 @@ describe "Voice LiveKit rooms", if: ENV["VOICE_LIVEKIT_TEST_URL"] do
def sfu_websocket_urls
page
- .evaluate_script("window.__voiceWsUrls")
- .select { |url| url.start_with?(ENV["VOICE_LIVEKIT_TEST_URL"]) }
+ .evaluate_script("window.__liveWsUrls")
+ .select { |url| url.start_with?(ENV["LIVE_LIVEKIT_TEST_URL"]) }
end
it "runs a two-browser camera call through the LiveKit server" do
using_session(:alice) do
sign_in(alice)
install_sfu_connection_probe
- install_voice_fake_media(
+ install_live_fake_media(
video_feeds: [
{
label: "Alice fake camera",
@@ -85,18 +85,18 @@ describe "Voice LiveKit rooms", if: ENV["VOICE_LIVEKIT_TEST_URL"] do
},
],
)
- visit("/voice/r/#{room.slug}")
- click_button(I18n.t("js.voice.room.join"))
- expect(page).to have_button(I18n.t("js.voice.video.camera_on"))
+ visit("/live/r/#{room.slug}")
+ click_button(I18n.t("js.live.room.join"))
+ expect(page).to have_button(I18n.t("js.live.video.camera_on"))
end
# The first join must have resolved and pinned the SFU transport — this
# is what distinguishes the call below from silently running on mesh.
- expect(Voice::ParticipantTracker.pinned_transport(room.id)).to eq("livekit")
+ expect(Live::ParticipantTracker.pinned_transport(room.id)).to eq("livekit")
using_session(:bob) do
sign_in(bob)
- install_voice_fake_media(
+ install_live_fake_media(
video_feeds: [
{
label: "Bob fake camera",
@@ -107,24 +107,24 @@ describe "Voice LiveKit rooms", if: ENV["VOICE_LIVEKIT_TEST_URL"] do
},
],
)
- visit("/voice/r/#{room.slug}")
- click_button(I18n.t("js.voice.room.join"))
- click_button(I18n.t("js.voice.video.camera_on"))
+ visit("/live/r/#{room.slug}")
+ click_button(I18n.t("js.live.room.join"))
+ click_button(I18n.t("js.live.video.camera_on"))
local_video_selector =
- ".voice-video-tile.--video[data-user-id='#{bob.id}'] video.voice-video-tile__video"
+ ".live-video-tile.--video[data-user-id='#{bob.id}'] video.live-video-tile__video"
expect(page).to have_css(local_video_selector)
- expect(voice_media_track_count(local_video_selector)).to eq(1)
+ expect(live_media_track_count(local_video_selector)).to eq(1)
end
using_session(:alice) do
# Bob's camera arrives through the SFU rather than a direct peer
# connection; a longer wait absorbs the extra publish/subscribe hop.
remote_video_selector =
- ".voice-video-tile.--video[data-user-id='#{bob.id}'] video.voice-video-tile__video"
+ ".live-video-tile.--video[data-user-id='#{bob.id}'] video.live-video-tile__video"
expect(page).to have_css(remote_video_selector, wait: 15)
- expect(voice_media_track_count(remote_video_selector, timeout: 15)).to eq(1)
- expect(voice_media_track_live?(remote_video_selector, timeout: 15)).to eq(true)
+ expect(live_media_track_count(remote_video_selector, timeout: 15)).to eq(1)
+ expect(live_media_track_live?(remote_video_selector, timeout: 15)).to eq(true)
expect(sfu_websocket_urls).not_to be_empty
end
diff --git a/plugins/live/spec/system/live_mesh_privacy_warning_spec.rb b/plugins/live/spec/system/live_mesh_privacy_warning_spec.rb
new file mode 100644
index 00000000000..a372103fdb3
--- /dev/null
+++ b/plugins/live/spec/system/live_mesh_privacy_warning_spec.rb
@@ -0,0 +1,59 @@
+# frozen_string_literal: true
+
+require_relative "../support/live_fake_media"
+
+describe "Live mesh privacy warning" do
+ fab!(:user)
+ fab!(:room) { Fabricate(:live_room, public: true) }
+
+ before do
+ user.activate
+ SiteSetting.live_enabled = true
+ SiteSetting.live_allowed_groups =
+ "#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
+ sign_in(user)
+ install_live_fake_media
+ end
+
+ def click_join
+ click_button(I18n.t("js.live.room.join"))
+ end
+
+ it "gates a mesh join behind the warning" do
+ visit("/live/r/#{room.slug}")
+
+ click_join
+ expect(page).to have_css(".live-mesh-privacy-warning-modal")
+ click_button(I18n.t("js.live.mesh_privacy_warning.cancel"))
+ expect(page).to have_no_css(".live-mesh-privacy-warning-modal")
+ expect(page).to have_no_css(".live-room-page__leave")
+
+ click_join
+ click_button(I18n.t("js.live.mesh_privacy_warning.join"))
+ expect(page).to have_css(".live-room-page__leave")
+ end
+
+ it "doesn't warn again on a device that opted out" do
+ visit("/live/r/#{room.slug}")
+
+ click_join
+ find(".live-mesh-privacy-warning-modal__dont-show-again input").click
+ click_button(I18n.t("js.live.mesh_privacy_warning.join"))
+ expect(page).to have_css(".live-room-page__leave")
+ click_button(I18n.t("js.live.room.leave"))
+
+ click_join
+ expect(page).to have_css(".live-room-page__leave")
+ expect(page).to have_no_css(".live-mesh-privacy-warning-modal")
+ end
+
+ it "doesn't warn when disabled site-wide" do
+ SiteSetting.live_mesh_privacy_warning_enabled = false
+
+ visit("/live/r/#{room.slug}")
+
+ click_join
+ expect(page).to have_css(".live-room-page__leave")
+ expect(page).to have_no_css(".live-mesh-privacy-warning-modal")
+ end
+end
diff --git a/plugins/voice/spec/system/voice_room_chat_panel_spec.rb b/plugins/live/spec/system/live_room_chat_panel_spec.rb
similarity index 52%
rename from plugins/voice/spec/system/voice_room_chat_panel_spec.rb
rename to plugins/live/spec/system/live_room_chat_panel_spec.rb
index d8200ebab5f..5ec73b33ab1 100644
--- a/plugins/voice/spec/system/voice_room_chat_panel_spec.rb
+++ b/plugins/live/spec/system/live_room_chat_panel_spec.rb
@@ -1,14 +1,14 @@
# frozen_string_literal: true
-require_relative "../support/voice_fake_media"
+require_relative "../support/live_fake_media"
-describe "Voice room chat panel" do
+describe "Live room chat panel" do
fab!(:user)
fab!(:admin)
fab!(:channel, :chat_channel) { Fabricate(:chat_channel, threading_enabled: true) }
fab!(:room) do
Fabricate(
- :voice_room,
+ :live_room,
name: "Team Room",
creator: admin,
public: true,
@@ -18,32 +18,32 @@ describe "Voice room chat panel" do
end
before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_mesh_privacy_warning_enabled = false
- SiteSetting.voice_allowed_groups =
+ SiteSetting.live_enabled = true
+ SiteSetting.live_mesh_privacy_warning_enabled = false
+ SiteSetting.live_allowed_groups =
"#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
chat_system_bootstrap(user, [channel])
sign_in(user)
- install_voice_fake_media
+ install_live_fake_media
end
it "renders an existing session thread through chat's own thread UI and posts through it" do
- Voice::ChatSession.post_message!(room, admin, "hi from admin")
+ Live::ChatSession.post_message!(room, admin, "hi from admin")
- visit("/voice/r/#{room.slug}?chat=true")
- click_button(I18n.t("js.voice.room.join"))
+ visit("/live/r/#{room.slug}?chat=true")
+ click_button(I18n.t("js.live.room.join"))
# The panel slides in; typing into it mid-animation can miss the composer.
- wait_for_animation(find(".voice-room-page__sidebar"))
+ wait_for_animation(find(".live-room-page__sidebar"))
# The real chat thread component, not a re-implementation.
- expect(page).to have_css(".voice-chat .chat-thread")
- expect(page).to have_css(".voice-chat .chat-message-text", text: "hi from admin")
+ expect(page).to have_css(".live-chat .chat-thread")
+ expect(page).to have_css(".live-chat .chat-message-text", text: "hi from admin")
# The native composer posts through chat's own API.
- find(".voice-chat .chat-composer__input").fill_in(with: "hello from the room")
- find(".voice-chat .chat-composer__input").send_keys(:enter)
+ find(".live-chat .chat-composer__input").fill_in(with: "hello from the room")
+ find(".live-chat .chat-composer__input").send_keys(:enter)
- expect(page).to have_css(".voice-chat .chat-message-text", text: "hello from the room")
+ expect(page).to have_css(".live-chat .chat-message-text", text: "hello from the room")
# The message renders staged before the create request lands — wait for
# the server to actually persist it.
@@ -57,47 +57,47 @@ describe "Voice room chat panel" do
it "opens the chat panel by default after joining a stage room" do
stage_room =
Fabricate(
- :voice_room,
+ :live_room,
name: "Stage Team Room",
creator: admin,
public: true,
- room_type: Voice::Room::ROOM_TYPE_STAGE,
+ room_type: Live::Room::ROOM_TYPE_STAGE,
chat_channel_id: channel.id,
)
- visit("/voice/r/#{stage_room.slug}")
- click_button(I18n.t("js.voice.room.join"))
+ visit("/live/r/#{stage_room.slug}")
+ click_button(I18n.t("js.live.room.join"))
- expect(page).to have_css(".voice-room-page__sidebar .voice-chat")
- expect(page).to have_current_path("/voice/r/#{stage_room.slug}")
+ expect(page).to have_css(".live-room-page__sidebar .live-chat")
+ expect(page).to have_current_path("/live/r/#{stage_room.slug}")
end
it "keeps the chat panel closed by default after joining an open room" do
- visit("/voice/r/#{room.slug}")
- click_button(I18n.t("js.voice.room.join"))
+ visit("/live/r/#{room.slug}")
+ click_button(I18n.t("js.live.room.join"))
- expect(page).to have_css(".voice-room-page__leave")
- expect(page).to have_no_css(".voice-room-page__sidebar")
+ expect(page).to have_css(".live-room-page__leave")
+ expect(page).to have_no_css(".live-room-page__sidebar")
end
it "opens the session thread from the first message sent through the starter composer" do
- visit("/voice/r/#{room.slug}?chat=true")
- click_button(I18n.t("js.voice.room.join"))
+ visit("/live/r/#{room.slug}?chat=true")
+ click_button(I18n.t("js.live.room.join"))
# The panel slides in; typing into it mid-animation can miss the composer.
- wait_for_animation(find(".voice-room-page__sidebar"))
+ wait_for_animation(find(".live-room-page__sidebar"))
# No thread yet: the panel offers the starter composer, not the thread UI.
- expect(page).to have_css(".voice-chat__input")
- expect(page).to have_no_css(".voice-chat .chat-thread")
+ expect(page).to have_css(".live-chat__input")
+ expect(page).to have_no_css(".live-chat .chat-thread")
- find(".voice-chat__input").fill_in(with: "kicking things off")
+ find(".live-chat__input").fill_in(with: "kicking things off")
# See the note above: the first send races thread creation, its message
# fetch, and the native composer's mount/focus against the settle check.
- using_wait_time(20) { find(".voice-chat__input").send_keys(:enter) }
+ using_wait_time(20) { find(".live-chat__input").send_keys(:enter) }
# The first message creates the thread and the panel swaps to the native UI.
- expect(page).to have_css(".voice-chat .chat-thread")
- expect(page).to have_css(".voice-chat .chat-message-text", text: "kicking things off")
+ expect(page).to have_css(".live-chat .chat-thread")
+ expect(page).to have_css(".live-chat .chat-message-text", text: "kicking things off")
thread = Chat::Thread.find_by(channel_id: channel.id)
expect(thread.original_message.message).to eq("In ##{room.slug}::room - kicking things off")
diff --git a/plugins/live/spec/system/live_rooms_spec.rb b/plugins/live/spec/system/live_rooms_spec.rb
new file mode 100644
index 00000000000..563515743fa
--- /dev/null
+++ b/plugins/live/spec/system/live_rooms_spec.rb
@@ -0,0 +1,402 @@
+# frozen_string_literal: true
+
+require_relative "page_objects/components/live_sidebar"
+require_relative "../support/live_fake_media"
+
+describe "Live rooms" do
+ let(:live_sidebar) { PageObjects::Components::LiveSidebar.new }
+
+ def click_room_page_widget_mode_button
+ find("button[data-identifier='live-room-menu']").click
+ within(".fk-d-menu[data-identifier='live-room-menu']") do
+ click_button(I18n.t("js.live.room.widget_mode"))
+ end
+ end
+
+ def click_call_widget_open_page_button
+ within(".live-call-widget__controls") { find(".d-icon-expand").ancestor("button").click }
+ end
+
+ def click_call_widget_leave_button
+ within(".live-call-widget__controls") { find(".live-call-widget__leave").click }
+ end
+
+ def switch_layout(layout_label)
+ find("button[data-identifier='live-room-menu']").click
+ within(".fk-d-menu[data-identifier='live-room-menu']") do
+ click_button(I18n.t("js.live.room.layout"))
+ end
+ click_button(layout_label)
+ end
+
+ fab!(:user)
+ fab!(:other_user, :user)
+ fab!(:admin)
+
+ before do
+ user.activate
+ SiteSetting.live_enabled = true
+ SiteSetting.live_mesh_privacy_warning_enabled = false
+ SiteSetting.live_allowed_groups =
+ "#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
+ SiteSetting.live_create_room_allowed_groups = "#{Group::AUTO_GROUPS[:trust_level_2]}"
+ end
+
+ context "when plugin is disabled" do
+ it "does not show live rooms section" do
+ SiteSetting.live_enabled = false
+ Fabricate(:live_room, name: "Test Room", creator: admin, public: true)
+ sign_in(user)
+
+ visit("/latest")
+
+ expect(live_sidebar).to be_not_visible
+ end
+ end
+
+ context "when plugin is enabled" do
+ context "as anonymous user" do
+ it "shows public rooms when access is open to everyone" do
+ Fabricate(:live_room, name: "Test Room", creator: admin, public: true)
+
+ visit("/latest")
+
+ expect(live_sidebar).to be_visible
+ end
+
+ it "does not show live rooms section when access is restricted to a group" do
+ SiteSetting.live_allowed_groups = "#{Group::AUTO_GROUPS[:trust_level_2]}"
+ Fabricate(:live_room, name: "Test Room", creator: admin, public: true)
+
+ visit("/latest")
+
+ expect(live_sidebar).to be_not_visible
+ end
+ end
+
+ context "as logged in user" do
+ fab!(:room) { Fabricate(:live_room, name: "Test Room", creator: admin, public: true) }
+
+ before do
+ user.update!(trust_level: TrustLevel[2])
+ Group.refresh_automatic_groups!
+ sign_in(user)
+ end
+
+ it "shows live rooms section when rooms exist" do
+ visit("/latest")
+
+ expect(live_sidebar).to be_visible
+ end
+
+ it "displays public rooms in the sidebar" do
+ visit("/latest")
+
+ expect(live_sidebar).to be_visible
+ expect(live_sidebar).to have_room(room.name)
+ end
+
+ it "hides private rooms from non-members even when they can create rooms" do
+ private_room = Fabricate(:live_room, name: "Private Room", creator: admin, public: false)
+
+ visit("/latest")
+
+ expect(live_sidebar).to have_room(room.name)
+ expect(live_sidebar).to have_no_room(private_room.name)
+ end
+
+ it "shows private rooms to their members" do
+ private_room = Fabricate(:live_room, name: "Private Room", creator: admin, public: false)
+ private_room.room_memberships.create!(user: user)
+
+ visit("/latest")
+
+ expect(live_sidebar).to have_room(private_room.name)
+ end
+
+ it "can publish a fake camera stream on the room page" do
+ install_live_fake_media
+
+ visit("/live/r/#{room.slug}")
+ click_button(I18n.t("js.live.room.join"))
+
+ expect(page).to have_button(I18n.t("js.live.video.camera_on"))
+ click_button(I18n.t("js.live.video.camera_on"))
+
+ video_selector =
+ ".live-video-tile.--video[data-user-id='#{user.id}'] video.live-video-tile__video"
+ expect(page).to have_css(video_selector)
+ expect(live_media_track_count(video_selector)).to eq(1)
+ end
+
+ it "switches between presentation and tiled layouts from the menu" do
+ install_live_fake_media
+
+ visit("/live/r/#{room.slug}")
+ click_button(I18n.t("js.live.room.join"))
+ expect(page).to have_css(".live-room-page__leave")
+ expect(page).to have_css(".live-room-page.--tiled")
+
+ switch_layout(I18n.t("js.live.video.layout_presentation"))
+ expect(page).to have_css(".live-room-page.--presentation")
+
+ switch_layout(I18n.t("js.live.video.layout_tiled"))
+ expect(page).to have_css(".live-room-page.--tiled")
+ end
+
+ it "keeps the active call in a widget after switching to widget mode" do
+ install_live_fake_media
+
+ visit("/live/r/#{room.slug}")
+ click_button(I18n.t("js.live.room.join"))
+ click_button(I18n.t("js.live.video.camera_on"))
+
+ click_room_page_widget_mode_button
+
+ expect(page).to have_css(".live-call-widget", text: room.name)
+ expect(page).to have_button(I18n.t("js.live.video.camera_off"))
+
+ widget_video_selector =
+ ".live-call-widget .live-video-tile.--video[data-user-id='#{user.id}'] video.live-video-tile__video"
+ expect(page).to have_css(widget_video_selector)
+ expect(live_media_track_count(widget_video_selector)).to eq(1)
+
+ click_call_widget_open_page_button
+
+ page_video_selector =
+ ".live-room-page .live-video-tile.--video[data-user-id='#{user.id}'] video.live-video-tile__video"
+ expect(page).to have_current_path("/live/r/#{room.slug}")
+ expect(page).to have_css(page_video_selector)
+ expect(live_media_track_count(page_video_selector)).to eq(1)
+ end
+
+ it "can stop video and leave the call from the persistent widget" do
+ install_live_fake_media
+
+ visit("/live/r/#{room.slug}")
+ click_button(I18n.t("js.live.room.join"))
+ click_button(I18n.t("js.live.video.camera_on"))
+
+ click_room_page_widget_mode_button
+
+ within(".live-call-widget") { click_button(I18n.t("js.live.video.camera_off")) }
+
+ expect(page).to have_button(I18n.t("js.live.video.camera_on"))
+ expect(page).to have_no_css(".live-call-widget .live-video-tile.--video")
+
+ click_call_widget_leave_button
+
+ expect(page).to have_no_css(".live-call-widget")
+ end
+
+ it "opens room actions from the widget overflow menu" do
+ install_live_fake_media
+
+ visit("/live/r/#{room.slug}")
+ click_button(I18n.t("js.live.room.join"))
+ click_room_page_widget_mode_button
+
+ expect(page).to have_css(".live-call-widget", text: room.name)
+
+ # The overflow menu portals out at the dropdown z-index; opening it and
+ # clicking an item asserts it renders above the widget rather than
+ # behind it.
+ find(".live-call-widget button[data-identifier='live-widget-room-menu']").click
+ within(".fk-d-menu[data-identifier='live-widget-room-menu']") do
+ click_button(I18n.t("js.live.room.info"))
+ end
+
+ expect(page).to have_css(".live-room-info-modal")
+ end
+
+ it "shows remote fake video when another user publishes a camera stream" do
+ other_user.activate
+ other_user.update!(trust_level: TrustLevel[2])
+ Group.refresh_automatic_groups!
+
+ using_session(:alice) do
+ sign_in(user)
+ install_live_fake_media(
+ video_feeds: [
+ {
+ label: "Alice fake camera",
+ width: 640,
+ height: 360,
+ color: "#2563eb",
+ accent: "#f97316",
+ },
+ ],
+ )
+ visit("/live/r/#{room.slug}")
+ click_button(I18n.t("js.live.room.join"))
+ expect(page).to have_button(I18n.t("js.live.video.camera_on"))
+ end
+
+ using_session(:bob) do
+ sign_in(other_user)
+ install_live_fake_media(
+ video_feeds: [
+ {
+ label: "Bob fake camera",
+ width: 640,
+ height: 360,
+ color: "#16a34a",
+ accent: "#7c3aed",
+ },
+ ],
+ )
+ visit("/live/r/#{room.slug}")
+ click_button(I18n.t("js.live.room.join"))
+ click_button(I18n.t("js.live.video.camera_on"))
+
+ local_video_selector =
+ ".live-video-tile.--video[data-user-id='#{other_user.id}'] video.live-video-tile__video"
+ expect(page).to have_css(local_video_selector)
+ expect(live_media_track_count(local_video_selector)).to eq(1)
+ end
+
+ using_session(:alice) do
+ remote_video_selector =
+ ".live-video-tile.--video[data-user-id='#{other_user.id}'] video.live-video-tile__video"
+ expect(page).to have_css(remote_video_selector, wait: 10)
+ expect(live_media_track_count(remote_video_selector, timeout: 10)).to eq(1)
+ end
+ end
+
+ it "keeps remote video attached in widget mode" do
+ other_user.activate
+ other_user.update!(trust_level: TrustLevel[2])
+ Group.refresh_automatic_groups!
+
+ using_session(:alice) do
+ sign_in(user)
+ install_live_fake_media
+ visit("/live/r/#{room.slug}")
+ click_button(I18n.t("js.live.room.join"))
+ click_room_page_widget_mode_button
+
+ expect(page).to have_css(".live-call-widget", text: room.name)
+ expect(page).to have_current_path("/latest")
+ end
+
+ using_session(:bob) do
+ sign_in(other_user)
+ install_live_fake_media(
+ video_feeds: [
+ {
+ label: "Bob widget camera",
+ width: 640,
+ height: 360,
+ color: "#16a34a",
+ accent: "#7c3aed",
+ },
+ ],
+ )
+ visit("/live/r/#{room.slug}")
+ click_button(I18n.t("js.live.room.join"))
+ click_button(I18n.t("js.live.video.camera_on"))
+
+ local_video_selector =
+ ".live-video-tile.--video[data-user-id='#{other_user.id}'] video.live-video-tile__video"
+ expect(page).to have_css(local_video_selector)
+ expect(live_media_track_count(local_video_selector)).to eq(1)
+ end
+
+ using_session(:alice) do
+ remote_tile_selector =
+ ".live-call-widget .live-video-tile[data-user-id='#{other_user.id}']"
+ remote_video_selector = "#{remote_tile_selector}.--video video.live-video-tile__video"
+
+ expect(page).to have_css(remote_tile_selector, wait: 10)
+ expect(page).to have_css(remote_video_selector, wait: 10)
+ expect(live_media_track_count(remote_video_selector, timeout: 10)).to eq(1)
+ expect(live_media_track_live?(remote_video_selector, timeout: 10)).to eq(true)
+ end
+ end
+ end
+
+ context "with a stage room" do
+ fab!(:stage_room) do
+ Fabricate(
+ :live_room,
+ name: "Stage Room",
+ creator: user,
+ public: true,
+ room_type: Live::Room::ROOM_TYPE_STAGE,
+ )
+ end
+
+ before { other_user.activate }
+
+ it "lets a joined moderator publish camera video while a listener gets no capture buttons" do
+ using_session(:moderator) do
+ sign_in(user)
+ install_live_fake_media
+
+ visit("/live/r/#{stage_room.slug}")
+ click_button(I18n.t("js.live.room.join"))
+
+ # Stage rooms feature the presenter by default instead of the grid.
+ expect(page).to have_css(".live-room-page.--presentation")
+
+ expect(page).to have_button(I18n.t("js.live.video.camera_on"))
+ click_button(I18n.t("js.live.video.camera_on"))
+
+ video_selector =
+ ".live-video-tile.--video[data-user-id='#{user.id}'] video.live-video-tile__video"
+ expect(page).to have_css(video_selector)
+ expect(live_media_track_count(video_selector)).to eq(1)
+ end
+
+ using_session(:listener) do
+ sign_in(other_user)
+ install_live_fake_media
+
+ visit("/live/r/#{stage_room.slug}")
+ click_button(I18n.t("js.live.room.join"))
+ expect(page).to have_css(".live-room-page__leave")
+
+ expect(page).to have_css(".live-room-page.--presentation")
+ expect(page).to have_no_button(I18n.t("js.live.video.camera_on"))
+ expect(page).to have_no_button(I18n.t("js.live.video.screen_share_start"))
+ end
+ end
+ end
+
+ context "as admin" do
+ before do
+ admin.activate
+ sign_in(admin)
+ end
+
+ it "shows live rooms section when rooms exist" do
+ Fabricate(:live_room, name: "Admin Room", creator: admin, public: true)
+
+ visit("/latest")
+
+ expect(live_sidebar).to be_visible
+ end
+ end
+
+ context "when user is not in create room groups" do
+ fab!(:low_trust_user) { Fabricate(:user, trust_level: TrustLevel[0]) }
+
+ before do
+ low_trust_user.activate
+ SiteSetting.live_create_room_allowed_groups = "#{Group::AUTO_GROUPS[:trust_level_2]}"
+ sign_in(low_trust_user)
+ end
+
+ it "shows public rooms but hides private rooms" do
+ public_room = Fabricate(:live_room, name: "Public Room", creator: admin, public: true)
+ private_room = Fabricate(:live_room, name: "Private Room", creator: admin, public: false)
+
+ visit("/latest")
+
+ expect(live_sidebar).to be_visible
+ expect(live_sidebar).to have_room(public_room.name)
+ expect(live_sidebar).to have_no_room(private_room.name)
+ end
+ end
+ end
+end
diff --git a/plugins/live/spec/system/live_stage_speak_queue_spec.rb b/plugins/live/spec/system/live_stage_speak_queue_spec.rb
new file mode 100644
index 00000000000..f8cd18f3cd2
--- /dev/null
+++ b/plugins/live/spec/system/live_stage_speak_queue_spec.rb
@@ -0,0 +1,145 @@
+# frozen_string_literal: true
+
+require_relative "../support/live_fake_media"
+
+# NOTE: outside CI, core pins every test browser to one fixed
+# --remote-debugging-port, so these two-session specs need CI=1 in the
+# environment to launch the second browser locally.
+describe "Live stage speak queue" do
+ fab!(:moderator, :user)
+ fab!(:listener, :user)
+ fab!(:room) do
+ Fabricate(
+ :live_room,
+ name: "Stage Room",
+ creator: moderator,
+ public: true,
+ room_type: Live::Room::ROOM_TYPE_STAGE,
+ )
+ end
+
+ let(:toasts) { PageObjects::Components::Toasts.new }
+
+ before do
+ moderator.activate
+ listener.activate
+ SiteSetting.live_enabled = true
+ SiteSetting.live_mesh_privacy_warning_enabled = false
+ SiteSetting.live_allowed_groups =
+ "#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
+ end
+
+ def join_room(user)
+ sign_in(user)
+ install_live_fake_media
+ visit("/live/r/#{room.slug}")
+ click_button(I18n.t("js.live.room.join"))
+ expect(page).to have_css(".live-room-page__leave")
+ end
+
+ def open_speak_queue
+ find("button[data-identifier='live-speak-queue-menu']").click
+ end
+
+ def speak_queue_menu
+ ".fk-d-menu[data-identifier='live-speak-queue-menu']"
+ end
+
+ it "promotes the listener to speaker when a moderator approves their request" do
+ using_session(:alice) { join_room(moderator) }
+
+ using_session(:bob) do
+ join_room(listener)
+
+ expect(page).to have_css(".live-call-controls__raise-hand")
+ find(".live-call-controls__raise-hand").click
+ expect(page).to have_css(".live-call-controls__raise-hand.--active")
+ end
+
+ using_session(:alice) do
+ expect(page).to have_css(".live-speak-queue-trigger__count", text: "1", wait: 10)
+ expect(page).to have_css(
+ ".sidebar-section[data-section-name='live-rooms'] .live-participant-suffix .d-icon-hand",
+ )
+
+ open_speak_queue
+ within(speak_queue_menu) do
+ expect(page).to have_css(".live-speak-queue__item", text: listener.username)
+ expect(page).to have_css(".live-speak-queue__position", text: "1")
+ find(".live-speak-queue__approve").click
+ end
+ end
+
+ using_session(:bob) do
+ expect(toasts).to have_success(I18n.t("js.live.stage.promoted_to_speaker"))
+ expect(page).to have_no_css(".live-call-controls__raise-hand")
+ expect(page).to have_button(I18n.t("js.live.video.camera_on"))
+ end
+
+ using_session(:alice) do
+ within(speak_queue_menu) { expect(page).to have_css(".live-speak-queue__empty") }
+ expect(page).to have_no_css(".live-speak-queue-trigger__count")
+ end
+ end
+
+ it "lets the listener raise their hand again after a moderator dismisses the request" do
+ using_session(:alice) { join_room(moderator) }
+
+ using_session(:bob) do
+ join_room(listener)
+
+ find(".live-call-controls__raise-hand").click
+ expect(page).to have_css(".live-call-controls__raise-hand.--active")
+ end
+
+ using_session(:alice) do
+ expect(page).to have_css(".live-speak-queue-trigger__count", text: "1", wait: 10)
+
+ open_speak_queue
+ within(speak_queue_menu) do
+ find(".live-speak-queue__dismiss").click
+ expect(page).to have_css(".live-speak-queue__empty")
+ end
+ expect(page).to have_no_css(".live-speak-queue-trigger__count")
+ end
+
+ using_session(:bob) do
+ expect(toasts).to have_default(I18n.t("js.live.stage.request_dismissed"))
+ expect(page).to have_css(".live-call-controls__raise-hand:not(.--active)")
+
+ find(".live-call-controls__raise-hand").click
+ expect(page).to have_css(".live-call-controls__raise-hand.--active")
+ end
+
+ using_session(:alice) do
+ expect(page).to have_css(".live-speak-queue-trigger__count", text: "1", wait: 10)
+ end
+ end
+
+ it "clears the moderator's queue when the listener lowers their own hand" do
+ using_session(:alice) { join_room(moderator) }
+
+ using_session(:bob) do
+ join_room(listener)
+
+ find(".live-call-controls__raise-hand").click
+ expect(page).to have_css(".live-call-controls__raise-hand.--active")
+ end
+
+ using_session(:alice) do
+ expect(page).to have_css(".live-speak-queue-trigger__count", text: "1", wait: 10)
+ end
+
+ using_session(:bob) do
+ find(".live-call-controls__raise-hand.--active").click
+ expect(page).to have_css(".live-call-controls__raise-hand:not(.--active)")
+ end
+
+ using_session(:alice) do
+ expect(page).to have_no_css(".live-speak-queue-trigger__count", wait: 10)
+
+ open_speak_queue
+ within(speak_queue_menu) { expect(page).to have_css(".live-speak-queue__empty") }
+ end
+ end
+end
diff --git a/plugins/live/spec/system/live_subtitles_spec.rb b/plugins/live/spec/system/live_subtitles_spec.rb
new file mode 100644
index 00000000000..773f45c0389
--- /dev/null
+++ b/plugins/live/spec/system/live_subtitles_spec.rb
@@ -0,0 +1,88 @@
+# frozen_string_literal: true
+
+require_relative "../support/live_fake_media"
+
+describe "Live subtitles" do
+ fab!(:user)
+ fab!(:admin)
+ fab!(:room) { Fabricate(:live_room, name: "Live Room", creator: admin, public: true) }
+
+ before do
+ user.activate
+ SiteSetting.live_enabled = true
+ SiteSetting.live_mesh_privacy_warning_enabled = false
+ SiteSetting.live_allowed_groups =
+ "#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
+ sign_in(user)
+ install_live_fake_media
+ end
+
+ def stub_webgpu
+ page.driver.with_playwright_page do |playwright_page|
+ playwright_page.add_init_script(script: <<~JS)
+ if (!navigator.gpu) {
+ Object.defineProperty(navigator, "gpu", { configurable: true, value: {} });
+ }
+ JS
+ end
+ end
+
+ def join_room
+ visit("/live/r/#{room.slug}")
+ click_button(I18n.t("js.live.room.join"))
+ expect(page).to have_css(".live-room-page__leave")
+ end
+
+ def open_voice_settings
+ find("button[data-identifier='live-audio-menu']").click
+ within(".fk-d-menu[data-identifier='live-audio-menu']") do
+ click_button(I18n.t("js.live.voice_settings.audio_settings"))
+ end
+ expect(page).to have_css(".live-voice-settings-modal")
+ end
+
+ it "hides the subtitles toggle when the site setting is off" do
+ SiteSetting.live_subtitles_enabled = false
+ stub_webgpu
+ join_room
+ open_voice_settings
+
+ within(".live-voice-settings") do
+ expect(page).to have_no_content(I18n.t("js.live.voice_settings.subtitles"))
+ end
+ end
+
+ it "offers the subtitles toggle and enables the caption overlay" do
+ SiteSetting.live_subtitles_enabled = true
+ stub_webgpu
+ join_room
+ open_voice_settings
+
+ within(".live-voice-settings") do
+ expect(page).to have_content(I18n.t("js.live.voice_settings.subtitles"))
+ end
+
+ toggle = PageObjects::Components::DToggleSwitch.new(".live-voice-settings__subtitles-toggle")
+ toggle.toggle
+ expect(toggle.checked?).to eq(true)
+
+ find(".modal-close").click
+ expect(page).to have_css(".live-captions", visible: :all)
+ end
+
+ it "lets the user pick the smaller subtitles model" do
+ SiteSetting.live_subtitles_enabled = true
+ stub_webgpu
+ join_room
+ open_voice_settings
+
+ select = PageObjects::Components::SelectKit.new(".live-voice-settings__subtitles-model-select")
+ expect(select).to have_selected_name(I18n.t("js.live.voice_settings.subtitles_models.ultra"))
+
+ select.expand
+ select.select_row_by_value("redux")
+
+ expect(select).to have_selected_name(I18n.t("js.live.voice_settings.subtitles_models.redux"))
+ expect(page.evaluate_script("localStorage.getItem('voice:stt-model')")).to eq("redux")
+ end
+end
diff --git a/plugins/live/spec/system/live_video_settings_spec.rb b/plugins/live/spec/system/live_video_settings_spec.rb
new file mode 100644
index 00000000000..761cc96a999
--- /dev/null
+++ b/plugins/live/spec/system/live_video_settings_spec.rb
@@ -0,0 +1,122 @@
+# frozen_string_literal: true
+
+require_relative "../support/live_fake_media"
+
+describe "Live video settings" do
+ fab!(:user)
+ fab!(:admin)
+ fab!(:room) { Fabricate(:live_room, name: "Video Room", creator: admin, public: true) }
+
+ let(:camera_select) do
+ PageObjects::Components::SelectKit.new(".live-video-settings__camera-select")
+ end
+
+ before do
+ user.activate
+ SiteSetting.live_enabled = true
+ SiteSetting.live_mesh_privacy_warning_enabled = false
+ SiteSetting.live_allowed_groups =
+ "#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
+ sign_in(user)
+ install_live_fake_media
+ end
+
+ def join_room
+ visit("/live/r/#{room.slug}")
+ click_button(I18n.t("js.live.room.join"))
+ expect(page).to have_css(".live-room-page__leave")
+ end
+
+ def open_video_menu
+ find("button[data-identifier='live-video-menu']").click
+ expect(page).to have_css(".fk-d-menu[data-identifier='live-video-menu']")
+ end
+
+ def open_video_settings
+ open_video_menu
+ within(".fk-d-menu[data-identifier='live-video-menu']") do
+ click_button(I18n.t("js.live.video_settings.title"))
+ end
+ expect(page).to have_css(".live-video-settings-modal")
+ end
+
+ it "hides the screen share button from groups not allowed to share a screen" do
+ SiteSetting.live_screen_share_allowed_groups = ""
+
+ join_room
+
+ expect(page).to have_button(I18n.t("js.live.video.camera_on"))
+ expect(page).to have_no_button(I18n.t("js.live.video.screen_share_start"))
+ end
+
+ it "hides the camera button from groups not allowed to share a camera" do
+ SiteSetting.live_video_allowed_groups = ""
+
+ join_room
+
+ expect(page).to have_button(I18n.t("js.live.video.screen_share_start"))
+ expect(page).to have_no_button(I18n.t("js.live.video.camera_on"))
+ end
+
+ it "offers voice and video settings from the call menus" do
+ join_room
+
+ find("button[data-identifier='live-audio-menu']").click
+ within(".fk-d-menu[data-identifier='live-audio-menu']") do
+ expect(page).to have_button(I18n.t("js.live.voice_settings.audio_settings"))
+ end
+ find("button[data-identifier='live-audio-menu']").click
+
+ open_video_menu
+ within(".fk-d-menu[data-identifier='live-video-menu']") do
+ expect(page).to have_button(I18n.t("js.live.video_settings.title"))
+ end
+ end
+
+ it "shows a camera preview and lists camera devices" do
+ join_room
+ open_video_settings
+
+ expect(page).to have_css(".live-video-settings__preview video")
+ expect(live_media_track_live?(".live-video-settings__preview video")).to eq(true)
+
+ camera_select.expand
+ expect(camera_select).to have_option_name("Live fake camera A")
+ expect(camera_select).to have_option_name("Live fake camera B")
+ end
+
+ it "keeps the published camera live after switching devices" do
+ join_room
+ click_button(I18n.t("js.live.video.camera_on"))
+
+ video_selector =
+ ".live-video-tile.--video[data-user-id='#{user.id}'] video.live-video-tile__video"
+ expect(page).to have_css(video_selector)
+
+ open_video_settings
+ camera_select.expand
+ camera_select.select_row_by_name("Live fake camera B")
+
+ expect(camera_select).to have_selected_name("Live fake camera B")
+ expect(live_media_track_live?(video_selector)).to eq(true)
+ end
+
+ it "shows the background blur toggle when the setting is enabled" do
+ join_room
+ open_video_settings
+
+ within(".live-video-settings") { expect(page).to have_css(".d-toggle-switch") }
+ end
+
+ it "hides background blur when the site setting is disabled" do
+ SiteSetting.live_video_background_blur_enabled = false
+
+ join_room
+ open_video_settings
+
+ within(".live-video-settings") do
+ expect(page).to have_css(".live-video-settings__camera-select")
+ expect(page).to have_no_css(".d-toggle-switch")
+ end
+ end
+end
diff --git a/plugins/voice/spec/system/page_objects/components/voice_back_to_voice_room.rb b/plugins/live/spec/system/page_objects/components/live_back_to_live_room.rb
similarity index 73%
rename from plugins/voice/spec/system/page_objects/components/voice_back_to_voice_room.rb
rename to plugins/live/spec/system/page_objects/components/live_back_to_live_room.rb
index d03b3b9f4f7..70305ef1fa3 100644
--- a/plugins/voice/spec/system/page_objects/components/voice_back_to_voice_room.rb
+++ b/plugins/live/spec/system/page_objects/components/live_back_to_live_room.rb
@@ -2,8 +2,8 @@
module PageObjects
module Components
- class VoiceBackToVoiceRoom < PageObjects::Components::Base
- SELECTOR = ".c-navbar__back-to-voice-room"
+ class LiveBackToLiveRoom < PageObjects::Components::Base
+ SELECTOR = ".c-navbar__back-to-live-room"
def has_back_to_room_button?
has_css?(SELECTOR)
diff --git a/plugins/voice/spec/system/page_objects/components/voice_sidebar.rb b/plugins/live/spec/system/page_objects/components/live_sidebar.rb
similarity index 60%
rename from plugins/voice/spec/system/page_objects/components/voice_sidebar.rb
rename to plugins/live/spec/system/page_objects/components/live_sidebar.rb
index fdf637f2ef4..4838c34bcc7 100644
--- a/plugins/voice/spec/system/page_objects/components/voice_sidebar.rb
+++ b/plugins/live/spec/system/page_objects/components/live_sidebar.rb
@@ -2,12 +2,12 @@
module PageObjects
module Components
- class VoiceSidebar < PageObjects::Components::Base
- ROOM_LINK_SELECTOR = ".sidebar-section-link.voice-sidebar-link"
+ class LiveSidebar < PageObjects::Components::Base
+ ROOM_LINK_SELECTOR = ".sidebar-section-link.live-sidebar-link"
attr_reader :section_selector
- def initialize(section_name: "voice-rooms")
+ def initialize(section_name: "live-rooms")
@section_selector = ".sidebar-section[data-section-name='#{section_name}']"
end
@@ -28,15 +28,15 @@ module PageObjects
end
def room_link(room_id)
- find("#{ROOM_LINK_SELECTOR}[data-link-name='voice-room-#{room_id}']")
+ find("#{ROOM_LINK_SELECTOR}[data-link-name='live-room-#{room_id}']")
end
def has_room_link?(room_id)
- page.has_css?("#{ROOM_LINK_SELECTOR}[data-link-name='voice-room-#{room_id}']")
+ page.has_css?("#{ROOM_LINK_SELECTOR}[data-link-name='live-room-#{room_id}']")
end
def has_no_room_link?(room_id)
- page.has_no_css?("#{ROOM_LINK_SELECTOR}[data-link-name='voice-room-#{room_id}']")
+ page.has_no_css?("#{ROOM_LINK_SELECTOR}[data-link-name='live-room-#{room_id}']")
end
def click_room(room_id)
@@ -46,31 +46,31 @@ module PageObjects
def has_active_room?(room_id)
page.has_css?(
- "#{ROOM_LINK_SELECTOR}[data-link-name='voice-room-#{room_id}'].sidebar-section-link--active",
+ "#{ROOM_LINK_SELECTOR}[data-link-name='live-room-#{room_id}'].sidebar-section-link--active",
)
end
def has_no_active_room?(room_id)
page.has_no_css?(
- "#{ROOM_LINK_SELECTOR}[data-link-name='voice-room-#{room_id}'].sidebar-section-link--active",
+ "#{ROOM_LINK_SELECTOR}[data-link-name='live-room-#{room_id}'].sidebar-section-link--active",
)
end
def has_participants?(room_id)
page.has_css?(
- "#{ROOM_LINK_SELECTOR}[data-link-name='voice-room-#{room_id}'] .voice-sidebar-link__participants",
+ "#{ROOM_LINK_SELECTOR}[data-link-name='live-room-#{room_id}'] .live-sidebar-link__participants",
)
end
def has_no_participants?(room_id)
page.has_no_css?(
- "#{ROOM_LINK_SELECTOR}[data-link-name='voice-room-#{room_id}'] .voice-sidebar-link__participants",
+ "#{ROOM_LINK_SELECTOR}[data-link-name='live-room-#{room_id}'] .live-sidebar-link__participants",
)
end
def has_speaking_indicator?(room_id)
page.has_css?(
- "#{ROOM_LINK_SELECTOR}[data-link-name='voice-room-#{room_id}'] .voice-sidebar-link__avatar--speaking",
+ "#{ROOM_LINK_SELECTOR}[data-link-name='live-room-#{room_id}'] .live-sidebar-link__avatar--speaking",
)
end
diff --git a/plugins/live/spec/system/voice_settings_spec.rb b/plugins/live/spec/system/voice_settings_spec.rb
new file mode 100644
index 00000000000..19cae5084e1
--- /dev/null
+++ b/plugins/live/spec/system/voice_settings_spec.rb
@@ -0,0 +1,90 @@
+# frozen_string_literal: true
+
+require_relative "../support/live_fake_media"
+
+describe "Voice settings" do
+ fab!(:user)
+ fab!(:admin)
+ fab!(:room) { Fabricate(:live_room, name: "Live Room", creator: admin, public: true) }
+
+ before do
+ user.activate
+ SiteSetting.live_enabled = true
+ SiteSetting.live_mesh_privacy_warning_enabled = false
+ SiteSetting.live_allowed_groups =
+ "#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
+ sign_in(user)
+ install_live_fake_media
+ end
+
+ def join_room
+ visit("/live/r/#{room.slug}")
+ click_button(I18n.t("js.live.room.join"))
+ expect(page).to have_css(".live-room-page__leave")
+ end
+
+ def open_voice_settings
+ find("button[data-identifier='live-audio-menu']").click
+ within(".fk-d-menu[data-identifier='live-audio-menu']") do
+ click_button(I18n.t("js.live.voice_settings.audio_settings"))
+ end
+ expect(page).to have_css(".live-voice-settings-modal")
+ end
+
+ it "offers the audio processing controls" do
+ join_room
+ open_voice_settings
+
+ within(".live-voice-settings") do
+ expect(page).to have_css(".live-voice-settings__noise-suppression-select")
+ expect(page).to have_content(I18n.t("js.live.voice_settings.echo_cancellation"))
+ expect(page).to have_content(I18n.t("js.live.voice_settings.auto_gain_control"))
+ end
+ end
+
+ it "toggles echo cancellation and automatic gain control" do
+ join_room
+ open_voice_settings
+
+ ec_toggle =
+ PageObjects::Components::DToggleSwitch.new(".live-voice-settings__echo-cancellation-toggle")
+ agc_toggle =
+ PageObjects::Components::DToggleSwitch.new(".live-voice-settings__auto-gain-toggle")
+
+ expect(ec_toggle.checked?).to eq(true)
+ expect(agc_toggle.checked?).to eq(true)
+
+ ec_toggle.toggle
+ expect(ec_toggle.unchecked?).to eq(true)
+ expect(agc_toggle.checked?).to eq(true)
+ end
+
+ # These run the real engine pipelines (wasm fetch, worklet ready
+ # handshake), so the "AI" assertions only pass once the filter is genuinely
+ # running — the modal spec covers DTLN, the submenu spec covers RNNoise.
+ it "enables AI noise cancellation from the voice settings modal and shows the mic badge" do
+ join_room
+ open_voice_settings
+
+ mode_select =
+ PageObjects::Components::SelectKit.new(".live-voice-settings__noise-suppression-select")
+ mode_select.expand
+ mode_select.select_row_by_value("ai:dtln")
+
+ expect(page).to have_css(".live-call-controls__ns-badge", wait: 15)
+ end
+
+ it "enables AI noise cancellation from the mic dropdown submenu" do
+ join_room
+
+ find("button[data-identifier='live-audio-menu']").click
+ within(".fk-d-menu[data-identifier='live-audio-menu']") do
+ click_button(I18n.t("js.live.voice_settings.noise_suppression"))
+ end
+ within(".fk-d-menu[data-identifier='live-call-submenu']") do
+ click_button(I18n.t("js.live.voice_settings.noise_suppression_modes.ai_rnnoise"))
+ end
+
+ expect(page).to have_css(".live-call-controls__ns-badge", wait: 15)
+ end
+end
diff --git a/plugins/voice/spec/validators/voice_livekit_policy_validator_spec.rb b/plugins/live/spec/validators/live_livekit_policy_validator_spec.rb
similarity index 57%
rename from plugins/voice/spec/validators/voice_livekit_policy_validator_spec.rb
rename to plugins/live/spec/validators/live_livekit_policy_validator_spec.rb
index 93d1760b548..d6bf01a321d 100644
--- a/plugins/voice/spec/validators/voice_livekit_policy_validator_spec.rb
+++ b/plugins/live/spec/validators/live_livekit_policy_validator_spec.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-RSpec.describe VoiceLivekitPolicyValidator do
+RSpec.describe LiveLivekitPolicyValidator do
subject(:validator) { described_class.new }
it "always accepts the disabled policy, even unconfigured" do
@@ -8,46 +8,46 @@ RSpec.describe VoiceLivekitPolicyValidator do
end
it "accepts a non-disabled policy when fully configured" do
- SiteSetting.voice_livekit_url = "wss://livekit.example.com"
- SiteSetting.voice_livekit_api_key = "lk_api_key"
- SiteSetting.voice_livekit_api_secret = "lk_api_secret"
+ SiteSetting.live_livekit_url = "wss://livekit.example.com"
+ SiteSetting.live_livekit_api_key = "lk_api_key"
+ SiteSetting.live_livekit_api_secret = "lk_api_secret"
expect(validator.valid_value?("per_room")).to eq(true)
expect(validator.valid_value?("all_rooms")).to eq(true)
end
it "rejects a non-disabled policy when the url is blank or invalid" do
- SiteSetting.voice_livekit_api_key = "lk_api_key"
- SiteSetting.voice_livekit_api_secret = "lk_api_secret"
+ SiteSetting.live_livekit_api_key = "lk_api_key"
+ SiteSetting.live_livekit_api_secret = "lk_api_secret"
expect(validator.valid_value?("per_room")).to eq(false)
# An invalid stored value (the URL validator refuses assignments, so this
# can only be pre-existing data) still blocks policy activation.
- SiteSetting.stubs(:voice_livekit_url).returns("https://livekit.example.com")
+ SiteSetting.stubs(:live_livekit_url).returns("https://livekit.example.com")
expect(validator.valid_value?("per_room")).to eq(false)
expect(validator.error_message).to eq(
- I18n.t("site_settings.errors.voice_livekit_policy_requires_url"),
+ I18n.t("site_settings.errors.live_livekit_policy_requires_url"),
)
end
it "rejects a non-disabled policy when the api key is missing" do
- SiteSetting.voice_livekit_url = "wss://livekit.example.com"
- SiteSetting.voice_livekit_api_secret = "lk_api_secret"
+ SiteSetting.live_livekit_url = "wss://livekit.example.com"
+ SiteSetting.live_livekit_api_secret = "lk_api_secret"
expect(validator.valid_value?("all_rooms")).to eq(false)
expect(validator.error_message).to eq(
- I18n.t("site_settings.errors.voice_livekit_policy_requires_api_key"),
+ I18n.t("site_settings.errors.live_livekit_policy_requires_api_key"),
)
end
it "rejects a non-disabled policy when the api secret is missing" do
- SiteSetting.voice_livekit_url = "ws://livekit.internal:7880"
- SiteSetting.voice_livekit_api_key = "lk_api_key"
+ SiteSetting.live_livekit_url = "ws://livekit.internal:7880"
+ SiteSetting.live_livekit_api_key = "lk_api_key"
expect(validator.valid_value?("all_rooms")).to eq(false)
expect(validator.error_message).to eq(
- I18n.t("site_settings.errors.voice_livekit_policy_requires_api_secret"),
+ I18n.t("site_settings.errors.live_livekit_policy_requires_api_secret"),
)
end
end
diff --git a/plugins/live/spec/validators/live_livekit_recording_s3_bucket_validator_spec.rb b/plugins/live/spec/validators/live_livekit_recording_s3_bucket_validator_spec.rb
new file mode 100644
index 00000000000..5c46706c4c3
--- /dev/null
+++ b/plugins/live/spec/validators/live_livekit_recording_s3_bucket_validator_spec.rb
@@ -0,0 +1,69 @@
+# frozen_string_literal: true
+
+RSpec.describe LiveLivekitRecordingS3BucketValidator do
+ subject(:validator) { described_class.new }
+
+ before do
+ SiteSetting.live_livekit_url = "wss://livekit.example.com"
+ SiteSetting.live_livekit_recording_s3_access_key_id = "recording-access-key"
+ SiteSetting.live_livekit_recording_s3_secret_access_key = "recording-secret-key"
+ end
+
+ it "accepts an empty bucket for self-hosted storage" do
+ SiteSetting.live_livekit_recording_s3_secret_access_key = ""
+
+ expect(validator.valid_value?("")).to eq(true)
+ end
+
+ it "accepts a bucket when the recording credentials and region are configured" do
+ expect(validator.valid_value?("live-recordings")).to eq(true)
+ end
+
+ it "validates the configured bucket name regex when saving the setting" do
+ ["live-recordings/folder", "Live-recordings", "ab", "a" * 64].each do |bucket|
+ expect { SiteSetting.live_livekit_recording_s3_bucket = bucket }.to raise_error(
+ Discourse::InvalidParameters,
+ "live_livekit_recording_s3_bucket: #{I18n.t("site_settings.errors.regex_mismatch")}",
+ )
+ end
+
+ SiteSetting.live_livekit_recording_s3_bucket = "live-recordings"
+ expect(SiteSetting.live_livekit_recording_s3_bucket).to eq("live-recordings")
+
+ SiteSetting.live_livekit_recording_s3_bucket = ""
+ expect(SiteSetting.live_livekit_recording_s3_bucket).to eq("")
+ end
+
+ it "requires both recording credentials" do
+ SiteSetting.live_livekit_recording_s3_access_key_id = ""
+ expect(validator.valid_value?("live-recordings")).to eq(false)
+
+ SiteSetting.live_livekit_recording_s3_access_key_id = "recording-access-key"
+ SiteSetting.live_livekit_recording_s3_secret_access_key = ""
+ expect(validator.valid_value?("live-recordings")).to eq(false)
+ expect(validator.error_message).to eq(
+ I18n.t("site_settings.errors.live_livekit_recording_s3_requires_credentials"),
+ )
+ end
+
+ it "requires a region unless a custom endpoint is configured" do
+ SiteSetting.live_livekit_recording_s3_region = ""
+
+ expect(validator.valid_value?("live-recordings")).to eq(false)
+ expect(validator.error_message).to eq(
+ I18n.t("site_settings.errors.live_livekit_recording_s3_requires_region"),
+ )
+
+ SiteSetting.live_livekit_recording_s3_endpoint = "https://storage.example.com"
+ expect(validator.valid_value?("live-recordings")).to eq(true)
+ end
+
+ it "requires an encrypted connection to LiveKit" do
+ SiteSetting.live_livekit_url = "ws://livekit.example.com"
+
+ expect(validator.valid_value?("live-recordings")).to eq(false)
+ expect(validator.error_message).to eq(
+ I18n.t("site_settings.errors.live_livekit_recording_s3_requires_wss"),
+ )
+ end
+end
diff --git a/plugins/voice/spec/validators/voice_livekit_url_validator_spec.rb b/plugins/live/spec/validators/live_livekit_url_validator_spec.rb
similarity index 85%
rename from plugins/voice/spec/validators/voice_livekit_url_validator_spec.rb
rename to plugins/live/spec/validators/live_livekit_url_validator_spec.rb
index 944cab0b5b1..73e0de15455 100644
--- a/plugins/voice/spec/validators/voice_livekit_url_validator_spec.rb
+++ b/plugins/live/spec/validators/live_livekit_url_validator_spec.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-RSpec.describe VoiceLivekitUrlValidator do
+RSpec.describe LiveLivekitUrlValidator do
subject(:validator) { described_class.new }
it "accepts a blank value" do
@@ -21,9 +21,7 @@ RSpec.describe VoiceLivekitUrlValidator do
"not a url",
].each do |value|
expect(validator.valid_value?(value)).to eq(false)
- expect(validator.error_message).to eq(
- I18n.t("site_settings.errors.voice_livekit_url_invalid"),
- )
+ expect(validator.error_message).to eq(I18n.t("site_settings.errors.live_livekit_url_invalid"))
end
end
@@ -33,7 +31,7 @@ RSpec.describe VoiceLivekitUrlValidator do
expect(validator.valid_value?("wss://livekit.example.com")).to eq(true)
expect(validator.valid_value?("ws://livekit.example.com")).to eq(false)
expect(validator.error_message).to eq(
- I18n.t("site_settings.errors.voice_livekit_url_requires_wss"),
+ I18n.t("site_settings.errors.live_livekit_url_requires_wss"),
)
end
diff --git a/plugins/voice/spec/validators/voice_turn_secret_servers_validator_spec.rb b/plugins/live/spec/validators/live_turn_secret_servers_validator_spec.rb
similarity index 75%
rename from plugins/voice/spec/validators/voice_turn_secret_servers_validator_spec.rb
rename to plugins/live/spec/validators/live_turn_secret_servers_validator_spec.rb
index 1a5945be9bd..acd998930b2 100644
--- a/plugins/voice/spec/validators/voice_turn_secret_servers_validator_spec.rb
+++ b/plugins/live/spec/validators/live_turn_secret_servers_validator_spec.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-RSpec.describe VoiceTurnSecretServersValidator do
+RSpec.describe LiveTurnSecretServersValidator do
subject(:validator) { described_class.new }
it "always accepts a blank value" do
@@ -9,7 +9,7 @@ RSpec.describe VoiceTurnSecretServersValidator do
end
it "accepts server urls when the TURN secret is configured" do
- SiteSetting.voice_turn_secret = "coturn-shared-secret"
+ SiteSetting.live_turn_secret = "coturn-shared-secret"
expect(validator.valid_value?("turn:coturn.example.com:3478")).to eq(true)
end
@@ -17,7 +17,7 @@ RSpec.describe VoiceTurnSecretServersValidator do
it "rejects server urls when the TURN secret is blank" do
expect(validator.valid_value?("turn:coturn.example.com:3478")).to eq(false)
expect(validator.error_message).to eq(
- I18n.t("site_settings.errors.voice_turn_secret_servers_requires_secret"),
+ I18n.t("site_settings.errors.live_turn_secret_servers_requires_secret"),
)
end
end
diff --git a/plugins/voice/test/javascripts/acceptance/voice-admin-rooms-test.gjs b/plugins/live/test/javascripts/acceptance/live-admin-rooms-test.gjs
similarity index 57%
rename from plugins/voice/test/javascripts/acceptance/voice-admin-rooms-test.gjs
rename to plugins/live/test/javascripts/acceptance/live-admin-rooms-test.gjs
index 0943a1f108d..e1b7db411e8 100644
--- a/plugins/voice/test/javascripts/acceptance/voice-admin-rooms-test.gjs
+++ b/plugins/live/test/javascripts/acceptance/live-admin-rooms-test.gjs
@@ -2,9 +2,9 @@ import { click, fillIn, visit } from "@ember/test-helpers";
import { test } from "qunit";
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
-acceptance("Voice | Admin rooms", function (needs) {
+acceptance("Live | Admin rooms", function (needs) {
needs.user({ admin: true });
- needs.settings({ voice_enabled: true, chat_enabled: false });
+ needs.settings({ live_enabled: true, chat_enabled: false });
let rooms = [];
@@ -13,28 +13,28 @@ acceptance("Voice | Admin rooms", function (needs) {
});
needs.pretender((server, helper) => {
- server.get("/admin/plugins/voice.json", () =>
+ server.get("/admin/plugins/live.json", () =>
helper.response({
- id: "voice",
- name: "voice",
+ id: "live",
+ name: "live",
enabled: true,
has_settings: true,
- humanized_name: "Voice",
+ humanized_name: "Live",
admin_route: {
- label: "voice.admin.title",
- location: "voice",
+ label: "live.admin.title",
+ location: "live",
use_new_show_route: true,
},
})
);
- server.get("/voice/rooms.json", () => helper.response({ rooms: [] }));
+ server.get("/live/rooms.json", () => helper.response({ rooms: [] }));
- server.get("/admin/plugins/voice/rooms.json", () =>
+ server.get("/admin/plugins/live/rooms.json", () =>
helper.response({ rooms })
);
- server.post("/admin/plugins/voice/rooms.json", (request) => {
+ server.post("/admin/plugins/live/rooms.json", (request) => {
const room = {
...JSON.parse(request.requestBody).room,
id: 42,
@@ -47,13 +47,13 @@ acceptance("Voice | Admin rooms", function (needs) {
});
test("room name links to the edit page after creating a room", async function (assert) {
- await visit("/admin/plugins/voice/voice-rooms");
- await click(".voice-admin__create-btn");
+ await visit("/admin/plugins/live/live-rooms");
+ await click(".live-admin__create-btn");
await fillIn("input[name='name']", "Lounge");
await click(".form-kit__button.btn-primary");
assert
- .dom(".voice-rooms__name-link")
- .hasAttribute("href", "/admin/plugins/voice/voice-rooms/42");
+ .dom(".live-rooms__name-link")
+ .hasAttribute("href", "/admin/plugins/live/live-rooms/42");
});
});
diff --git a/plugins/voice/test/javascripts/acceptance/voice-anon-sidebar-test.gjs b/plugins/live/test/javascripts/acceptance/live-anon-sidebar-test.gjs
similarity index 77%
rename from plugins/voice/test/javascripts/acceptance/voice-anon-sidebar-test.gjs
rename to plugins/live/test/javascripts/acceptance/live-anon-sidebar-test.gjs
index 6189d1c0486..648c1b90241 100644
--- a/plugins/voice/test/javascripts/acceptance/voice-anon-sidebar-test.gjs
+++ b/plugins/live/test/javascripts/acceptance/live-anon-sidebar-test.gjs
@@ -2,12 +2,12 @@ import { visit } from "@ember/test-helpers";
import { test } from "qunit";
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
-acceptance("Voice anon sidebar", function (needs) {
- needs.settings({ voice_enabled: true });
- needs.site({ voice_public_access: true });
+acceptance("Live anon sidebar", function (needs) {
+ needs.settings({ live_enabled: true });
+ needs.site({ live_public_access: true });
needs.pretender((server, helper) => {
- server.get("/voice/rooms.json", () =>
+ server.get("/live/rooms.json", () =>
helper.response({
rooms: [
{
@@ -35,13 +35,13 @@ acceptance("Voice anon sidebar", function (needs) {
await visit("/latest");
assert
- .dom(".sidebar-section[data-section-name='voice-rooms']")
+ .dom(".sidebar-section[data-section-name='live-rooms']")
.exists("the rooms section is rendered");
assert
- .dom("[data-link-name='voice-room-1']")
+ .dom("[data-link-name='live-room-1']")
.hasText("Public room", "the public room link is rendered");
assert
- .dom("[data-link-name='voice-participant-1-2']")
+ .dom("[data-link-name='live-participant-1-2']")
.hasText("jane", "public room participants are rendered");
const sectionNames = [
@@ -55,7 +55,7 @@ acceptance("Voice anon sidebar", function (needs) {
"the standard navigation sections are rendered"
);
assert.true(
- sectionNames.indexOf("voice-rooms") > sectionNames.indexOf("categories"),
+ sectionNames.indexOf("live-rooms") > sectionNames.indexOf("categories"),
"rooms render after the standard navigation sections, as they do for logged-in users"
);
});
diff --git a/plugins/voice/test/javascripts/acceptance/voice-participant-menu-test.gjs b/plugins/live/test/javascripts/acceptance/live-participant-menu-test.gjs
similarity index 75%
rename from plugins/voice/test/javascripts/acceptance/voice-participant-menu-test.gjs
rename to plugins/live/test/javascripts/acceptance/live-participant-menu-test.gjs
index aa0c0c4edf6..63e97ca84c0 100644
--- a/plugins/voice/test/javascripts/acceptance/voice-participant-menu-test.gjs
+++ b/plugins/live/test/javascripts/acceptance/live-participant-menu-test.gjs
@@ -3,15 +3,15 @@ import { click, triggerEvent, visit } from "@ember/test-helpers";
import { test } from "qunit";
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
-const PARTICIPANT_ROW = "[data-link-name='voice-participant-1-2']";
-const MENU = ".fk-d-menu[data-identifier='voice-participant-menu']";
+const PARTICIPANT_ROW = "[data-link-name='live-participant-1-2']";
+const MENU = ".fk-d-menu[data-identifier='live-participant-menu']";
-acceptance("Voice participant context menu", function (needs) {
+acceptance("Live participant context menu", function (needs) {
needs.user();
- needs.settings({ voice_enabled: true });
+ needs.settings({ live_enabled: true });
needs.pretender((server, helper) => {
- server.get("/voice/rooms.json", () =>
+ server.get("/live/rooms.json", () =>
helper.response({
rooms: [
{
@@ -49,8 +49,8 @@ acceptance("Voice participant context menu", function (needs) {
});
test("offers the menu for a room the user is connected to", async function (assert) {
- const voiceWebrtc = getOwner(this).lookup("service:voice-webrtc");
- voiceWebrtc.connectionStateFor = () => "connected";
+ const liveWebrtc = getOwner(this).lookup("service:live-webrtc");
+ liveWebrtc.connectionStateFor = () => "connected";
await visit("/latest");
@@ -58,10 +58,10 @@ acceptance("Voice participant context menu", function (needs) {
assert.dom(MENU).exists("the participant menu opens");
assert
- .dom(".voice-participant-sidebar-context-menu__volume-slider")
+ .dom(".live-participant-sidebar-context-menu__volume-slider")
.exists("audio controls are available");
assert
- .dom(".voice-participant-sidebar-context-menu__spotlight-btn")
+ .dom(".live-participant-sidebar-context-menu__spotlight-btn")
.doesNotExist(
"page-only spotlight controls are not shown in the sidebar"
);
diff --git a/plugins/voice/test/javascripts/acceptance/voice-transcript-draft-icon-test.js b/plugins/live/test/javascripts/acceptance/live-transcript-draft-icon-test.js
similarity index 84%
rename from plugins/voice/test/javascripts/acceptance/voice-transcript-draft-icon-test.js
rename to plugins/live/test/javascripts/acceptance/live-transcript-draft-icon-test.js
index 2509f0068b6..b461590c7b4 100644
--- a/plugins/voice/test/javascripts/acceptance/voice-transcript-draft-icon-test.js
+++ b/plugins/live/test/javascripts/acceptance/live-transcript-draft-icon-test.js
@@ -5,19 +5,19 @@ import {
updateCurrentUser,
} from "discourse/tests/helpers/qunit-helpers";
-acceptance("Voice transcript draft icon", function (needs) {
+acceptance("Live transcript draft icon", function (needs) {
needs.user();
- needs.settings({ voice_enabled: true });
+ needs.settings({ live_enabled: true });
needs.pretender((server, helper) => {
- server.get("/voice/rooms.json", () =>
+ server.get("/live/rooms.json", () =>
helper.response({ rooms: [], can_create_room: false })
);
server.get("/drafts.json", () =>
helper.response({
drafts: [
{
- draft_key: "new_topic_voice_1_1756400000000",
+ draft_key: "new_topic_live_1_1756400000000",
data: '{"title":"Sala do Bar — transcript"}',
},
{ draft_key: "new_topic", data: '{"title":"A topic draft"}' },
diff --git a/plugins/voice/test/javascripts/acceptance/voice-widget-mode-test.js b/plugins/live/test/javascripts/acceptance/live-widget-mode-test.js
similarity index 72%
rename from plugins/voice/test/javascripts/acceptance/voice-widget-mode-test.js
rename to plugins/live/test/javascripts/acceptance/live-widget-mode-test.js
index 1d5d9d8c69a..be33bca985e 100644
--- a/plugins/voice/test/javascripts/acceptance/voice-widget-mode-test.js
+++ b/plugins/live/test/javascripts/acceptance/live-widget-mode-test.js
@@ -13,12 +13,12 @@ const ROOM = {
};
function stubRooms(needs) {
- needs.settings({ voice_enabled: true });
+ needs.settings({ live_enabled: true });
needs.pretender((server, helper) => {
- server.get("/voice/rooms.json", () =>
+ server.get("/live/rooms.json", () =>
helper.response({ rooms: [ROOM], can_create_room: false })
);
- server.get(`/voice/rooms/${ROOM.slug}.json`, () =>
+ server.get(`/live/rooms/${ROOM.slug}.json`, () =>
helper.response({ room: ROOM })
);
});
@@ -26,15 +26,15 @@ function stubRooms(needs) {
function stubJoin(context) {
const joined = [];
- const voiceWebrtc = getOwner(context).lookup("service:voice-webrtc");
- voiceWebrtc.join = (room) => {
+ const liveWebrtc = getOwner(context).lookup("service:live-webrtc");
+ liveWebrtc.join = (room) => {
joined.push(room.slug);
return Promise.resolve();
};
- return { joined, voiceWebrtc };
+ return { joined, liveWebrtc };
}
-acceptance("Voice room widget mode", function (needs) {
+acceptance("Live room widget mode", function (needs) {
needs.user();
stubRooms(needs);
@@ -43,7 +43,7 @@ acceptance("Voice room widget mode", function (needs) {
const { joined } = stubJoin(this);
try {
- await visit(`/voice/r/${ROOM.slug}?join=true&widget=true`);
+ await visit(`/live/r/${ROOM.slug}?join=true&widget=true`);
} catch (error) {
assert.strictEqual(
error.message,
@@ -59,7 +59,7 @@ acceptance("Voice room widget mode", function (needs) {
test("lands on the homepage when opened from a full page load", async function (assert) {
const { joined } = stubJoin(this);
- await visit(`/voice/r/${ROOM.slug}?join=true&widget=true`);
+ await visit(`/live/r/${ROOM.slug}?join=true&widget=true`);
assert.strictEqual(currentURL(), "/latest", "does not open the room page");
assert.deepEqual(joined, [ROOM.slug], "joins the room in the background");
@@ -68,7 +68,7 @@ acceptance("Voice room widget mode", function (needs) {
test("accepts a valueless widget param", async function (assert) {
const { joined } = stubJoin(this);
- await visit(`/voice/r/${ROOM.slug}?join=true&widget`);
+ await visit(`/live/r/${ROOM.slug}?join=true&widget`);
assert.strictEqual(currentURL(), "/latest", "does not open the room page");
assert.deepEqual(joined, [ROOM.slug], "joins the room in the background");
@@ -77,11 +77,11 @@ acceptance("Voice room widget mode", function (needs) {
test("ignores an explicitly falsy widget param", async function (assert) {
const { joined } = stubJoin(this);
- await visit(`/voice/r/${ROOM.slug}?widget=false`);
+ await visit(`/live/r/${ROOM.slug}?widget=false`);
assert.strictEqual(
currentURL(),
- `/voice/r/${ROOM.slug}?widget=false`,
+ `/live/r/${ROOM.slug}?widget=false`,
"opens the room page"
);
assert.deepEqual(joined, [], "does not join");
@@ -90,23 +90,23 @@ acceptance("Voice room widget mode", function (needs) {
test("needs a join to dock, so the widget param alone opens the room page", async function (assert) {
const { joined } = stubJoin(this);
- await visit(`/voice/r/${ROOM.slug}?widget=true`);
+ await visit(`/live/r/${ROOM.slug}?widget=true`);
assert.strictEqual(
currentURL(),
- `/voice/r/${ROOM.slug}?widget=true`,
+ `/live/r/${ROOM.slug}?widget=true`,
"opens the room page"
);
assert.deepEqual(joined, [], "does not join without being asked to");
});
test("docks the call back to the page the user came from when they join", async function (assert) {
- const { joined, voiceWebrtc } = stubJoin(this);
- voiceWebrtc.setCallWidgetHidden(true);
+ const { joined, liveWebrtc } = stubJoin(this);
+ liveWebrtc.setCallWidgetHidden(true);
await visit("/t/internationalization-localization/280");
- await visit(`/voice/r/${ROOM.slug}?widget=true`);
- await click(".voice-room-page__join");
+ await visit(`/live/r/${ROOM.slug}?widget=true`);
+ await click(".live-room-page__join");
assert.deepEqual(joined, [ROOM.slug], "joins the room");
assert.strictEqual(
@@ -115,7 +115,7 @@ acceptance("Voice room widget mode", function (needs) {
"returns to where the user was instead of resetting their place"
);
assert.false(
- voiceWebrtc.callWidgetHidden,
+ liveWebrtc.callWidgetHidden,
"the call widget is no longer hidden"
);
});
@@ -127,11 +127,11 @@ acceptance("Voice room widget mode", function (needs) {
.lookup("service:session-store")
.setObject({
key: "routeHistory",
- value: [`/voice/r/${ROOM.slug}?join=true`, "/latest"],
+ value: [`/live/r/${ROOM.slug}?join=true`, "/latest"],
});
- await visit(`/voice/r/${ROOM.slug}?widget=true`);
- await click(".voice-room-page__join");
+ await visit(`/live/r/${ROOM.slug}?widget=true`);
+ await click(".live-room-page__join");
assert.deepEqual(joined, [ROOM.slug], "joins the room");
assert.strictEqual(
@@ -145,8 +145,8 @@ acceptance("Voice room widget mode", function (needs) {
const { joined } = stubJoin(this);
getOwner(this).lookup("service:session-store").remove("routeHistory");
- await visit(`/voice/r/${ROOM.slug}?widget=true`);
- await click(".voice-room-page__join");
+ await visit(`/live/r/${ROOM.slug}?widget=true`);
+ await click(".live-room-page__join");
assert.deepEqual(joined, [ROOM.slug], "joins the room");
assert.strictEqual(currentURL(), "/latest", "leaves the room page");
@@ -155,13 +155,13 @@ acceptance("Voice room widget mode", function (needs) {
test("keeps a join on the room page when the param is falsy", async function (assert) {
const { joined } = stubJoin(this);
- await visit(`/voice/r/${ROOM.slug}?widget=false`);
- await click(".voice-room-page__join");
+ await visit(`/live/r/${ROOM.slug}?widget=false`);
+ await click(".live-room-page__join");
assert.deepEqual(joined, [ROOM.slug], "joins the room");
assert.strictEqual(
currentURL(),
- `/voice/r/${ROOM.slug}?widget=false`,
+ `/live/r/${ROOM.slug}?widget=false`,
"stays on the room page"
);
});
@@ -169,24 +169,24 @@ acceptance("Voice room widget mode", function (needs) {
test("leaves a join without a widget param on the room page", async function (assert) {
const { joined } = stubJoin(this);
- await visit(`/voice/r/${ROOM.slug}?join=true`);
+ await visit(`/live/r/${ROOM.slug}?join=true`);
assert.strictEqual(
currentURL(),
- `/voice/r/${ROOM.slug}`,
+ `/live/r/${ROOM.slug}`,
"opens the room page and consumes the join param"
);
assert.deepEqual(joined, [ROOM.slug], "the room page joins the call");
});
test("shows a widget the user had dismissed", async function (assert) {
- const { voiceWebrtc } = stubJoin(this);
- voiceWebrtc.setCallWidgetHidden(true);
+ const { liveWebrtc } = stubJoin(this);
+ liveWebrtc.setCallWidgetHidden(true);
- await visit(`/voice/r/${ROOM.slug}?join=true&widget=true`);
+ await visit(`/live/r/${ROOM.slug}?join=true&widget=true`);
assert.false(
- voiceWebrtc.callWidgetHidden,
+ liveWebrtc.callWidgetHidden,
"the call widget is no longer hidden"
);
});
@@ -194,21 +194,21 @@ acceptance("Voice room widget mode", function (needs) {
test("opens the room page when the params are absent", async function (assert) {
const { joined } = stubJoin(this);
- await visit(`/voice/r/${ROOM.slug}`);
+ await visit(`/live/r/${ROOM.slug}`);
- assert.strictEqual(currentURL(), `/voice/r/${ROOM.slug}`);
+ assert.strictEqual(currentURL(), `/live/r/${ROOM.slug}`);
assert.deepEqual(joined, [], "does not join without being asked to");
});
});
-acceptance("Voice room widget mode - anonymous", function (needs) {
+acceptance("Live room widget mode - anonymous", function (needs) {
stubRooms(needs);
- needs.site({ voice_public_access: true });
+ needs.site({ live_public_access: true });
test("does not dock the call, since anonymous visitors cannot join", async function (assert) {
const { joined } = stubJoin(this);
- await visit(`/voice/r/${ROOM.slug}?join=true&widget=true`);
+ await visit(`/live/r/${ROOM.slug}?join=true&widget=true`);
// The room page takes the join request instead, which prompts for a login.
assert.strictEqual(currentURL(), "/login", "prompts for a login");
@@ -216,11 +216,11 @@ acceptance("Voice room widget mode - anonymous", function (needs) {
});
test("opens the room page for a widget param on its own", async function (assert) {
- await visit(`/voice/r/${ROOM.slug}?widget=true`);
+ await visit(`/live/r/${ROOM.slug}?widget=true`);
assert.strictEqual(
currentURL(),
- `/voice/r/${ROOM.slug}?widget=true`,
+ `/live/r/${ROOM.slug}?widget=true`,
"opens the room page"
);
});
diff --git a/plugins/voice/test/javascripts/integration/components/voice-invite-agent-button-test.gjs b/plugins/live/test/javascripts/integration/components/live-invite-agent-button-test.gjs
similarity index 77%
rename from plugins/voice/test/javascripts/integration/components/voice-invite-agent-button-test.gjs
rename to plugins/live/test/javascripts/integration/components/live-invite-agent-button-test.gjs
index 9d89c48b2c2..e30fa98da7c 100644
--- a/plugins/voice/test/javascripts/integration/components/voice-invite-agent-button-test.gjs
+++ b/plugins/live/test/javascripts/integration/components/live-invite-agent-button-test.gjs
@@ -6,8 +6,8 @@ import pretender, { response } from "discourse/tests/helpers/create-pretender";
import formKit from "discourse/tests/helpers/form-kit-helper";
import { logIn } from "discourse/tests/helpers/qunit-helpers";
import DDropdownMenu from "discourse/ui-kit/d-dropdown-menu";
-import VoiceInviteAgentModal from "discourse/plugins/voice/discourse/components/modal/voice-invite-agent";
-import VoiceInviteAgentButton from "discourse/plugins/voice/discourse/components/voice-invite-agent-button";
+import LiveInviteAgentButton from "discourse/plugins/live/discourse/components/live-invite-agent-button";
+import LiveInviteAgentModal from "discourse/plugins/live/discourse/components/modal/live-invite-agent";
class ModalStub extends Service {
show(component, options) {
@@ -16,14 +16,14 @@ class ModalStub extends Service {
}
}
-module("Integration | Component | VoiceInviteAgentButton", function (hooks) {
+module("Integration | Component | LiveInviteAgentButton", function (hooks) {
setupRenderingTest(hooks);
hooks.beforeEach(function () {
logIn(this.owner);
this.owner.unregister("service:modal");
this.owner.register("service:modal", ModalStub);
- this.owner.lookup("service:site").set("voice_livekit_agent_bot_id", -2);
+ this.owner.lookup("service:site").set("live_livekit_agent_bot_id", -2);
this.room = {
id: 1,
public: true,
@@ -36,13 +36,13 @@ module("Integration | Component | VoiceInviteAgentButton", function (hooks) {
await render(
<template>
<DDropdownMenu as |dropdown|>
- <VoiceInviteAgentButton @item={{dropdown.item}} @room={{this.room}} />
+ <LiveInviteAgentButton @item={{dropdown.item}} @room={{this.room}} />
</DDropdownMenu>
</template>
);
- await click(".voice-invite-agent");
+ await click(".live-invite-agent");
const modal = this.owner.lookup("service:modal");
- assert.strictEqual(modal.component, VoiceInviteAgentModal);
+ assert.strictEqual(modal.component, LiveInviteAgentModal);
assert.strictEqual(modal.model.room, this.room);
});
@@ -52,17 +52,17 @@ module("Integration | Component | VoiceInviteAgentButton", function (hooks) {
this.closeModal = () => {
this.closed = true;
};
- pretender.get("/voice/agents", () =>
+ pretender.get("/live/agents", () =>
response(200, { agents: [{ name: "assistant" }, { name: "support" }] })
);
- pretender.post("/voice/rooms/1/invite_agent", (request) => {
+ pretender.post("/live/rooms/1/invite_agent", (request) => {
invited = true;
assert.strictEqual(request.requestBody, "agent_name=assistant");
return response(201, { dispatch_id: "AD_test" });
});
await render(
<template>
- <VoiceInviteAgentModal
+ <LiveInviteAgentModal
@closeModal={{this.closeModal}}
@inline={{true}}
@model={{this.model}}
@@ -80,24 +80,24 @@ module("Integration | Component | VoiceInviteAgentButton", function (hooks) {
let invited = false;
this.model = { room: this.room };
this.closeModal = () => {};
- pretender.get("/voice/agents", () =>
+ pretender.get("/live/agents", () =>
response(200, { agents: [{ name: "assistant" }] })
);
- pretender.post("/voice/rooms/1/invite_agent", (request) => {
+ pretender.post("/live/rooms/1/invite_agent", (request) => {
invited = true;
assert.strictEqual(request.requestBody, "agent_name=custom-agent");
return response(201, { dispatch_id: "AD_test" });
});
await render(
<template>
- <VoiceInviteAgentModal
+ <LiveInviteAgentModal
@closeModal={{this.closeModal}}
@inline={{true}}
@model={{this.model}}
/>
</template>
);
- await click(".voice-invite-agent-modal__toggle");
+ await click(".live-invite-agent-modal__toggle");
assert.dom("[data-name='agent_name'] select").doesNotExist();
await fillIn("[data-name='agent_name'] input", "custom-agent");
await click("button[type='submit']");
@@ -108,13 +108,13 @@ module("Integration | Component | VoiceInviteAgentButton", function (hooks) {
this.model = { room: this.room };
let agents = [];
const queries = [];
- pretender.get("/voice/agents", (request) => {
+ pretender.get("/live/agents", (request) => {
queries.push(request.queryParams.refresh);
return response(200, { agents });
});
await render(
<template>
- <VoiceInviteAgentModal
+ <LiveInviteAgentModal
@closeModal={{this.closeModal}}
@inline={{true}}
@model={{this.model}}
@@ -124,7 +124,7 @@ module("Integration | Component | VoiceInviteAgentButton", function (hooks) {
assert.dom("[data-name='agent_name'] input").exists();
agents = [{ name: "assistant" }];
- await click(".voice-invite-agent-modal__refresh");
+ await click(".live-invite-agent-modal__refresh");
assert.deepEqual(queries, [undefined, "true"]);
assert.dom("[data-name='agent_name'] select").exists();
@@ -133,10 +133,10 @@ module("Integration | Component | VoiceInviteAgentButton", function (hooks) {
test("falls back to a typed name when the list is unavailable", async function (assert) {
this.model = { room: this.room };
- pretender.get("/voice/agents", () => response(503, { errors: ["down"] }));
+ pretender.get("/live/agents", () => response(503, { errors: ["down"] }));
await render(
<template>
- <VoiceInviteAgentModal
+ <LiveInviteAgentModal
@closeModal={{this.closeModal}}
@inline={{true}}
@model={{this.model}}
@@ -153,15 +153,15 @@ module("Integration | Component | VoiceInviteAgentButton", function (hooks) {
this.closeModal = () => {
this.closed = true;
};
- pretender.get("/voice/agents", () => response(200, { agents: [] }));
- pretender.post("/voice/rooms/1/invite_agent", (request) => {
+ pretender.get("/live/agents", () => response(200, { agents: [] }));
+ pretender.post("/live/rooms/1/invite_agent", (request) => {
invited = true;
assert.strictEqual(request.requestBody, "agent_name=assistant");
return response(201, { dispatch_id: "AD_test" });
});
await render(
<template>
- <VoiceInviteAgentModal
+ <LiveInviteAgentModal
@closeModal={{this.closeModal}}
@inline={{true}}
@model={{this.model}}
@@ -185,26 +185,26 @@ module("Integration | Component | VoiceInviteAgentButton", function (hooks) {
await render(
<template>
<DDropdownMenu as |dropdown|>
- <VoiceInviteAgentButton
+ <LiveInviteAgentButton
@item={{dropdown.item}}
@room={{this.testRoom}}
/>
</DDropdownMenu>
</template>
);
- assert.dom(".voice-invite-agent").doesNotExist();
+ assert.dom(".live-invite-agent").doesNotExist();
}
});
test("requires an available bot the user may invite", async function (assert) {
- this.owner.lookup("service:site").set("voice_livekit_agent_bot_id", null);
+ this.owner.lookup("service:site").set("live_livekit_agent_bot_id", null);
await render(
<template>
<DDropdownMenu as |dropdown|>
- <VoiceInviteAgentButton @item={{dropdown.item}} @room={{this.room}} />
+ <LiveInviteAgentButton @item={{dropdown.item}} @room={{this.room}} />
</DDropdownMenu>
</template>
);
- assert.dom(".voice-invite-agent").doesNotExist();
+ assert.dom(".live-invite-agent").doesNotExist();
});
});
diff --git a/plugins/voice/test/javascripts/integration/components/voice-participant-sidebar-context-menu-test.gjs b/plugins/live/test/javascripts/integration/components/live-participant-sidebar-context-menu-test.gjs
similarity index 76%
rename from plugins/voice/test/javascripts/integration/components/voice-participant-sidebar-context-menu-test.gjs
rename to plugins/live/test/javascripts/integration/components/live-participant-sidebar-context-menu-test.gjs
index 888f59400ae..7b8ea7bf262 100644
--- a/plugins/voice/test/javascripts/integration/components/voice-participant-sidebar-context-menu-test.gjs
+++ b/plugins/live/test/javascripts/integration/components/live-participant-sidebar-context-menu-test.gjs
@@ -4,9 +4,9 @@ import { module, test } from "qunit";
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
import pretender, { response } from "discourse/tests/helpers/create-pretender";
import { logIn } from "discourse/tests/helpers/qunit-helpers";
-import VoiceParticipantSidebarContextMenu from "discourse/plugins/voice/discourse/components/voice-participant-sidebar-context-menu";
+import LiveParticipantSidebarContextMenu from "discourse/plugins/live/discourse/components/live-participant-sidebar-context-menu";
-class VoiceWebrtcStub extends Service {
+class LiveWebrtcStub extends Service {
getParticipantVolume() {
return 1;
}
@@ -17,14 +17,14 @@ class VoiceWebrtcStub extends Service {
}
module(
- "Integration | Component | VoiceParticipantSidebarContextMenu",
+ "Integration | Component | LiveParticipantSidebarContextMenu",
function (hooks) {
setupRenderingTest(hooks);
hooks.beforeEach(function () {
logIn(this.owner);
- this.owner.unregister("service:voice-webrtc");
- this.owner.register("service:voice-webrtc", VoiceWebrtcStub);
+ this.owner.unregister("service:live-webrtc");
+ this.owner.register("service:live-webrtc", LiveWebrtcStub);
this.selectedParticipantId = null;
this.closed = false;
@@ -49,7 +49,7 @@ module(
};
this.menuData.canManageRoom = true;
let kicked = false;
- pretender.delete("/voice/rooms/1/kick", (request) => {
+ pretender.delete("/live/rooms/1/kick", (request) => {
kicked = true;
assert.strictEqual(
request.requestBody,
@@ -60,14 +60,14 @@ module(
});
await render(
<template>
- <VoiceParticipantSidebarContextMenu
+ <LiveParticipantSidebarContextMenu
@close={{this.closeMenu}}
@data={{this.menuData}}
/>
</template>
);
- await click(".voice-participant-sidebar-context-menu__kick-btn");
+ await click(".live-participant-sidebar-context-menu__kick-btn");
assert.true(kicked);
assert.true(this.closed);
@@ -77,7 +77,7 @@ module(
test("spotlights the participant for the viewer", async function (assert) {
await render(
<template>
- <VoiceParticipantSidebarContextMenu
+ <LiveParticipantSidebarContextMenu
@close={{this.closeMenu}}
@data={{this.menuData}}
/>
@@ -85,10 +85,10 @@ module(
);
assert
- .dom(".voice-participant-sidebar-context-menu__spotlight-btn")
+ .dom(".live-participant-sidebar-context-menu__spotlight-btn")
.hasText("Spotlight for me", "offers the local spotlight action");
- await click(".voice-participant-sidebar-context-menu__spotlight-btn");
+ await click(".live-participant-sidebar-context-menu__spotlight-btn");
assert.strictEqual(
this.selectedParticipantId,
@@ -103,7 +103,7 @@ module(
await render(
<template>
- <VoiceParticipantSidebarContextMenu
+ <LiveParticipantSidebarContextMenu
@close={{this.closeMenu}}
@data={{this.menuData}}
/>
@@ -111,7 +111,7 @@ module(
);
assert
- .dom(".voice-participant-sidebar-context-menu__spotlight-btn")
+ .dom(".live-participant-sidebar-context-menu__spotlight-btn")
.hasText("Remove from spotlight", "offers to remove the spotlight")
.hasAttribute("aria-pressed", "true", "exposes the active state");
});
diff --git a/plugins/voice/test/javascripts/integration/components/voice-participant-sidebar-suffix-test.gjs b/plugins/live/test/javascripts/integration/components/live-participant-sidebar-suffix-test.gjs
similarity index 54%
rename from plugins/voice/test/javascripts/integration/components/voice-participant-sidebar-suffix-test.gjs
rename to plugins/live/test/javascripts/integration/components/live-participant-sidebar-suffix-test.gjs
index afa4127c6fe..be6ac3d813c 100644
--- a/plugins/voice/test/javascripts/integration/components/voice-participant-sidebar-suffix-test.gjs
+++ b/plugins/live/test/javascripts/integration/components/live-participant-sidebar-suffix-test.gjs
@@ -1,10 +1,10 @@
import { render } from "@ember/test-helpers";
import { module, test } from "qunit";
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
-import VoiceParticipantSidebarSuffix from "discourse/plugins/voice/discourse/components/voice-participant-sidebar-suffix";
+import LiveParticipantSidebarSuffix from "discourse/plugins/live/discourse/components/live-participant-sidebar-suffix";
module(
- "Integration | Component | voice-participant-sidebar-suffix",
+ "Integration | Component | live-participant-sidebar-suffix",
function (hooks) {
setupRenderingTest(hooks);
@@ -19,14 +19,14 @@ module(
await render(
<template>
- <VoiceParticipantSidebarSuffix @suffixArgs={{suffixArgs}} />
+ <LiveParticipantSidebarSuffix @suffixArgs={{suffixArgs}} />
</template>
);
- assert.dom(".voice-participant-suffix .d-icon-display").exists();
- assert.dom(".voice-participant-suffix .d-icon-video").exists();
- assert.dom(".voice-participant-suffix .d-icon-microphone-slash").exists();
- assert.dom(".voice-participant-suffix .d-icon-volume-xmark").exists();
+ assert.dom(".live-participant-suffix .d-icon-display").exists();
+ assert.dom(".live-participant-suffix .d-icon-video").exists();
+ assert.dom(".live-participant-suffix .d-icon-microphone-slash").exists();
+ assert.dom(".live-participant-suffix .d-icon-volume-xmark").exists();
});
test("renders the wrapper even with no active states", async function (assert) {
@@ -40,12 +40,12 @@ module(
await render(
<template>
- <VoiceParticipantSidebarSuffix @suffixArgs={{suffixArgs}} />
+ <LiveParticipantSidebarSuffix @suffixArgs={{suffixArgs}} />
</template>
);
- assert.dom(".voice-participant-suffix").exists();
- assert.dom(".voice-participant-suffix .d-icon").doesNotExist();
+ assert.dom(".live-participant-suffix").exists();
+ assert.dom(".live-participant-suffix .d-icon").doesNotExist();
});
}
);
diff --git a/plugins/voice/test/javascripts/integration/components/voice-room-form-test.gjs b/plugins/live/test/javascripts/integration/components/live-room-form-test.gjs
similarity index 76%
rename from plugins/voice/test/javascripts/integration/components/voice-room-form-test.gjs
rename to plugins/live/test/javascripts/integration/components/live-room-form-test.gjs
index d1d77938bdd..878029fd039 100644
--- a/plugins/voice/test/javascripts/integration/components/voice-room-form-test.gjs
+++ b/plugins/live/test/javascripts/integration/components/live-room-form-test.gjs
@@ -3,7 +3,7 @@ import { render } from "@ember/test-helpers";
import { module, test } from "qunit";
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
import formKit from "discourse/tests/helpers/form-kit-helper";
-import VoiceRoomForm from "discourse/plugins/voice/discourse/components/voice-room-form";
+import LiveRoomForm from "discourse/plugins/live/discourse/components/live-room-form";
class ChatApiStub extends Service {
channels() {
@@ -14,13 +14,13 @@ class ChatApiStub extends Service {
}
}
-module("Integration | Component | voice-room-form", function (hooks) {
+module("Integration | Component | live-room-form", function (hooks) {
setupRenderingTest(hooks);
hooks.beforeEach(function () {
this.siteSettings.chat_enabled = true;
- this.siteSettings.voice_chat_enabled = true;
- this.owner.lookup("service:site").set("voice_video_available", false);
+ this.siteSettings.live_chat_enabled = true;
+ this.owner.lookup("service:site").set("live_video_available", false);
this.owner.unregister("service:chat-api");
this.owner.register("service:chat-api", ChatApiStub);
@@ -38,7 +38,7 @@ module("Integration | Component | voice-room-form", function (hooks) {
chat_idle_minutes: 2,
};
- await render(<template><VoiceRoomForm @room={{this.room}} /></template>);
+ await render(<template><LiveRoomForm @room={{this.room}} /></template>);
assert.dom('select[name="chat_channel_id"]').hasValue("6");
assert
@@ -58,7 +58,7 @@ module("Integration | Component | voice-room-form", function (hooks) {
chat_idle_minutes: 2,
};
- await render(<template><VoiceRoomForm @room={{this.room}} /></template>);
+ await render(<template><LiveRoomForm @room={{this.room}} /></template>);
assert.dom('input[name="chat_idle_minutes"]').exists();
await formKit().field("chat_channel_id").select("__NONE__");
@@ -84,14 +84,14 @@ module("Integration | Component | voice-room-form", function (hooks) {
this.owner
.lookup("service:site")
- .set("voice_livekit_per_room_available", true);
- await render(<template><VoiceRoomForm @room={{this.room}} /></template>);
+ .set("live_livekit_per_room_available", true);
+ await render(<template><LiveRoomForm @room={{this.room}} /></template>);
assert.dom('[data-name="livekit_enabled"]').exists();
this.owner
.lookup("service:site")
- .set("voice_livekit_per_room_available", false);
- await render(<template><VoiceRoomForm @room={{this.room}} /></template>);
+ .set("live_livekit_per_room_available", false);
+ await render(<template><LiveRoomForm @room={{this.room}} /></template>);
assert.dom('[data-name="livekit_enabled"]').doesNotExist();
});
@@ -107,11 +107,11 @@ module("Integration | Component | voice-room-form", function (hooks) {
chat_idle_minutes: 15,
};
- await render(<template><VoiceRoomForm @room={{this.room}} /></template>);
+ await render(<template><LiveRoomForm @room={{this.room}} /></template>);
assert.dom('[data-name="video_enabled"]').doesNotExist();
- this.owner.lookup("service:site").set("voice_video_available", true);
- await render(<template><VoiceRoomForm @room={{this.room}} /></template>);
+ this.owner.lookup("service:site").set("live_video_available", true);
+ await render(<template><LiveRoomForm @room={{this.room}} /></template>);
assert.dom('[data-name="video_enabled"]').exists();
});
@@ -127,7 +127,7 @@ module("Integration | Component | voice-room-form", function (hooks) {
chat_idle_minutes: 15,
};
- await render(<template><VoiceRoomForm @room={{this.room}} /></template>);
+ await render(<template><LiveRoomForm @room={{this.room}} /></template>);
assert.dom('input[name="chat_idle_minutes"]').doesNotExist();
});
diff --git a/plugins/voice/test/javascripts/integration/components/voice-room-page-test.gjs b/plugins/live/test/javascripts/integration/components/live-room-page-test.gjs
similarity index 69%
rename from plugins/voice/test/javascripts/integration/components/voice-room-page-test.gjs
rename to plugins/live/test/javascripts/integration/components/live-room-page-test.gjs
index 96d86e3c619..848bb805229 100644
--- a/plugins/voice/test/javascripts/integration/components/voice-room-page-test.gjs
+++ b/plugins/live/test/javascripts/integration/components/live-room-page-test.gjs
@@ -5,9 +5,9 @@ import { module, test } from "qunit";
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
import pretender, { response } from "discourse/tests/helpers/create-pretender";
import { logIn } from "discourse/tests/helpers/qunit-helpers";
-import VoiceRoomPage from "discourse/plugins/voice/discourse/components/voice/room-page";
+import LiveRoomPage from "discourse/plugins/live/discourse/components/live/room-page";
-class VoiceRoomsStub extends Service {
+class LiveRoomsStub extends Service {
@tracked rooms = [];
roomById(id) {
@@ -19,7 +19,7 @@ class VoiceRoomsStub extends Service {
}
}
-class VoiceWebrtcStub extends Service {
+class LiveWebrtcStub extends Service {
@tracked activeRoomId = 1;
@tracked audioEnabled = true;
@tracked deafened = false;
@@ -29,7 +29,7 @@ class VoiceWebrtcStub extends Service {
screenShareSupported = true;
get activeRoom() {
- return this.voiceRooms.roomById(this.activeRoomId);
+ return this.liveRooms.roomById(this.activeRoomId);
}
connectionStateFor() {
@@ -96,12 +96,12 @@ class CapabilitiesStub extends Service {
async function selectParticipantFromOpenMenu(owner) {
const menuService = owner.lookup("service:menu");
- const menu = menuService.getByIdentifier("voice-participant-menu");
+ const menu = menuService.getByIdentifier("live-participant-menu");
menu.options.data.onSpotlight(menu.options.data.participant.id);
await menuService.close(menu);
}
-module("Integration | Component | Voice | RoomPage", function (hooks) {
+module("Integration | Component | Live | RoomPage", function (hooks) {
setupRenderingTest(hooks);
hooks.beforeEach(function () {
@@ -109,18 +109,18 @@ module("Integration | Component | Voice | RoomPage", function (hooks) {
this.owner.unregister("service:capabilities");
this.owner.register("service:capabilities", CapabilitiesStub);
- this.owner.unregister("service:voice-rooms");
- this.owner.register("service:voice-rooms", VoiceRoomsStub);
- this.owner.unregister("service:voice-webrtc");
- this.owner.register("service:voice-webrtc", VoiceWebrtcStub);
+ this.owner.unregister("service:live-rooms");
+ this.owner.register("service:live-rooms", LiveRoomsStub);
+ this.owner.unregister("service:live-webrtc");
+ this.owner.register("service:live-webrtc", LiveWebrtcStub);
this.owner.unregister("service:router");
this.owner.register("service:router", RouterStub);
this.owner.unregister("service:modal");
this.owner.register("service:modal", ModalStub);
- this.voiceRooms = this.owner.lookup("service:voice-rooms");
- this.voiceWebrtc = this.owner.lookup("service:voice-webrtc");
- this.voiceWebrtc.voiceRooms = this.voiceRooms;
+ this.liveRooms = this.owner.lookup("service:live-rooms");
+ this.liveWebrtc = this.owner.lookup("service:live-webrtc");
+ this.liveWebrtc.liveRooms = this.liveRooms;
this.room = {
id: 1,
@@ -150,23 +150,23 @@ module("Integration | Component | Voice | RoomPage", function (hooks) {
],
};
- this.voiceRooms.rooms = [this.room];
+ this.liveRooms.rooms = [this.room];
});
test("defaults to the tiled layout with the layout switcher available", async function (assert) {
- await render(<template><VoiceRoomPage @room={{this.room}} /></template>);
+ await render(<template><LiveRoomPage @room={{this.room}} /></template>);
assert
- .dom(".voice-room-page")
+ .dom(".live-room-page")
.hasClass("--tiled", "defaults to tiled layout");
- assert.dom(".voice-room-page__grid").exists("renders the tiled grid");
+ assert.dom(".live-room-page__grid").exists("renders the tiled grid");
// The layout switcher lives behind the overflow menu. Switching layouts
// through the nested `menu`-service submenu needs the app's modal/portal
// outlets, so the end-to-end switch is covered by a system spec.
- await click(".voice-room-menu-trigger");
+ await click(".live-room-menu-trigger");
assert
- .dom(".voice-room-page__layout-trigger")
+ .dom(".live-room-page__layout-trigger")
.exists("exposes the layout switcher in the overflow menu");
});
@@ -176,16 +176,16 @@ module("Integration | Component | Voice | RoomPage", function (hooks) {
// separately.
this.room.chat_available = false;
- await render(<template><VoiceRoomPage @room={{this.room}} /></template>);
+ await render(<template><LiveRoomPage @room={{this.room}} /></template>);
assert
- .dom(".voice-room-page")
+ .dom(".live-room-page")
.hasClass("--presentation", "stage rooms default to presentation");
assert
- .dom(".voice-room-page")
+ .dom(".live-room-page")
.doesNotHaveClass("--tiled", "the tiled default no longer applies");
assert
- .dom(".voice-room-page__presentation")
+ .dom(".live-room-page__presentation")
.exists("renders the featured-presenter layout");
});
@@ -195,16 +195,16 @@ module("Integration | Component | Voice | RoomPage", function (hooks) {
this.room.active_participants[1].is_screen_sharing = true;
this.room.active_participants[2].is_screen_sharing = true;
- await render(<template><VoiceRoomPage @room={{this.room}} /></template>);
+ await render(<template><LiveRoomPage @room={{this.room}} /></template>);
assert
.dom(
- ".voice-room-page__presentation-main .voice-video-tile[data-user-id='2']"
+ ".live-room-page__presentation-main .live-video-tile[data-user-id='2']"
)
.exists("automatically features the first screen share");
assert
.dom(
- ".voice-room-page__presentation-rail .voice-video-tile[data-user-id='3']"
+ ".live-room-page__presentation-rail .live-video-tile[data-user-id='3']"
)
.exists("keeps the other screen share in the rail");
});
@@ -213,25 +213,25 @@ module("Integration | Component | Voice | RoomPage", function (hooks) {
this.room.active_participants[1].is_screen_sharing = true;
this.room.active_participants[2].is_screen_sharing = true;
- await render(<template><VoiceRoomPage @room={{this.room}} /></template>);
+ await render(<template><LiveRoomPage @room={{this.room}} /></template>);
- await click(".voice-video-tile[data-user-id='3'] .voice-video-tile__menu");
+ await click(".live-video-tile[data-user-id='3'] .live-video-tile__menu");
await selectParticipantFromOpenMenu(this.owner);
await settled();
assert
- .dom(".voice-room-page")
+ .dom(".live-room-page")
.hasClass("--presentation", "switches to presentation layout");
assert
.dom(
- ".voice-room-page__presentation-main .voice-video-tile[data-user-id='3']"
+ ".live-room-page__presentation-main .live-video-tile[data-user-id='3']"
)
.exists("features the selected screen share");
- await click(".voice-room-page__presentation-main .voice-video-tile__menu");
+ await click(".live-room-page__presentation-main .live-video-tile__menu");
const participantMenu = this.owner
.lookup("service:menu")
- .getByIdentifier("voice-participant-menu");
+ .getByIdentifier("live-participant-menu");
assert.true(
participantMenu.options.data.isSpotlighted,
"marks the spotlight as active"
@@ -241,7 +241,7 @@ module("Integration | Component | Voice | RoomPage", function (hooks) {
assert
.dom(
- ".voice-room-page__presentation-main .voice-video-tile[data-user-id='2']"
+ ".live-room-page__presentation-main .live-video-tile[data-user-id='2']"
)
.exists("returns to automatic screen-share selection");
});
@@ -250,23 +250,23 @@ module("Integration | Component | Voice | RoomPage", function (hooks) {
this.room.active_participants[1].is_screen_sharing = true;
this.room.active_participants[2].is_screen_sharing = true;
- await render(<template><VoiceRoomPage @room={{this.room}} /></template>);
+ await render(<template><LiveRoomPage @room={{this.room}} /></template>);
- await click(".voice-video-tile[data-user-id='3'] .voice-video-tile__menu");
+ await click(".live-video-tile[data-user-id='3'] .live-video-tile__menu");
await selectParticipantFromOpenMenu(this.owner);
await settled();
- await click(".voice-room-menu-trigger");
- await click(".voice-room-page__layout-trigger");
+ await click(".live-room-menu-trigger");
+ await click(".live-room-page__layout-trigger");
this.owner
.lookup("service:menu")
- .getByIdentifier("voice-call-submenu")
+ .getByIdentifier("live-call-submenu")
.options.data.onSelect("presentation");
await settled();
assert
.dom(
- ".voice-room-page__presentation-main .voice-video-tile[data-user-id='2']"
+ ".live-room-page__presentation-main .live-video-tile[data-user-id='2']"
)
.exists("the default control restores automatic selection");
});
@@ -282,19 +282,19 @@ module("Integration | Component | Voice | RoomPage", function (hooks) {
}))
);
- await render(<template><VoiceRoomPage @room={{this.room}} /></template>);
+ await render(<template><LiveRoomPage @room={{this.room}} /></template>);
assert
- .dom(".voice-video-tile[data-user-id='6']")
+ .dom(".live-video-tile[data-user-id='6']")
.hasClass("--avatar", "the last publisher starts outside the budget");
- await click(".voice-video-tile[data-user-id='6'] .voice-video-tile__menu");
+ await click(".live-video-tile[data-user-id='6'] .live-video-tile__menu");
await selectParticipantFromOpenMenu(this.owner);
await settled();
assert
.dom(
- ".voice-room-page__presentation-main .voice-video-tile[data-user-id='6']"
+ ".live-room-page__presentation-main .live-video-tile[data-user-id='6']"
)
.hasClass("--video", "the spotlighted publisher receives live video");
});
@@ -303,12 +303,12 @@ module("Integration | Component | Voice | RoomPage", function (hooks) {
this.room.active_participants[1].is_screen_sharing = true;
this.room.active_participants[2].is_screen_sharing = true;
- await render(<template><VoiceRoomPage @room={{this.room}} /></template>);
- await click(".voice-video-tile[data-user-id='3'] .voice-video-tile__menu");
+ await render(<template><LiveRoomPage @room={{this.room}} /></template>);
+ await click(".live-video-tile[data-user-id='3'] .live-video-tile__menu");
await selectParticipantFromOpenMenu(this.owner);
await settled();
- this.voiceRooms.rooms = [
+ this.liveRooms.rooms = [
{
...this.room,
active_participants: this.room.active_participants.filter(
@@ -320,16 +320,16 @@ module("Integration | Component | Voice | RoomPage", function (hooks) {
assert
.dom(
- ".voice-room-page__presentation-main .voice-video-tile[data-user-id='2']"
+ ".live-room-page__presentation-main .live-video-tile[data-user-id='2']"
)
.exists("falls back to automatic selection");
- this.voiceRooms.rooms = [this.room];
+ this.liveRooms.rooms = [this.room];
await settled();
assert
.dom(
- ".voice-room-page__presentation-main .voice-video-tile[data-user-id='2']"
+ ".live-room-page__presentation-main .live-video-tile[data-user-id='2']"
)
.exists("does not restore a stale spotlight if the participant rejoins");
});
@@ -337,15 +337,15 @@ module("Integration | Component | Voice | RoomPage", function (hooks) {
test("a joined stage room with chat available opens the chat panel by default", async function (assert) {
// The panel prepares its chat session on mount; an empty payload keeps it
// in the pre-thread composer state without touching chat internals.
- pretender.post("/voice/rooms/1/chat_session", () => response({}));
+ pretender.post("/live/rooms/1/chat_session", () => response({}));
this.room.room_type = "stage";
- await render(<template><VoiceRoomPage @room={{this.room}} /></template>);
+ await render(<template><LiveRoomPage @room={{this.room}} /></template>);
assert
- .dom(".voice-room-page")
+ .dom(".live-room-page")
.hasClass("--chat-open", "the chat panel is open by default");
- assert.dom(".voice-chat").exists("mounts the chat panel");
+ assert.dom(".live-chat").exists("mounts the chat panel");
});
});
diff --git a/plugins/voice/test/javascripts/integration/components/voice/call-widget-test.gjs b/plugins/live/test/javascripts/integration/components/live/call-widget-test.gjs
similarity index 68%
rename from plugins/voice/test/javascripts/integration/components/voice/call-widget-test.gjs
rename to plugins/live/test/javascripts/integration/components/live/call-widget-test.gjs
index afc701e79e9..2ab2123e716 100644
--- a/plugins/voice/test/javascripts/integration/components/voice/call-widget-test.gjs
+++ b/plugins/live/test/javascripts/integration/components/live/call-widget-test.gjs
@@ -10,9 +10,9 @@ import {
import { module, test } from "qunit";
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
import { logIn } from "discourse/tests/helpers/qunit-helpers";
-import VoiceCallWidget from "discourse/plugins/voice/discourse/components/voice/call-widget";
+import LiveCallWidget from "discourse/plugins/live/discourse/components/live/call-widget";
-class VoiceRoomsStub extends Service {
+class LiveRoomsStub extends Service {
@tracked rooms = [];
roomById(id) {
@@ -34,7 +34,7 @@ class VoiceRoomsStub extends Service {
}
}
-class VoiceWebrtcStub extends Service {
+class LiveWebrtcStub extends Service {
@tracked activeRoomId = 1;
@tracked audioEnabled = true;
@tracked callWidgetHidden = false;
@@ -48,7 +48,7 @@ class VoiceWebrtcStub extends Service {
leaveCalls = [];
get activeRoom() {
- return this.voiceRooms.roomById(this.activeRoomId);
+ return this.liveRooms.roomById(this.activeRoomId);
}
videoAllowedIn() {
@@ -100,24 +100,24 @@ class RouterStub extends Service {
transitionTo() {}
}
-module("Integration | Component | voice/call-widget", function (hooks) {
+module("Integration | Component | live/call-widget", function (hooks) {
setupRenderingTest(hooks);
hooks.beforeEach(function () {
this.currentUser = logIn(this.owner);
- this.owner.unregister("service:voice-rooms");
- this.owner.register("service:voice-rooms", VoiceRoomsStub);
- this.owner.unregister("service:voice-webrtc");
- this.owner.register("service:voice-webrtc", VoiceWebrtcStub);
+ this.owner.unregister("service:live-rooms");
+ this.owner.register("service:live-rooms", LiveRoomsStub);
+ this.owner.unregister("service:live-webrtc");
+ this.owner.register("service:live-webrtc", LiveWebrtcStub);
this.owner.unregister("service:router");
this.owner.register("service:router", RouterStub);
- this.voiceRooms = this.owner.lookup("service:voice-rooms");
- this.voiceWebrtc = this.owner.lookup("service:voice-webrtc");
- this.voiceWebrtc.voiceRooms = this.voiceRooms;
+ this.liveRooms = this.owner.lookup("service:live-rooms");
+ this.liveWebrtc = this.owner.lookup("service:live-webrtc");
+ this.liveWebrtc.liveRooms = this.liveRooms;
- this.voiceRooms.rooms = [
+ this.liveRooms.rooms = [
{
id: 1,
slug: "test-room",
@@ -138,14 +138,14 @@ module("Integration | Component | voice/call-widget", function (hooks) {
});
test("offers the agent invitation in the widget room menu", async function (assert) {
- this.owner.lookup("service:site").set("voice_livekit_agent_bot_id", -2);
- Object.assign(this.voiceRooms.rooms[0], {
+ this.owner.lookup("service:site").set("live_livekit_agent_bot_id", -2);
+ Object.assign(this.liveRooms.rooms[0], {
public: true,
expected_transport: "livekit",
});
- await render(<template><VoiceCallWidget /></template>);
- await click("button[data-identifier='voice-widget-room-menu']");
- assert.dom(".voice-invite-agent").hasText("Invite LiveKit agent");
+ await render(<template><LiveCallWidget /></template>);
+ await click("button[data-identifier='live-widget-room-menu']");
+ assert.dom(".live-invite-agent").hasText("Invite LiveKit agent");
});
test("keeps video watching and participant tiles live in widget mode", async function (assert) {
@@ -153,20 +153,20 @@ module("Integration | Component | voice/call-widget", function (hooks) {
await render(
<template>
{{#if this.renderWidget}}
- <VoiceCallWidget />
+ <LiveCallWidget />
{{/if}}
</template>
);
assert.deepEqual(
- this.voiceWebrtc.watchingCalls.at(-1),
+ this.liveWebrtc.watchingCalls.at(-1),
{ roomId: 1, watching: true, options: {} },
"marks the room watched while the widget is visible"
);
- this.voiceWebrtc.videoStreams.set("1:2", { id: "bob-video" });
- this.voiceRooms.setParticipants(1, [
- ...this.voiceRooms.roomById(1).active_participants,
+ this.liveWebrtc.videoStreams.set("1:2", { id: "bob-video" });
+ this.liveRooms.setParticipants(1, [
+ ...this.liveRooms.roomById(1).active_participants,
{
id: 2,
username: "bob",
@@ -177,28 +177,28 @@ module("Integration | Component | voice/call-widget", function (hooks) {
await settled();
assert
- .dom(".voice-call-widget .voice-video-tile[data-user-id='2']")
+ .dom(".live-call-widget .live-video-tile[data-user-id='2']")
.exists("adds a participant tile while the widget is docked");
assert
.dom(
- ".voice-call-widget .voice-video-tile[data-user-id='2'] video.voice-video-tile__video"
+ ".live-call-widget .live-video-tile[data-user-id='2'] video.live-video-tile__video"
)
.exists("renders the live remote video element in the widget");
- this.voiceRooms.setParticipants(1, [
- this.voiceRooms.roomById(1).active_participants[0],
+ this.liveRooms.setParticipants(1, [
+ this.liveRooms.roomById(1).active_participants[0],
]);
await settled();
assert
- .dom(".voice-call-widget .voice-video-tile[data-user-id='2']")
+ .dom(".live-call-widget .live-video-tile[data-user-id='2']")
.doesNotExist("removes the participant tile while the widget is docked");
this.set("renderWidget", false);
await settled();
assert.deepEqual(
- this.voiceWebrtc.watchingCalls.at(-1),
+ this.liveWebrtc.watchingCalls.at(-1),
{ roomId: 1, watching: false, options: { keepVideo: true } },
"clears the widget watch state when the widget is removed"
);
@@ -207,44 +207,44 @@ module("Integration | Component | voice/call-widget", function (hooks) {
test("hides on the room's own page even when the URL carries extra query params", async function (assert) {
const router = this.owner.lookup("service:router");
- await render(<template><VoiceCallWidget /></template>);
- assert.dom(".voice-call-widget").exists("shows while docked elsewhere");
+ await render(<template><LiveCallWidget /></template>);
+ assert.dom(".live-call-widget").exists("shows while docked elsewhere");
router.currentRoute = {
- name: "voice-room",
+ name: "live-room",
params: { slug: "test-room" },
queryParams: { chat: "true" },
};
await settled();
assert
- .dom(".voice-call-widget")
+ .dom(".live-call-widget")
.doesNotExist("hides on the room's own page, regardless of query params");
router.currentRoute = { name: "discovery.latest", params: {} };
await settled();
assert
- .dom(".voice-call-widget")
+ .dom(".live-call-widget")
.exists("shows again once navigated away from the room page");
});
test("stays hidden while the user has hidden the call widget", async function (assert) {
- await render(<template><VoiceCallWidget /></template>);
- assert.dom(".voice-call-widget").exists("shows by default");
+ await render(<template><LiveCallWidget /></template>);
+ assert.dom(".live-call-widget").exists("shows by default");
- this.voiceWebrtc.callWidgetHidden = true;
+ this.liveWebrtc.callWidgetHidden = true;
await settled();
assert
- .dom(".voice-call-widget")
+ .dom(".live-call-widget")
.doesNotExist("hides while the preference is on");
- this.voiceWebrtc.callWidgetHidden = false;
+ this.liveWebrtc.callWidgetHidden = false;
await settled();
assert
- .dom(".voice-call-widget")
+ .dom(".live-call-widget")
.exists("shows again once the preference is turned off");
});
@@ -264,22 +264,22 @@ module("Integration | Component | voice/call-widget", function (hooks) {
avatar_template: `/letter_avatar_proxy/v4/letter/${letter}/{size}.png`,
};
});
- this.voiceRooms.setParticipants(1, [
- ...this.voiceRooms.roomById(1).active_participants,
+ this.liveRooms.setParticipants(1, [
+ ...this.liveRooms.roomById(1).active_participants,
...fakes,
]);
- await render(<template><VoiceCallWidget /></template>);
+ await render(<template><LiveCallWidget /></template>);
await waitUntil(() =>
- document.querySelector(".voice-call-widget__overflow-tile")
+ document.querySelector(".live-call-widget__overflow-tile")
);
const tileCount = document.querySelectorAll(
- ".voice-call-widget .voice-video-tile"
+ ".live-call-widget .live-video-tile"
).length;
const hidden = parseInt(
document
- .querySelector(".voice-call-widget__overflow-count")
+ .querySelector(".live-call-widget__overflow-count")
.textContent.trim()
.replace("+", ""),
10
@@ -293,7 +293,7 @@ module("Integration | Component | voice/call-widget", function (hooks) {
"every participant is either a tile or counted"
);
assert
- .dom(".voice-call-widget__overflow-avatars img")
+ .dom(".live-call-widget__overflow-avatars img")
.exists("previews hidden participants' avatars");
});
@@ -311,9 +311,9 @@ module("Integration | Component | voice/call-widget", function (hooks) {
avatar_template: `/letter_avatar_proxy/v4/letter/${letter}/{size}.png`,
};
});
- this.voiceWebrtc.videoStreams.set("1:300", { id: "zed-video" });
- this.voiceRooms.setParticipants(1, [
- ...this.voiceRooms.roomById(1).active_participants,
+ this.liveWebrtc.videoStreams.set("1:300", { id: "zed-video" });
+ this.liveRooms.setParticipants(1, [
+ ...this.liveRooms.roomById(1).active_participants,
...fakes,
{
id: 300,
@@ -323,18 +323,18 @@ module("Integration | Component | voice/call-widget", function (hooks) {
},
]);
- await render(<template><VoiceCallWidget /></template>);
+ await render(<template><LiveCallWidget /></template>);
await waitUntil(() =>
- document.querySelector(".voice-call-widget__overflow-tile")
+ document.querySelector(".live-call-widget__overflow-tile")
);
assert
.dom(
- ".voice-call-widget .voice-video-tile[data-user-id='300'] video.voice-video-tile__video"
+ ".live-call-widget .live-video-tile[data-user-id='300'] video.live-video-tile__video"
)
.exists("the camera publisher is promoted out of the overflow tail");
assert
- .dom(".voice-call-widget .voice-video-tile[data-user-id='100']")
+ .dom(".live-call-widget .live-video-tile[data-user-id='100']")
.doesNotExist("an avatar-only participant yields the slot");
});
@@ -347,30 +347,30 @@ module("Integration | Component | voice/call-widget", function (hooks) {
avatar_template: `/letter_avatar_proxy/v4/letter/${letter}/{size}.png`,
};
});
- this.voiceRooms.setParticipants(1, [
- ...this.voiceRooms.roomById(1).active_participants,
+ this.liveRooms.setParticipants(1, [
+ ...this.liveRooms.roomById(1).active_participants,
...fakes,
]);
- await render(<template><VoiceCallWidget /></template>);
+ await render(<template><LiveCallWidget /></template>);
await waitUntil(
() =>
- document.querySelectorAll(".voice-call-widget .voice-video-tile")
+ document.querySelectorAll(".live-call-widget .live-video-tile")
.length === 4
);
assert
- .dom(".voice-call-widget .voice-video-tile")
+ .dom(".live-call-widget .live-video-tile")
.exists({ count: 4 }, "renders a tile per participant");
assert
- .dom(".voice-call-widget__overflow-tile")
+ .dom(".live-call-widget__overflow-tile")
.doesNotExist("no overflow tile when everyone fits");
});
test("resizing below the widget threshold enters extra minimized mode", async function (assert) {
- await render(<template><VoiceCallWidget /></template>);
+ await render(<template><LiveCallWidget /></template>);
- const widget = document.querySelector(".voice-call-widget");
+ const widget = document.querySelector(".live-call-widget");
widget.getBoundingClientRect = () => ({
left: 100,
top: 100,
@@ -380,7 +380,7 @@ module("Integration | Component | voice/call-widget", function (hooks) {
height: 240,
});
- await triggerEvent(".voice-call-widget__resize.--se", "mousedown", {
+ await triggerEvent(".live-call-widget__resize.--se", "mousedown", {
button: 0,
clientX: 500,
clientY: 340,
@@ -392,38 +392,38 @@ module("Integration | Component | voice/call-widget", function (hooks) {
await triggerEvent(window, "mouseup");
assert
- .dom(".voice-call-widget")
+ .dom(".live-call-widget")
.hasClass(
"--extra-minimized",
"marks the widget as extra minimized after crossing the resize threshold"
);
assert
- .dom(".voice-call-widget__tiles")
+ .dom(".live-call-widget__tiles")
.doesNotExist("hides participant tiles in extra minimized mode");
assert
- .dom(".voice-call-widget__controls button")
+ .dom(".live-call-widget__controls button")
.exists({ count: 2 }, "only renders expand and leave controls");
assert.false(
/inset-inline-start|inset-block-start/.test(
- document.querySelector(".voice-call-widget").getAttribute("style") ?? ""
+ document.querySelector(".live-call-widget").getAttribute("style") ?? ""
),
"keeps the extra minimized widget pinned to the bottom-right corner"
);
- await click(".voice-call-widget__expand");
+ await click(".live-call-widget__expand");
assert
- .dom(".voice-call-widget")
+ .dom(".live-call-widget")
.doesNotHaveClass(
"--extra-minimized",
"expands back to the default widget dimensions"
);
assert
- .dom(".voice-call-widget__tiles")
+ .dom(".live-call-widget__tiles")
.exists("restores the default widget content");
assert.false(
/inset-inline-start|inset-block-start/.test(
- document.querySelector(".voice-call-widget").getAttribute("style") ?? ""
+ document.querySelector(".live-call-widget").getAttribute("style") ?? ""
),
"expands from the bottom-right corner instead of the old resize position"
);
diff --git a/plugins/live/test/javascripts/integration/components/live/voice-canvas-test.gjs b/plugins/live/test/javascripts/integration/components/live/voice-canvas-test.gjs
new file mode 100644
index 00000000000..735dc65c4de
--- /dev/null
+++ b/plugins/live/test/javascripts/integration/components/live/voice-canvas-test.gjs
@@ -0,0 +1,73 @@
+import { tracked } from "@glimmer/tracking";
+import { action } from "@ember/object";
+import Service from "@ember/service";
+import { render, settled } from "@ember/test-helpers";
+import { module, test } from "qunit";
+import { setupRenderingTest } from "discourse/tests/helpers/component-test";
+import LiveVoiceCanvas from "discourse/plugins/live/discourse/components/live/voice-canvas";
+
+class LiveWebrtcStub extends Service {
+ @tracked localStream = null;
+ @tracked remoteStreams = [];
+ @tracked remoteScreenAudioStreams = [];
+ attachCalls = [];
+
+ @action
+ attachStream(stream, element) {
+ this.attachCalls.push({ stream, element });
+ }
+}
+
+module("Integration | Component | live/voice-canvas", function (hooks) {
+ setupRenderingTest(hooks);
+
+ hooks.beforeEach(function () {
+ this.owner.unregister("service:live-webrtc");
+ this.owner.register("service:live-webrtc", LiveWebrtcStub);
+ this.liveWebrtc = this.owner.lookup("service:live-webrtc");
+ });
+
+ test("re-attaches a remote stream when the object changes but the id stays the same", async function (assert) {
+ const firstStream = { id: "peer-stream" };
+ const secondStream = { id: "peer-stream" };
+
+ this.liveWebrtc.remoteStreams = [firstStream];
+
+ await render(<template><LiveVoiceCanvas /></template>);
+
+ assert.strictEqual(this.liveWebrtc.attachCalls.length, 1);
+ assert.strictEqual(this.liveWebrtc.attachCalls[0].stream, firstStream);
+
+ const element = this.liveWebrtc.attachCalls[0].element;
+
+ this.liveWebrtc.remoteStreams = [secondStream];
+ await settled();
+
+ assert.strictEqual(this.liveWebrtc.attachCalls.length, 2);
+ assert.strictEqual(this.liveWebrtc.attachCalls[1].stream, secondStream);
+ assert.strictEqual(this.liveWebrtc.attachCalls[1].element, element);
+ });
+
+ test("renders a dedicated sink for each remote screen audio stream", async function (assert) {
+ const voiceStream = { id: "voice-stream" };
+ const screenAudioStream = { id: "screen-audio-stream" };
+
+ this.liveWebrtc.remoteStreams = [voiceStream];
+
+ await render(<template><LiveVoiceCanvas /></template>);
+
+ assert.strictEqual(this.liveWebrtc.attachCalls.length, 1);
+
+ this.liveWebrtc.remoteScreenAudioStreams = [screenAudioStream];
+ await settled();
+
+ assert.strictEqual(this.liveWebrtc.attachCalls.length, 2);
+ assert.strictEqual(
+ this.liveWebrtc.attachCalls[1].stream,
+ screenAudioStream
+ );
+ assert
+ .dom(".live-voice-canvas audio")
+ .exists({ count: 2 }, "keeps the live sink alongside the screen sink");
+ });
+});
diff --git a/plugins/voice/test/javascripts/unit/lib/audio-monitor-test.js b/plugins/live/test/javascripts/unit/lib/audio-monitor-test.js
similarity index 96%
rename from plugins/voice/test/javascripts/unit/lib/audio-monitor-test.js
rename to plugins/live/test/javascripts/unit/lib/audio-monitor-test.js
index 614d7c23d86..8197cc867a4 100644
--- a/plugins/voice/test/javascripts/unit/lib/audio-monitor-test.js
+++ b/plugins/live/test/javascripts/unit/lib/audio-monitor-test.js
@@ -1,11 +1,11 @@
import { module, test } from "qunit";
-import AudioMonitor from "discourse/plugins/voice/discourse/lib/voice/audio-monitor";
+import AudioMonitor from "discourse/plugins/live/discourse/lib/live/audio-monitor";
function wait(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
-module("Voice | Unit | Lib | audio-monitor", function (hooks) {
+module("Live | Unit | Lib | audio-monitor", function (hooks) {
hooks.beforeEach(function () {
const testContext = this;
diff --git a/plugins/voice/test/javascripts/unit/lib/fullscreen-test.js b/plugins/live/test/javascripts/unit/lib/fullscreen-test.js
similarity index 94%
rename from plugins/voice/test/javascripts/unit/lib/fullscreen-test.js
rename to plugins/live/test/javascripts/unit/lib/fullscreen-test.js
index 464da542b24..afc741be307 100644
--- a/plugins/voice/test/javascripts/unit/lib/fullscreen-test.js
+++ b/plugins/live/test/javascripts/unit/lib/fullscreen-test.js
@@ -2,11 +2,11 @@ import { module, test } from "qunit";
import {
toggleFullscreen,
toggleTileFullscreen,
-} from "discourse/plugins/voice/discourse/lib/voice/fullscreen";
+} from "discourse/plugins/live/discourse/lib/live/fullscreen";
// Nothing is fullscreen during these tests, so toggle always takes the enter
// path; each case exposes only one browser's API to assert the fallback order.
-module("Voice | Unit | Lib | fullscreen", function () {
+module("Live | Unit | Lib | fullscreen", function () {
test("prefers the standard Fullscreen API on the tile", function (assert) {
let called = false;
const tile = {
diff --git a/plugins/voice/test/javascripts/unit/lib/local-audio-pipeline-test.js b/plugins/live/test/javascripts/unit/lib/local-audio-pipeline-test.js
similarity index 97%
rename from plugins/voice/test/javascripts/unit/lib/local-audio-pipeline-test.js
rename to plugins/live/test/javascripts/unit/lib/local-audio-pipeline-test.js
index 0619d927ba7..277c0e71011 100644
--- a/plugins/voice/test/javascripts/unit/lib/local-audio-pipeline-test.js
+++ b/plugins/live/test/javascripts/unit/lib/local-audio-pipeline-test.js
@@ -1,7 +1,7 @@
import { setupTest } from "ember-qunit";
import { module, test } from "qunit";
import Site from "discourse/models/site";
-import LocalAudioPipeline from "discourse/plugins/voice/discourse/lib/voice/local-audio-pipeline";
+import LocalAudioPipeline from "discourse/plugins/live/discourse/lib/live/local-audio-pipeline";
const STORAGE_KEYS = [
"voice:noise-suppression",
@@ -94,13 +94,13 @@ function installFakeEnvironment(context, { rawStream, processedStream }) {
};
// The gem-vendored asset base the loaders read at runtime.
- Site.current().set("voice_assets_path", "/plugins/voice/javascripts/0.0.0");
+ Site.current().set("live_assets_path", "/plugins/live/javascripts/0.0.0");
const originalFetch = globalThis.fetch;
globalThis.AudioContext = FakeAudioContext;
window.AudioContext = FakeAudioContext;
globalThis.AudioWorkletNode = FakeAudioWorkletNode;
globalThis.fetch = (url, options) => {
- if (String(url).includes("/plugins/voice/javascripts/")) {
+ if (String(url).includes("/plugins/live/javascripts/")) {
return Promise.resolve({
ok: true,
arrayBuffer: async () => new ArrayBuffer(8),
@@ -141,7 +141,7 @@ async function waitForWorkletNode(workletNodes, index = 0) {
throw new Error("worklet node never received wasm bytes");
}
-module("Voice | Unit | Lib | local-audio-pipeline", function (hooks) {
+module("Live | Unit | Lib | local-audio-pipeline", function (hooks) {
setupTest(hooks);
hooks.beforeEach(function () {
diff --git a/plugins/voice/test/javascripts/unit/lib/logger-test.js b/plugins/live/test/javascripts/unit/lib/logger-test.js
similarity index 60%
rename from plugins/voice/test/javascripts/unit/lib/logger-test.js
rename to plugins/live/test/javascripts/unit/lib/logger-test.js
index 007f6ca2d22..8841c54c62e 100644
--- a/plugins/voice/test/javascripts/unit/lib/logger-test.js
+++ b/plugins/live/test/javascripts/unit/lib/logger-test.js
@@ -2,9 +2,9 @@ import { setupTest } from "ember-qunit";
import { module, test } from "qunit";
import sinon from "sinon";
import { getOwnerWithFallback, setDefaultOwner } from "discourse/lib/get-owner";
-import voiceLog from "discourse/plugins/voice/discourse/lib/voice/logger";
+import liveLog from "discourse/plugins/live/discourse/lib/live/logger";
-module("Voice | Unit | Lib | logger", function (hooks) {
+module("Live | Unit | Lib | logger", function (hooks) {
setupTest(hooks);
hooks.beforeEach(function () {
@@ -23,52 +23,52 @@ module("Voice | Unit | Lib | logger", function (hooks) {
test("logging is disabled by default", function (assert) {
assert.false(
- this.siteSettings.voice_verbose_logging,
+ this.siteSettings.live_verbose_logging,
"verbose logging defaults to off"
);
- voiceLog.info("[voice] local stream obtained");
- voiceLog.warn("[voice] failed to obtain local stream");
+ liveLog.info("[live] local stream obtained");
+ liveLog.warn("[live] failed to obtain local stream");
assert.false(this.info.called, "info is silent");
assert.false(this.warn.called, "warnings are silent");
});
test("logging follows changes to the setting", function (assert) {
- this.siteSettings.voice_verbose_logging = true;
- voiceLog.info("[voice] local stream obtained");
- voiceLog.warn("[voice] failed to obtain local stream");
- this.siteSettings.voice_verbose_logging = false;
- voiceLog.info("[voice] local stream obtained");
- voiceLog.warn("[voice] failed to obtain local stream");
+ this.siteSettings.live_verbose_logging = true;
+ liveLog.info("[live] local stream obtained");
+ liveLog.warn("[live] failed to obtain local stream");
+ this.siteSettings.live_verbose_logging = false;
+ liveLog.info("[live] local stream obtained");
+ liveLog.warn("[live] failed to obtain local stream");
assert.true(
- this.info.calledOnceWithExactly("[voice] local stream obtained"),
+ this.info.calledOnceWithExactly("[live] local stream obtained"),
"info logs only when enabled"
);
assert.true(
- this.warn.calledOnceWithExactly("[voice] failed to obtain local stream"),
+ this.warn.calledOnceWithExactly("[live] failed to obtain local stream"),
"warnings log only when enabled"
);
});
test("only sanitized error fields are logged", function (assert) {
- this.siteSettings.voice_verbose_logging = true;
+ this.siteSettings.live_verbose_logging = true;
const error = new Error("publish failed: token=secret");
const payload = { candidate: "private IP address", token: "secret token" };
- voiceLog.info("[voice] received signal", payload);
- voiceLog.warn("[voice] failed to obtain local stream", error, payload);
+ liveLog.info("[live] received signal", payload);
+ liveLog.warn("[live] failed to obtain local stream", error, payload);
assert.deepEqual(
this.info.firstCall.args,
- ["[voice] received signal"],
+ ["[live] received signal"],
"payloads are omitted"
);
assert.deepEqual(
this.warn.firstCall.args,
[
- "[voice] failed to obtain local stream",
+ "[live] failed to obtain local stream",
{ name: "Error", message: "publish failed: [FILTERED]" },
],
"only sanitized error details are included"
diff --git a/plugins/voice/test/javascripts/unit/lib/peer-manager-test.js b/plugins/live/test/javascripts/unit/lib/peer-manager-test.js
similarity index 98%
rename from plugins/voice/test/javascripts/unit/lib/peer-manager-test.js
rename to plugins/live/test/javascripts/unit/lib/peer-manager-test.js
index b7a7b4aaff4..670a2cc1501 100644
--- a/plugins/voice/test/javascripts/unit/lib/peer-manager-test.js
+++ b/plugins/live/test/javascripts/unit/lib/peer-manager-test.js
@@ -1,5 +1,5 @@
import { module, test } from "qunit";
-import PeerManager from "discourse/plugins/voice/discourse/lib/voice/peer-manager";
+import PeerManager from "discourse/plugins/live/discourse/lib/live/peer-manager";
class FakeRTCPeerConnection {
signalingState = "stable";
@@ -57,7 +57,7 @@ class FakeRTCPeerConnection {
}
}
-module("Voice | Unit | Lib | peer-manager", function (hooks) {
+module("Live | Unit | Lib | peer-manager", function (hooks) {
hooks.beforeEach(function () {
this.originalRTCPeerConnection = globalThis.RTCPeerConnection;
globalThis.RTCPeerConnection = FakeRTCPeerConnection;
diff --git a/plugins/voice/test/javascripts/unit/lib/room-message-queue-test.js b/plugins/live/test/javascripts/unit/lib/room-message-queue-test.js
similarity index 86%
rename from plugins/voice/test/javascripts/unit/lib/room-message-queue-test.js
rename to plugins/live/test/javascripts/unit/lib/room-message-queue-test.js
index ec089b4dd35..9f8a785657f 100644
--- a/plugins/voice/test/javascripts/unit/lib/room-message-queue-test.js
+++ b/plugins/live/test/javascripts/unit/lib/room-message-queue-test.js
@@ -1,7 +1,7 @@
import { module, test } from "qunit";
-import RoomMessageQueue from "discourse/plugins/voice/discourse/lib/voice/room-message-queue";
+import RoomMessageQueue from "discourse/plugins/live/discourse/lib/live/room-message-queue";
-module("Voice | Unit | Lib | room-message-queue", function () {
+module("Live | Unit | Lib | room-message-queue", function () {
test("continues processing later messages after a failure", async function (assert) {
const queue = new RoomMessageQueue();
const processed = [];
diff --git a/plugins/voice/test/javascripts/unit/lib/sanitize-error-test.js b/plugins/live/test/javascripts/unit/lib/sanitize-error-test.js
similarity index 94%
rename from plugins/voice/test/javascripts/unit/lib/sanitize-error-test.js
rename to plugins/live/test/javascripts/unit/lib/sanitize-error-test.js
index 40eef7b5ebf..bc86f0ae67c 100644
--- a/plugins/voice/test/javascripts/unit/lib/sanitize-error-test.js
+++ b/plugins/live/test/javascripts/unit/lib/sanitize-error-test.js
@@ -1,7 +1,7 @@
import { module, test } from "qunit";
-import sanitizeError from "discourse/plugins/voice/discourse/lib/voice/sanitize-error";
+import sanitizeError from "discourse/plugins/live/discourse/lib/live/sanitize-error";
-module("Voice | Unit | Lib | sanitize-error", function () {
+module("Live | Unit | Lib | sanitize-error", function () {
test("retains diagnostic fields without stacks or nested payloads", function (assert) {
const error = new Error("track publication timed out");
error.name = "PublishError";
diff --git a/plugins/voice/test/javascripts/unit/lib/signaling-test.js b/plugins/live/test/javascripts/unit/lib/signaling-test.js
similarity index 96%
rename from plugins/voice/test/javascripts/unit/lib/signaling-test.js
rename to plugins/live/test/javascripts/unit/lib/signaling-test.js
index 2c87aad517c..aa844065fd1 100644
--- a/plugins/voice/test/javascripts/unit/lib/signaling-test.js
+++ b/plugins/live/test/javascripts/unit/lib/signaling-test.js
@@ -1,5 +1,5 @@
import { module, test } from "qunit";
-import SignalingManager from "discourse/plugins/voice/discourse/lib/voice/signaling";
+import SignalingManager from "discourse/plugins/live/discourse/lib/live/signaling";
function wait(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
@@ -17,7 +17,7 @@ function deferred() {
return { promise, resolve, reject };
}
-module("Voice | Unit | Lib | signaling", function () {
+module("Live | Unit | Lib | signaling", function () {
test("clearForPeer drops unsent HTTP-batched signals for destroyed peers", async function (assert) {
assert.timeout(1000);
diff --git a/plugins/voice/test/javascripts/unit/lib/sound-effects-test.js b/plugins/live/test/javascripts/unit/lib/sound-effects-test.js
similarity index 99%
rename from plugins/voice/test/javascripts/unit/lib/sound-effects-test.js
rename to plugins/live/test/javascripts/unit/lib/sound-effects-test.js
index 9615d588a55..c3907d3c3f6 100644
--- a/plugins/voice/test/javascripts/unit/lib/sound-effects-test.js
+++ b/plugins/live/test/javascripts/unit/lib/sound-effects-test.js
@@ -16,7 +16,7 @@ import {
startRingtone,
startWaitingSound,
stopCallSounds,
-} from "discourse/plugins/voice/discourse/lib/voice/sound-effects";
+} from "discourse/plugins/live/discourse/lib/live/sound-effects";
const ROOM_CUES = [
playConnectedSound,
diff --git a/plugins/voice/test/javascripts/unit/lib/speak-queue-test.js b/plugins/live/test/javascripts/unit/lib/speak-queue-test.js
similarity index 95%
rename from plugins/voice/test/javascripts/unit/lib/speak-queue-test.js
rename to plugins/live/test/javascripts/unit/lib/speak-queue-test.js
index 48183ddb2d0..d3b76d6f484 100644
--- a/plugins/voice/test/javascripts/unit/lib/speak-queue-test.js
+++ b/plugins/live/test/javascripts/unit/lib/speak-queue-test.js
@@ -2,13 +2,13 @@ import { module, test } from "qunit";
import {
queuePosition,
speakQueue,
-} from "discourse/plugins/voice/discourse/lib/voice/speak-queue";
+} from "discourse/plugins/live/discourse/lib/live/speak-queue";
function stageRoom(participants) {
return { room_type: "stage", active_participants: participants };
}
-module("Voice | Unit | Lib | speak-queue", function () {
+module("Live | Unit | Lib | speak-queue", function () {
test("orders raised hands by hand_raised_at ascending", function (assert) {
const room = stageRoom([
{ id: 1, hand_raised_at: 300 },
diff --git a/plugins/voice/test/javascripts/unit/lib/stage-roles-test.js b/plugins/live/test/javascripts/unit/lib/stage-roles-test.js
similarity index 96%
rename from plugins/voice/test/javascripts/unit/lib/stage-roles-test.js
rename to plugins/live/test/javascripts/unit/lib/stage-roles-test.js
index 6928c40c6a7..ed2a02b9e80 100644
--- a/plugins/voice/test/javascripts/unit/lib/stage-roles-test.js
+++ b/plugins/live/test/javascripts/unit/lib/stage-roles-test.js
@@ -2,7 +2,7 @@ import { module, test } from "qunit";
import {
participantEntitledToMedia,
remoteTrackAllowed,
-} from "discourse/plugins/voice/discourse/lib/voice/stage-roles";
+} from "discourse/plugins/live/discourse/lib/live/stage-roles";
function room(participant) {
return {
@@ -15,7 +15,7 @@ function room(participant) {
const videoTrack = { kind: "video" };
const audioTrack = { kind: "audio" };
-module("Voice | Unit | Lib | stage-roles", function () {
+module("Live | Unit | Lib | stage-roles", function () {
test("a mesh video track needs the sender's entitlement", function (assert) {
const cases = [
[{ is_video_on: true, can_publish_video: true }, true, "entitled camera"],
diff --git a/plugins/voice/test/javascripts/unit/lib/stt-models-test.js b/plugins/live/test/javascripts/unit/lib/stt-models-test.js
similarity index 92%
rename from plugins/voice/test/javascripts/unit/lib/stt-models-test.js
rename to plugins/live/test/javascripts/unit/lib/stt-models-test.js
index 62b36747c0b..38a721f5458 100644
--- a/plugins/voice/test/javascripts/unit/lib/stt-models-test.js
+++ b/plugins/live/test/javascripts/unit/lib/stt-models-test.js
@@ -6,9 +6,9 @@ import {
setPreferredSttModel,
STT_MODELS,
sttModelUrl,
-} from "discourse/plugins/voice/discourse/lib/voice/stt-models";
+} from "discourse/plugins/live/discourse/lib/live/stt-models";
-module("Voice | Unit | Lib | stt-models", function (hooks) {
+module("Live | Unit | Lib | stt-models", function (hooks) {
setupTest(hooks);
hooks.beforeEach(function () {
diff --git a/plugins/voice/test/javascripts/unit/lib/subtitles-test.js b/plugins/live/test/javascripts/unit/lib/subtitles-test.js
similarity index 98%
rename from plugins/voice/test/javascripts/unit/lib/subtitles-test.js
rename to plugins/live/test/javascripts/unit/lib/subtitles-test.js
index 5783d7fad21..3caa2519d00 100644
--- a/plugins/voice/test/javascripts/unit/lib/subtitles-test.js
+++ b/plugins/live/test/javascripts/unit/lib/subtitles-test.js
@@ -1,6 +1,6 @@
import { setupTest } from "ember-qunit";
import { module, test } from "qunit";
-import SubtitlesManager from "discourse/plugins/voice/discourse/lib/voice/subtitles";
+import SubtitlesManager from "discourse/plugins/live/discourse/lib/live/subtitles";
function createFakeStream(id, trackId = `${id}-track`) {
return {
@@ -104,7 +104,7 @@ function fakeVadModule() {
};
}
-module("Voice | Unit | Lib | subtitles", function (hooks) {
+module("Live | Unit | Lib | subtitles", function (hooks) {
setupTest(hooks);
hooks.beforeEach(function () {
diff --git a/plugins/voice/test/javascripts/unit/lib/transcript-draft-sync-test.js b/plugins/live/test/javascripts/unit/lib/transcript-draft-sync-test.js
similarity index 89%
rename from plugins/voice/test/javascripts/unit/lib/transcript-draft-sync-test.js
rename to plugins/live/test/javascripts/unit/lib/transcript-draft-sync-test.js
index 5216a75cccb..0b1b522e6a4 100644
--- a/plugins/voice/test/javascripts/unit/lib/transcript-draft-sync-test.js
+++ b/plugins/live/test/javascripts/unit/lib/transcript-draft-sync-test.js
@@ -1,8 +1,8 @@
import { setupTest } from "ember-qunit";
import { module, test } from "qunit";
-import TranscriptDraftSync from "discourse/plugins/voice/discourse/lib/voice/transcript-draft-sync";
+import TranscriptDraftSync from "discourse/plugins/live/discourse/lib/live/transcript-draft-sync";
-module("Voice | Unit | Lib | transcript-draft-sync", function (hooks) {
+module("Live | Unit | Lib | transcript-draft-sync", function (hooks) {
setupTest(hooks);
hooks.beforeEach(function () {
@@ -25,7 +25,7 @@ module("Voice | Unit | Lib | transcript-draft-sync", function (hooks) {
test("flushes only when dirty and tracks the sequence", async function (assert) {
this.sync.start(5, 1000);
- assert.strictEqual(this.sync.key, "new_topic_voice_5_1000");
+ assert.strictEqual(this.sync.key, "new_topic_live_5_1000");
await this.sync.flush();
assert.strictEqual(this.saves.length, 0, "clean flush is a no-op");
@@ -106,6 +106,6 @@ module("Voice | Unit | Lib | transcript-draft-sync", function (hooks) {
await this.sync.stop();
assert.strictEqual(this.saves.length, 1);
- assert.strictEqual(this.sync.key, "new_topic_voice_5_1000", "key kept");
+ assert.strictEqual(this.sync.key, "new_topic_live_5_1000", "key kept");
});
});
diff --git a/plugins/voice/test/javascripts/unit/lib/transcript-markdown-test.js b/plugins/live/test/javascripts/unit/lib/transcript-markdown-test.js
similarity index 89%
rename from plugins/voice/test/javascripts/unit/lib/transcript-markdown-test.js
rename to plugins/live/test/javascripts/unit/lib/transcript-markdown-test.js
index 5b9b3bc5814..9a484f41987 100644
--- a/plugins/voice/test/javascripts/unit/lib/transcript-markdown-test.js
+++ b/plugins/live/test/javascripts/unit/lib/transcript-markdown-test.js
@@ -1,8 +1,8 @@
import { setupTest } from "ember-qunit";
import { module, test } from "qunit";
-import { transcriptToMarkdown } from "discourse/plugins/voice/discourse/lib/voice/transcript-markdown";
+import { transcriptToMarkdown } from "discourse/plugins/live/discourse/lib/live/transcript-markdown";
-module("Voice | Unit | Lib | transcript-markdown", function (hooks) {
+module("Live | Unit | Lib | transcript-markdown", function (hooks) {
setupTest(hooks);
const entries = [
@@ -40,7 +40,7 @@ module("Voice | Unit | Lib | transcript-markdown", function (hooks) {
assert.strictEqual(
markdown,
[
- '[chat quote="alice;7;2026-08-20T16:38:24.000Z" source="Weekly sync" sourceType=voice chained="true"]\nhello world\n[/chat]',
+ '[chat quote="alice;7;2026-08-20T16:38:24.000Z" source="Weekly sync" sourceType=live chained="true"]\nhello world\n[/chat]',
'[chat quote="bob;8;2026-08-20T16:38:46.000Z" chained="true"]\nhi there\n[/chat]',
].join("\n\n")
);
diff --git a/plugins/voice/test/javascripts/unit/lib/transcript-recorder-test.js b/plugins/live/test/javascripts/unit/lib/transcript-recorder-test.js
similarity index 95%
rename from plugins/voice/test/javascripts/unit/lib/transcript-recorder-test.js
rename to plugins/live/test/javascripts/unit/lib/transcript-recorder-test.js
index 0e428bf021d..5d485cee806 100644
--- a/plugins/voice/test/javascripts/unit/lib/transcript-recorder-test.js
+++ b/plugins/live/test/javascripts/unit/lib/transcript-recorder-test.js
@@ -1,8 +1,8 @@
import { setupTest } from "ember-qunit";
import { module, test } from "qunit";
-import TranscriptRecorder from "discourse/plugins/voice/discourse/lib/voice/transcript-recorder";
+import TranscriptRecorder from "discourse/plugins/live/discourse/lib/live/transcript-recorder";
-module("Voice | Unit | Lib | transcript-recorder", function (hooks) {
+module("Live | Unit | Lib | transcript-recorder", function (hooks) {
setupTest(hooks);
hooks.beforeEach(function () {
diff --git a/plugins/voice/test/javascripts/unit/lib/video-grid-layout-test.js b/plugins/live/test/javascripts/unit/lib/video-grid-layout-test.js
similarity index 96%
rename from plugins/voice/test/javascripts/unit/lib/video-grid-layout-test.js
rename to plugins/live/test/javascripts/unit/lib/video-grid-layout-test.js
index 84ff1d1fd1c..77168aa2daa 100644
--- a/plugins/voice/test/javascripts/unit/lib/video-grid-layout-test.js
+++ b/plugins/live/test/javascripts/unit/lib/video-grid-layout-test.js
@@ -3,12 +3,12 @@ import {
bestRowHeight,
computeWidgetGrid,
DEFAULT_TILE_ASPECT,
-} from "discourse/plugins/voice/discourse/lib/voice/video-grid-layout";
+} from "discourse/plugins/live/discourse/lib/live/video-grid-layout";
const LANDSCAPE = DEFAULT_TILE_ASPECT; // 16 / 9
const PORTRAIT = 9 / 16;
-module("Voice | Unit | Lib | video-grid-layout", function () {
+module("Live | Unit | Lib | video-grid-layout", function () {
test("a single tile fills the constraining dimension", function (assert) {
// Wide container: a landscape tile is limited by height.
assert.strictEqual(
@@ -85,7 +85,7 @@ module("Voice | Unit | Lib | video-grid-layout", function () {
});
});
-module("Voice | Unit | Lib | video-grid-layout | widget grid", function () {
+module("Live | Unit | Lib | video-grid-layout | widget grid", function () {
test("a lone participant fills the box, aspect permitting", function (assert) {
assert.deepEqual(
computeWidgetGrid({ width: 400, height: 300, count: 1, gap: 8 }),
diff --git a/plugins/voice/test/javascripts/unit/models/voice-room-test.js b/plugins/live/test/javascripts/unit/models/live-room-test.js
similarity index 82%
rename from plugins/voice/test/javascripts/unit/models/voice-room-test.js
rename to plugins/live/test/javascripts/unit/models/live-room-test.js
index b1352821d3f..a39ea87545d 100644
--- a/plugins/voice/test/javascripts/unit/models/voice-room-test.js
+++ b/plugins/live/test/javascripts/unit/models/live-room-test.js
@@ -1,7 +1,7 @@
import { module, test } from "qunit";
-import VoiceRoom from "discourse/plugins/voice/admin/models/voice-room";
+import LiveRoom from "discourse/plugins/live/admin/models/live-room";
-module("Unit | model | voice-room", function () {
+module("Unit | model | live-room", function () {
const attrs = () => ({
name: "Team Meeting",
description: "Recurring sync",
@@ -14,13 +14,13 @@ module("Unit | model | voice-room", function () {
});
test("createProperties includes the chat settings fields", function (assert) {
- const room = VoiceRoom.create(attrs());
+ const room = LiveRoom.create(attrs());
assert.deepEqual(room.createProperties(), attrs());
});
test("updateProperties includes the chat settings fields", function (assert) {
- const room = VoiceRoom.create(attrs());
+ const room = LiveRoom.create(attrs());
assert.deepEqual(room.updateProperties(), attrs());
});
@@ -30,7 +30,7 @@ module("Unit | model | voice-room", function () {
// JSON.stringify (used by this model's adapter) silently drops
// `undefined`-valued keys, so the clear would never reach the server
// unless it's normalized to `null` first.
- const room = VoiceRoom.create({ ...attrs(), chat_channel_id: undefined });
+ const room = LiveRoom.create({ ...attrs(), chat_channel_id: undefined });
const saved = room.updateProperties();
diff --git a/plugins/voice/test/javascripts/unit/services/voice-rooms-test.js b/plugins/live/test/javascripts/unit/services/live-rooms-test.js
similarity index 92%
rename from plugins/voice/test/javascripts/unit/services/voice-rooms-test.js
rename to plugins/live/test/javascripts/unit/services/live-rooms-test.js
index e5f8f3d8f5f..04b62556372 100644
--- a/plugins/voice/test/javascripts/unit/services/voice-rooms-test.js
+++ b/plugins/live/test/javascripts/unit/services/live-rooms-test.js
@@ -1,11 +1,11 @@
import { setupTest } from "ember-qunit";
import { module, test } from "qunit";
-module("Voice | Unit | Service | voice-rooms", function (hooks) {
+module("Live | Unit | Service | live-rooms", function (hooks) {
setupTest(hooks);
test("room edits preserve user-specific state across shared updates", function (assert) {
- const service = this.owner.lookup("service:voice-rooms");
+ const service = this.owner.lookup("service:live-rooms");
const membership = { id: 1, role_name: "moderator" };
service.upsertRoom({
id: 1,
@@ -31,7 +31,7 @@ module("Voice | Unit | Service | voice-rooms", function (hooks) {
});
test("user-scoped responses can revoke room permissions", function (assert) {
- const service = this.owner.lookup("service:voice-rooms");
+ const service = this.owner.lookup("service:live-rooms");
service.upsertRoom({
id: 1,
slug: "watercooler",
@@ -55,7 +55,7 @@ module("Voice | Unit | Service | voice-rooms", function (hooks) {
});
test("participant lists keep one canonical order across updates", function (assert) {
- const service = this.owner.lookup("service:voice-rooms");
+ const service = this.owner.lookup("service:live-rooms");
service.handleDirectoryEvent({
type: "created",
diff --git a/plugins/voice/test/javascripts/unit/services/voice-webrtc-livekit-test.js b/plugins/live/test/javascripts/unit/services/live-webrtc-livekit-test.js
similarity index 97%
rename from plugins/voice/test/javascripts/unit/services/voice-webrtc-livekit-test.js
rename to plugins/live/test/javascripts/unit/services/live-webrtc-livekit-test.js
index 873303b0282..6091e5ed60b 100644
--- a/plugins/voice/test/javascripts/unit/services/voice-webrtc-livekit-test.js
+++ b/plugins/live/test/javascripts/unit/services/live-webrtc-livekit-test.js
@@ -7,8 +7,8 @@ import { logIn } from "discourse/tests/helpers/qunit-helpers";
import {
setLivekitReconnectDelaysForTesting,
setLivekitSdkLoaderForTesting,
-} from "discourse/plugins/voice/discourse/lib/voice/livekit-session";
-import { setPeerTimingForTesting } from "discourse/plugins/voice/discourse/lib/voice/peer-manager";
+} from "discourse/plugins/live/discourse/lib/live/livekit-session";
+import { setPeerTimingForTesting } from "discourse/plugins/live/discourse/lib/live/peer-manager";
// Park the mesh peer machinery's wall-clock timers far outside any test's
// window. This suite mostly runs on the livekit transport, but its mesh
@@ -24,7 +24,7 @@ const SAFE_PEER_TIMING = {
connectionTimeoutMs: 60_000,
};
-class VoiceRoomsStub extends Service {
+class LiveRoomsStub extends Service {
#roomHandlers = new Map();
#roomsById = new Map();
@@ -449,11 +449,11 @@ function installFakeAudioEnvironment({ rawStream, processedStream }) {
}
// The gem-vendored asset base the loaders read at runtime.
- Site.current().set("voice_assets_path", "/plugins/voice/javascripts/0.0.0");
+ Site.current().set("live_assets_path", "/plugins/live/javascripts/0.0.0");
const originalFetch = globalThis.fetch;
const fakeFetch = (url, options) => {
- if (String(url).includes("/plugins/voice/javascripts/")) {
+ if (String(url).includes("/plugins/live/javascripts/")) {
return Promise.resolve({
ok: true,
arrayBuffer: async () => new ArrayBuffer(8),
@@ -492,7 +492,7 @@ function installFakeAudioEnvironment({ rawStream, processedStream }) {
};
}
-module("Voice | Unit | Service | voice-webrtc-livekit", function (hooks) {
+module("Live | Unit | Service | live-webrtc-livekit", function (hooks) {
setupTest(hooks);
hooks.beforeEach(function () {
@@ -503,21 +503,21 @@ module("Voice | Unit | Service | voice-webrtc-livekit", function (hooks) {
this.cameraPreferenceKey = `voice-camera-enabled-${this.currentUser.id}`;
this.keyValueStore.remove(this.cameraPreferenceKey);
this.siteSettings = this.owner.lookup("service:site-settings");
- this.siteSettings.voice_auto_status_enabled = true;
- this.siteSettings.voice_video_max_publishers = 4;
+ this.siteSettings.live_auto_status_enabled = true;
+ this.siteSettings.live_video_max_publishers = 4;
localStorage.removeItem("voice:noise-suppression");
localStorage.removeItem("voice:noise-suppression-mode");
- this.owner.unregister("service:voice-rooms");
- this.owner.register("service:voice-rooms", VoiceRoomsStub);
+ this.owner.unregister("service:live-rooms");
+ this.owner.register("service:live-rooms", LiveRoomsStub);
this.owner.unregister("service:toasts");
this.owner.register("service:toasts", RecordingToastsStub);
- this.rooms = this.owner.lookup("service:voice-rooms");
+ this.rooms = this.owner.lookup("service:live-rooms");
this.toasts = this.owner.lookup("service:toasts");
this.room = {
id: 1,
- name: "Voice",
+ name: "Live",
room_type: "open",
video_enabled: true,
video_allowed: true,
@@ -540,7 +540,7 @@ module("Voice | Unit | Service | voice-webrtc-livekit", function (hooks) {
this.joinRequests = 0;
this.leaveRequests = 0;
- pretender.post("/voice/rooms/1/join", () => {
+ pretender.post("/live/rooms/1/join", () => {
this.joinRequests++;
return response({
transport: "livekit",
@@ -548,16 +548,16 @@ module("Voice | Unit | Service | voice-webrtc-livekit", function (hooks) {
room: JSON.parse(JSON.stringify(this.room)),
});
});
- pretender.post("/voice/rooms/1/toggle_mute", () => response({}));
- pretender.post("/voice/rooms/1/signal", () => response({}));
+ pretender.post("/live/rooms/1/toggle_mute", () => response({}));
+ pretender.post("/live/rooms/1/signal", () => response({}));
this.stateRequests = [];
- pretender.post("/voice/rooms/1/state", (request) => {
+ pretender.post("/live/rooms/1/state", (request) => {
this.stateRequests.push(
Object.fromEntries(new URLSearchParams(request.requestBody))
);
return response({});
});
- pretender.delete("/voice/rooms/1/leave", () => {
+ pretender.delete("/live/rooms/1/leave", () => {
this.leaveRequests++;
return response({});
});
@@ -624,7 +624,7 @@ module("Voice | Unit | Service | voice-webrtc-livekit", function (hooks) {
this.originalGetDisplayMedia = navigator.mediaDevices.getDisplayMedia;
navigator.mediaDevices.getDisplayMedia = async () => this.screenStream;
- this.subject = this.owner.lookup("service:voice-webrtc");
+ this.subject = this.owner.lookup("service:live-webrtc");
});
hooks.afterEach(function () {
@@ -647,7 +647,7 @@ module("Voice | Unit | Service | voice-webrtc-livekit", function (hooks) {
});
test("mesh rooms never load the LiveKit SDK", async function (assert) {
- pretender.post("/voice/rooms/1/join", () =>
+ pretender.post("/live/rooms/1/join", () =>
response({
transport: "mesh",
room: JSON.parse(JSON.stringify(this.room)),
@@ -1137,13 +1137,13 @@ module("Voice | Unit | Service | voice-webrtc-livekit", function (hooks) {
assert.strictEqual(
this.toasts.errors.length,
1,
- "shows the unreachable-voice-server toast"
+ "shows the unreachable-live-server toast"
);
});
test("a terminal disconnect reconnects with a freshly minted token", async function (assert) {
let mintCalls = 0;
- pretender.post("/voice/rooms/1/livekit_token", () => {
+ pretender.post("/live/rooms/1/livekit_token", () => {
mintCalls++;
return response({ url: "wss://sfu.example.com", token: "token-2" });
});
@@ -1179,7 +1179,7 @@ module("Voice | Unit | Service | voice-webrtc-livekit", function (hooks) {
test("the reconnect ladder stops immediately on 410 Gone", async function (assert) {
let mintCalls = 0;
- pretender.post("/voice/rooms/1/livekit_token", () => {
+ pretender.post("/live/rooms/1/livekit_token", () => {
mintCalls++;
return response(410, { errors: ["room instance ended"] });
});
@@ -1212,7 +1212,7 @@ module("Voice | Unit | Service | voice-webrtc-livekit", function (hooks) {
test("an exhausted reconnect ladder leaves the room", async function (assert) {
let mintCalls = 0;
- pretender.post("/voice/rooms/1/livekit_token", () => {
+ pretender.post("/live/rooms/1/livekit_token", () => {
mintCalls++;
return response({ url: "wss://sfu.example.com", token: "token-2" });
});
@@ -1716,7 +1716,7 @@ module("Voice | Unit | Service | voice-webrtc-livekit", function (hooks) {
});
test("a ladder reconnect republishes the live camera", async function (assert) {
- pretender.post("/voice/rooms/1/livekit_token", () =>
+ pretender.post("/live/rooms/1/livekit_token", () =>
response({ url: "wss://sfu.example.com", token: "token-2" })
);
diff --git a/plugins/voice/test/javascripts/unit/services/voice-webrtc-test.js b/plugins/live/test/javascripts/unit/services/live-webrtc-test.js
similarity index 97%
rename from plugins/voice/test/javascripts/unit/services/voice-webrtc-test.js
rename to plugins/live/test/javascripts/unit/services/live-webrtc-test.js
index 753b760e8e3..29c59d3d049 100644
--- a/plugins/voice/test/javascripts/unit/services/voice-webrtc-test.js
+++ b/plugins/live/test/javascripts/unit/services/live-webrtc-test.js
@@ -4,7 +4,7 @@ import { module, test } from "qunit";
import Site from "discourse/models/site";
import pretender, { response } from "discourse/tests/helpers/create-pretender";
import { logIn } from "discourse/tests/helpers/qunit-helpers";
-import { setPeerTimingForTesting } from "discourse/plugins/voice/discourse/lib/voice/peer-manager";
+import { setPeerTimingForTesting } from "discourse/plugins/live/discourse/lib/live/peer-manager";
// Park the service's wall-clock timers far outside any test's window so a
// CPU-starved run can't have a fallback offer, peer restart, or stuck-"new"
@@ -21,7 +21,7 @@ const SAFE_PEER_TIMING = {
connectionTimeoutMs: 60_000,
};
-class VoiceRoomsStub extends Service {
+class LiveRoomsStub extends Service {
#roomHandlers = new Map();
#roomsById = new Map();
@@ -418,10 +418,10 @@ function installFakeAudioEnvironment({ rawStream, processedStream }) {
}
// The gem-vendored asset base the loaders read at runtime.
- Site.current().set("voice_assets_path", "/plugins/voice/javascripts/0.0.0");
+ Site.current().set("live_assets_path", "/plugins/live/javascripts/0.0.0");
const originalFetch = globalThis.fetch;
const fakeFetch = (url, options) => {
- if (String(url).includes("/plugins/voice/javascripts/")) {
+ if (String(url).includes("/plugins/live/javascripts/")) {
return Promise.resolve({
ok: true,
arrayBuffer: async () => new ArrayBuffer(8),
@@ -461,7 +461,7 @@ function installFakeAudioEnvironment({ rawStream, processedStream }) {
};
}
-module("Voice | Unit | Service | voice-webrtc", function (hooks) {
+module("Live | Unit | Service | live-webrtc", function (hooks) {
setupTest(hooks);
hooks.beforeEach(function () {
@@ -471,16 +471,16 @@ module("Voice | Unit | Service | voice-webrtc", function (hooks) {
this.cameraPreferenceKey = `voice-camera-enabled-${this.currentUser.id}`;
this.keyValueStore.remove(this.cameraPreferenceKey);
this.siteSettings = this.owner.lookup("service:site-settings");
- this.siteSettings.voice_auto_status_enabled = true;
+ this.siteSettings.live_auto_status_enabled = true;
localStorage.removeItem("voice:noise-suppression");
localStorage.removeItem("voice:noise-suppression-mode");
- this.owner.unregister("service:voice-rooms");
- this.owner.register("service:voice-rooms", VoiceRoomsStub);
+ this.owner.unregister("service:live-rooms");
+ this.owner.register("service:live-rooms", LiveRoomsStub);
this.owner.unregister("service:toasts");
this.owner.register("service:toasts", ToastsStub);
- this.rooms = this.owner.lookup("service:voice-rooms");
+ this.rooms = this.owner.lookup("service:live-rooms");
this.room = {
id: 1,
name: "Stage",
@@ -493,15 +493,15 @@ module("Voice | Unit | Service | voice-webrtc", function (hooks) {
};
this.rooms.seedRoom(this.room);
- pretender.post("/voice/rooms/1/join", () =>
+ pretender.post("/live/rooms/1/join", () =>
response({
participant_session_id: "session-abc",
room: JSON.parse(JSON.stringify(this.room)),
})
);
- pretender.post("/voice/rooms/1/signal", () => response({}));
- pretender.post("/voice/rooms/1/toggle_mute", () => response({}));
- pretender.delete("/voice/rooms/1/leave", () => response({}));
+ pretender.post("/live/rooms/1/signal", () => response({}));
+ pretender.post("/live/rooms/1/toggle_mute", () => response({}));
+ pretender.delete("/live/rooms/1/leave", () => response({}));
this.originalRTCPeerConnection = globalThis.RTCPeerConnection;
this.originalRTCIceCandidate = globalThis.RTCIceCandidate;
@@ -550,7 +550,7 @@ module("Voice | Unit | Service | voice-webrtc", function (hooks) {
}
};
- this.subject = this.owner.lookup("service:voice-webrtc");
+ this.subject = this.owner.lookup("service:live-webrtc");
});
hooks.afterEach(function () {
@@ -579,7 +579,7 @@ module("Voice | Unit | Service | voice-webrtc", function (hooks) {
},
];
- pretender.post("/voice/rooms/1/join", () =>
+ pretender.post("/live/rooms/1/join", () =>
response({
room: JSON.parse(JSON.stringify(this.room)),
ice: { servers, transport_policy: "relay" },
@@ -595,7 +595,7 @@ module("Voice | Unit | Service | voice-webrtc", function (hooks) {
test("ICE configuration survives a join response without an ice payload", async function (assert) {
const servers = [{ urls: "stun:stun.example.com:3478" }];
- pretender.post("/voice/rooms/1/join", () =>
+ pretender.post("/live/rooms/1/join", () =>
response({
room: JSON.parse(JSON.stringify(this.room)),
ice: { servers, transport_policy: "all" },
@@ -605,7 +605,7 @@ module("Voice | Unit | Service | voice-webrtc", function (hooks) {
await this.subject.join(this.room);
this.subject.leave(this.room, { keepLocalStream: true });
- pretender.post("/voice/rooms/1/join", () =>
+ pretender.post("/live/rooms/1/join", () =>
response({ room: JSON.parse(JSON.stringify(this.room)) })
);
@@ -657,7 +657,7 @@ module("Voice | Unit | Service | voice-webrtc", function (hooks) {
const joinResponse = deferred();
- pretender.post("/voice/rooms/1/join", () =>
+ pretender.post("/live/rooms/1/join", () =>
joinResponse.promise.then(() =>
response({
room: JSON.parse(JSON.stringify(this.room)),
@@ -707,7 +707,7 @@ module("Voice | Unit | Service | voice-webrtc", function (hooks) {
active_participants: [{ id: this.currentUser.id, role: "listener" }],
};
- pretender.post("/voice/rooms/1/join", () =>
+ pretender.post("/live/rooms/1/join", () =>
joinResponse.promise.then(() =>
response({
room: JSON.parse(JSON.stringify(staleRoom)),
@@ -748,7 +748,7 @@ module("Voice | Unit | Service | voice-webrtc", function (hooks) {
],
};
- pretender.post("/voice/rooms/1/join", () =>
+ pretender.post("/live/rooms/1/join", () =>
response({
room: JSON.parse(JSON.stringify(responseRoom)),
})
@@ -769,7 +769,7 @@ module("Voice | Unit | Service | voice-webrtc", function (hooks) {
const joinResponse = deferred();
- pretender.post("/voice/rooms/1/join", () =>
+ pretender.post("/live/rooms/1/join", () =>
joinResponse.promise.then(() =>
response({
room: JSON.parse(JSON.stringify(this.room)),
@@ -811,14 +811,14 @@ module("Voice | Unit | Service | voice-webrtc", function (hooks) {
const joinResponse = deferred();
let signalRequests = 0;
- pretender.post("/voice/rooms/1/join", () =>
+ pretender.post("/live/rooms/1/join", () =>
joinResponse.promise.then(() =>
response({
room: JSON.parse(JSON.stringify(this.room)),
})
)
);
- pretender.post("/voice/rooms/1/signal", () => {
+ pretender.post("/live/rooms/1/signal", () => {
signalRequests++;
return response({});
});
@@ -873,7 +873,7 @@ module("Voice | Unit | Service | voice-webrtc", function (hooks) {
{ id: 2, role: "participant" },
];
- pretender.post("/voice/rooms/1/signal", (request) => {
+ pretender.post("/live/rooms/1/signal", (request) => {
signalRequests.push(signalPayloadFrom(request));
return response({});
});
@@ -922,7 +922,7 @@ module("Voice | Unit | Service | voice-webrtc", function (hooks) {
{ id: 50, role: "participant" },
];
- pretender.post("/voice/rooms/1/signal", (request) => {
+ pretender.post("/live/rooms/1/signal", (request) => {
signalRequests.push(signalPayloadFrom(request));
return response({});
});
@@ -991,7 +991,7 @@ module("Voice | Unit | Service | voice-webrtc", function (hooks) {
{ id: 2, role: "participant" },
];
- pretender.post("/voice/rooms/1/signal", (request) => {
+ pretender.post("/live/rooms/1/signal", (request) => {
signalRequests.push(signalPayloadFrom(request));
return response({});
});
@@ -1068,7 +1068,7 @@ module("Voice | Unit | Service | voice-webrtc", function (hooks) {
{ id: 2, role: "participant" },
];
- pretender.post("/voice/rooms/1/signal", (request) => {
+ pretender.post("/live/rooms/1/signal", (request) => {
signalRequests.push(signalPayloadFrom(request));
return response({});
});
@@ -1633,7 +1633,7 @@ module("Voice | Unit | Service | voice-webrtc", function (hooks) {
{ id: 50, role: "participant" },
];
- pretender.post("/voice/rooms/1/signal", (request) => {
+ pretender.post("/live/rooms/1/signal", (request) => {
signalRequests.push(...signalsFrom(request));
return response({});
});
@@ -1731,7 +1731,7 @@ module("Voice | Unit | Service | voice-webrtc", function (hooks) {
{ id: 2, role: "participant" },
];
- pretender.post("/voice/rooms/1/signal", (request) => {
+ pretender.post("/live/rooms/1/signal", (request) => {
signalRequests.push(signalPayloadFrom(request));
return response({});
});
@@ -1809,7 +1809,7 @@ module("Voice | Unit | Service | voice-webrtc", function (hooks) {
{ id: 99, role: "participant" },
];
- pretender.post("/voice/rooms/1/signal", (request) => {
+ pretender.post("/live/rooms/1/signal", (request) => {
signalRequests.push(signalPayloadFrom(request));
return response({});
});
@@ -1875,7 +1875,7 @@ module("Voice | Unit | Service | voice-webrtc", function (hooks) {
{ id: this.currentUser.id, role: "participant" },
];
- pretender.post("/voice/rooms/1/signal", (request) => {
+ pretender.post("/live/rooms/1/signal", (request) => {
signalRequests.push(signalPayloadFrom(request));
signalSessionIds.push(
new URLSearchParams(request.requestBody).get("participant_session_id")
@@ -1954,7 +1954,7 @@ module("Voice | Unit | Service | voice-webrtc", function (hooks) {
{ id: this.currentUser.id, role: "participant" },
];
- pretender.post("/voice/rooms/1/signal", () => response({}));
+ pretender.post("/live/rooms/1/signal", () => response({}));
const candidate = {
candidate: "candidate:1 1 UDP 2122252543 127.0.0.1 3478 typ host",
@@ -2022,7 +2022,7 @@ module("Voice | Unit | Service | voice-webrtc", function (hooks) {
{ id: this.currentUser.id, role: "participant" },
];
- pretender.post("/voice/rooms/1/signal", () => response({}));
+ pretender.post("/live/rooms/1/signal", () => response({}));
const candidate = {
candidate: "candidate:1 1 UDP 2122252543 127.0.0.1 3478 typ host",
@@ -2108,7 +2108,7 @@ module("Voice | Unit | Service | voice-webrtc", function (hooks) {
{ id: 2, role: "participant" },
];
- pretender.post("/voice/rooms/1/signal", () => response({}));
+ pretender.post("/live/rooms/1/signal", () => response({}));
const offer = (ufrag) => ({
type: "offer",
@@ -2163,7 +2163,7 @@ module("Voice | Unit | Service | voice-webrtc", function (hooks) {
let signalRequests = 0;
- pretender.post("/voice/rooms/1/signal", () => {
+ pretender.post("/live/rooms/1/signal", () => {
signalRequests++;
return response({});
});
@@ -2355,7 +2355,7 @@ module("Voice | Unit | Service | voice-webrtc", function (hooks) {
test("leaving the room page stops an active camera publication", async function (assert) {
this.room.video_allowed = true;
this.room.screen_share_allowed = true;
- this.siteSettings.voice_video_max_publishers = 8;
+ this.siteSettings.live_video_max_publishers = 8;
this.room.room_type = "open";
this.room.video_enabled = true;
@@ -2366,7 +2366,7 @@ module("Voice | Unit | Service | voice-webrtc", function (hooks) {
];
const stateRequests = [];
- pretender.post("/voice/rooms/1/state", (request) => {
+ pretender.post("/live/rooms/1/state", (request) => {
stateRequests.push(
Object.fromEntries(new URLSearchParams(request.requestBody))
);
@@ -2483,7 +2483,7 @@ module("Voice | Unit | Service | voice-webrtc", function (hooks) {
function setupCameraRoom(context) {
context.room.video_allowed = true;
context.room.screen_share_allowed = true;
- context.siteSettings.voice_video_max_publishers = 8;
+ context.siteSettings.live_video_max_publishers = 8;
context.room.room_type = "open";
context.room.video_enabled = true;
@@ -2492,7 +2492,7 @@ module("Voice | Unit | Service | voice-webrtc", function (hooks) {
{ id: context.currentUser.id, role: "participant" },
];
- pretender.post("/voice/rooms/1/state", () => response({}));
+ pretender.post("/live/rooms/1/state", () => response({}));
}
test("explicit camera toggles update the remembered preference", async function (assert) {
@@ -2543,14 +2543,14 @@ module("Voice | Unit | Service | voice-webrtc", function (hooks) {
active_participants: [{ id: this.currentUser.id, role: "participant" }],
};
this.rooms.seedRoom(secondRoom);
- pretender.post("/voice/rooms/2/join", () =>
+ pretender.post("/live/rooms/2/join", () =>
response({
participant_session_id: "session-def",
room: JSON.parse(JSON.stringify(secondRoom)),
})
);
- pretender.post("/voice/rooms/2/state", () => response({}));
- pretender.delete("/voice/rooms/2/leave", () => response({}));
+ pretender.post("/live/rooms/2/state", () => response({}));
+ pretender.delete("/live/rooms/2/leave", () => response({}));
const rawTrack = createFakeTrack("raw-track");
const rawStream = createFakeStream("raw-stream", rawTrack);
@@ -3296,7 +3296,7 @@ module("Voice | Unit | Service | voice-webrtc", function (hooks) {
this.room.video_allowed = true;
this.room.screen_share_allowed = true;
- this.siteSettings.voice_video_max_publishers = 8;
+ this.siteSettings.live_video_max_publishers = 8;
this.room.room_type = "open";
this.room.video_enabled = true;
diff --git a/plugins/voice/admin/assets/javascripts/discourse/routes/admin-plugins/show/voice-recordings.js b/plugins/voice/admin/assets/javascripts/discourse/routes/admin-plugins/show/voice-recordings.js
deleted file mode 100644
index 30609449121..00000000000
--- a/plugins/voice/admin/assets/javascripts/discourse/routes/admin-plugins/show/voice-recordings.js
+++ /dev/null
@@ -1,8 +0,0 @@
-import Route from "@ember/routing/route";
-import { ajax } from "discourse/lib/ajax";
-
-export default class VoiceRecordingsRoute extends Route {
- async model() {
- return await ajax("/admin/plugins/voice/recordings.json");
- }
-}
diff --git a/plugins/voice/admin/assets/javascripts/discourse/routes/admin-plugins/show/voice-rooms.js b/plugins/voice/admin/assets/javascripts/discourse/routes/admin-plugins/show/voice-rooms.js
deleted file mode 100644
index 2aec3771082..00000000000
--- a/plugins/voice/admin/assets/javascripts/discourse/routes/admin-plugins/show/voice-rooms.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import Route from "@ember/routing/route";
-
-export default class VoiceRoomsRoute extends Route {}
diff --git a/plugins/voice/admin/assets/javascripts/discourse/templates/admin-plugins/show/voice-dashboard.gjs b/plugins/voice/admin/assets/javascripts/discourse/templates/admin-plugins/show/voice-dashboard.gjs
deleted file mode 100644
index 288ca022900..00000000000
--- a/plugins/voice/admin/assets/javascripts/discourse/templates/admin-plugins/show/voice-dashboard.gjs
+++ /dev/null
@@ -1,5 +0,0 @@
-import VoiceDashboard from "discourse/plugins/voice/admin/components/voice-dashboard";
-
-export default <template>
- <VoiceDashboard @controller={{@controller}} @model={{@model}} />
-</template>
diff --git a/plugins/voice/admin/assets/javascripts/discourse/templates/admin-plugins/show/voice-recordings.gjs b/plugins/voice/admin/assets/javascripts/discourse/templates/admin-plugins/show/voice-recordings.gjs
deleted file mode 100644
index 9927dbd88cc..00000000000
--- a/plugins/voice/admin/assets/javascripts/discourse/templates/admin-plugins/show/voice-recordings.gjs
+++ /dev/null
@@ -1,3 +0,0 @@
-import VoiceRecordingList from "discourse/plugins/voice/admin/components/voice-recording-list";
-
-export default <template><VoiceRecordingList @model={{@model}} /></template>
diff --git a/plugins/voice/admin/assets/javascripts/discourse/templates/admin-plugins/show/voice-rooms/edit.gjs b/plugins/voice/admin/assets/javascripts/discourse/templates/admin-plugins/show/voice-rooms/edit.gjs
deleted file mode 100644
index 8e3b4e47e18..00000000000
--- a/plugins/voice/admin/assets/javascripts/discourse/templates/admin-plugins/show/voice-rooms/edit.gjs
+++ /dev/null
@@ -1,5 +0,0 @@
-import VoiceRoomForm from "discourse/plugins/voice/discourse/components/voice-room-form";
-
-export default <template>
- <VoiceRoomForm @onSave={{@controller.saveRoom}} @room={{@controller.model}} />
-</template>
diff --git a/plugins/voice/admin/assets/javascripts/discourse/templates/admin-plugins/show/voice-rooms/new.gjs b/plugins/voice/admin/assets/javascripts/discourse/templates/admin-plugins/show/voice-rooms/new.gjs
deleted file mode 100644
index 8e3b4e47e18..00000000000
--- a/plugins/voice/admin/assets/javascripts/discourse/templates/admin-plugins/show/voice-rooms/new.gjs
+++ /dev/null
@@ -1,5 +0,0 @@
-import VoiceRoomForm from "discourse/plugins/voice/discourse/components/voice-room-form";
-
-export default <template>
- <VoiceRoomForm @onSave={{@controller.saveRoom}} @room={{@controller.model}} />
-</template>
diff --git a/plugins/voice/app/controllers/voice/agents_controller.rb b/plugins/voice/app/controllers/voice/agents_controller.rb
deleted file mode 100644
index 937524b6897..00000000000
--- a/plugins/voice/app/controllers/voice/agents_controller.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-module Voice
- class AgentsController < ApplicationController
- def index
- unless guardian.can_invite_voice_agents? && Voice::AgentBot.available?
- raise Discourse::InvalidAccess
- end
-
- refresh = params[:refresh].to_s == "true"
- RateLimiter.new(current_user, "voice-agent-list-refresh", 6, 1.minute).performed! if refresh
-
- result = Voice::Livekit::CloudAgentClient.list(refresh:)
- if result[:ok]
- render json: { agents: result[:agents] }
- else
- render_json_error(I18n.t("voice.errors.agent_list_failed"), status: 503)
- end
- end
- end
-end
diff --git a/plugins/voice/app/controllers/voice/room_memberships_controller.rb b/plugins/voice/app/controllers/voice/room_memberships_controller.rb
deleted file mode 100644
index 31ac4ad6be9..00000000000
--- a/plugins/voice/app/controllers/voice/room_memberships_controller.rb
+++ /dev/null
@@ -1,97 +0,0 @@
-# frozen_string_literal: true
-
-module Voice
- class RoomMembershipsController < ApplicationController
- before_action :load_room
-
- def index
- guardian.ensure_can_manage_voice_room!(@room)
- render_serialized @room.room_memberships, Voice::RoomMembershipSerializer, root: :memberships
- end
-
- def create
- guardian.ensure_can_manage_voice_room!(@room)
- user = fetch_user
- role = Voice::RoomMembership.role_value(params[:role])
- ensure_agent_role_allowed!(user)
- membership = @room.room_memberships.find_or_initialize_by(user: user)
- membership.role = role
- membership.save!
-
- if Voice::ParticipantTracker.user_ids(@room.id).include?(user.id)
- metadata = Voice::ParticipantTracker.get_metadata(@room.id, user.id)
- metadata[:role] = membership.role_name
- metadata.delete(:hand_raised_at) if membership.can_speak?
- Voice::ParticipantTracker.update_metadata(@room.id, user.id, metadata)
- Voice::RoomBroadcaster.publish_role_change(@room, user.id, membership.role_name)
- Voice::RoomBroadcaster.publish_participants(@room)
- Voice::Livekit::RoomServiceClient.update_participant(@room, user)
- end
-
- render_serialized membership, Voice::RoomMembershipSerializer, root: :membership
- end
-
- def update
- guardian.ensure_can_manage_voice_room!(@room)
- membership = @room.room_memberships.find(params[:id])
- new_role = params.require(:role)
- role = Voice::RoomMembership.role_value(new_role)
- ensure_agent_role_allowed!(membership.user)
- membership.update!(role: role)
-
- if Voice::ParticipantTracker.user_ids(@room.id).include?(membership.user_id)
- metadata = Voice::ParticipantTracker.get_metadata(@room.id, membership.user_id)
- metadata[:role] = membership.role_name
- metadata.delete(:hand_raised_at) if membership.can_speak?
- Voice::ParticipantTracker.update_metadata(@room.id, membership.user_id, metadata)
- Voice::RoomBroadcaster.publish_role_change(@room, membership.user_id, membership.role_name)
- Voice::RoomBroadcaster.publish_participants(@room)
- # Lets a promoted stage listener publish without reconnecting; on
- # failure the client falls back to re-minting a token and reconnecting.
- Voice::Livekit::RoomServiceClient.update_participant(@room, membership.user)
- end
-
- render_serialized membership, Voice::RoomMembershipSerializer, root: :membership
- end
-
- def destroy
- guardian.ensure_can_manage_voice_room!(@room)
- membership = @room.room_memberships.find(params[:id])
- user_id = membership.user_id
- membership.destroy!
-
- if Voice::ParticipantTracker.user_ids(@room.id).include?(user_id)
- metadata = Voice::ParticipantTracker.get_metadata(@room.id, user_id)
- metadata[:role] = "participant"
- Voice::ParticipantTracker.update_metadata(@room.id, user_id, metadata)
- Voice::RoomBroadcaster.publish_role_change(@room, user_id, "participant")
- Voice::RoomBroadcaster.publish_participants(@room)
- if (user = User.find_by(id: user_id))
- Voice::Livekit::RoomServiceClient.update_participant(@room, user)
- end
- end
-
- head :no_content
- end
-
- private
-
- def ensure_agent_role_allowed!(user)
- raise Discourse::InvalidParameters.new(:user_id) if user.bot?
- end
-
- def fetch_user
- if params[:user_id]
- User.find(params[:user_id])
- elsif params[:username]
- User.find_by_username_or_email(params[:username])
- else
- raise Discourse::InvalidParameters
- end
- end
-
- def load_room
- @room = Voice::Room.find(params[:room_id])
- end
- end
-end
diff --git a/plugins/voice/app/jobs/scheduled/voice/close_orphaned_sessions.rb b/plugins/voice/app/jobs/scheduled/voice/close_orphaned_sessions.rb
deleted file mode 100644
index b59a56d4b9c..00000000000
--- a/plugins/voice/app/jobs/scheduled/voice/close_orphaned_sessions.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-# frozen_string_literal: true
-
-module Jobs
- module Voice
- class CloseOrphanedSessions < ::Jobs::Scheduled
- every 5.minutes
-
- def execute(_args)
- return unless SiteSetting.voice_enabled && SiteSetting.voice_analytics_enabled
-
- participant_cache = {}
-
- ::Voice::Session.orphaned.find_each do |session|
- participant_ids =
- participant_cache[session.room_id] ||= ::Voice::ParticipantTracker.user_ids(
- session.room_id,
- )
- next if participant_ids.include?(session.user_id)
-
- left_at =
- ::Voice::ParticipantTracker.last_heartbeat_at(session.room_id, session.user_id) ||
- Time.current
-
- session.close!(at: left_at)
- ::Voice::ParticipantTracker.remove(session.room_id, session.user_id)
-
- room = ::Voice::Room.find_by(id: session.room_id)
- if room && ::Voice::ParticipantTracker.human_user_ids(room.id).empty?
- ::Voice::AgentManager.evict_agents_in_room!(room)
- end
-
- user = User.find_by(id: session.user_id)
- ::Voice::BadgeGranterHooks.on_leave(user, session) if user
- end
- end
- end
- end
-end
diff --git a/plugins/voice/app/jobs/scheduled/voice/purge_old_sessions.rb b/plugins/voice/app/jobs/scheduled/voice/purge_old_sessions.rb
deleted file mode 100644
index dcc654ade84..00000000000
--- a/plugins/voice/app/jobs/scheduled/voice/purge_old_sessions.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-module Jobs
- module Voice
- class PurgeOldSessions < ::Jobs::Scheduled
- every 1.day
-
- def execute(_args)
- return unless SiteSetting.voice_enabled
-
- days = SiteSetting.voice_session_retention_days
- return if days <= 0
-
- cutoff = days.days.ago
- ::Voice::Session.where("created_at < ?", cutoff).in_batches(of: 1000).delete_all
- ::Voice::CoPresence.where("date < ?", cutoff.to_date).in_batches(of: 1000).delete_all
- end
- end
- end
-end
diff --git a/plugins/voice/app/services/voice/statistics.rb b/plugins/voice/app/services/voice/statistics.rb
deleted file mode 100644
index 82ca6b616ee..00000000000
--- a/plugins/voice/app/services/voice/statistics.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-module Voice
- class Statistics
- def self.about_users
- return {} unless SiteSetting.voice_enabled && SiteSetting.voice_analytics_enabled
-
- { "7_days": Voice::Session.where("joined_at > ?", 7.days.ago).distinct.count(:user_id) }
- end
- end
-end
diff --git a/plugins/voice/app/validators/voice_livekit_recording_s3_bucket_validator.rb b/plugins/voice/app/validators/voice_livekit_recording_s3_bucket_validator.rb
deleted file mode 100644
index 2466e5ae10f..00000000000
--- a/plugins/voice/app/validators/voice_livekit_recording_s3_bucket_validator.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-# frozen_string_literal: true
-
-class VoiceLivekitRecordingS3BucketValidator
- include RegexSettingValidation
-
- def initialize(opts = {})
- initialize_regex_opts(opts)
- end
-
- def valid_value?(value)
- @error_key = nil
- @regex_fail = false
- return true if value.blank?
- return false if !regex_match?(value)
-
- @error_key =
- if SiteSetting.voice_livekit_recording_s3_access_key_id.blank? ||
- SiteSetting.voice_livekit_recording_s3_secret_access_key.blank?
- "voice_livekit_recording_s3_requires_credentials"
- elsif SiteSetting.voice_livekit_recording_s3_region.blank? &&
- SiteSetting.voice_livekit_recording_s3_endpoint.blank?
- "voice_livekit_recording_s3_requires_region"
- elsif !SiteSetting.voice_livekit_url.start_with?("wss://")
- "voice_livekit_recording_s3_requires_wss"
- end
-
- @error_key.nil?
- end
-
- def error_message
- return I18n.t(@regex_error) if @regex_fail
-
- I18n.t("site_settings.errors.#{@error_key}") if @error_key
- end
-end
diff --git a/plugins/voice/assets/javascripts/discourse/components/voice-participant-sidebar-suffix.gjs b/plugins/voice/assets/javascripts/discourse/components/voice-participant-sidebar-suffix.gjs
deleted file mode 100644
index 78064677592..00000000000
--- a/plugins/voice/assets/javascripts/discourse/components/voice-participant-sidebar-suffix.gjs
+++ /dev/null
@@ -1,28 +0,0 @@
-import dIcon from "discourse/ui-kit/helpers/d-icon";
-
-const VoiceParticipantSidebarSuffix = <template>
- {{! Always rendered, even with no icons — this is the element that pushes
- itself and the hover menu button to the right edge of the row. }}
- <span class="voice-participant-suffix">
- {{#if @suffixArgs.isHandRaised}}
- {{dIcon "hand" title="voice.participant.status_hand_raised"}}
- {{/if}}
- {{#if @suffixArgs.isScreenSharing}}
- {{dIcon "display" title="voice.participant.status_screen_sharing"}}
- {{/if}}
- {{#if @suffixArgs.isVideoOn}}
- {{dIcon "video" title="voice.participant.status_video"}}
- {{/if}}
- {{#if @suffixArgs.isPtt}}
- {{dIcon "walkie-talkie" title="voice.participant.status_ptt"}}
- {{/if}}
- {{#if @suffixArgs.isMuted}}
- {{dIcon "microphone-slash" title="voice.participant.status_muted"}}
- {{/if}}
- {{#if @suffixArgs.isDeafened}}
- {{dIcon "volume-xmark" title="voice.participant.status_deafened"}}
- {{/if}}
- </span>
-</template>;
-
-export default VoiceParticipantSidebarSuffix;
diff --git a/plugins/voice/assets/javascripts/discourse/components/voice/global-call-layer.gjs b/plugins/voice/assets/javascripts/discourse/components/voice/global-call-layer.gjs
deleted file mode 100644
index c96fb4b8cda..00000000000
--- a/plugins/voice/assets/javascripts/discourse/components/voice/global-call-layer.gjs
+++ /dev/null
@@ -1,7 +0,0 @@
-import VoiceCallWidget from "./call-widget.gjs";
-import VoiceVoiceCanvas from "./voice-canvas.gjs";
-
-export default <template>
- <VoiceVoiceCanvas />
- <VoiceCallWidget />
-</template>
diff --git a/plugins/voice/assets/javascripts/discourse/connectors/user-card-below-message-button/voice-call-button.gjs b/plugins/voice/assets/javascripts/discourse/connectors/user-card-below-message-button/voice-call-button.gjs
deleted file mode 100644
index 4fea135a791..00000000000
--- a/plugins/voice/assets/javascripts/discourse/connectors/user-card-below-message-button/voice-call-button.gjs
+++ /dev/null
@@ -1,11 +0,0 @@
-import VoiceCallButton from "../../components/voice/call-button.gjs";
-
-const VoiceCardCallButton = <template>
- {{#if @outletArgs.user.voice_can_call}}
- <li class="user-card-below-message-button voice-call-button">
- <VoiceCallButton @user={{@outletArgs.user}} />
- </li>
- {{/if}}
-</template>;
-
-export default VoiceCardCallButton;
diff --git a/plugins/voice/assets/javascripts/discourse/connectors/user-profile-controls/voice-call-button.gjs b/plugins/voice/assets/javascripts/discourse/connectors/user-profile-controls/voice-call-button.gjs
deleted file mode 100644
index 5df9d6685f1..00000000000
--- a/plugins/voice/assets/javascripts/discourse/connectors/user-profile-controls/voice-call-button.gjs
+++ /dev/null
@@ -1,11 +0,0 @@
-import VoiceCallButton from "../../components/voice/call-button.gjs";
-
-const VoiceProfileCallButton = <template>
- {{#if @outletArgs.model.voice_can_call}}
- <li class="voice-call-button">
- <VoiceCallButton @user={{@outletArgs.model}} />
- </li>
- {{/if}}
-</template>;
-
-export default VoiceProfileCallButton;
diff --git a/plugins/voice/assets/javascripts/discourse/initializers/voice-chat-thread-navbar.js b/plugins/voice/assets/javascripts/discourse/initializers/voice-chat-thread-navbar.js
deleted file mode 100644
index 737e5fe3fa9..00000000000
--- a/plugins/voice/assets/javascripts/discourse/initializers/voice-chat-thread-navbar.js
+++ /dev/null
@@ -1,6 +0,0 @@
-import { apiInitializer } from "discourse/lib/api";
-import VoiceBackToVoiceRoomButton from "discourse/plugins/voice/discourse/components/voice-back-to-voice-room-button";
-
-export default apiInitializer((api) => {
- api.renderInOutlet("chat-thread-navbar-actions", VoiceBackToVoiceRoomButton);
-});
diff --git a/plugins/voice/assets/javascripts/discourse/voice-route-map.js b/plugins/voice/assets/javascripts/discourse/voice-route-map.js
deleted file mode 100644
index 9ee19cbc961..00000000000
--- a/plugins/voice/assets/javascripts/discourse/voice-route-map.js
+++ /dev/null
@@ -1,6 +0,0 @@
-export default function () {
- this.route("voice-room", { path: "/voice/r/:slug" });
- this.route("voice-room-invite", {
- path: "/voice/r/:slug/invited-by/:username",
- });
-}
diff --git a/plugins/voice/config/locales/server.en.yml b/plugins/voice/config/locales/server.en.yml
deleted file mode 100644
index ced29985c6a..00000000000
--- a/plugins/voice/config/locales/server.en.yml
+++ /dev/null
@@ -1,262 +0,0 @@
-en:
- site_settings:
- voice_verbose_logging: "Log voice diagnostic information and warnings in server logs and browser consoles. Disabled by default. Logs exclude credentials, transcripts, signaling payloads, and raw error details."
- voice_enabled: "Voice brings integrated voice and video rooms to Discourse, with screen sharing, background blur, noise suppression, live subtitles, direct calls, room chat, and group-based permissions. Members can keep browsing while they talk, with no external app required."
- voice_allowed_groups: "Groups that can access voice rooms."
- voice_create_room_allowed_groups: "Groups that can create new voice rooms."
- voice_direct_calls_allowed_groups: "Groups that can start a direct call with another user from their user card or profile. Empty disables direct calls. Callers also need to be in {{setting:voice_allowed_groups}}; anyone with voice room access can receive a call."
- voice_max_rooms_per_user: "Maximum number of voice rooms a single user can own. Temporary rooms created automatically by other features do not count."
- voice_max_invites_per_day: "Maximum number of voice room invite notifications a single user can send per day. Repeated invites to the same person in the same room don't notify again (and don't count) until a day has passed."
- voice_ephemeral_room_ttl_minutes: "Minutes a temporary room (created automatically by another feature, such as a direct call) can sit empty before it is deleted. Rooms with people in them are never deleted."
- voice_participant_ttl_seconds: "Seconds to keep active speaker presence in Redis before automatic cleanup. Client heartbeat refreshes every 10 seconds."
- voice_max_room_participants: "Maximum number of people who can be in a voice room at the same time. A room's own participant limit can lower this, but never raise it."
- voice_auto_status_enabled: "Automatically set user status when they join a voice room (e.g. '🎙️ In Watercooler'). Requires the 'enable user status' site setting."
- voice_mesh_privacy_warning_enabled: "Warn users before they join a peer-to-peer voice room that other participants may be able to see their IP address, with an option to not show the warning again on that device. Calls hosted on a LiveKit server never show the warning."
- voice_badges_enabled: "Enable voice chat badges when {{setting:voice_enabled}} is enabled. Grants badges for voice room milestones like time spent, rooms visited, and connections made. Toggling this enables or disables every badge in the Voice group at once. Requires {{setting:voice_analytics_enabled}}, which records the sessions the badges are computed from."
- voice_analytics_enabled: "Record who joined which voice room and when, and how long people spent in a room together. Powers the admin voice statistics, the contacts and companions suggestions, and every voice badge."
- voice_session_retention_days: "Days to keep voice session and time-together history before it is deleted. Badges already earned are never taken away, but progress toward badges that accumulate over time (hours in voice, days in a room, people met) only counts history within this window."
- voice_idle_threshold_minutes: "Minutes of inactivity before a voice room participant is marked as idle. Set to 0 to disable."
- voice_afk_auto_mute_threshold_minutes: "Minutes of inactivity before a voice room participant is automatically muted. Set to 0 to disable."
- voice_afk_disconnect_threshold_minutes: "Minutes of inactivity before a voice room participant is automatically disconnected. Set to 0 to disable."
- voice_video_allowed_groups: "Groups whose members can share their camera in voice rooms. Leave empty to turn camera video off site-wide. Rooms can individually opt out of all media via their room settings, and stage room listeners can never publish."
- voice_screen_share_allowed_groups: "Groups whose members can share their screen in voice rooms. Leave empty to turn screen sharing off site-wide. Rooms can individually opt out of all media via their room settings, and stage room listeners can never publish."
- voice_video_max_publishers: "Maximum number of participants who can share video or their screen at the same time in a room. On peer-to-peer rooms, higher values increase CPU and bandwidth load for everyone watching; on rooms using a LiveKit media server, they mainly increase load on that server."
- voice_video_background_blur_enabled: "Allow participants to blur their camera background. Segmentation runs on the publisher's device via MediaPipe, which increases CPU/GPU load while their camera is on."
- voice_subtitles_enabled: "Allow participants to turn on live subtitles for other people's speech. Transcription runs entirely on the viewer's device via an NVIDIA Parakeet speech-to-text model (less than 0.5 GB, downloaded on first use, WebGPU required); no audio leaves the browser."
- voice_stt_model_base_url: "Optional base URL for a self-hosted mirror of the subtitles models. When blank, the model files are downloaded on first use from Discourse's HuggingFace repository (Discourse/Discourse-STT). A mirror must keep that repository's folder layout and file names, reachable by browsers with CORS allowed — see docs/subtitles-model-mirror.md in the plugin."
- voice_max_voice_quality: "Highest microphone audio quality participants may choose in their voice settings. Standard is the browser's speech default (~32 kbps); high (~64 kbps) and maximum (~128 kbps) improve fidelity for good microphones at the cost of bandwidth."
- voice_max_camera_quality: "Highest camera quality participants may choose in their video settings. Standard captures at 720p; high captures at 1080p; maximum additionally stops automatic quality reduction as viewer count grows on peer-to-peer rooms, which multiplies the sender's upload bandwidth and CPU use."
- voice_max_screen_share_quality: "Highest screen share quality participants may choose in their video settings. Standard targets 15 fps at a modest bitrate; high allows 30 fps at a higher bitrate; maximum allows 60 fps at a very high bitrate ceiling, letting fast connections share high-resolution screens at full quality."
- voice_chat_enabled: "Allow voice rooms to be linked to a chat channel. Each chat session opens a thread in that channel; messages are real chat messages, so participants can also follow along in the chat UI."
- voice_stun_servers: "STUN server URIs (stun:host:port), separated by |, used by peer-to-peer voice rooms for NAT traversal. Can be left empty when {{setting:voice_turn_secret_servers}} is configured — clients then discover their public address through the TURN server itself."
- voice_turn_servers: "TURN server URIs (turn:host:port or turns:host:port), separated by |, used to relay voice traffic when a direct connection cannot be established. Authenticated with {{setting:voice_turn_username}} and {{setting:voice_turn_credential}}; for servers supporting short-lived credentials, use {{setting:voice_turn_secret_servers}} instead."
- voice_turn_username: "Static username for the TURN servers in {{setting:voice_turn_servers}}."
- voice_turn_credential: "Static password for the TURN servers in {{setting:voice_turn_servers}}."
- voice_turn_secret: "Shared secret used to mint short-lived TURN credentials for the servers in {{setting:voice_turn_secret_servers}} (TURN REST API, coturn's use-auth-secret mode). Must match the secret configured on those TURN servers."
- voice_turn_secret_servers: "TURN server URIs (turn:host:port or turns:host:port), separated by |, that authenticate with short-lived per-user credentials derived from {{setting:voice_turn_secret}} instead of a static username and password, so credentials cannot be reused by third parties."
- voice_livekit_agent_enabled: "Allow members of {{setting:voice_livekit_agent_invite_allowed_groups}} to invite a LiveKit Cloud agent to public voice rooms. Creates the livekit_agent_bot account. Requires configured LiveKit Cloud credentials."
- voice_livekit_agent_invite_allowed_groups: "Groups that can invite a LiveKit Cloud agent to a public voice room they can join. Admins are always included. Members also need to be in {{setting:voice_allowed_groups}}; room managers can kick an agent regardless of this setting."
- voice_livekit_url: "WebSocket URL (wss://, or ws:// outside production) of a self-hosted LiveKit server. Together with the API key and secret, lets voice rooms use it as their media server (SFU) instead of the peer-to-peer mesh. The server must be reachable at a public address."
- voice_livekit_api_key: "API key of the LiveKit server."
- voice_livekit_api_secret: "API secret of the LiveKit server, used to sign short-lived room access tokens."
- voice_livekit_room_policy: "Which rooms use the LiveKit media server instead of the peer-to-peer mesh. Changes never affect calls already in progress — each room switches when its next call starts."
- voice_livekit_room_prefix: "Namespace prefix for room names on the LiveKit server. Leave empty to use the site's database name."
- voice_livekit_mesh_fallback: "When a LiveKit access token cannot be issued and the room is empty, start the call on the peer-to-peer mesh instead of failing the join. Off by default because silent degradation can hide a LiveKit outage."
- voice_livekit_recording_enabled: "Allow room moderators to record calls that run on the LiveKit media server. LiveKit Cloud requires {{setting:voice_livekit_recording_s3_bucket}}. Self-hosted Egress can use its own storage configuration. Recordings are not Discourse uploads.<br><br>Configure a webhook in LiveKit pointing to <code>https://YOUR-FORUM/voice/livekit/webhook</code>, replacing YOUR-FORUM with this site's hostname. Use the same API key as {{setting:voice_livekit_api_key}} and include <code>egress_ended</code> events so recording statuses and download notifications update when recordings finish."
- voice_livekit_recording_filepath: "Filepath passed to LiveKit Egress for recordings. Supports LiveKit's template placeholders such as {room_name}, {room_id}, {time} and {utc}; the file extension is added automatically."
- voice_livekit_recording_s3_bucket: "Dedicated S3 bucket for voice recordings, without a path. Set the recording credentials and region before saving this setting. Use {{setting:voice_livekit_recording_filepath}} for a folder prefix. Leave empty to use self-hosted Egress storage. Discourse upload storage settings are not used."
- voice_livekit_recording_s3_region: "AWS region of the recording bucket, such as us-east-1. Required unless {{setting:voice_livekit_recording_s3_endpoint}} is set."
- voice_livekit_recording_s3_access_key_id: "S3 access key for the recording bucket. Sent to the configured LiveKit server over HTTPS when starting a recording. Use credentials with write access limited to the recording location."
- voice_livekit_recording_s3_secret_access_key: "S3 secret key for the recording bucket. Sent only to the configured LiveKit server over HTTPS, never to participants."
- voice_livekit_recording_s3_endpoint: "Optional HTTPS endpoint for S3-compatible recording storage, without a path or trailing slash. Leave empty for AWS S3. Custom endpoints use path-style bucket addressing."
- errors:
- voice_livekit_agent_requires_cloud: "Configure a LiveKit Cloud URL, API key, and API secret before enabling the agent."
- voice_livekit_agent_username_taken: "The username livekit_agent_bot is already in use. Rename that account before enabling the agent."
- voice_livekit_recording_s3_requires_credentials: "Set the recording S3 access key and secret key before setting a recording bucket."
- voice_livekit_recording_s3_requires_region: "Set the recording S3 region or a custom endpoint before setting a recording bucket."
- voice_livekit_recording_s3_requires_wss: "Use a wss:// LiveKit URL before configuring S3 recording storage so storage credentials are sent over HTTPS."
- voice_turn_secret_servers_requires_secret: "Set voice_turn_secret before adding TURN servers that use short-lived credentials."
- voice_livekit_policy_requires_url: "Set voice_livekit_url to a valid wss:// URL before enabling a LiveKit room policy."
- voice_livekit_url_invalid: "The LiveKit URL must be a ws:// or wss:// URL with a hostname and no embedded credentials."
- voice_livekit_url_requires_wss: "The LiveKit URL must use wss:// in production."
- voice_livekit_policy_requires_api_key: "Set voice_livekit_api_key before enabling a LiveKit room policy."
- voice_livekit_policy_requires_api_secret: "Set voice_livekit_api_secret before enabling a LiveKit room policy."
- voice:
- defaults:
- watercooler_description: "Join for casual drop-in voice chats with other community members."
- chat:
- default_thread_title: "Voice chat in %{room}"
- default_thread_opener: "In %{room} - %{message}"
- user_status:
- in_room: "In %{room_name}"
- in_private_room: "In a voice room"
- afk_in_room: "AFK in %{room_name}"
- afk_in_private_room: "AFK in a voice room"
- errors:
- not_enabled: "Voice rooms are disabled."
- not_authorized: "You are not allowed to perform that action for this room."
- room_limit: "You reached the maximum number of rooms you can create."
- missing_payload: "Signal payload is required."
- participant_session_required: "Your call session has expired. Rejoin the room to start a new one."
- room_full: "This room is full."
- invalid_signal: "The signal payload is malformed or exceeds the allowed size."
- state_change_required: "A state change is required."
- ephemeral_room_limit: "You have too many ongoing calls. End one before starting another."
- cannot_call_user: "Sorry, you cannot call that user."
- cannot_kick_self: "You cannot kick yourself from the room."
- cannot_kick_creator: "You cannot kick the room creator."
- listeners_cannot_unmute: "Listeners cannot unmute in a Stage room."
- video_not_allowed: "You are not allowed to share your camera in this room."
- screen_share_not_allowed: "You are not allowed to share your screen in this room."
- video_publisher_limit: "The maximum number of simultaneous video streams for this room has been reached."
- chat_unavailable: "Chat is not available for this room."
- chat_requires_presence: "Join the voice room to use its chat."
- flag_target_never_joined: "That user has not joined this room."
- flag_already_handled: "Thanks, we have already been notified about this user and are looking into it."
- chat_threading_disabled: "The linked chat channel no longer has threading enabled, so a chat session can't be started."
- livekit_unavailable: "The voice server is unavailable. Contact your site administrator."
- agent_dispatch_forbidden: "The agent can only join an ongoing LiveKit call in a public room. Check the agent settings and make sure a human is present."
- agent_dispatch_failed: "LiveKit could not confirm the agent invitation. Check the agent's deployment and the server logs before trying again."
- agent_list_failed: "LiveKit could not list the deployed agents. Enter the agent's dispatch name instead."
- livekit_room_instance_ended: "This call has ended. Rejoin the room to start a new one."
- livekit_no_signaling: "This room's call uses a media server; peer-to-peer signaling is disabled."
- recording_unavailable: "Recording is not available for this call."
- recording_already_active: "This call is already being recorded."
- recording_not_active: "This call is not being recorded."
- recording_failed: "The recording could not be started. Contact your site administrator."
- recording_stop_failed: "The recording could not be stopped. Please try again."
- reviewable_score_types:
- notify_moderators:
- pm_title: "A voice room participant requires staff attention"
- pm_body: "@%{username} in the voice room [%{room_name}](%{link}) requires staff attention:\n\n%{message}"
- reviewables:
- actions:
- agree_and_keep:
- title: "Agree"
- description: "Agree with the flag."
- agree_and_suspend:
- title: "Suspend user"
- description: "Agree with the flag and suspend the user."
- agree_and_silence:
- title: "Silence user"
- description: "Agree with the flag and silence the user."
- disagree:
- title: "Disagree"
- description: "Disagree with the flag."
- ignore:
- title: "Ignore flag"
- description: "Remove the flag from the queue without taking action."
- invite_notification:
- title: "%{username} invited you to %{room_name}"
- excerpt: "Join the voice room %{room_name}"
- call_notification:
- title: "%{username} is calling you"
- excerpt: "Join %{room_name} to answer"
- call:
- room_name: "📞 %{caller} + %{callee}"
- recording_ready_pm:
- title: "Your recording of %{room_name} is ready"
- body_with_link: |
- Your recording of the voice room **%{room_name}** (%{duration}) is ready:
-
- [Download the recording](%{link})
-
- Anyone with this link can access the recording — share it carefully.
- body_with_path: |
- Your recording of the voice room **%{room_name}** (%{duration}) has finished.
-
- It is stored on the recording server at:
-
- `%{filepath}`
-
- Ask your site administrator for access.
- unknown_duration: "unknown duration"
- badges:
- mic_check:
- name: "Mic Check"
- description: "Completed your first voice chat session."
- long_description: "Awarded after spending at least 30 seconds in a voice room with another person."
- rookie:
- name: "Rookie"
- description: "Spent 1 hour in voice chat."
- long_description: "Awarded for accumulating 1 hour of total voice time."
- chatterbox:
- name: "Chatterbox"
- description: "Spent 10 hours in voice chat."
- long_description: "Awarded for accumulating 10 hours of total voice time."
- silver_tongue:
- name: "Silver Tongue"
- description: "Spent 100 hours in voice chat."
- long_description: "Awarded for accumulating 100 hours of total voice time."
- icebreaker:
- name: "Icebreaker"
- description: "Joined a room full of strangers."
- long_description: "Awarded for joining a voice room where you had no prior co-presence history with anyone."
- social_butterfly:
- name: "Social Butterfly"
- description: "Chatted with 10 different people."
- long_description: "Awarded for achieving co-presence with 10 or more distinct users."
- life_of_the_party:
- name: "Life of the Party"
- description: "Chatted with 50 different people."
- long_description: "Awarded for achieving co-presence with 50 or more distinct users."
- familiar_face:
- name: "Familiar Face"
- description: "Spent 2 hours chatting with the same person."
- long_description: "Awarded for achieving co-presence with one specific user for 2 or more hours total."
- inner_circle:
- name: "Inner Circle"
- description: "Spent 10 hours chatting with the same person."
- long_description: "Awarded for achieving co-presence with one specific user for 10 or more hours total."
- partners_in_crime:
- name: "Partners in Crime"
- description: "Spent 50 hours chatting with the same person."
- long_description: "Awarded for achieving co-presence with one specific user for 50 or more hours total."
- explorer:
- name: "Explorer"
- description: "Joined 5 different voice rooms."
- long_description: "Awarded for joining 5 different voice rooms."
- nomad:
- name: "Nomad"
- description: "Joined 20 different voice rooms."
- long_description: "Awarded for joining 20 different voice rooms."
- omnipresent:
- name: "Omnipresent"
- description: "Joined 50 different voice rooms."
- long_description: "Awarded for joining 50 different voice rooms."
- patron:
- name: "Patron"
- description: "Visited the same room on 10 different days."
- long_description: "Awarded for joining the same voice room on 10 distinct days."
- barfly:
- name: "Barfly"
- description: "Visited the same room on 30 different days."
- long_description: "Awarded for joining the same voice room on 30 distinct days."
- the_mayor:
- name: "The Mayor"
- description: "Visited the same room on 100 different days."
- long_description: "Awarded for joining the same voice room on 100 distinct days."
- host:
- name: "Host"
- description: "Created your first voice room."
- long_description: "Awarded for creating your first voice room."
- crowd_puller:
- name: "Crowd Puller"
- description: "A room you created reached 50 total joins."
- long_description: "Awarded when a voice room you created accumulates 50 or more total joins."
- master_of_ceremonies:
- name: "Master of Ceremonies"
- description: "A room you created reached 500 total joins."
- long_description: "Awarded when a voice room you created accumulates 500 or more total joins."
- plus_one:
- name: "Plus One"
- description: "Someone joined a voice room through your invite."
- long_description: "Awarded the first time a person you invited joins a voice room through your invite."
- connector:
- name: "Connector"
- description: "10 people joined voice rooms through your invites."
- long_description: "Awarded when 10 different people join voice rooms through your invites."
- people_magnet:
- name: "People Magnet"
- description: "50 people joined voice rooms through your invites."
- long_description: "Awarded when 50 different people join voice rooms through your invites."
- night_owl:
- name: "Night Owl"
- description: "Chatted between midnight and 5 AM."
- long_description: "Awarded for participating in a voice session between midnight and 5 AM in your local timezone."
- early_bird:
- name: "Early Bird"
- description: "Chatted between 5 AM and 9 AM."
- long_description: "Awarded for participating in a voice session between 5 AM and 9 AM in your local timezone."
- packed_house:
- name: "Packed House"
- description: "Was in a room when it hit max capacity."
- long_description: "Awarded for being in a voice room at the exact moment it reaches maximum capacity."
- weekend_warrior:
- name: "Weekend Warrior"
- description: "Spent 5 hours chatting on weekends."
- long_description: "Awarded for accumulating 5 or more hours of voice chat on weekends."
- marathoner:
- name: "Marathoner"
- description: "Spent 4 hours in a single voice session with company."
- long_description: "Awarded for a single continuous voice session with 4 or more hours spent while at least one other person was in the room."
diff --git a/plugins/voice/docs/ARCHITECTURE.md b/plugins/voice/docs/ARCHITECTURE.md
deleted file mode 100644
index 8cfa734b520..00000000000
--- a/plugins/voice/docs/ARCHITECTURE.md
+++ /dev/null
@@ -1,41 +0,0 @@
-# Voice Plugin Architecture
-
-Voice adds lightweight WebRTC voice rooms to Discourse without proxying audio/video through the server. Media runs over one of two transports — the default peer-to-peer mesh, or an optional self-hosted [LiveKit](https://livekit.io) SFU (see [livekit.md](./livekit.md)) — while everything else (presence, sessions, roster, moderation) is transport-independent. It consists of the following layers:
-
-## Backend
-
-- **Models**
- - `Voice::Room`: describes each voice space and keeps ownership, slug, visibility, and capacity metadata. Creator is automatically promoted to room moderator. Rooms flagged `ephemeral` are short-lived rooms created programmatically by other features and are excluded from every discovery surface (see [ephemeral-rooms.md](./ephemeral-rooms.md)).
- - `Voice::RoomMembership`: links users to rooms while storing participant/moderator roles.
-- **Services**
- - `Voice::ParticipantTracker`: stores the list of actively connected users per room in Redis with a short TTL. Join/leave actions refresh MessageBus subscribers. Also pins each live call's transport (`mesh` or `livekit`) so every participant of a call is on the same one; the pin clears when the room empties.
- - `Voice::RoomBroadcaster`: emits participant snapshots to `/voice/rooms/:id` MessageBus channels so Ember clients can update sidebars in real time.
- - `Voice::DirectoryBroadcaster`: keeps the sidebar list in sync across clients by broadcasting CRUD events to `/voice/rooms/index`. Skips ephemeral rooms, which never appear in the directory.
- - `Voice::EphemeralRoomManager`: the only entry point for creating ephemeral rooms, plus their TTL-based reaping (driven by a scheduled job). Contract in [ephemeral-rooms.md](./ephemeral-rooms.md).
- - `Voice::SignalRelay`: relays raw WebRTC SDP/ICE payloads between peers via MessageBus without touching media data (mesh rooms only).
- - `Voice::Livekit`: mints short-lived, least-privilege LiveKit access tokens (HS256 JWT) and resolves whether a room is eligible for the SFU per `voice_livekit_room_policy`. `Voice::Livekit::RoomServiceClient` mirrors kicks, role changes, and room deletion to the LiveKit server best-effort via Twirp-JSON.
-- **Controllers**
- - `RoomsController` exposes CRUD, join/leave, participant, and signaling endpoints.
- - `RoomMembershipsController` lets moderators manage explicit memberships.
-- **Authorization**
- - Guardian extensions gate room visibility, membership, and management. Site settings define who can create/manage rooms and cap per-user ownership tallies.
- - Camera and screen sharing are separate group-gated capabilities, resolved per user against the room's own media flag and their speaking rights. Publishing is enforced at the state endpoint and, on LiveKit rooms, by the token's track-source grants. Each room's serialization carries the viewer's own two rights for the UI, and every roster entry carries that sender's entitlements — mesh peers exchange media directly, so receivers gate video and screen audio on the sender's server-attested entitlement plus their published state.
-
-## Frontend
-
-- **Services**
- - `voice-rooms`: fetches initial room data, subscribes to MessageBus channels, updates tracked sidebar state, and forwards participant events to the UI.
- - `voice-webrtc`: manages `navigator.mediaDevices` capture, maintains one `RTCPeerConnection` per peer (mesh) or one `LivekitRoomSession` per room (LiveKit), exchanges offers/answers/candidates through the `signal` endpoint on mesh rooms, and keeps remote audio elements synced. Both transports feed the same remote-media registry, so every component downstream is transport-agnostic; the vendored `livekit-client` bundle is dynamically imported only when a LiveKit room is joined.
-- **Sidebar Integration**
- - `voice-sidebar` initializer registers a sidebar section with custom links for each room. Each link swaps its label with inline avatar thumbnails (plus a counter) so active participants are visible without modifying core sidebar components.
-- **Room UI**
- - `voice-room` route/controller fetch full room metadata, render participant lists, and command the WebRTC service to join/leave rooms. `Voice::VoiceCanvas` mounts `<audio>` sinks for local and remote streams during active calls.
- - Presentation layout automatically features the first screen share or active camera. A viewer can locally override that choice from a participant's video-tile menu; selecting a layout through the standard control restores automatic selection.
-
-## Message Flow
-
-1. User joins a room → `POST /voice/rooms/:id/join` resolves the call's transport (pinned in Redis for the call's lifetime), adds them to Redis, and broadcasts the participants list. For LiveKit calls the response also carries the server URL and a short-lived access token.
-2. Clients refresh presence with `POST /voice/rooms/:id/heartbeat` every 10 seconds (TTL is 30 seconds) without re-broadcasting participants.
-3. On mesh calls, each participant receiving the broadcast spins up `RTCPeerConnection` objects (only lower user IDs send offers to avoid glare) and relays SDP/ICE payloads via `POST /voice/rooms/:id/signal`. On LiveKit calls the client instead opens a single connection to the SFU and publishes/subscribes there; the `signal` endpoint rejects payloads for those rooms.
-4. Audio flows directly peer-to-peer (or through the site's own LiveKit server); Discourse only transports JSON signaling events.
-5. Sidebar avatars and the room screen update automatically as MessageBus notifications arrive — the roster is driven by Redis presence on both transports, never by media state.
diff --git a/plugins/voice/lib/voice.rb b/plugins/voice/lib/voice.rb
deleted file mode 100644
index aa7867bf1da..00000000000
--- a/plugins/voice/lib/voice.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-# frozen_string_literal: true
-
-module ::Voice
- PLUGIN_NAME = "voice"
- ROOM_CHANNEL_PREFIX = "/voice/rooms"
- ROOM_INDEX_CHANNEL = "/voice/rooms/index"
-
- # Chat::Thread custom field marking a thread as a room's voice session
- # thread, so it can be traced back to its room long after the live session
- # pointer in Redis has expired.
- THREAD_ROOM_ID_FIELD = "voice_room_id"
-
- def self.table_name_prefix
- "voice_"
- end
-
- def self.enabled?
- SiteSetting.voice_enabled
- end
-
- # Callers must omit raw errors and payloads, which can contain credentials or content.
- def self.warn(message)
- Rails.logger.warn(message) if SiteSetting.voice_verbose_logging
- end
-
- def self.room_channel(room_id)
- "#{ROOM_CHANNEL_PREFIX}/#{room_id}"
- end
-
- def self.room_chat_channel(room_id)
- "#{ROOM_CHANNEL_PREFIX}/#{room_id}/chat"
- end
-
- def self.room_index_channel
- ROOM_INDEX_CHANNEL
- end
-
- # Pseudo-groups have no group_users rows, but a client's message-bus groups
- # don't come only from that table (see config/initializers/004-message_bus.rb):
- # logged-in clients carry the logged_in_users pseudo-group and anonymous
- # clients carry anonymous_users, so targeting the allowed groups reaches
- # exactly the visitors who may see public rooms — anonymous ones included,
- # when they are admitted.
- def self.public_room_message_bus_targets
- { group_ids: SiteSetting.voice_allowed_groups_map }
- end
-end
-
-require_relative "voice/engine"
-require_relative "voice/guardian_extension"
-require_relative "voice/ice_config"
-require_relative "voice/livekit"
-require_relative "voice/livekit/twirp"
-require_relative "voice/livekit/egress_client"
-require_relative "voice/livekit/health_check"
-require_relative "voice/livekit/room_service_client"
-require_relative "voice/livekit/agent_dispatch_client"
-require_relative "voice/livekit/cloud_agent_client"
-require_relative "voice/livekit/webhook_verifier"
-require_relative "voice/media_entitlements"
-require_relative "voice/room_hashtag_data_source"
-require_relative "voice/user_status_manager"
-require_relative "../app/services/voice/agent_manager"
diff --git a/plugins/voice/lib/voice/guardian_extension.rb b/plugins/voice/lib/voice/guardian_extension.rb
deleted file mode 100644
index 5a4edacfad7..00000000000
--- a/plugins/voice/lib/voice/guardian_extension.rb
+++ /dev/null
@@ -1,195 +0,0 @@
-# frozen_string_literal: true
-
-module Voice
- module GuardianExtension
- # Access means participating — joining rooms, calling, appearing in
- # rosters — so it always requires authentication. Anonymous visitors are
- # served read-only through voice_public_access? instead.
- def can_access_voice?
- SiteSetting.voice_enabled? && authenticated? &&
- in_any_groups?(SiteSetting.voice_allowed_groups_map)
- end
-
- # Whether Voice is open to anonymous visitors, letting them browse (but
- # not join) public rooms. Never true on login-required sites, where there
- # are no anonymous visitors to serve.
- def voice_public_access?
- return false unless SiteSetting.voice_enabled?
- return false if SiteSetting.login_required
-
- SiteSetting.voice_allowed_groups_map.include?(Group::AUTO_GROUPS[:anonymous_users])
- end
-
- def can_create_voice_room?
- return false unless can_access_voice?
- user.in_any_groups?(SiteSetting.voice_create_room_allowed_groups_map)
- end
-
- # Starting a direct call is gated separately from receiving one: anyone
- # with voice-room access can be called, but only these groups get the
- # call button and the calls endpoint.
- def can_start_voice_call?
- return false unless can_access_voice?
- user.in_any_groups?(SiteSetting.voice_direct_calls_allowed_groups_map)
- end
-
- # A specific user may be rung only by callers they could receive a
- # personal message from: muting or ignoring the caller, disabling
- # personal messages, or an allowlist that omits the caller all block the
- # call. Staff are exempt, as they are for personal messages.
- def can_call_voice_user?(target)
- return false unless can_start_voice_call?
- return false if target.blank? || target.bot? || target.id == user.id
- return false unless target.guardian.can_access_voice?
-
- !UserCommScreener.new(
- acting_user: user,
- target_user_ids: [target.id],
- ).disallowing_pms_from_actor?(target.id)
- end
-
- # Being allowed to create rooms grants nothing over other people's rooms:
- # a room is managed by site staff, its creator, and its moderators only.
- def can_manage_voice_room?(room)
- return false unless can_access_voice?
- return false unless room
-
- is_staff? || room.creator_id == user.id || room.moderator?(user)
- end
-
- def ensure_can_manage_voice_room!(room)
- unless can_manage_voice_room?(room)
- raise Discourse::InvalidAccess.new(I18n.t("voice.errors.not_authorized"))
- end
- end
-
- def ensure_can_create_voice_room!
- unless can_create_voice_room?
- raise Discourse::InvalidAccess.new(I18n.t("voice.errors.not_authorized"))
- end
- end
-
- def can_join_voice_room?(room)
- return false unless can_access_voice?
- return false unless room
-
- room.public? || room.member?(user) || can_manage_voice_room?(room)
- end
-
- def ensure_can_join_voice_room!(room)
- unless can_join_voice_room?(room)
- raise Discourse::InvalidAccess.new(I18n.t("voice.errors.not_authorized"))
- end
- end
-
- # Inviting is sharing access you already have: anyone who can join a
- # public room may invite others to it, while a private room's roster is a
- # management concern — inviting there grants a membership.
- def can_invite_to_voice_room?(room)
- return false unless can_join_voice_room?(room)
-
- room.public? || can_manage_voice_room?(room)
- end
-
- # Room-independent half of can_invite_voice_agent?, so the client can learn
- # whether to offer the action before any room is chosen.
- def can_invite_voice_agents?
- return false unless can_access_voice?
- user.in_any_groups?(SiteSetting.voice_livekit_agent_invite_allowed_groups_map)
- end
-
- def can_invite_voice_agent?(room)
- can_invite_voice_agents? && can_join_voice_room?(room) && room.public? &&
- Voice::AgentBot.available?
- end
-
- def ensure_can_invite_to_voice_room!(room)
- unless can_invite_to_voice_room?(room)
- raise Discourse::InvalidAccess.new(I18n.t("voice.errors.not_authorized"))
- end
- end
-
- def can_see_voice_room?(room)
- return false unless room
- return true if can_join_voice_room?(room)
-
- # Anonymous and not-yet-authorized visitors may browse public rooms when
- # access is open to everyone. Joining still requires authentication.
- voice_public_access? && room.public?
- end
-
- def ensure_can_see_voice_room!(room)
- unless can_see_voice_room?(room)
- raise Discourse::InvalidAccess.new(I18n.t("voice.errors.not_authorized"))
- end
- end
-
- def can_flag_voice_user?(room, target_user)
- return false unless can_join_voice_room?(room)
- return false if target_user.blank? || target_user.bot?
-
- target_user.id != user.id
- end
-
- def ensure_can_flag_voice_user!(room, target_user)
- unless can_flag_voice_user?(room, target_user)
- raise Discourse::InvalidAccess.new(I18n.t("voice.errors.not_authorized"))
- end
- end
-
- def can_speak_in_voice_room?(room)
- return true if room.open?
- return true if user&.admin?
- membership = room.membership_for(user)
- membership&.can_speak? || false
- end
-
- # Camera and screen sharing are gated independently, per user: the room
- # must allow media at all, the user must be able to speak in it (a stage
- # listener publishes nothing), and their groups must carry the capability.
- def can_publish_video_in_voice_room?(room)
- eligible_to_publish_video_in_voice_room?(room) && voice_room_media_live?(room)
- end
-
- def can_screen_share_in_voice_room?(room)
- eligible_to_screen_share_in_voice_room?(room) && voice_room_media_live?(room)
- end
-
- # The same capability minus the room's media flag and the stage role,
- # which clients track live from room and role_change broadcasts. This is
- # the half that gets serialized, so neither re-enabling a room's media nor
- # a promotion needs the room re-serialized for each user.
- def eligible_to_publish_video_in_voice_room?(room)
- voice_media_entitlements(room)[:can_publish_video]
- end
-
- def eligible_to_screen_share_in_voice_room?(room)
- voice_media_entitlements(room)[:can_screen_share]
- end
-
- # Only stage-room listeners have anything to request — anyone who can
- # already speak (including admins and everyone in open rooms) cannot.
- def can_request_to_speak_in_voice_room?(room)
- return false unless can_join_voice_room?(room)
- room.stage? && !can_speak_in_voice_room?(room)
- end
-
- def ensure_can_request_to_speak_in_voice_room!(room)
- unless can_request_to_speak_in_voice_room?(room)
- raise Discourse::InvalidAccess.new(I18n.t("voice.errors.not_authorized"))
- end
- end
-
- private
-
- def voice_media_entitlements(room)
- return Voice::MediaEntitlements::NONE unless can_join_voice_room?(room)
-
- Voice::MediaEntitlements.for_user(user)
- end
-
- def voice_room_media_live?(room)
- room.video_enabled? && can_speak_in_voice_room?(room)
- end
- end
-end
diff --git a/plugins/voice/spec/fabricators/voice_room_fabricator.rb b/plugins/voice/spec/fabricators/voice_room_fabricator.rb
deleted file mode 100644
index 8c807035601..00000000000
--- a/plugins/voice/spec/fabricators/voice_room_fabricator.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-Fabricator(:voice_room, class_name: "Voice::Room") do
- name { sequence(:voice_room_name) { |i| "Voice #{i}" } }
- public { false }
- creator { Fabricate(:user) }
-end
-
-Fabricator(:voice_ephemeral_room, from: :voice_room) do
- ephemeral true
- last_occupied_at { Time.current }
-end
diff --git a/plugins/voice/spec/jobs/scheduled/voice/cleanup_ephemeral_rooms_spec.rb b/plugins/voice/spec/jobs/scheduled/voice/cleanup_ephemeral_rooms_spec.rb
deleted file mode 100644
index f6af752a51e..00000000000
--- a/plugins/voice/spec/jobs/scheduled/voice/cleanup_ephemeral_rooms_spec.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-RSpec.describe Jobs::Voice::CleanupEphemeralRooms do
- fab!(:stale_room) { Fabricate(:voice_ephemeral_room, last_occupied_at: 2.hours.ago) }
-
- it "reaps stale ephemeral rooms" do
- SiteSetting.voice_enabled = true
- room_id = stale_room.id
-
- described_class.new.execute({})
-
- expect(Voice::Room.exists?(room_id)).to eq(false)
- end
-
- it "does nothing while the plugin is disabled" do
- SiteSetting.voice_enabled = false
-
- described_class.new.execute({})
-
- expect(Voice::Room.exists?(stale_room.id)).to eq(true)
- end
-end
diff --git a/plugins/voice/spec/jobs/scheduled/voice/reconcile_recordings_spec.rb b/plugins/voice/spec/jobs/scheduled/voice/reconcile_recordings_spec.rb
deleted file mode 100644
index a3b867707c3..00000000000
--- a/plugins/voice/spec/jobs/scheduled/voice/reconcile_recordings_spec.rb
+++ /dev/null
@@ -1,94 +0,0 @@
-# frozen_string_literal: true
-
-require "rails_helper"
-require_relative "../../../../db/migrate/20241107000000_create_voice_rooms"
-require_relative "../../../../db/migrate/20260305162426_add_room_type_to_voice_rooms"
-require_relative "../../../../db/migrate/20260612135211_add_video_enabled_to_voice_rooms"
-require_relative "../../../../db/migrate/20260717172530_create_voice_recordings"
-
-RSpec.describe Jobs::Voice::ReconcileRecordings do
- before do
- ActiveRecord::Migration.suppress_messages do
- CreateVoiceRooms.new.change unless ActiveRecord::Base.connection.table_exists?(:voice_rooms)
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :room_type)
- AddRoomTypeToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :video_enabled)
- AddVideoEnabledToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.table_exists?(:voice_recordings)
- CreateVoiceRecordings.new.change
- end
- end
- Voice::Room.reset_column_information
- Voice::Recording.reset_column_information
- end
-
- fab!(:user)
- fab!(:room) { Fabricate(:voice_room, public: true) }
-
- before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_livekit_url = "wss://livekit.example.com"
- SiteSetting.voice_livekit_api_key = "lk_api_key"
- SiteSetting.voice_livekit_api_secret = "lk_api_secret"
- SiteSetting.voice_livekit_recording_enabled = true
- end
-
- def create_stuck_recording
- Voice::Recording.create!(
- room: room,
- started_by: user,
- egress_id: "EG_1",
- filepath: "voice/test-abc123",
- started_at: 10.minutes.ago,
- )
- end
-
- let!(:list_stub) do
- stub_request(:post, "https://livekit.example.com/twirp/livekit.Egress/ListEgress").to_return(
- body: {
- items: [
- {
- "egressId" => "EG_1",
- "status" => "EGRESS_COMPLETE",
- "fileResults" => [{ "filename" => "test.mp4" }],
- },
- ],
- }.to_json,
- )
- end
-
- it "resolves stuck recordings without webhooks" do
- recording = create_stuck_recording
-
- described_class.new.execute({})
-
- expect(recording.reload.status).to eq("completed")
- expect(list_stub).to have_been_requested
- end
-
- it "makes zero HTTP calls when there is nothing to resolve" do
- described_class.new.execute({})
-
- expect(list_stub).not_to have_been_requested
- end
-
- it "makes zero HTTP calls when recordings are disabled" do
- create_stuck_recording
- SiteSetting.voice_livekit_recording_enabled = false
-
- described_class.new.execute({})
-
- expect(list_stub).not_to have_been_requested
- end
-
- it "makes zero HTTP calls when LiveKit is not configured" do
- create_stuck_recording
- SiteSetting.voice_livekit_api_secret = ""
-
- described_class.new.execute({})
-
- expect(list_stub).not_to have_been_requested
- end
-end
diff --git a/plugins/voice/spec/lib/voice/guardian_extension_spec.rb b/plugins/voice/spec/lib/voice/guardian_extension_spec.rb
deleted file mode 100644
index 215b4f32c44..00000000000
--- a/plugins/voice/spec/lib/voice/guardian_extension_spec.rb
+++ /dev/null
@@ -1,351 +0,0 @@
-# frozen_string_literal: true
-
-require "rails_helper"
-require_relative "../../../db/migrate/20241107000000_create_voice_rooms"
-require_relative "../../../db/migrate/20260305162426_add_room_type_to_voice_rooms"
-require_relative "../../../db/migrate/20260612135211_add_video_enabled_to_voice_rooms"
-
-RSpec.describe Voice::GuardianExtension do
- before do
- ActiveRecord::Migration.suppress_messages do
- CreateVoiceRooms.new.change unless ActiveRecord::Base.connection.table_exists?(:voice_rooms)
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :room_type)
- AddRoomTypeToVoiceRooms.new.change
- Voice::Room.reset_column_information
- end
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :video_enabled)
- AddVideoEnabledToVoiceRooms.new.change
- Voice::Room.reset_column_information
- end
- end
- end
-
- fab!(:staff, :admin)
- fab!(:creator) { Fabricate(:user, trust_level: TrustLevel[2]) }
- fab!(:room_moderator) { Fabricate(:user, trust_level: TrustLevel[2]) }
- fab!(:room_speaker) { Fabricate(:user, trust_level: TrustLevel[2]) }
- fab!(:member) { Fabricate(:user, trust_level: TrustLevel[2]) }
-
- # In voice_create_room_allowed_groups but with no tie to the private room:
- # the room-creation permission must not leak into other people's rooms.
- fab!(:outsider) { Fabricate(:user, trust_level: TrustLevel[2]) }
-
- fab!(:low_trust_user) { Fabricate(:user, trust_level: TrustLevel[0]) }
- fab!(:public_room) { Fabricate(:voice_room, creator: staff, public: true) }
- fab!(:private_room) { Fabricate(:voice_room, creator: creator, public: false) }
-
- fab!(:moderator_membership) do
- private_room.room_memberships.create!(
- user: room_moderator,
- role: Voice::RoomMembership::ROLE_MODERATOR,
- )
- end
-
- fab!(:speaker_membership) do
- private_room.room_memberships.create!(
- user: room_speaker,
- role: Voice::RoomMembership::ROLE_SPEAKER,
- )
- end
-
- fab!(:participant_membership) do
- private_room.room_memberships.create!(
- user: member,
- role: Voice::RoomMembership::ROLE_PARTICIPANT,
- )
- end
-
- let(:anonymous_guardian) { Guardian.new(nil) }
-
- before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_allowed_groups =
- "#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
- SiteSetting.voice_create_room_allowed_groups = "#{Group::AUTO_GROUPS[:trust_level_2]}"
- end
-
- describe "#voice_public_access?" do
- it "is true when anonymous visitors are admitted on a public site" do
- expect(anonymous_guardian.voice_public_access?).to eq(true)
- end
-
- it "is false on login-required sites even when anonymous visitors are admitted" do
- SiteSetting.login_required = true
-
- expect(anonymous_guardian.voice_public_access?).to eq(false)
- end
-
- it "is true when access is open to the anonymous_users pseudogroup" do
- SiteSetting.voice_allowed_groups = "#{Group::AUTO_GROUPS[:anonymous_users]}"
-
- expect(anonymous_guardian.voice_public_access?).to eq(true)
- end
-
- it "is false when access is limited to logged-in users" do
- SiteSetting.voice_allowed_groups = "#{Group::AUTO_GROUPS[:logged_in_users]}"
-
- expect(anonymous_guardian.voice_public_access?).to eq(false)
- end
- end
-
- describe "#can_create_voice_room?" do
- it "is true for users in the create-room groups" do
- expect(outsider.guardian.can_create_voice_room?).to eq(true)
- end
-
- it "is false for users outside the create-room groups" do
- expect(low_trust_user.guardian.can_create_voice_room?).to eq(false)
- end
-
- it "is false for anonymous visitors" do
- expect(anonymous_guardian.can_create_voice_room?).to eq(false)
- end
-
- it "is false for users outside the voice allowed groups" do
- SiteSetting.voice_allowed_groups = "#{Group::AUTO_GROUPS[:staff]}"
-
- expect(outsider.guardian.can_create_voice_room?).to eq(false)
- end
- end
-
- describe "#can_invite_voice_agents?" do
- it "is true for admins by default" do
- expect(staff.guardian.can_invite_voice_agents?).to eq(true)
- end
-
- it "is false for users outside the invite groups" do
- expect(outsider.guardian.can_invite_voice_agents?).to eq(false)
- end
-
- it "is true for users in the invite groups" do
- SiteSetting.voice_livekit_agent_invite_allowed_groups =
- "#{Group::AUTO_GROUPS[:admins]}|#{Group::AUTO_GROUPS[:trust_level_2]}"
-
- expect(outsider.guardian.can_invite_voice_agents?).to eq(true)
- end
-
- it "is false for anonymous visitors" do
- expect(anonymous_guardian.can_invite_voice_agents?).to eq(false)
- end
-
- it "is false for users outside the voice allowed groups" do
- SiteSetting.voice_livekit_agent_invite_allowed_groups =
- "#{Group::AUTO_GROUPS[:admins]}|#{Group::AUTO_GROUPS[:trust_level_2]}"
- SiteSetting.voice_allowed_groups = "#{Group::AUTO_GROUPS[:staff]}"
-
- expect(outsider.guardian.can_invite_voice_agents?).to eq(false)
- end
- end
-
- describe "#can_manage_voice_room?" do
- it "is false for a create-room-group user with no tie to the room" do
- expect(outsider.guardian.can_manage_voice_room?(private_room)).to eq(false)
- end
-
- it "is false for a plain participant member" do
- expect(member.guardian.can_manage_voice_room?(private_room)).to eq(false)
- end
-
- it "is false for a speaker member" do
- expect(room_speaker.guardian.can_manage_voice_room?(private_room)).to eq(false)
- end
-
- it "is true for the room creator" do
- expect(creator.guardian.can_manage_voice_room?(private_room)).to eq(true)
- end
-
- it "is true for a room moderator" do
- expect(room_moderator.guardian.can_manage_voice_room?(private_room)).to eq(true)
- end
-
- it "is true for site staff" do
- expect(staff.guardian.can_manage_voice_room?(private_room)).to eq(true)
- end
-
- it "is false for everyone when the plugin is disabled" do
- SiteSetting.voice_enabled = false
-
- expect(creator.guardian.can_manage_voice_room?(private_room)).to eq(false)
- expect(staff.guardian.can_manage_voice_room?(private_room)).to eq(false)
- end
-
- it "is false for a create-room-group user on public rooms they don't own" do
- expect(outsider.guardian.can_manage_voice_room?(public_room)).to eq(false)
- end
-
- it "is false for anonymous visitors" do
- expect(anonymous_guardian.can_manage_voice_room?(public_room)).to eq(false)
- end
-
- it "is false for a nil room" do
- expect(creator.guardian.can_manage_voice_room?(nil)).to eq(false)
- end
- end
-
- describe "#can_join_voice_room?" do
- it "lets any allowed user join public rooms" do
- expect(low_trust_user.guardian.can_join_voice_room?(public_room)).to eq(true)
- end
-
- it "prevents anonymous visitors from joining public rooms" do
- expect(anonymous_guardian.can_join_voice_room?(public_room)).to eq(false)
- end
-
- it "prevents a create-room-group non-member from joining a private room" do
- expect(outsider.guardian.can_join_voice_room?(private_room)).to eq(false)
- end
-
- it "lets members join a private room regardless of role" do
- expect(member.guardian.can_join_voice_room?(private_room)).to eq(true)
- expect(room_speaker.guardian.can_join_voice_room?(private_room)).to eq(true)
- expect(room_moderator.guardian.can_join_voice_room?(private_room)).to eq(true)
- end
-
- it "lets the creator join their private room" do
- expect(creator.guardian.can_join_voice_room?(private_room)).to eq(true)
- end
-
- it "lets site staff join a private room they aren't a member of" do
- expect(staff.guardian.can_join_voice_room?(private_room)).to eq(true)
- end
-
- it "prevents users outside the voice allowed groups from joining" do
- SiteSetting.voice_allowed_groups = "#{Group::AUTO_GROUPS[:staff]}"
-
- expect(member.guardian.can_join_voice_room?(private_room)).to eq(false)
- end
- end
-
- describe "#can_see_voice_room?" do
- it "lets anonymous visitors see public rooms when anonymous visitors are admitted" do
- expect(anonymous_guardian.can_see_voice_room?(public_room)).to eq(true)
- end
-
- it "hides public rooms from anonymous visitors on login-required sites" do
- SiteSetting.login_required = true
-
- expect(anonymous_guardian.can_see_voice_room?(public_room)).to eq(false)
- end
-
- it "hides private rooms from anonymous visitors" do
- expect(anonymous_guardian.can_see_voice_room?(private_room)).to eq(false)
- end
-
- it "hides private rooms from a create-room-group non-member" do
- expect(outsider.guardian.can_see_voice_room?(private_room)).to eq(false)
- end
-
- it "shows private rooms to their members" do
- expect(member.guardian.can_see_voice_room?(private_room)).to eq(true)
- end
-
- it "shows private rooms to site staff" do
- expect(staff.guardian.can_see_voice_room?(private_room)).to eq(true)
- end
- end
-
- describe "#can_request_to_speak_in_voice_room?" do
- before { private_room.update!(room_type: Voice::Room::ROOM_TYPE_STAGE) }
-
- it "is true for a stage-room member with the participant role" do
- expect(member.guardian.can_request_to_speak_in_voice_room?(private_room)).to eq(true)
- end
-
- it "is false for a stage speaker, who can already speak" do
- expect(room_speaker.guardian.can_request_to_speak_in_voice_room?(private_room)).to eq(false)
- end
-
- it "is false for a room moderator, who can already speak" do
- expect(room_moderator.guardian.can_request_to_speak_in_voice_room?(private_room)).to eq(false)
- end
-
- it "is false for site staff, who can already speak" do
- expect(staff.guardian.can_request_to_speak_in_voice_room?(private_room)).to eq(false)
- end
-
- it "is false in an open room, where everyone can already speak" do
- expect(member.guardian.can_request_to_speak_in_voice_room?(public_room)).to eq(false)
- end
-
- it "is false for a non-member who cannot join the private stage room" do
- expect(outsider.guardian.can_request_to_speak_in_voice_room?(private_room)).to eq(false)
- end
-
- it "is false for anonymous visitors" do
- public_room.update!(room_type: Voice::Room::ROOM_TYPE_STAGE)
-
- expect(anonymous_guardian.can_request_to_speak_in_voice_room?(public_room)).to eq(false)
- end
- end
-
- describe "media publish permissions" do
- it "grants both capabilities to a member of the allowed groups" do
- expect(member.guardian.can_publish_video_in_voice_room?(public_room)).to eq(true)
- expect(member.guardian.can_screen_share_in_voice_room?(public_room)).to eq(true)
- end
-
- it "gates each capability on its own group setting" do
- SiteSetting.voice_video_allowed_groups = "#{Group::AUTO_GROUPS[:trust_level_4]}"
-
- expect(member.guardian.can_publish_video_in_voice_room?(public_room)).to eq(false)
- expect(member.guardian.can_screen_share_in_voice_room?(public_room)).to eq(true)
-
- SiteSetting.voice_screen_share_allowed_groups = ""
-
- expect(member.guardian.can_screen_share_in_voice_room?(public_room)).to eq(false)
- end
-
- it "is false for both when the room has media disabled" do
- public_room.update!(video_enabled: false)
-
- expect(member.guardian.can_publish_video_in_voice_room?(public_room)).to eq(false)
- expect(member.guardian.can_screen_share_in_voice_room?(public_room)).to eq(false)
- end
-
- it "is false for a stage listener, who publishes nothing" do
- private_room.update!(room_type: Voice::Room::ROOM_TYPE_STAGE)
-
- expect(member.guardian.can_publish_video_in_voice_room?(private_room)).to eq(false)
- expect(member.guardian.can_screen_share_in_voice_room?(private_room)).to eq(false)
- expect(room_speaker.guardian.can_publish_video_in_voice_room?(private_room)).to eq(true)
- expect(room_speaker.guardian.can_screen_share_in_voice_room?(private_room)).to eq(true)
- end
-
- # Clients apply the role themselves, so a promotion takes effect without
- # the room being re-serialized for the promoted user.
- it "keeps a stage listener eligible so a promotion needs no fresh payload" do
- private_room.update!(room_type: Voice::Room::ROOM_TYPE_STAGE)
-
- expect(member.guardian.eligible_to_publish_video_in_voice_room?(private_room)).to eq(true)
- expect(member.guardian.eligible_to_screen_share_in_voice_room?(private_room)).to eq(true)
- end
-
- it "is not eligible when the group or access says no" do
- SiteSetting.voice_video_allowed_groups = ""
-
- expect(member.guardian.eligible_to_publish_video_in_voice_room?(private_room)).to eq(false)
- expect(outsider.guardian.eligible_to_screen_share_in_voice_room?(private_room)).to eq(false)
- end
-
- # The room flag reaches clients through anonymous broadcasts that can't
- # refresh a per-user field, so folding it in would strand a "no" after
- # the room's media is turned back on.
- it "stays eligible while the room's media is off, but cannot publish" do
- private_room.update!(video_enabled: false)
-
- expect(member.guardian.eligible_to_screen_share_in_voice_room?(private_room)).to eq(true)
- expect(member.guardian.can_screen_share_in_voice_room?(private_room)).to eq(false)
- expect(member.guardian.can_publish_video_in_voice_room?(private_room)).to eq(false)
- end
-
- it "is false for a user who cannot join the room" do
- expect(outsider.guardian.can_publish_video_in_voice_room?(private_room)).to eq(false)
- expect(outsider.guardian.can_screen_share_in_voice_room?(private_room)).to eq(false)
- end
-
- it "is false for anonymous visitors" do
- expect(anonymous_guardian.can_publish_video_in_voice_room?(public_room)).to eq(false)
- expect(anonymous_guardian.can_screen_share_in_voice_room?(public_room)).to eq(false)
- end
- end
-end
diff --git a/plugins/voice/spec/lib/voice/logging_spec.rb b/plugins/voice/spec/lib/voice/logging_spec.rb
deleted file mode 100644
index 990beb93483..00000000000
--- a/plugins/voice/spec/lib/voice/logging_spec.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-require "rails_helper"
-
-RSpec.describe Voice do
- describe ".warn" do
- it "disables warning logs by default" do
- expect(SiteSetting.voice_verbose_logging).to eq(false)
-
- logs = track_log_messages { described_class.warn("[voice] chat operation failed") }
-
- expect(logs.warnings).to be_empty
- end
-
- it "logs warnings only while verbose logging is enabled" do
- logs =
- track_log_messages do
- SiteSetting.voice_verbose_logging = true
- described_class.warn("[voice] chat operation failed")
- SiteSetting.voice_verbose_logging = false
- described_class.warn("[voice] chat operation failed")
- end
-
- expect(logs.warnings).to eq(["[voice] chat operation failed"])
- end
- end
-end
diff --git a/plugins/voice/spec/migrations/enable_voice_badges_by_default_spec.rb b/plugins/voice/spec/migrations/enable_voice_badges_by_default_spec.rb
deleted file mode 100644
index dad7b2e9171..00000000000
--- a/plugins/voice/spec/migrations/enable_voice_badges_by_default_spec.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-# frozen_string_literal: true
-
-require Rails.root.join(
- "plugins/voice/db/post_migrate/20260903195501_enable_voice_badges_by_default.rb",
- )
-
-RSpec.describe EnableVoiceBadgesByDefault do
- before do
- @original_verbose = ActiveRecord::Migration.verbose
- ActiveRecord::Migration.verbose = false
- SeedFu.seed(Rails.root.join("plugins/voice/db/fixtures"))
- Voice::BadgeGranterHooks.disable_all!
- end
-
- after { ActiveRecord::Migration.verbose = @original_verbose }
-
- def voice_badges
- Badge.joins(:badge_grouping).where(badge_groupings: { name: "Voice" })
- end
-
- it "enables the voice badges on sites that never set the setting" do
- described_class.new.up
-
- expect(voice_badges.where(enabled: false)).to be_empty
- end
-
- it "leaves the badges alone on sites that explicitly disabled them" do
- # The test provider keeps settings in memory; the migration reads the table.
- DB.exec(
- "INSERT INTO site_settings (name, data_type, value, created_at, updated_at) VALUES ('voice_badges_enabled', :type, 'f', NOW(), NOW())",
- type: SiteSettings::TypeSupervisor.types[:bool],
- )
-
- described_class.new.up
-
- expect(voice_badges.where(enabled: true)).to be_empty
- end
-
- it "does not touch badges outside the Voice grouping" do
- Badge.find_by(name: "Editor").update!(enabled: false)
-
- described_class.new.up
-
- expect(Badge.find_by(name: "Editor").enabled).to eq(false)
- end
-end
diff --git a/plugins/voice/spec/migrations/replace_voice_video_enabled_setting_spec.rb b/plugins/voice/spec/migrations/replace_voice_video_enabled_setting_spec.rb
deleted file mode 100644
index 895da0df002..00000000000
--- a/plugins/voice/spec/migrations/replace_voice_video_enabled_setting_spec.rb
+++ /dev/null
@@ -1,65 +0,0 @@
-# frozen_string_literal: true
-
-require Rails.root.join(
- "plugins/voice/db/post_migrate/20261009144947_replace_voice_video_enabled_setting.rb",
- )
-
-RSpec.describe ReplaceVoiceVideoEnabledSetting do
- before do
- @original_verbose = ActiveRecord::Migration.verbose
- ActiveRecord::Migration.verbose = false
- end
-
- after { ActiveRecord::Migration.verbose = @original_verbose }
-
- # The test provider keeps settings in memory; the migration reads the table.
- def insert_old_setting(value)
- DB.exec(
- "INSERT INTO site_settings (name, data_type, value, created_at, updated_at) VALUES ('voice_video_enabled', :type, :value, NOW(), NOW())",
- type: SiteSettings::TypeSupervisor.types[:bool],
- value: value,
- )
- end
-
- def stored(name)
- DB.query_single("SELECT value FROM site_settings WHERE name = :name", name: name)
- end
-
- it "keeps video off for a site that had disabled it" do
- insert_old_setting("f")
-
- described_class.new.up
-
- expect(stored("voice_video_allowed_groups")).to eq([""])
- expect(stored("voice_screen_share_allowed_groups")).to eq([""])
- expect(stored("voice_video_enabled")).to be_empty
- end
-
- it "leaves the new defaults in place for a site that had video on" do
- insert_old_setting("t")
-
- described_class.new.up
-
- expect(stored("voice_video_allowed_groups")).to be_empty
- expect(stored("voice_screen_share_allowed_groups")).to be_empty
- expect(stored("voice_video_enabled")).to be_empty
- end
-
- it "writes nothing when the old setting was never stored" do
- described_class.new.up
-
- expect(stored("voice_video_allowed_groups")).to be_empty
- end
-
- it "does not overwrite a group list an admin already configured" do
- insert_old_setting("f")
- DB.exec(
- "INSERT INTO site_settings (name, data_type, value, created_at, updated_at) VALUES ('voice_video_allowed_groups', :type, '13', NOW(), NOW())",
- type: SiteSettings::TypeSupervisor.types[:group_list],
- )
-
- described_class.new.up
-
- expect(stored("voice_video_allowed_groups")).to eq(["13"])
- end
-end
diff --git a/plugins/voice/spec/requests/voice/rooms_controller_recording_spec.rb b/plugins/voice/spec/requests/voice/rooms_controller_recording_spec.rb
deleted file mode 100644
index fd9a842440b..00000000000
--- a/plugins/voice/spec/requests/voice/rooms_controller_recording_spec.rb
+++ /dev/null
@@ -1,178 +0,0 @@
-# frozen_string_literal: true
-
-require "rails_helper"
-require_relative "../../../db/migrate/20241107000000_create_voice_rooms"
-require_relative "../../../db/migrate/20260305162426_add_room_type_to_voice_rooms"
-require_relative "../../../db/migrate/20260612135211_add_video_enabled_to_voice_rooms"
-require_relative "../../../db/migrate/20260717172530_create_voice_recordings"
-
-RSpec.describe Voice::RoomsController do
- before do
- ActiveRecord::Migration.suppress_messages do
- CreateVoiceRooms.new.change unless ActiveRecord::Base.connection.table_exists?(:voice_rooms)
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :room_type)
- AddRoomTypeToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.column_exists?(:voice_rooms, :video_enabled)
- AddVideoEnabledToVoiceRooms.new.change
- end
- unless ActiveRecord::Base.connection.table_exists?(:voice_recordings)
- CreateVoiceRecordings.new.change
- end
- end
- Voice::Room.reset_column_information
- Voice::Recording.reset_column_information
- end
-
- fab!(:creator, :user)
- fab!(:participant, :user)
- fab!(:room) { Fabricate(:voice_room, public: true, creator: creator) }
-
- before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_allowed_groups =
- "#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
- SiteSetting.voice_livekit_url = "wss://livekit.example.com"
- SiteSetting.voice_livekit_api_key = "lk_api_key"
- SiteSetting.voice_livekit_api_secret = "lk_api_secret"
- SiteSetting.voice_livekit_room_policy = "all_rooms"
- SiteSetting.voice_livekit_recording_enabled = true
- Voice::ParticipantTracker.pin_transport!(room.id, "livekit")
- end
-
- after { Voice::ParticipantTracker.clear(room.id) }
-
- def stub_start(egress_id: "EG_1")
- stub_request(
- :post,
- "https://livekit.example.com/twirp/livekit.Egress/StartRoomCompositeEgress",
- ).to_return(body: { egressId: egress_id }.to_json)
- end
-
- def stub_stop
- stub_request(:post, "https://livekit.example.com/twirp/livekit.Egress/StopEgress").to_return(
- body: "{}",
- )
- end
-
- describe "#start_recording" do
- it "starts a recording and returns its room-wide status to a room manager" do
- sign_in(creator)
- stub_start
-
- post "/voice/rooms/#{room.id}/recording.json"
-
- expect(response.status).to eq(200)
- expect(response.parsed_body["recording"]["started_by"]["id"]).to eq(creator.id)
- expect(Voice::RecordingManager.status(room.id)).to be_present
- end
-
- it "rejects a participant who cannot manage the room" do
- sign_in(participant)
- stub = stub_start
-
- post "/voice/rooms/#{room.id}/recording.json"
-
- expect(response.status).to eq(403)
- expect(stub).not_to have_been_requested
- end
-
- it "rejects the request when recordings are disabled" do
- sign_in(creator)
- SiteSetting.voice_livekit_recording_enabled = false
-
- post "/voice/rooms/#{room.id}/recording.json"
-
- expect(response.status).to eq(422)
- expect(response.parsed_body["errors"]).to include(
- I18n.t("voice.errors.recording_unavailable"),
- )
- end
-
- it "rejects the request for a mesh call" do
- sign_in(creator)
- Voice::ParticipantTracker.clear_transport_pin(room.id)
- Voice::ParticipantTracker.pin_transport!(room.id, "mesh")
-
- post "/voice/rooms/#{room.id}/recording.json"
-
- expect(response.status).to eq(422)
- end
-
- it "returns 422 when the egress fails to start" do
- sign_in(creator)
- stub_request(
- :post,
- "https://livekit.example.com/twirp/livekit.Egress/StartRoomCompositeEgress",
- ).to_return(status: 500, body: "boom")
-
- post "/voice/rooms/#{room.id}/recording.json"
-
- expect(response.status).to eq(422)
- expect(Voice::RecordingManager.status(room.id)).to be_nil
- end
- end
-
- describe "#stop_recording" do
- before do
- sign_in(creator)
- stub_start
- post "/voice/rooms/#{room.id}/recording.json"
- end
-
- it "stops the recording for a room manager" do
- stub_stop
-
- delete "/voice/rooms/#{room.id}/recording.json"
-
- expect(response.status).to eq(204)
- expect(Voice::RecordingManager.status(room.id)).to be_nil
- end
-
- it "rejects a participant who cannot manage the room" do
- sign_in(participant)
- stub = stub_stop
-
- delete "/voice/rooms/#{room.id}/recording.json"
-
- expect(response.status).to eq(403)
- expect(stub).not_to have_been_requested
- expect(Voice::RecordingManager.status(room.id)).to be_present
- end
-
- it "returns 422 when nothing is being recorded" do
- stub_stop
- delete "/voice/rooms/#{room.id}/recording.json"
-
- delete "/voice/rooms/#{room.id}/recording.json"
-
- expect(response.status).to eq(422)
- expect(response.parsed_body["errors"]).to include(I18n.t("voice.errors.recording_not_active"))
- end
- end
-
- describe "#show" do
- it "serializes an active recording for any viewer" do
- sign_in(creator)
- stub_start
- post "/voice/rooms/#{room.id}/recording.json"
-
- sign_in(participant)
- get "/voice/rooms/#{room.id}.json"
-
- expect(response.status).to eq(200)
- expect(response.parsed_body["room"]["recording"]["started_by"]["username"]).to eq(
- creator.username,
- )
- end
-
- it "omits the recording field when nothing is being recorded" do
- sign_in(participant)
-
- get "/voice/rooms/#{room.id}.json"
-
- expect(response.status).to eq(200)
- expect(response.parsed_body["room"]).not_to have_key("recording")
- end
- end
-end
diff --git a/plugins/voice/spec/serializers/site_serializer_spec.rb b/plugins/voice/spec/serializers/site_serializer_spec.rb
deleted file mode 100644
index 7a3993ddf9c..00000000000
--- a/plugins/voice/spec/serializers/site_serializer_spec.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-# frozen_string_literal: true
-
-RSpec.describe SiteSerializer do
- fab!(:user)
-
- before { SiteSetting.voice_enabled = true }
-
- def voice_video_available
- described_class.new(Site.new(user.guardian), scope: user.guardian, root: false).as_json[
- :voice_video_available
- ]
- end
-
- describe "#voice_video_available" do
- it "is true when either capability has groups" do
- SiteSetting.voice_video_allowed_groups = ""
- SiteSetting.voice_screen_share_allowed_groups = Group::AUTO_GROUPS[:trust_level_1]
-
- expect(voice_video_available).to eq(true)
- end
-
- it "is false when neither capability has groups" do
- SiteSetting.voice_video_allowed_groups = ""
- SiteSetting.voice_screen_share_allowed_groups = ""
-
- expect(voice_video_available).to eq(false)
- end
- end
-end
diff --git a/plugins/voice/spec/serializers/voice_user_card_serializer_spec.rb b/plugins/voice/spec/serializers/voice_user_card_serializer_spec.rb
deleted file mode 100644
index 8ae43db092a..00000000000
--- a/plugins/voice/spec/serializers/voice_user_card_serializer_spec.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-# frozen_string_literal: true
-
-RSpec.describe UserCardSerializer do
- fab!(:viewer) { Fabricate(:user, trust_level: TrustLevel[2]) }
- fab!(:target) { Fabricate(:user, trust_level: TrustLevel[2]) }
-
- before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_allowed_groups =
- "#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
- end
-
- def serialize(user, scope_user)
- described_class.new(user, scope: scope_user.guardian, root: false).as_json
- end
-
- describe "#voice_can_call" do
- it "is true for a callable user when the viewer may start direct calls, false for oneself" do
- SiteSetting.voice_direct_calls_allowed_groups = Group::AUTO_GROUPS[:trust_level_2]
-
- expect(serialize(target, viewer)[:voice_can_call]).to eq(true)
- expect(serialize(viewer, viewer)[:voice_can_call]).to eq(false)
- end
-
- it "is false for a target outside the voice-room groups" do
- SiteSetting.voice_allowed_groups = Group::AUTO_GROUPS[:trust_level_2]
- SiteSetting.voice_direct_calls_allowed_groups = Group::AUTO_GROUPS[:trust_level_2]
- outsider = Fabricate(:user, trust_level: TrustLevel[0])
-
- expect(serialize(outsider, viewer)[:voice_can_call]).to eq(false)
- end
-
- it "is false when the target has muted the viewer" do
- SiteSetting.voice_direct_calls_allowed_groups = Group::AUTO_GROUPS[:trust_level_2]
- MutedUser.create!(user_id: target.id, muted_user_id: viewer.id)
-
- expect(serialize(target, viewer)[:voice_can_call]).to eq(false)
- end
-
- it "is false when the target does not accept personal messages from the viewer" do
- SiteSetting.voice_direct_calls_allowed_groups = Group::AUTO_GROUPS[:trust_level_2]
- target.user_option.update!(allow_private_messages: false)
-
- expect(serialize(target, viewer)[:voice_can_call]).to eq(false)
- end
-
- it "is omitted entirely when direct calls are disabled (the default)" do
- expect(serialize(target, viewer)).not_to have_key(:voice_can_call)
- end
- end
-end
diff --git a/plugins/voice/spec/services/voice/default_room_seeder_spec.rb b/plugins/voice/spec/services/voice/default_room_seeder_spec.rb
deleted file mode 100644
index 0dc9ee5bf5e..00000000000
--- a/plugins/voice/spec/services/voice/default_room_seeder_spec.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-# frozen_string_literal: true
-require "rails_helper"
-require_relative "../../../db/migrate/20241107000000_create_voice_rooms"
-
-RSpec.describe Voice::DefaultRoomSeeder do
- before do
- ActiveRecord::Migration.suppress_messages do
- CreateVoiceRooms.new.change unless ActiveRecord::Base.connection.table_exists?(:voice_rooms)
- end
- end
-
- before { wipe_rooms! }
-
- it "creates a Watercooler room when voice is enabled and no rooms exist" do
- SiteSetting.voice_enabled = true
- wipe_rooms!
-
- expect { described_class.ensure! }.to change { Voice::Room.count }.by(1)
-
- room = Voice::Room.first
- expect(room.name).to eq("Watercooler")
- expect(room.public).to eq(true)
- end
-
- it "does nothing if voice is disabled" do
- SiteSetting.voice_enabled = false
-
- expect { described_class.ensure! }.not_to change { Voice::Room.count }
- end
-
- it "still seeds when only ephemeral rooms exist" do
- SiteSetting.voice_enabled = true
- wipe_rooms!
- Fabricate(:voice_ephemeral_room, creator: Fabricate(:admin))
-
- expect { described_class.ensure! }.to change { Voice::Room.persistent.count }.by(1)
- end
-
- it "does nothing if rooms already exist without checking pending migrations" do
- SiteSetting.voice_enabled = true
- wipe_rooms!
- Fabricate(:voice_room, name: "Existing", creator: Fabricate(:admin))
-
- described_class.ensure!
- queries = track_sql_queries { described_class.ensure! }
-
- expect(Voice::Room.count).to eq(1)
- expect(queries.grep(/pg_class|schema_migrations/)).to be_empty
- end
-
- def wipe_rooms!
- Voice::RoomMembership.delete_all
- Voice::Room.delete_all
- end
-end
diff --git a/plugins/voice/spec/services/voice/statistics_spec.rb b/plugins/voice/spec/services/voice/statistics_spec.rb
deleted file mode 100644
index ce7cf0986d9..00000000000
--- a/plugins/voice/spec/services/voice/statistics_spec.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-# frozen_string_literal: true
-
-require "rails_helper"
-
-RSpec.describe Voice::Statistics do
- fab!(:user)
- fab!(:room, :voice_room)
-
- before do
- freeze_time
- SiteSetting.voice_enabled = true
- SiteSetting.voice_analytics_enabled = true
- end
-
- it "counts each participant once across rooms and repeat visits in the last seven days" do
- Fabricate(:voice_session, user: user, room: room, joined_at: 1.day.ago)
- Fabricate(:voice_session, user: user, joined_at: 2.days.ago)
- Fabricate(:voice_session, room: room, joined_at: 6.days.ago, left_at: nil)
- Fabricate(:voice_session, room: room, joined_at: 7.days.ago)
- Fabricate(:voice_session, room: room, joined_at: 8.days.ago)
-
- expect(described_class.about_users).to eq("7_days": 2)
- expect(About.fetch_stats[:voice_users_7_days]).to eq(2)
- end
-
- it "returns zero when nobody joined recently" do
- expect(described_class.about_users).to eq("7_days": 0)
- end
-
- it "omits the statistic when voice is disabled" do
- SiteSetting.voice_enabled = false
-
- expect(About.fetch_stats).not_to have_key(:voice_users_7_days)
- end
-
- it "omits the statistic when analytics are disabled" do
- SiteSetting.voice_analytics_enabled = false
-
- expect(About.fetch_stats).not_to have_key(:voice_users_7_days)
- end
-end
diff --git a/plugins/voice/spec/system/back_to_voice_room_spec.rb b/plugins/voice/spec/system/back_to_voice_room_spec.rb
deleted file mode 100644
index 09f7f52bec8..00000000000
--- a/plugins/voice/spec/system/back_to_voice_room_spec.rb
+++ /dev/null
@@ -1,70 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "../support/voice_fake_media"
-
-describe "Back to voice room button" do
- include ThemeScreenshotMarker
-
- fab!(:user)
- fab!(:channel, :chat_channel) { Fabricate(:chat_channel, threading_enabled: true) }
-
- fab!(:room) do
- Fabricate(:voice_room, name: "Team Room", public: true, chat_channel_id: channel.id)
- end
-
- let(:chat_page) { PageObjects::Pages::Chat.new }
- let(:channel_page) { PageObjects::Pages::ChatChannel.new }
- let(:chat_drawer_page) { PageObjects::Pages::ChatDrawer.new }
- let(:back_to_voice_room) { PageObjects::Components::VoiceBackToVoiceRoom.new }
-
- before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_mesh_privacy_warning_enabled = false
- SiteSetting.voice_chat_enabled = true
- SiteSetting.voice_allowed_groups =
- "#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
- chat_system_bootstrap(user, [channel])
- sign_in(user)
- install_voice_fake_media
- end
-
- it "takes the user from a session thread straight into its voice room" do
- session = Voice::ChatSession.post_message!(room, user, "hi from the room")
- thread = Chat::Thread.find(session[:thread_id])
-
- chat_page.visit_thread(thread)
-
- expect(back_to_voice_room).to have_back_to_room_button
- screenshot_marker(label: "back-to-voice-room-full-page", only: :desktop)
- back_to_voice_room.click
-
- expect(page).to have_current_path("/voice/r/#{room.slug}", ignore_query: true)
-
- # The click joins the call directly — no interstitial join button — and,
- # since this session is still live, arrives with its chat panel open.
- expect(page).to have_button(I18n.t("js.voice.room.leave"))
- expect(page).to have_no_button(I18n.t("js.voice.room.join"))
- expect(page).to have_css(".voice-chat")
- end
-
- it "shows the button on the drawer thread header" do
- Voice::ChatSession.post_message!(room, user, "hi from the room")
- session = Voice::ChatSession.post_message!(room, user, "and a reply")
- thread = Chat::Thread.find(session[:thread_id])
-
- chat_drawer_page.visit_channel(channel)
- channel_page.message_thread_indicator(thread.original_message).click
-
- expect(chat_drawer_page).to have_open_thread(thread)
- expect(back_to_voice_room).to have_back_to_room_button
- screenshot_marker(label: "back-to-voice-room-drawer", only: :desktop)
- end
-
- it "hides the button on a thread that is not a voice-room session" do
- thread = Fabricate(:chat_thread, channel: channel)
-
- chat_page.visit_thread(thread)
-
- expect(back_to_voice_room).to have_no_back_to_room_button
- end
-end
diff --git a/plugins/voice/spec/system/configure_livekit_agent_spec.rb b/plugins/voice/spec/system/configure_livekit_agent_spec.rb
deleted file mode 100644
index 4ee346eb716..00000000000
--- a/plugins/voice/spec/system/configure_livekit_agent_spec.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-# frozen_string_literal: true
-
-describe "Configure a LiveKit agent" do
- fab!(:admin)
- let(:settings_page) { PageObjects::Pages::AdminSiteSettings.new }
-
- before do
- SiteSetting.voice_enabled = true
- SiteSetting.voice_livekit_url = "wss://test.livekit.cloud"
- SiteSetting.voice_livekit_api_key = "key"
- SiteSetting.voice_livekit_api_secret = "secret"
- sign_in(admin)
- end
-
- it "lets an admin enable the bot without configuring an agent name" do
- settings_page.visit("voice_livekit_agent")
- expect(settings_page).to have_setting("voice_livekit_agent_enabled")
- expect(settings_page).to have_setting("voice_livekit_agent_invite_allowed_groups")
- expect(page).to have_content("Voice livekit agent enabled")
- # The description embeds a {{setting:...}} token that renders as a link,
- # so only a token-free fragment can be matched literally.
- expect(page).to have_content("to invite a LiveKit Cloud agent to public voice rooms")
-
- settings_page.toggle_bool_setting("voice_livekit_agent_enabled")
-
- page.refresh
- expect(settings_page.bool_setting_checkbox("voice_livekit_agent_enabled")).to be_checked
- end
-end
diff --git a/plugins/voice/spec/system/voice_mesh_privacy_warning_spec.rb b/plugins/voice/spec/system/voice_mesh_privacy_warning_spec.rb
deleted file mode 100644
index 8d1ca08338b..00000000000
--- a/plugins/voice/spec/system/voice_mesh_privacy_warning_spec.rb
+++ /dev/null
@@ -1,59 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "../support/voice_fake_media"
-
-describe "Voice mesh privacy warning" do
- fab!(:user)
- fab!(:room) { Fabricate(:voice_room, public: true) }
-
- before do
- user.activate
- SiteSetting.voice_enabled = true
- SiteSetting.voice_allowed_groups =
- "#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
- sign_in(user)
- install_voice_fake_media
- end
-
- def click_join
- click_button(I18n.t("js.voice.room.join"))
- end
-
- it "gates a mesh join behind the warning" do
- visit("/voice/r/#{room.slug}")
-
- click_join
- expect(page).to have_css(".voice-mesh-privacy-warning-modal")
- click_button(I18n.t("js.voice.mesh_privacy_warning.cancel"))
- expect(page).to have_no_css(".voice-mesh-privacy-warning-modal")
- expect(page).to have_no_css(".voice-room-page__leave")
-
- click_join
- click_button(I18n.t("js.voice.mesh_privacy_warning.join"))
- expect(page).to have_css(".voice-room-page__leave")
- end
-
- it "doesn't warn again on a device that opted out" do
- visit("/voice/r/#{room.slug}")
-
- click_join
- find(".voice-mesh-privacy-warning-modal__dont-show-again input").click
- click_button(I18n.t("js.voice.mesh_privacy_warning.join"))
- expect(page).to have_css(".voice-room-page__leave")
- click_button(I18n.t("js.voice.room.leave"))
-
- click_join
- expect(page).to have_css(".voice-room-page__leave")
- expect(page).to have_no_css(".voice-mesh-privacy-warning-modal")
- end
-
- it "doesn't warn when disabled site-wide" do
- SiteSetting.voice_mesh_privacy_warning_enabled = false
-
- visit("/voice/r/#{room.slug}")
-
- click_join
- expect(page).to have_css(".voice-room-page__leave")
- expect(page).to have_no_css(".voice-mesh-privacy-warning-modal")
- end
-end
diff --git a/plugins/voice/spec/system/voice_rooms_spec.rb b/plugins/voice/spec/system/voice_rooms_spec.rb
deleted file mode 100644
index 9496bb1bfef..00000000000
--- a/plugins/voice/spec/system/voice_rooms_spec.rb
+++ /dev/null
@@ -1,402 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "page_objects/components/voice_sidebar"
-require_relative "../support/voice_fake_media"
-
-describe "Voice rooms" do
- let(:voice_sidebar) { PageObjects::Components::VoiceSidebar.new }
-
- def click_room_page_widget_mode_button
- find("button[data-identifier='voice-room-menu']").click
- within(".fk-d-menu[data-identifier='voice-room-menu']") do
- click_button(I18n.t("js.voice.room.widget_mode"))
- end
- end
-
- def click_call_widget_open_page_button
- within(".voice-call-widget__controls") { find(".d-icon-expand").ancestor("button").click }
- end
-
- def click_call_widget_leave_button
- within(".voice-call-widget__controls") { find(".voice-call-widget__leave").click }
- end
-
- def switch_layout(layout_label)
- find("button[data-identifier='voice-room-menu']").click
- within(".fk-d-menu[data-identifier='voice-room-menu']") do
- click_button(I18n.t("js.voice.room.layout"))
- end
- click_button(layout_label)
- end
-
- fab!(:user)
- fab!(:other_user, :user)
- fab!(:admin)
-
- before do
- user.activate
- SiteSetting.voice_enabled = true
- SiteSetting.voice_mesh_privacy_warning_enabled = false
- SiteSetting.voice_allowed_groups =
- "#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
- SiteSetting.voice_create_room_allowed_groups = "#{Group::AUTO_GROUPS[:trust_level_2]}"
- end
-
- context "when plugin is disabled" do
- it "does not show voice rooms section" do
- SiteSetting.voice_enabled = false
- Fabricate(:voice_room, name: "Test Room", creator: admin, public: true)
- sign_in(user)
-
- visit("/latest")
-
- expect(voice_sidebar).to be_not_visible
- end
- end
-
- context "when plugin is enabled" do
- context "as anonymous user" do
- it "shows public rooms when access is open to everyone" do
- Fabricate(:voice_room, name: "Test Room", creator: admin, public: true)
-
- visit("/latest")
-
- expect(voice_sidebar).to be_visible
- end
-
- it "does not show voice rooms section when access is restricted to a group" do
- SiteSetting.voice_allowed_groups = "#{Group::AUTO_GROUPS[:trust_level_2]}"
- Fabricate(:voice_room, name: "Test Room", creator: admin, public: true)
-
- visit("/latest")
-
- expect(voice_sidebar).to be_not_visible
- end
- end
-
- context "as logged in user" do
- fab!(:room) { Fabricate(:voice_room, name: "Test Room", creator: admin, public: true) }
-
- before do
- user.update!(trust_level: TrustLevel[2])
- Group.refresh_automatic_groups!
- sign_in(user)
- end
-
- it "shows voice rooms section when rooms exist" do
- visit("/latest")
-
- expect(voice_sidebar).to be_visible
- end
-
- it "displays public rooms in the sidebar" do
- visit("/latest")
-
- expect(voice_sidebar).to be_visible
- expect(voice_sidebar).to have_room(room.name)
- end
-
- it "hides private rooms from non-members even when they can create rooms" do
- private_room = Fabricate(:voice_room, name: "Private Room", creator: admin, public: false)
-
- visit("/latest")
-
- expect(voice_sidebar).to have_room(room.name)
- expect(voice_sidebar).to have_no_room(private_room.name)
- end
-
- it "shows private rooms to their members" do
- private_room = Fabricate(:voice_room, name: "Private Room", creator: admin, public: false)
- private_room.room_memberships.create!(user: user)
-
- visit("/latest")
-
- expect(voice_sidebar).to have_room(private_room.name)
- end
-
- it "can publish a fake camera stream on the room page" do
- install_voice_fake_media
-
- visit("/voice/r/#{room.slug}")
- click_button(I18n.t("js.voice.room.join"))
-
- expect(page).to have_button(I18n.t("js.voice.video.camera_on"))
- click_button(I18n.t("js.voice.video.camera_on"))
-
- video_selector =
- ".voice-video-tile.--video[data-user-id='#{user.id}'] video.voice-video-tile__video"
- expect(page).to have_css(video_selector)
- expect(voice_media_track_count(video_selector)).to eq(1)
- end
-
- it "switches between presentation and tiled layouts from the menu" do
- install_voice_fake_media
-
- visit("/voice/r/#{room.slug}")
- click_button(I18n.t("js.voice.room.join"))
- expect(page).to have_css(".voice-room-page__leave")
- expect(page).to have_css(".voice-room-page.--tiled")
-
- switch_layout(I18n.t("js.voice.video.layout_presentation"))
- expect(page).to have_css(".voice-room-page.--presentation")
-
- switch_layout(I18n.t("js.voice.video.layout_tiled"))
- expect(page).to have_css(".voice-room-page.--tiled")
- end
-
- it "keeps the active call in a widget after switching to widget mode" do
- install_voice_fake_media
-
- visit("/voice/r/#{room.slug}")
- click_button(I18n.t("js.voice.room.join"))
- click_button(I18n.t("js.voice.video.camera_on"))
-
- click_room_page_widget_mode_button
-
- expect(page).to have_css(".voice-call-widget", text: room.name)
- expect(page).to have_button(I18n.t("js.voice.video.camera_off"))
-
- widget_video_selector =
- ".voice-call-widget .voice-video-tile.--video[data-user-id='#{user.id}'] video.voice-video-tile__video"
- expect(page).to have_css(widget_video_selector)
- expect(voice_media_track_count(widget_video_selector)).to eq(1)
-
- click_call_widget_open_page_button
-
- page_video_selector =
- ".voice-room-page .voice-video-tile.--video[data-user-id='#{user.id}'] video.voice-video-tile__video"
- expect(page).to have_current_path("/voice/r/#{room.slug}")
- expect(page).to have_css(page_video_selector)
- expect(voice_media_track_count(page_video_selector)).to eq(1)
- end
-
- it "can stop video and leave the call from the persistent widget" do
- install_voice_fake_media
-
- visit("/voice/r/#{room.slug}")
- click_button(I18n.t("js.voice.room.join"))
- click_button(I18n.t("js.voice.video.camera_on"))
-
- click_room_page_widget_mode_button
-
- within(".voice-call-widget") { click_button(I18n.t("js.voice.video.camera_off")) }
-
- expect(page).to have_button(I18n.t("js.voice.video.camera_on"))
- expect(page).to have_no_css(".voice-call-widget .voice-video-tile.--video")
-
- click_call_widget_leave_button
-
- expect(page).to have_no_css(".voice-call-widget")
- end
-
- it "opens room actions from the widget overflow menu" do
- install_voice_fake_media
-
- visit("/voice/r/#{room.slug}")
- click_button(I18n.t("js.voice.room.join"))
- click_room_page_widget_mode_button
-
- expect(page).to have_css(".voice-call-widget", text: room.name)
-
- # The overflow menu portals out at the dropdown z-index; opening it and
- # clicking an item asserts it renders above the widget rather than
- # behind it.
- find(".voice-call-widget button[data-identifier='voice-widget-room-menu']").click
- within(".fk-d-menu[data-identifier='voice-widget-room-menu']") do
- click_button(I18n.t("js.voice.room.info"))
- end
-
- expect(page).to have_css(".voice-room-info-modal")
- end
-
- it "shows remote fake video when another user publishes a camera stream" do
- other_user.activate
- other_user.update!(trust_level: TrustLevel[2])
- Group.refresh_automatic_groups!
-
- using_session(:alice) do
- sign_in(user)
- install_voice_fake_media(
- video_feeds: [
- {
- label: "Alice fake camera",
- width: 640,
- height: 360,
- color: "#2563eb",
- accent: "#f97316",
- },
- ],
- )
- visit("/voice/r/#{room.slug}")
- click_button(I18n.t("js.voice.room.join"))
- expect(page).to have_button(I18n.t("js.voice.video.camera_on"))
- end
-
- using_session(:bob) do
- sign_in(other_user)
- install_voice_fake_media(
- video_feeds: [
- {
- label: "Bob fake camera",
- width: 640,
- height: 360,
- color: "#16a34a",
- accent: "#7c3aed",
- },
- ],
- )
- visit("/voice/r/#{room.slug}")
- click_button(I18n.t("js.voice.room.join"))
- click_button(I18n.t("js.voice.video.camera_on"))
-
- local_video_selector =
- ".voice-video-tile.--video[data-user-id='#{other_user.id}'] video.voice-video-tile__video"
- expect(page).to have_css(local_video_selector)
- expect(voice_media_track_count(local_video_selector)).to eq(1)
- end
-
- using_session(:alice) do
- remote_video_selector =
- ".voice-video-tile.--video[data-user-id='#{other_user.id}'] video.voice-video-tile__video"
- expect(page).to have_css(remote_video_selector, wait: 10)
- expect(voice_media_track_count(remote_video_selector, timeout: 10)).to eq(1)
- end
- end
-
- it "keeps remote video attached in widget mode" do
- other_user.activate
- other_user.update!(trust_level: TrustLevel[2])
- Group.refresh_automatic_groups!
-
- using_session(:alice) do
- sign_in(user)
- install_voice_fake_media
- visit("/voice/r/#{room.slug}")
- click_button(I18n.t("js.voice.room.join"))
- click_room_page_widget_mode_button
-
- expect(page).to have_css(".voice-call-widget", text: room.name)
- expect(page).to have_current_path("/latest")
- end
-
- using_session(:bob) do
- sign_in(other_user)
- install_voice_fake_media(
- video_feeds: [
- {
- label: "Bob widget camera",
- width: 640,
- height: 360,
- color: "#16a34a",
- accent: "#7c3aed",
- },
- ],
- )
- visit("/voice/r/#{room.slug}")
- click_button(I18n.t("js.voice.room.join"))
- click_button(I18n.t("js.voice.video.camera_on"))
-
- local_video_selector =
- ".voice-video-tile.--video[data-user-id='#{other_user.id}'] video.voice-video-tile__video"
- expect(page).to have_css(local_video_selector)
- expect(voice_media_track_count(local_video_selector)).to eq(1)
- end
-
- using_session(:alice) do
- remote_tile_selector =
- ".voice-call-widget .voice-video-tile[data-user-id='#{other_user.id}']"
- remote_video_selector = "#{remote_tile_selector}.--video video.voice-video-tile__video"
-
- expect(page).to have_css(remote_tile_selector, wait: 10)
- expect(page).to have_css(remote_video_selector, wait: 10)
- expect(voice_media_track_count(remote_video_selector, timeout: 10)).to eq(1)
- expect(voice_media_track_live?(remote_video_selector, timeout: 10)).to eq(true)
- end
- end
- end
-
- context "with a stage room" do
- fab!(:stage_room) do
- Fabricate(
- :voice_room,
- name: "Stage Room",
- creator: user,
- public: true,
- room_type: Voice::Room::ROOM_TYPE_STAGE,
- )
- end
-
- before { other_user.activate }
-
- it "lets a joined moderator publish camera video while a listener gets no capture buttons" do
- using_session(:moderator) do
- sign_in(user)
- install_voice_fake_media
-
- visit("/voice/r/#{stage_room.slug}")
- click_button(I18n.t("js.voice.room.join"))
-
- # Stage rooms feature the presenter by default instead of the grid.
- expect(page).to have_css(".voice-room-page.--presentation")
-
- expect(page).to have_button(I18n.t("js.voice.video.camera_on"))
- click_button(I18n.t("js.voice.video.camera_on"))
-
- video_selector =
- ".voice-video-tile.--video[data-user-id='#{user.id}'] video.voice-video-tile__video"
- expect(page).to have_css(video_selector)
- expect(voice_media_track_count(video_selector)).to eq(1)
- end
-
- using_session(:listener) do
- sign_in(other_user)
- install_voice_fake_media
-
- visit("/voice/r/#{stage_room.slug}")
- click_button(I18n.t("js.voice.room.join"))
- expect(page).to have_css(".voice-room-page__leave")
-
- expect(page).to have_css(".voice-room-page.--presentation")
- expect(page).to have_no_button(I18n.t("js.voice.video.camera_on"))
- expect(page).to have_no_button(I18n.t("js.voice.video.screen_share_start"))
- end
- end
- end
-
- context "as admin" do
- before do
- admin.activate
- sign_in(admin)
- end
-
- it "shows voice rooms section when rooms exist" do
- Fabricate(:voice_room, name: "Admin Room", creator: admin, public: true)
-
- visit("/latest")
-
- expect(voice_sidebar).to be_visible
- end
- end
-
- context "when user is not in create room groups" do
- fab!(:low_trust_user) { Fabricate(:user, trust_level: TrustLevel[0]) }
-
- before do
- low_trust_user.activate
- SiteSetting.voice_create_room_allowed_groups = "#{Group::AUTO_GROUPS[:trust_level_2]}"
- sign_in(low_trust_user)
- end
-
- it "shows public rooms but hides private rooms" do
- public_room = Fabricate(:voice_room, name: "Public Room", creator: admin, public: true)
- private_room = Fabricate(:voice_room, name: "Private Room", creator: admin, public: false)
-
- visit("/latest")
-
- expect(voice_sidebar).to be_visible
- expect(voice_sidebar).to have_room(public_room.name)
- expect(voice_sidebar).to have_no_room(private_room.name)
- end
- end
- end
-end
diff --git a/plugins/voice/spec/system/voice_settings_spec.rb b/plugins/voice/spec/system/voice_settings_spec.rb
deleted file mode 100644
index d0307689a80..00000000000
--- a/plugins/voice/spec/system/voice_settings_spec.rb
+++ /dev/null
@@ -1,90 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "../support/voice_fake_media"
-
-describe "Voice settings" do
- fab!(:user)
- fab!(:admin)
- fab!(:room) { Fabricate(:voice_room, name: "Voice Room", creator: admin, public: true) }
-
- before do
- user.activate
- SiteSetting.voice_enabled = true
- SiteSetting.voice_mesh_privacy_warning_enabled = false
- SiteSetting.voice_allowed_groups =
- "#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
- sign_in(user)
- install_voice_fake_media
- end
-
- def join_room
- visit("/voice/r/#{room.slug}")
- click_button(I18n.t("js.voice.room.join"))
- expect(page).to have_css(".voice-room-page__leave")
- end
-
- def open_voice_settings
- find("button[data-identifier='voice-audio-menu']").click
- within(".fk-d-menu[data-identifier='voice-audio-menu']") do
- click_button(I18n.t("js.voice.voice_settings.audio_settings"))
- end
- expect(page).to have_css(".voice-voice-settings-modal")
- end
-
- it "offers the audio processing controls" do
- join_room
- open_voice_settings
-
- within(".voice-voice-settings") do
- expect(page).to have_css(".voice-voice-settings__noise-suppression-select")
- expect(page).to have_content(I18n.t("js.voice.voice_settings.echo_cancellation"))
- expect(page).to have_content(I18n.t("js.voice.voice_settings.auto_gain_control"))
- end
- end
-
- it "toggles echo cancellation and automatic gain control" do
- join_room
- open_voice_settings
-
- ec_toggle =
- PageObjects::Components::DToggleSwitch.new(".voice-voice-settings__echo-cancellation-toggle")
- agc_toggle =
- PageObjects::Components::DToggleSwitch.new(".voice-voice-settings__auto-gain-toggle")
-
- expect(ec_toggle.checked?).to eq(true)
- expect(agc_toggle.checked?).to eq(true)
-
- ec_toggle.toggle
- expect(ec_toggle.unchecked?).to eq(true)
- expect(agc_toggle.checked?).to eq(true)
- end
-
- # These run the real engine pipelines (wasm fetch, worklet ready
- # handshake), so the "AI" assertions only pass once the filter is genuinely
- # running — the modal spec covers DTLN, the submenu spec covers RNNoise.
- it "enables AI noise cancellation from the voice settings modal and shows the mic badge" do
- join_room
- open_voice_settings
-
- mode_select =
- PageObjects::Components::SelectKit.new(".voice-voice-settings__noise-suppression-select")
- mode_select.expand
- mode_select.select_row_by_value("ai:dtln")
-
- expect(page).to have_css(".voice-call-controls__ns-badge", wait: 15)
- end
-
- it "enables AI noise cancellation from the mic dropdown submenu" do
- join_room
-
- find("button[data-identifier='voice-audio-menu']").click
- within(".fk-d-menu[data-identifier='voice-audio-menu']") do
- click_button(I18n.t("js.voice.voice_settings.noise_suppression"))
- end
- within(".fk-d-menu[data-identifier='voice-call-submenu']") do
- click_button(I18n.t("js.voice.voice_settings.noise_suppression_modes.ai_rnnoise"))
- end
-
- expect(page).to have_css(".voice-call-controls__ns-badge", wait: 15)
- end
-end
diff --git a/plugins/voice/spec/system/voice_stage_speak_queue_spec.rb b/plugins/voice/spec/system/voice_stage_speak_queue_spec.rb
deleted file mode 100644
index 3e05de608fb..00000000000
--- a/plugins/voice/spec/system/voice_stage_speak_queue_spec.rb
+++ /dev/null
@@ -1,145 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "../support/voice_fake_media"
-
-# NOTE: outside CI, core pins every test browser to one fixed
-# --remote-debugging-port, so these two-session specs need CI=1 in the
-# environment to launch the second browser locally.
-describe "Voice stage speak queue" do
- fab!(:moderator, :user)
- fab!(:listener, :user)
- fab!(:room) do
- Fabricate(
- :voice_room,
- name: "Stage Room",
- creator: moderator,
- public: true,
- room_type: Voice::Room::ROOM_TYPE_STAGE,
- )
- end
-
- let(:toasts) { PageObjects::Components::Toasts.new }
-
- before do
- moderator.activate
- listener.activate
- SiteSetting.voice_enabled = true
- SiteSetting.voice_mesh_privacy_warning_enabled = false
- SiteSetting.voice_allowed_groups =
- "#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
- end
-
- def join_room(user)
- sign_in(user)
- install_voice_fake_media
- visit("/voice/r/#{room.slug}")
- click_button(I18n.t("js.voice.room.join"))
- expect(page).to have_css(".voice-room-page__leave")
- end
-
- def open_speak_queue
- find("button[data-identifier='voice-speak-queue-menu']").click
- end
-
- def speak_queue_menu
- ".fk-d-menu[data-identifier='voice-speak-queue-menu']"
- end
-
- it "promotes the listener to speaker when a moderator approves their request" do
- using_session(:alice) { join_room(moderator) }
-
- using_session(:bob) do
- join_room(listener)
-
- expect(page).to have_css(".voice-call-controls__raise-hand")
- find(".voice-call-controls__raise-hand").click
- expect(page).to have_css(".voice-call-controls__raise-hand.--active")
- end
-
- using_session(:alice) do
- expect(page).to have_css(".voice-speak-queue-trigger__count", text: "1", wait: 10)
- expect(page).to have_css(
- ".sidebar-section[data-section-name='voice-rooms'] .voice-participant-suffix .d-icon-hand",
- )
-
- open_speak_queue
- within(speak_queue_menu) do
- expect(page).to have_css(".voice-speak-queue__item", text: listener.username)
- expect(page).to have_css(".voice-speak-queue__position", text: "1")
- find(".voice-speak-queue__approve").click
- end
- end
-
- using_session(:bob) do
- expect(toasts).to have_success(I18n.t("js.voice.stage.promoted_to_speaker"))
- expect(page).to have_no_css(".voice-call-controls__raise-hand")
- expect(page).to have_button(I18n.t("js.voice.video.camera_on"))
- end
-
- using_session(:alice) do
- within(speak_queue_menu) { expect(page).to have_css(".voice-speak-queue__empty") }
- expect(page).to have_no_css(".voice-speak-queue-trigger__count")
- end
- end
-
- it "lets the listener raise their hand again after a moderator dismisses the request" do
- using_session(:alice) { join_room(moderator) }
-
- using_session(:bob) do
- join_room(listener)
-
- find(".voice-call-controls__raise-hand").click
- expect(page).to have_css(".voice-call-controls__raise-hand.--active")
- end
-
- using_session(:alice) do
- expect(page).to have_css(".voice-speak-queue-trigger__count", text: "1", wait: 10)
-
- open_speak_queue
- within(speak_queue_menu) do
- find(".voice-speak-queue__dismiss").click
- expect(page).to have_css(".voice-speak-queue__empty")
- end
- expect(page).to have_no_css(".voice-speak-queue-trigger__count")
- end
-
- using_session(:bob) do
- expect(toasts).to have_default(I18n.t("js.voice.stage.request_dismissed"))
- expect(page).to have_css(".voice-call-controls__raise-hand:not(.--active)")
-
- find(".voice-call-controls__raise-hand").click
- expect(page).to have_css(".voice-call-controls__raise-hand.--active")
- end
-
- using_session(:alice) do
- expect(page).to have_css(".voice-speak-queue-trigger__count", text: "1", wait: 10)
- end
- end
-
- it "clears the moderator's queue when the listener lowers their own hand" do
- using_session(:alice) { join_room(moderator) }
-
- using_session(:bob) do
- join_room(listener)
-
- find(".voice-call-controls__raise-hand").click
- expect(page).to have_css(".voice-call-controls__raise-hand.--active")
- end
-
- using_session(:alice) do
- expect(page).to have_css(".voice-speak-queue-trigger__count", text: "1", wait: 10)
- end
-
- using_session(:bob) do
- find(".voice-call-controls__raise-hand.--active").click
- expect(page).to have_css(".voice-call-controls__raise-hand:not(.--active)")
- end
-
- using_session(:alice) do
- expect(page).to have_no_css(".voice-speak-queue-trigger__count", wait: 10)
-
- open_speak_queue
- within(speak_queue_menu) { expect(page).to have_css(".voice-speak-queue__empty") }
- end
- end
-end
diff --git a/plugins/voice/spec/system/voice_subtitles_spec.rb b/plugins/voice/spec/system/voice_subtitles_spec.rb
deleted file mode 100644
index 976eeae72e2..00000000000
--- a/plugins/voice/spec/system/voice_subtitles_spec.rb
+++ /dev/null
@@ -1,88 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "../support/voice_fake_media"
-
-describe "Voice subtitles" do
- fab!(:user)
- fab!(:admin)
- fab!(:room) { Fabricate(:voice_room, name: "Voice Room", creator: admin, public: true) }
-
- before do
- user.activate
- SiteSetting.voice_enabled = true
- SiteSetting.voice_mesh_privacy_warning_enabled = false
- SiteSetting.voice_allowed_groups =
- "#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
- sign_in(user)
- install_voice_fake_media
- end
-
- def stub_webgpu
- page.driver.with_playwright_page do |playwright_page|
- playwright_page.add_init_script(script: <<~JS)
- if (!navigator.gpu) {
- Object.defineProperty(navigator, "gpu", { configurable: true, value: {} });
- }
- JS
- end
- end
-
- def join_room
- visit("/voice/r/#{room.slug}")
- click_button(I18n.t("js.voice.room.join"))
- expect(page).to have_css(".voice-room-page__leave")
- end
-
- def open_voice_settings
- find("button[data-identifier='voice-audio-menu']").click
- within(".fk-d-menu[data-identifier='voice-audio-menu']") do
- click_button(I18n.t("js.voice.voice_settings.audio_settings"))
- end
- expect(page).to have_css(".voice-voice-settings-modal")
- end
-
- it "hides the subtitles toggle when the site setting is off" do
- SiteSetting.voice_subtitles_enabled = false
- stub_webgpu
- join_room
- open_voice_settings
-
- within(".voice-voice-settings") do
- expect(page).to have_no_content(I18n.t("js.voice.voice_settings.subtitles"))
- end
- end
-
- it "offers the subtitles toggle and enables the caption overlay" do
- SiteSetting.voice_subtitles_enabled = true
- stub_webgpu
- join_room
- open_voice_settings
-
- within(".voice-voice-settings") do
- expect(page).to have_content(I18n.t("js.voice.voice_settings.subtitles"))
- end
-
- toggle = PageObjects::Components::DToggleSwitch.new(".voice-voice-settings__subtitles-toggle")
- toggle.toggle
- expect(toggle.checked?).to eq(true)
-
- find(".modal-close").click
- expect(page).to have_css(".voice-captions", visible: :all)
- end
-
- it "lets the user pick the smaller subtitles model" do
- SiteSetting.voice_subtitles_enabled = true
- stub_webgpu
- join_room
- open_voice_settings
-
- select = PageObjects::Components::SelectKit.new(".voice-voice-settings__subtitles-model-select")
- expect(select).to have_selected_name(I18n.t("js.voice.voice_settings.subtitles_models.ultra"))
-
- select.expand
- select.select_row_by_value("redux")
-
- expect(select).to have_selected_name(I18n.t("js.voice.voice_settings.subtitles_models.redux"))
- expect(page.evaluate_script("localStorage.getItem('voice:stt-model')")).to eq("redux")
- end
-end
diff --git a/plugins/voice/spec/system/voice_video_settings_spec.rb b/plugins/voice/spec/system/voice_video_settings_spec.rb
deleted file mode 100644
index de5f4727a65..00000000000
--- a/plugins/voice/spec/system/voice_video_settings_spec.rb
+++ /dev/null
@@ -1,122 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "../support/voice_fake_media"
-
-describe "Voice video settings" do
- fab!(:user)
- fab!(:admin)
- fab!(:room) { Fabricate(:voice_room, name: "Video Room", creator: admin, public: true) }
-
- let(:camera_select) do
- PageObjects::Components::SelectKit.new(".voice-video-settings__camera-select")
- end
-
- before do
- user.activate
- SiteSetting.voice_enabled = true
- SiteSetting.voice_mesh_privacy_warning_enabled = false
- SiteSetting.voice_allowed_groups =
- "#{Group::AUTO_GROUPS[:anonymous_users]}|#{Group::AUTO_GROUPS[:logged_in_users]}"
- sign_in(user)
- install_voice_fake_media
- end
-
- def join_room
- visit("/voice/r/#{room.slug}")
- click_button(I18n.t("js.voice.room.join"))
- expect(page).to have_css(".voice-room-page__leave")
- end
-
- def open_video_menu
- find("button[data-identifier='voice-video-menu']").click
- expect(page).to have_css(".fk-d-menu[data-identifier='voice-video-menu']")
- end
-
- def open_video_settings
- open_video_menu
- within(".fk-d-menu[data-identifier='voice-video-menu']") do
- click_button(I18n.t("js.voice.video_settings.title"))
- end
- expect(page).to have_css(".voice-video-settings-modal")
- end
-
- it "hides the screen share button from groups not allowed to share a screen" do
- SiteSetting.voice_screen_share_allowed_groups = ""
-
- join_room
-
- expect(page).to have_button(I18n.t("js.voice.video.camera_on"))
- expect(page).to have_no_button(I18n.t("js.voice.video.screen_share_start"))
- end
-
- it "hides the camera button from groups not allowed to share a camera" do
- SiteSetting.voice_video_allowed_groups = ""
-
- join_room
-
- expect(page).to have_button(I18n.t("js.voice.video.screen_share_start"))
- expect(page).to have_no_button(I18n.t("js.voice.video.camera_on"))
- end
-
- it "offers voice and video settings from the call menus" do
- join_room
-
- find("button[data-identifier='voice-audio-menu']").click
- within(".fk-d-menu[data-identifier='voice-audio-menu']") do
- expect(page).to have_button(I18n.t("js.voice.voice_settings.audio_settings"))
- end
- find("button[data-identifier='voice-audio-menu']").click
-
- open_video_menu
- within(".fk-d-menu[data-identifier='voice-video-menu']") do
- expect(page).to have_button(I18n.t("js.voice.video_settings.title"))
- end
- end
-
- it "shows a camera preview and lists camera devices" do
- join_room
- open_video_settings
-
- expect(page).to have_css(".voice-video-settings__preview video")
- expect(voice_media_track_live?(".voice-video-settings__preview video")).to eq(true)
-
- camera_select.expand
- expect(camera_select).to have_option_name("Voice fake camera A")
- expect(camera_select).to have_option_name("Voice fake camera B")
- end
-
- it "keeps the published camera live after switching devices" do
- join_room
- click_button(I18n.t("js.voice.video.camera_on"))
-
- video_selector =
- ".voice-video-tile.--video[data-user-id='#{user.id}'] video.voice-video-tile__video"
- expect(page).to have_css(video_selector)
-
- open_video_settings
- camera_select.expand
- camera_select.select_row_by_name("Voice fake camera B")
-
- expect(camera_select).to have_selected_name("Voice fake camera B")
- expect(voice_media_track_live?(video_selector)).to eq(true)
- end
-
- it "shows the background blur toggle when the setting is enabled" do
- join_room
- open_video_settings
-
- within(".voice-video-settings") { expect(page).to have_css(".d-toggle-switch") }
- end
-
- it "hides background blur when the site setting is disabled" do
- SiteSetting.voice_video_background_blur_enabled = false
-
- join_room
- open_video_settings
-
- within(".voice-video-settings") do
- expect(page).to have_css(".voice-video-settings__camera-select")
- expect(page).to have_no_css(".d-toggle-switch")
- end
- end
-end
diff --git a/plugins/voice/spec/validators/voice_livekit_recording_s3_bucket_validator_spec.rb b/plugins/voice/spec/validators/voice_livekit_recording_s3_bucket_validator_spec.rb
deleted file mode 100644
index bf4f5bac53b..00000000000
--- a/plugins/voice/spec/validators/voice_livekit_recording_s3_bucket_validator_spec.rb
+++ /dev/null
@@ -1,69 +0,0 @@
-# frozen_string_literal: true
-
-RSpec.describe VoiceLivekitRecordingS3BucketValidator do
- subject(:validator) { described_class.new }
-
- before do
- SiteSetting.voice_livekit_url = "wss://livekit.example.com"
- SiteSetting.voice_livekit_recording_s3_access_key_id = "recording-access-key"
- SiteSetting.voice_livekit_recording_s3_secret_access_key = "recording-secret-key"
- end
-
- it "accepts an empty bucket for self-hosted storage" do
- SiteSetting.voice_livekit_recording_s3_secret_access_key = ""
-
- expect(validator.valid_value?("")).to eq(true)
- end
-
- it "accepts a bucket when the recording credentials and region are configured" do
- expect(validator.valid_value?("voice-recordings")).to eq(true)
- end
-
- it "validates the configured bucket name regex when saving the setting" do
- ["voice-recordings/folder", "Voice-recordings", "ab", "a" * 64].each do |bucket|
- expect { SiteSetting.voice_livekit_recording_s3_bucket = bucket }.to raise_error(
- Discourse::InvalidParameters,
- "voice_livekit_recording_s3_bucket: #{I18n.t("site_settings.errors.regex_mismatch")}",
- )
- end
-
- SiteSetting.voice_livekit_recording_s3_bucket = "voice-recordings"
- expect(SiteSetting.voice_livekit_recording_s3_bucket).to eq("voice-recordings")
-
- SiteSetting.voice_livekit_recording_s3_bucket = ""
- expect(SiteSetting.voice_livekit_recording_s3_bucket).to eq("")
- end
-
- it "requires both recording credentials" do
- SiteSetting.voice_livekit_recording_s3_access_key_id = ""
- expect(validator.valid_value?("voice-recordings")).to eq(false)
-
- SiteSetting.voice_livekit_recording_s3_access_key_id = "recording-access-key"
- SiteSetting.voice_livekit_recording_s3_secret_access_key = ""
- expect(validator.valid_value?("voice-recordings")).to eq(false)
- expect(validator.error_message).to eq(
- I18n.t("site_settings.errors.voice_livekit_recording_s3_requires_credentials"),
- )
- end
-
- it "requires a region unless a custom endpoint is configured" do
- SiteSetting.voice_livekit_recording_s3_region = ""
-
- expect(validator.valid_value?("voice-recordings")).to eq(false)
- expect(validator.error_message).to eq(
- I18n.t("site_settings.errors.voice_livekit_recording_s3_requires_region"),
- )
-
- SiteSetting.voice_livekit_recording_s3_endpoint = "https://storage.example.com"
- expect(validator.valid_value?("voice-recordings")).to eq(true)
- end
-
- it "requires an encrypted connection to LiveKit" do
- SiteSetting.voice_livekit_url = "ws://livekit.example.com"
-
- expect(validator.valid_value?("voice-recordings")).to eq(false)
- expect(validator.error_message).to eq(
- I18n.t("site_settings.errors.voice_livekit_recording_s3_requires_wss"),
- )
- end
-end
diff --git a/plugins/voice/test/javascripts/integration/components/voice/voice-canvas-test.gjs b/plugins/voice/test/javascripts/integration/components/voice/voice-canvas-test.gjs
deleted file mode 100644
index f9ce517587c..00000000000
--- a/plugins/voice/test/javascripts/integration/components/voice/voice-canvas-test.gjs
+++ /dev/null
@@ -1,73 +0,0 @@
-import { tracked } from "@glimmer/tracking";
-import { action } from "@ember/object";
-import Service from "@ember/service";
-import { render, settled } from "@ember/test-helpers";
-import { module, test } from "qunit";
-import { setupRenderingTest } from "discourse/tests/helpers/component-test";
-import VoiceVoiceCanvas from "discourse/plugins/voice/discourse/components/voice/voice-canvas";
-
-class VoiceWebrtcStub extends Service {
- @tracked localStream = null;
- @tracked remoteStreams = [];
- @tracked remoteScreenAudioStreams = [];
- attachCalls = [];
-
- @action
- attachStream(stream, element) {
- this.attachCalls.push({ stream, element });
- }
-}
-
-module("Integration | Component | voice/voice-canvas", function (hooks) {
- setupRenderingTest(hooks);
-
- hooks.beforeEach(function () {
- this.owner.unregister("service:voice-webrtc");
- this.owner.register("service:voice-webrtc", VoiceWebrtcStub);
- this.voiceWebrtc = this.owner.lookup("service:voice-webrtc");
- });
-
- test("re-attaches a remote stream when the object changes but the id stays the same", async function (assert) {
- const firstStream = { id: "peer-stream" };
- const secondStream = { id: "peer-stream" };
-
- this.voiceWebrtc.remoteStreams = [firstStream];
-
- await render(<template><VoiceVoiceCanvas /></template>);
-
- assert.strictEqual(this.voiceWebrtc.attachCalls.length, 1);
- assert.strictEqual(this.voiceWebrtc.attachCalls[0].stream, firstStream);
-
- const element = this.voiceWebrtc.attachCalls[0].element;
-
- this.voiceWebrtc.remoteStreams = [secondStream];
- await settled();
-
- assert.strictEqual(this.voiceWebrtc.attachCalls.length, 2);
- assert.strictEqual(this.voiceWebrtc.attachCalls[1].stream, secondStream);
- assert.strictEqual(this.voiceWebrtc.attachCalls[1].element, element);
- });
-
- test("renders a dedicated sink for each remote screen audio stream", async function (assert) {
- const voiceStream = { id: "voice-stream" };
- const screenAudioStream = { id: "screen-audio-stream" };
-
- this.voiceWebrtc.remoteStreams = [voiceStream];
-
- await render(<template><VoiceVoiceCanvas /></template>);
-
- assert.strictEqual(this.voiceWebrtc.attachCalls.length, 1);
-
- this.voiceWebrtc.remoteScreenAudioStreams = [screenAudioStream];
- await settled();
-
- assert.strictEqual(this.voiceWebrtc.attachCalls.length, 2);
- assert.strictEqual(
- this.voiceWebrtc.attachCalls[1].stream,
- screenAudioStream
- );
- assert
- .dom(".voice-voice-canvas audio")
- .exists({ count: 2 }, "keeps the voice sink alongside the screen sink");
- });
-});
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index ccc4c09a285..4fab81b5690 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1129,25 +1129,25 @@ importers:
specifier: workspace:@discourse/types@*
version: link:../../frontend/discourse-types
- plugins/poll:
+ plugins/live:
dependencies:
discourse:
specifier: workspace:@discourse/types@*
version: link:../../frontend/discourse-types
- plugins/spoiler-alert:
+ plugins/poll:
dependencies:
discourse:
specifier: workspace:@discourse/types@*
version: link:../../frontend/discourse-types
- plugins/styleguide:
+ plugins/spoiler-alert:
dependencies:
discourse:
specifier: workspace:@discourse/types@*
version: link:../../frontend/discourse-types
- plugins/voice:
+ plugins/styleguide:
dependencies:
discourse:
specifier: workspace:@discourse/types@*
diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml
index c5e7d95c48d..0ead5cdb73f 100644
--- a/pnpm-workspace.yaml
+++ b/pnpm-workspace.yaml
@@ -70,7 +70,7 @@ packages:
- "plugins/poll"
- "plugins/spoiler-alert"
- "plugins/styleguide"
-- "plugins/voice"
+- "plugins/live"
- "themes/horizon"
patchedDependencies:
diff --git a/spec/requests/api/schemas/json/site_response.json b/spec/requests/api/schemas/json/site_response.json
index 01eb9595d83..d29a2b58ece 100644
--- a/spec/requests/api/schemas/json/site_response.json
+++ b/spec/requests/api/schemas/json/site_response.json
@@ -155,7 +155,7 @@
"suggested_edit_accepted": {
"type": "integer"
},
- "voice_invitation": {
+ "live_invitation": {
"type": "integer"
}
},