library: rpc: do not validate nonce of initial response

Yet another inconsistency between arRPC and Discord RPC, Discord RPC does not send a nonce at all. Now we internally treat "initial-ready" as a magic string to bypass nonce validation.

Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
This commit is contained in:
Ophestra Umiker 2024-06-30 02:57:42 +09:00
parent 5bb6f9f1a8
commit 50e3f3a03f
Signed by: cat
SSH Key Fingerprint: SHA256:gQ67O0enBZ7UdZypgtspB2FDM1g3GVw8nX0XSdcFw8Q
1 changed files with 3 additions and 0 deletions

3
rpc.go
View File

@ -68,6 +68,9 @@ func (p payload) traceCommand(command string) *string {
} }
func (p payload) nonce(n string) bool { func (p payload) nonce(n string) bool {
if n == "initial-ready" {
return true
}
return p.Nonce == n return p.Nonce == n
} }