-
-
Notifications
You must be signed in to change notification settings - Fork 455
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
Conversation
It no longer relies on AbstractIrcServer & IAbstractIrcServer
There was a problem hiding this 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
QCoreApplication::instance()->thread()); | ||
|
||
// Apply a leaky bucket rate limiting to JOIN messages | ||
auto actuallyJoin = [&](QString message) { |
There was a problem hiding this comment.
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]
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()) |
There was a problem hiding this comment.
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]
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()) |
There was a problem hiding this comment.
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]
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)); |
There was a problem hiding this comment.
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]
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()) |
There was a problem hiding this comment.
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]
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()) |
There was a problem hiding this comment.
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]
for (std::weak_ptr<Channel> &weak : this->channels.values()) | |
for (std::weak_ptr<Channel> const&weak : this->channels.values()) |
There was a problem hiding this 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 was a problem hiding this 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 |
There was a problem hiding this comment.
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]
ITwitchIrcServer *getTwitchAbstract() override | |
static ITwitchIrcServer *getTwitchAbstract() override |
{ | ||
} | ||
|
||
ChannelPtr getOrAddChannel(const QString &dirtyChannelName) override |
There was a problem hiding this comment.
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]
ChannelPtr getOrAddChannel(const QString &dirtyChannelName) override | |
ChannelPtr getOrAddChannel(const QString & /*dirtyChannelName*/) override |
return {}; | ||
} | ||
|
||
ChannelPtr getChannelOrEmpty(const QString &dirtyChannelName) override |
There was a problem hiding this comment.
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]
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) { |
There was a problem hiding this comment.
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]
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()) |
There was a problem hiding this comment.
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]
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()) |
There was a problem hiding this comment.
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]
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)); |
There was a problem hiding this comment.
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]
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()) |
There was a problem hiding this comment.
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]
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()) |
There was a problem hiding this comment.
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]
for (std::weak_ptr<Channel> &weak : this->channels.values()) | |
for (std::weak_ptr<Channel> const&weak : this->channels.values()) |
{ | ||
public: | ||
enum class ConnectionType { |
There was a problem hiding this comment.
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 {
^
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 |
#5498