Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed newly uploaded subscriber emotes not being available #2992

Merged
merged 18 commits into from Jul 17, 2021

Conversation

zneix
Copy link
Collaborator

@zneix zneix commented Jul 11, 2021

Pull request checklist:

  • CHANGELOG.md was updated, if applicable

Description

  • Added a handle function to GLOBALUSERSTATE irc message.
  • Moved initial loading of user's emotes to IrcMessageHandler::handleGlobalUserStateMessage - it's done, so that we're sure we've already have emote-sets cached in TwitchAccount::userstateEmoteSets_.
  • Refactored whole logic regarding (re)loading user's emotes.

Current order of handling emotes:

  1. Load (GLOBAL)USERSTATE emote sets from IVR.
  2. Call Kraken's getUserEmotes.
  3. Fill up TwitchAccount::emoteData with emote sets that were returned in a Kraken call, but aren't present in emoteData.

We still continue to call TwitchAccount::loadUserstateEmotes in case of follower emotes (which are not present in GLOBALUSERSTATE message) and/or newly obtained emote sets, e.g. on firsst USERSTATE message after receiving a gifted sub.

Closes #2935
Closes #3007

@zneix zneix marked this pull request as ready for review July 13, 2021 21:11
@Mm2PL Mm2PL self-requested a review July 13, 2021 21:12
CHANGELOG.md Outdated Show resolved Hide resolved
emoteData->emoteSets.emplace_back(newUserEmoteSet);
}
},
[] {
// fetching emotes failed, ivr API might be down
},
[=] {
// XXX(zneix): We check if this is the last iteration and if so, call the callback
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be "accurate enough" but if we really want to call the callback once all requests are done, we'll need to do some sort of syncgroup outside of the requests (see https://en.cppreference.com/w/cpp/thread/latch)

zneix and others added 2 commits July 17, 2021 11:20
We now load emotes after `GLOBALUSERSTATE`, so this isn't needed anymore
Co-authored-by: Felanbird <41973452+Felanbird@users.noreply.github.com>
Copy link
Collaborator

@Mm2PL Mm2PL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mm2PL suggested changes.

src/providers/twitch/IrcMessageHandler.cpp Show resolved Hide resolved
src/providers/twitch/TwitchAccount.cpp Outdated Show resolved Hide resolved
src/providers/twitch/TwitchIrcServer.cpp Outdated Show resolved Hide resolved
@zneix zneix requested a review from Mm2PL July 17, 2021 11:52
@zneix
Copy link
Collaborator Author

zneix commented Jul 17, 2021

Apparently my logic from #2856 was wrong, I've fixed it in 9564b3b and it seems to split emote sets correctly now.

@zneix zneix enabled auto-merge (squash) July 17, 2021 15:01
@zneix zneix merged commit 7e13564 into master Jul 17, 2021
@zneix zneix deleted the zneix/fix/newly-uploaded-emotes branch July 17, 2021 15:18
zneix added a commit to SevenTV/chatterino7 that referenced this pull request Jul 17, 2021
Now we're on commit 9f2fc90; Changes from upstream we pulled:

- Major: Newly uploaded Twitch emotes are once again present in emote picker and can be autocompleted with Tab as well. (Chatterino#2992)
- Minor: Added autocompletion in /whispers for Twitch emotes, Global Bttv/Ffz emotes and emojis. (Chatterino#2999, Chatterino#3033)
- Minor: Received Twitch messages now use the exact same timestamp (obtained from Twitch's server) for every Chatterino user instead of assuming message timestamp on client's side. (Chatterino#3021)
- Minor: Received IRC messages use `time` message tag for timestamp if it's available. (Chatterino#3021)
- Bugfix: Fixed "smiley" emotes being unable to be "Tabbed" with autocompletion, introduced in v2.3.3. (Chatterino#3010)
- Dev: Ubuntu packages are now available (Chatterino#2936)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants