Fix signal connection nodiscard warnings (#4818)

This commit is contained in:
pajlada
2023-09-16 13:52:51 +02:00
committed by GitHub
parent 2d5f078306
commit 8fe3af3522
40 changed files with 709 additions and 554 deletions
+8 -5
View File
@@ -133,21 +133,24 @@ void TwitchIrcServer::initializeConnection(IrcConnection *connection,
std::shared_ptr<Channel> TwitchIrcServer::createChannel(
const QString &channelName)
{
auto channel =
std::shared_ptr<TwitchChannel>(new TwitchChannel(channelName));
auto channel = std::make_shared<TwitchChannel>(channelName);
channel->initialize();
channel->sendMessageSignal.connect(
// We can safely ignore these signal connections since the TwitchIrcServer is only
// ever destroyed when the full Application state is about to be destroyed, at which point
// no Channel's should live
// NOTE: CHANNEL_LIFETIME
std::ignore = channel->sendMessageSignal.connect(
[this, channel = channel.get()](auto &chan, auto &msg, bool &sent) {
this->onMessageSendRequested(channel, msg, sent);
});
channel->sendReplySignal.connect(
std::ignore = channel->sendReplySignal.connect(
[this, channel = channel.get()](auto &chan, auto &msg, auto &replyId,
bool &sent) {
this->onReplySendRequested(channel, msg, replyId, sent);
});
return std::shared_ptr<Channel>(channel);
return channel;
}
void TwitchIrcServer::privateMessageReceived(