This commit is contained in:
fourtf
2018-02-05 21:20:38 +01:00
23 changed files with 255 additions and 104 deletions
+17
View File
@@ -143,6 +143,23 @@ std::shared_ptr<Channel> TwitchServer::getCustomChannel(const QString &channelNa
return nullptr;
}
void TwitchServer::forEachChannelAndSpecialChannels(std::function<void(ChannelPtr)> func)
{
std::lock_guard<std::mutex> lock(this->channelMutex);
for (std::weak_ptr<Channel> &weak : this->channels) {
std::shared_ptr<Channel> chan = weak.lock();
if (!chan) {
continue;
}
func(chan);
}
func(this->whispersChannel);
func(this->mentionsChannel);
}
} // namespace twitch
} // namespace providers
} // namespace chatterino