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

Remove experimental IRC support #5547

Merged
merged 7 commits into from
Aug 18, 2024
Merged

Conversation

pajlada
Copy link
Member

@pajlada pajlada commented Aug 17, 2024

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

mocks/include/mocks/EmptyApplication.hpp Show resolved Hide resolved
mocks/include/mocks/TwitchIrcServer.hpp Show resolved Hide resolved
mocks/include/mocks/TwitchIrcServer.hpp Show resolved Hide resolved
QCoreApplication::instance()->thread());

// Apply a leaky bucket rate limiting to JOIN messages
auto actuallyJoin = [&](QString message) {
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: the parameter 'message' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]

Suggested change
auto actuallyJoin = [&](QString message) {
auto actuallyJoin = [&](const QString& message) {

auto reconnected = makeSystemMessage("reconnected");
reconnected->flags.set(MessageFlag::ConnectedMessage);

for (std::weak_ptr<Channel> &weak : this->channels.values())
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: variable 'weak' of type 'std::weak_ptr &' can be declared 'const' [misc-const-correctness]

Suggested change
for (std::weak_ptr<Channel> &weak : this->channels.values())
for (std::weak_ptr<Channel> const&weak : this->channels.values())

b->flags.set(MessageFlag::DisconnectedMessage);
auto disconnectedMsg = b.release();

for (std::weak_ptr<Channel> &weak : this->channels.values())
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: variable 'weak' of type 'std::weak_ptr &' can be declared 'const' [misc-const-correctness]

Suggested change
for (std::weak_ptr<Channel> &weak : this->channels.values())
for (std::weak_ptr<Channel> const&weak : this->channels.values())

if (fakeMessage->command() == "PRIVMSG")
{
this->privateMessageReceived(
static_cast<Communi::IrcPrivateMessage *>(fakeMessage));
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: do not use static_cast to downcast from a base to a derived class; use dynamic_cast instead [cppcoreguidelines-pro-type-static-cast-downcast]

Suggested change
static_cast<Communi::IrcPrivateMessage *>(fakeMessage));
dynamic_cast<Communi::IrcPrivateMessage *>(fakeMessage));

MessageBuilder b(systemMessage, messageText);
auto message = b.release();

for (std::weak_ptr<Channel> &weak : this->channels.values())
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: variable 'weak' of type 'std::weak_ptr &' can be declared 'const' [misc-const-correctness]

Suggested change
for (std::weak_ptr<Channel> &weak : this->channels.values())
for (std::weak_ptr<Channel> const&weak : this->channels.values())

{
std::lock_guard<std::mutex> lock(this->channelMutex);

for (std::weak_ptr<Channel> &weak : this->channels.values())
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: variable 'weak' of type 'std::weak_ptr &' can be declared 'const' [misc-const-correctness]

Suggested change
for (std::weak_ptr<Channel> &weak : this->channels.values())
for (std::weak_ptr<Channel> const&weak : this->channels.values())

src/providers/twitch/TwitchIrcServer.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

mocks/include/mocks/EmptyApplication.hpp Show resolved Hide resolved
mocks/include/mocks/TwitchIrcServer.hpp Show resolved Hide resolved
mocks/include/mocks/TwitchIrcServer.hpp Show resolved Hide resolved
src/providers/twitch/TwitchIrcServer.cpp Show resolved Hide resolved
src/providers/twitch/TwitchIrcServer.cpp Show resolved Hide resolved
src/providers/twitch/TwitchIrcServer.cpp Show resolved Hide resolved
src/providers/twitch/TwitchIrcServer.cpp Show resolved Hide resolved
src/providers/twitch/TwitchIrcServer.cpp Show resolved Hide resolved
src/providers/twitch/TwitchIrcServer.cpp Show resolved Hide resolved
src/providers/twitch/TwitchIrcServer.hpp Show resolved Hide resolved
@pajlada pajlada enabled auto-merge (squash) August 18, 2024 11:38
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

@@ -133,7 +133,7 @@ class EmptyApplication : public IApplication
return nullptr;
}

IAbstractIrcServer *getTwitchAbstract() override
ITwitchIrcServer *getTwitchAbstract() override
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: method 'getTwitchAbstract' can be made static [readability-convert-member-functions-to-static]

Suggested change
ITwitchIrcServer *getTwitchAbstract() override
static ITwitchIrcServer *getTwitchAbstract() override

{
}

ChannelPtr getOrAddChannel(const QString &dirtyChannelName) override
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: parameter 'dirtyChannelName' is unused [misc-unused-parameters]

Suggested change
ChannelPtr getOrAddChannel(const QString &dirtyChannelName) override
ChannelPtr getOrAddChannel(const QString & /*dirtyChannelName*/) override

return {};
}

