Feat/voice channels#6
Conversation
Adds ObsidianIRC voice channels (Discord-style audio rooms with
optional video / screen-share). All media negotiation lives in the
hosted-backend's WebRTC SFU; this module is the IRC <-> SFU bridge.
Core patches:
* src/channel.c valid_channelname() and src/api-isupport.c
CHANTYPES default now accept `^` alongside `#`.
* include/struct.h IsChannelName() macro recognises both prefixes.
* Voice channels otherwise behave exactly like normal IRC
channels: JOIN/PART/NAMES/MODE all work; +P keeps them
permanent; empty channels reap normally.
src/modules/voice-channels.c (new):
* Unix-socket bridge to hosted-backend at
/tmp/obbyirc-voice.sock by default (override via
set::voice-bridge-socket in obbyircd.conf or VOICE_BRIDGE_SOCKET
env var). Reconnects on every 100ms pump tick when down.
* NDJSON wire format -- one JSON object per line, both ways.
* Outbound (IRCd -> backend):
{op:"signal",from,channel,account,payload:{...}}
{op:"part",from,channel}
{op:"quit",from}
Forwards every TAGMSG to a `^channel` carrying the
+obsidianirc/rtc tag, then *strips* the tag from the outgoing
mtag list so the empty TAGMSG is dropped by message.c's
has_client_mtags guard -- SDP/ICE never leak to other channel
members.
* Inbound (backend -> IRCd):
{op:"signal",to,payload:{...}}
Re-emits as `:server.name TAGMSG <to> @+obsidianirc/rtc=<json>`
with full IRC tag-value escaping (";" -> "\:", " " -> "\s",
"\" -> "\\", CR/LF). Targets starting with `^` or `#` fan out
to every local member; other targets are nick lookups.
* Hooks LOCAL_PART and LOCAL_QUIT to keep the SFU in sync when
clients drop without explicit leave signaling.
* Loaded by default via doc/conf/modules.default.conf; uses
libjansson (already pulled in by other modules).
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughThis PR adds voice/video channel support to ObbyIRCd by introducing a new ChangesVoice-Channels Bridge Feature
Sequence DiagramsequenceDiagram
participant Client as IRC Client
participant ObbyIRCd as ObbyIRCd<br/>(voice-channels)
participant Bridge as WebRTC Bridge<br/>(Unix Socket)
participant Backend as Hosted Backend<br/>(SFU/TURN)
Client->>ObbyIRCd: TAGMSG on ^channel<br/>+obsidianirc/rtc={...signal...}
ObbyIRCd->>ObbyIRCd: Intercept pre-channel hook
ObbyIRCd->>ObbyIRCd: Extract & parse JSON payload
ObbyIRCd->>Bridge: Send frame: {op:"signal",...}
ObbyIRCd->>ObbyIRCd: Remove tag from outgoing msg
Bridge->>Backend: Forward signal
Backend->>Backend: Process RTC state
Backend->>Bridge: Return signal frame
Bridge->>ObbyIRCd: Poll & read JSON frame
ObbyIRCd->>ObbyIRCd: Parse inbound frame
ObbyIRCd->>Client: TAGMSG ^channel<br/>+obsidianirc/rtc={...signal...}
Note over Client,Backend: Lifecycle: Client parts channel
Client->>ObbyIRCd: PART ^channel
ObbyIRCd->>Bridge: Send frame: {op:"part",...}
Bridge->>Backend: Notify participant exit
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
Summary by CodeRabbit
New Features
Chores