Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Quite a big one. I want to put some parts in separate PRs.
The issue: We currently have three third party emote providers. Each of them is a separate entry in
Application
and each of them needs to be wired up separately throughout different parts of the app (emote popup, message building, split header refreshing, twitch channel refreshing, input completion, etc.). In the future, plugins should also be able to have their own emote providers that integrate with the app (not just message building).The solution: Abstract emote providers into
EmoteProvider
s. Most parts of the app don't care if emotes are from BTTV, FFZ, or 7TV. All they care about is their order and "origin" (channel/global). Of course, there are exceptions to this. Namely, live updates which are still specific to one provider and drive-by updates ofTwitchChannel
(FFZ badges and 7TV user data). The key thing is that they're scoped toTwitchChannel
- they don't leak into other parts such as input completion.We now have one
EmoteController
in theApplication
(the oldsingletons/Emotes
+ third party emotes). The emote controller holds all providers. Currently, providers are set at startup, but they could be added at runtime in the future. Each channel with third party emotes contains anEmoteHolder
. This contains the emote maps for each provider for that channel. It's responsible for (re-)loading them.Most of the changes to other parts here depend on this. A few more important ones:
homePage
but it was never used in context menus