fredemmott / StreamDeck-Discord

Control the Discord application with the Elgato StreamDeck
MIT License
275 stars 23 forks source link

Refactor DiscordRPCSDK to use asio from think-async #47

Closed fredemmott closed 3 years ago

fredemmott commented 3 years ago

Right now, the plugin maintains state, e.g. isDeafened/isMuted; this isn't ideal. For example, getState() returns cached state data.

This makes adding new functionality annoying, especially if it's not covering stuff already in the VOICE_STATE data.

making getState() actually fetch the data directly from discord would block the plugin, which also isn't great.

However, if getState() returned asio::awaitable<> and waited for a response with co_await, this would be resolved, and be more easily extensible.

Specifically want to use this async library because it is also used by Elgato's StreamDeck SDK so should be relatively easy to integrate.

fredemmott commented 3 years ago

Done, made implementing hangup somewhat trivial :)