ChannelPtr getChannelOrEmpty(const QString &dirtyChannelName) override
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: parameter 'dirtyChannelName' is unused [misc-unused-parameters]

Suggested change
ChannelPtr getChannelOrEmpty(const QString &dirtyChannelName) override
ChannelPtr getChannelOrEmpty(const QString & /*dirtyChannelName*/) override

QCoreApplication::instance()->thread());

// Apply a leaky bucket rate limiting to JOIN messages
auto actuallyJoin = [&](QString message) {
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: the parameter 'message' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]

Suggested change
auto actuallyJoin = [&](QString message) {
auto actuallyJoin = [&](const QString& message) {

auto reconnected = makeSystemMessage("reconnected");
reconnected->flags.set(MessageFlag::ConnectedMessage);

for (std::weak_ptr<Channel> &weak : this->channels.values())
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: variable 'weak' of type 'std::weak_ptr &' can be declared 'const' [misc-const-correctness]

Suggested change
for (std::weak_ptr<Channel> &weak : this->channels.values())
for (std::weak_ptr<Channel> const&weak : this->channels.values())

b->flags.set(MessageFlag::DisconnectedMessage);
auto disconnectedMsg = b.release();

for (std::weak_ptr<Channel> &weak : this->channels.values())
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: variable 'weak' of type 'std::weak_ptr &' can be declared 'const' [misc-const-correctness]

Suggested change
for (std::weak_ptr<Channel> &weak : this->channels.values())
for (std::weak_ptr<Channel> const&weak : this->channels.values())

if (fakeMessage->command() == "PRIVMSG")
{
this->privateMessageReceived(
static_cast<Communi::IrcPrivateMessage *>(fakeMessage));
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: do not use static_cast to downcast from a base to a derived class; use dynamic_cast instead [cppcoreguidelines-pro-type-static-cast-downcast]

Suggested change
static_cast<Communi::IrcPrivateMessage *>(fakeMessage));
dynamic_cast<Communi::IrcPrivateMessage *>(fakeMessage));

MessageBuilder b(systemMessage, messageText);
auto message = b.release();

for (std::weak_ptr<Channel> &weak : this->channels.values())
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: variable 'weak' of type 'std::weak_ptr &' can be declared 'const' [misc-const-correctness]

Suggested change
for (std::weak_ptr<Channel> &weak : this->channels.values())
for (std::weak_ptr<Channel> const&weak : this->channels.values())

{
std::lock_guard<std::mutex> lock(this->channelMutex);

for (std::weak_ptr<Channel> &weak : this->channels.values())
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: variable 'weak' of type 'std::weak_ptr &' can be declared 'const' [misc-const-correctness]

Suggested change
for (std::weak_ptr<Channel> &weak : this->channels.values())
for (std::weak_ptr<Channel> const&weak : this->channels.values())

{
public:
enum class ConnectionType {
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: enum 'ConnectionType' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size [performance-enum-size]

    enum class ConnectionType {
               ^

@pajlada pajlada merged commit 998920d into master Aug 18, 2024
17 checks passed
@pajlada pajlada deleted the refactor/begin-demolishing-irc-support branch August 18, 2024 12:04
@Mm2PL
Copy link
Collaborator

Mm2PL commented Aug 18, 2024

Maybe I wasn't clear enough that I didn't want this to happen until we could migrate IRC to plugins. Maybe building all this back from the ground won't be that terrible Clueless

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