Make connection to Discord IPC smarter#2
Conversation
|
Hey @hyblocker! Sorry, I didn't realise that I wasn't watching these repos on orgs outside of my personal account, so I never got notified about PRs here :) I'll take a look at this today |
|
Somehow, I don't think this PR actually changes anything at all. As soon as the client is set to Some ( Am I wrong? |
|
In fact, the only thing I can see this changing is breaking the functionality for reconnecting when the client disconnects (https://github.com/hyblocker/opendeck-discord/blob/1a09ed89293120a6dbbda94fd6ecb7a1a0f5f7e3/src/rpc_events.rs#L40), as it'll skip the reconnect attempt as the client is Some but disconnected. |
I noticed the plugin in it's current state spams Discord IPC with oauth events. I made the re-initialisation handler take into account the current connection state and take into account whether or not re-initialisation succeeded or not.