[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

@@ -174,6 +174,11 @@ export abstract class BaseChannelAuthService {
async validateDMSendPermissions({channelId, userId}: {channelId: ChannelID; userId: UserID}): Promise<void> {
const channel = await this.channelRepository.channelData.findUnique(channelId);
if (!channel) throw new UnknownChannelError();
if (channel.type === ChannelTypes.GROUP_DM || channel.type === ChannelTypes.DM_PERSONAL_NOTES) {
return;
}
const recipients = await this.userRepository.listUsers(Array.from(channel.recipientIds));
await this.dmPermissionValidator.validate({recipients, userId});
}

View File

@@ -72,6 +72,12 @@ export class CallService {
throw new InvalidChannelTypeForCallError();
}
const caller = await this.userRepository.findUnique(userId);
const isUnclaimedCaller = caller != null && !caller.passwordHash && !caller.isBot;
if (isUnclaimedCaller && channel.type === ChannelTypes.DM) {
return {ringable: false};
}
const call = await this.gatewayService.getCall(channelId);
const alreadyInCall = call ? call.voice_states.some((vs) => vs.user_id === userId.toString()) : false;
if (alreadyInCall) {