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

feat: Live Emote Updates for 7TV #4090

Merged
merged 27 commits into from Nov 13, 2022

Conversation

Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented Oct 30, 2022

Pull request checklist:

  • CHANGELOG.md was updated, if applicable

Description

This PR adds live emote updates (EventApi) for 7TV (see previous PR #4087 and discussion #4038). It's rather large, since it adds building blocks (mainly for adding the messages) for other emote providers.

Tests won't pass until Chatterino/twitch-pubsub-server-test#30 is merged and a new version of the tests is released.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

There were too many comments to post at once. Showing the first 25 out of 41. Check the log or trigger a new build to see more.

src/messages/MessageBuilder.cpp Show resolved Hide resolved
src/messages/MessageBuilder.cpp Show resolved Hide resolved
src/messages/MessageBuilder.cpp Show resolved Hide resolved
src/messages/MessageBuilder.cpp Show resolved Hide resolved
src/messages/MessageBuilder.cpp Show resolved Hide resolved
src/providers/seventv/SeventvEventApi.cpp Outdated Show resolved Hide resolved
src/providers/seventv/eventapi/SeventvEventApiClient.cpp Outdated Show resolved Hide resolved
src/providers/seventv/eventapi/SeventvEventApiDispatch.cpp Outdated Show resolved Hide resolved
src/providers/seventv/eventapi/SeventvEventApiDispatch.cpp Outdated Show resolved Hide resolved
src/providers/seventv/eventapi/SeventvEventApiDispatch.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

src/providers/seventv/eventapi/SeventvEventApiDispatch.hpp Outdated Show resolved Hide resolved
src/providers/seventv/eventapi/SeventvEventApiDispatch.hpp Outdated Show resolved Hide resolved
src/providers/seventv/eventapi/SeventvEventApiMessage.hpp Outdated Show resolved Hide resolved
src/providers/seventv/eventapi/SeventvEventApiMessage.hpp Outdated Show resolved Hide resolved
src/providers/twitch/TwitchIrcServer.cpp Show resolved Hide resolved
tests/src/SeventvEventApi.cpp Outdated Show resolved Hide resolved
tests/src/SeventvEventApi.cpp Outdated Show resolved Hide resolved
tests/src/SeventvEventApi.cpp Outdated Show resolved Hide resolved
tests/src/SeventvEventApi.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

src/providers/twitch/TwitchChannel.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

src/providers/twitch/TwitchChannel.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

src/providers/twitch/TwitchChannel.cpp Outdated Show resolved Hide resolved
@@ -6,7 +6,7 @@ on:
workflow_dispatch:

env:
TWITCH_PUBSUB_SERVER_IMAGE: ghcr.io/chatterino/twitch-pubsub-server-test:v1.0.4
TWITCH_PUBSUB_SERVER_IMAGE: ghcr.io/chatterino/twitch-pubsub-server-test:master
Copy link
Member

Choose a reason for hiding this comment

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

Reminder for myself to change to v1.0.5 once we've tested this PR and pushed a new release for the pubsub server test

src/providers/twitch/TwitchChannel.cpp Outdated Show resolved Hide resolved
src/providers/twitch/TwitchChannel.hpp Outdated Show resolved Hide resolved
src/providers/twitch/TwitchChannel.hpp Outdated Show resolved Hide resolved
src/providers/twitch/TwitchChannel.hpp Outdated Show resolved Hide resolved
src/providers/seventv/SeventvEmotes.hpp Outdated Show resolved Hide resolved
src/providers/seventv/SeventvEmotes.cpp Outdated Show resolved Hide resolved
src/Application.cpp Outdated Show resolved Hide resolved
src/providers/seventv/SeventvEventApi.hpp Outdated Show resolved Hide resolved
src/providers/seventv/SeventvEventApi.hpp Outdated Show resolved Hide resolved

std::unordered_set<QString> subscribedEmoteSets_;
std::unordered_set<QString> subscribedUsers_;
std::chrono::milliseconds heartbeatInterval_;
Copy link
Member

Choose a reason for hiding this comment

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

hearbeatInterval_ can be made const if we end up keeping it. If it's removed and replaced with a defaultHeartbeatInterval it can just be set in the constructor of the SeventvEventApiClient instead with a magic value

@Nerixyz Nerixyz force-pushed the feat/seventv-liveupdates branch 2 times, most recently from b6ea764 to 44bb728 Compare November 6, 2022 20:57
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

src/messages/MessageBuilder.cpp Show resolved Hide resolved
src/providers/seventv/SeventvEventAPI.cpp Show resolved Hide resolved
src/providers/seventv/SeventvEventAPI.cpp Show resolved Hide resolved
src/providers/seventv/SeventvEventAPI.cpp Show resolved Hide resolved
src/providers/seventv/SeventvEventAPI.cpp Show resolved Hide resolved
src/providers/twitch/TwitchChannel.cpp Show resolved Hide resolved
tests/src/SeventvEventAPI.cpp Show resolved Hide resolved
tests/src/SeventvEventAPI.cpp Show resolved Hide resolved
tests/src/SeventvEventAPI.cpp Show resolved Hide resolved
tests/src/SeventvEventAPI.cpp Show resolved Hide resolved
@zneix
Copy link
Collaborator

zneix commented Nov 10, 2022

Make the whole websocket completely optional, would be cool to be able to completely not include it at the compilation process to not bloat the application...

@pajlada
Copy link
Member

pajlada commented Nov 10, 2022

Make the whole websocket completely optional, would be cool to be able to completely not include it at the compilation process to not bloat the application...

If the setting is disabled, the class is never instantiated so run-time this is a non-issue.

We haven't done compile-time feature flags before, the closest we've gotten to it is enabling/disabling QtKeychain but the file is still there.
I'm happy to explore the idea of compile-time feature flags as it's not a foreign concept but I'd like to hear more justification for it.

@Nerixyz
Copy link
Contributor Author

Nerixyz commented Nov 10, 2022

to not bloat the application...

You'd still include websocketpp for PubSub, so you won't save much space:

feat/seventv-liveupdates@9ef333d vs master@3303cdc, Qt 5.12.12

  • Windows 17.627kb -> 17.698kb, +71.0kb, +0.40%
  • macOS 15.633kb -> 15.734kb, +101.0kb, +0.65%
  • AppImage 34.287kb -> 34.423kb, +136.0kb, +0.40%

This would also mean that CI will need to run 4 additional builds, or 8 for all Qt versions.

Copy link
Member

@pajlada pajlada left a comment

Choose a reason for hiding this comment

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

Just some teeny tiny things 👍

src/messages/Emote.hpp Show resolved Hide resolved
src/providers/seventv/eventapi/SeventvEventAPIClient.hpp Outdated Show resolved Hide resolved
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

src/providers/twitch/TwitchChannel.cpp Show resolved Hide resolved
src/providers/twitch/TwitchChannel.cpp Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants