fix: preserve invites on nickname lookup failure

This commit is contained in:
illusia committed 2026-10-09 00:26:21 +08:00
1 parent 75893339c5
commit efa0b85a0e
4 files changed
+45 -2

No files matched your search

+10
View File
@@ -311,6 +311,16 @@ export class AdminService {
return revoked;
}
getManagedInvite(token: string): { target: string; channel: string } | null {
if (!/^[A-Za-z0-9_-]{32,128}$/.test(token)) return null;
const record = this.database.getManagedInvite(hashInviteToken(token));
if (!record) return null;
return {
target: record.targetText ?? formatTeamSpeakTarget({ host: record.targetHost, port: record.targetPort }),
channel: record.channel,
};
}
consumeManagedInvite(token: string): { target: string; serverPassword: string; channel: string } | null {
if (!/^[A-Za-z0-9_-]{32,128}$/.test(token)) return null;
const record = this.database.consumeManagedInvite(hashInviteToken(token));