feat(voice): add WebRTC voice channels with Cloudflare TURN support
Add voice channel functionality with WebRTC peer-to-peer audio: - Add VoiceSignalingConsumer for WebRTC signaling and peer coordination - Add GlobalConsumer for real-time presence and voice status updates - Add voice channel type to Channel model with current_voice_channel tracking on UserProfile - Add voice controls UI (mute, deafen, disconnect) in status panel - Add voice member list display in sidebar with avatar support - Add
This commit is contained in:
@@ -15,6 +15,7 @@ class UserProfile(models.Model):
|
||||
role = models.CharField(max_length=20, choices=ROLE_CHOICES, default='user')
|
||||
blocked_users = models.ManyToManyField(User, related_name='blocked_by', blank=True)
|
||||
online = models.BooleanField(default=False)
|
||||
current_voice_channel = models.ForeignKey('Channel', on_delete=models.SET_NULL, null=True, blank=True, related_name='voice_members')
|
||||
|
||||
def __str__(self):
|
||||
return f'{self.user.username} ({self.role})'
|
||||
@@ -27,8 +28,13 @@ class UserProfile(models.Model):
|
||||
|
||||
|
||||
class Channel(models.Model):
|
||||
CHANNEL_TYPES = [
|
||||
('text', 'Text Channel'),
|
||||
('voice', 'Voice Channel'),
|
||||
]
|
||||
name = models.CharField(max_length=100, unique=True)
|
||||
description = models.TextField(blank=True, default='')
|
||||
channel_type = models.CharField(max_length=10, choices=CHANNEL_TYPES, default='text')
|
||||
created_by = models.ForeignKey(User, on_delete=models.SET_NULL, null=True, related_name='created_channels')
|
||||
members = models.ManyToManyField(User, related_name='channels', blank=True)
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
Reference in New Issue
Block a user