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

refactor: deduplicate IRC parsing #5678

Merged
merged 10 commits into from
Nov 2, 2024

Conversation

Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented Oct 26, 2024

This deduplicates the code for parsing historical vs. live messages. It introduces a MessageSink which hold some traits (some behavior as to how messages should be added). It is modelled after the Channel, which is why it has the addMessage signature. Ideally, I'd want to make a new function that just takes a message, but I couldn't come up with a good name (because ultimately, it will add a message to the sink). An alternative could be to make MessageSink a wrapper around Channel.

This should make it easier to parse specific messages (e.g. subs) without introducing differences between recent and live messages.

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/common/enums/MessageContext.hpp 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/common/enums/MessageContext.hpp Show resolved Hide resolved
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.

a little mini review, from what I've seen so far it looks good

I'm not super fond of the word "sink" but I don't know of a better word that's not super wordy

src/util/VectorMessageSink.hpp Show resolved Hide resolved
src/providers/twitch/IrcMessageHandler.cpp Show resolved Hide resolved
src/messages/MessageSimilarity.hpp Outdated Show resolved Hide resolved
src/messages/MessageSimilarity.hpp Outdated Show resolved Hide resolved
src/messages/MessageSink.hpp Outdated Show resolved Hide resolved
src/messages/MessageSink.hpp Show resolved Hide resolved
src/messages/MessageSink.hpp Show resolved Hide resolved
src/messages/MessageSink.hpp Outdated Show resolved Hide resolved
src/common/Channel.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/common/enums/MessageContext.hpp 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/common/enums/MessageContext.hpp 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/common/enums/MessageContext.hpp 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/common/enums/MessageContext.hpp Show resolved Hide resolved
@pajlada pajlada enabled auto-merge (squash) November 2, 2024 12:51
@pajlada pajlada merged commit 101a45f into Chatterino:master Nov 2, 2024
18 checks passed
@Nerixyz Nerixyz deleted the refactor/deduplicate-irc branch November 2, 2024 12:59
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.

2 participants