[skip ci] feat: prepare for public release

This commit is contained in:
Hampus Kraft
2026-01-02 19:27:51 +00:00
parent 197b23757f
commit 5ae825fc7d
199 changed files with 38391 additions and 33358 deletions

View File

@@ -18,9 +18,11 @@
*/
import type {ChannelID, GuildID, UserID} from '~/BrandedTypes';
import {ChannelTypes} from '~/Constants';
import type {IChannelRepository} from '~/channel/IChannelRepository';
import {
FeatureTemporarilyDisabledError,
UnclaimedAccountRestrictedError,
UnknownChannelError,
UnknownGuildMemberError,
UnknownUserError,
@@ -114,6 +116,21 @@ export class VoiceService {
throw new UnknownChannelError();
}
const isUnclaimed = !user.passwordHash && !user.isBot;
if (isUnclaimed) {
if (channel.type === ChannelTypes.DM) {
throw new UnclaimedAccountRestrictedError('join 1:1 voice calls');
}
if (channel.type === ChannelTypes.GUILD_VOICE) {
const guild = guildId ? await this.guildRepository.findUnique(guildId) : null;
const isOwner = guild?.ownerId === userId;
if (!isOwner) {
throw new UnclaimedAccountRestrictedError('join voice channels you do not own');
}
}
}
let mute = false;
let deaf = false;