mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-03 12:02:50 +08:00
fix: preserve invites on nickname lookup failure
This commit is contained in:
1 parent
75893339c5
commit
efa0b85a0e
4 files changed
+45
-2
No files matched your search
@@ -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));
|
||||
|
||||
Reference in new issue
Block a user