mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
fixed some concurrency issues
This commit is contained in:
parent
0b0f1c9c5c
commit
83b6fad8e6
4 changed files with 17 additions and 6 deletions
|
@ -289,10 +289,14 @@ void Application::initPubsub()
|
||||||
QString channelId;
|
QString channelId;
|
||||||
if (rj::getSafe(data, "channel_id", channelId))
|
if (rj::getSafe(data, "channel_id", channelId))
|
||||||
{
|
{
|
||||||
const auto &chan =
|
auto chan = this->twitch.server->getChannelOrEmptyByID(channelId);
|
||||||
this->twitch.server->getChannelOrEmptyByID(channelId);
|
|
||||||
auto channel = dynamic_cast<TwitchChannel *>(chan.get());
|
auto reward = ChannelPointReward(data);
|
||||||
channel->addChannelPointReward(ChannelPointReward(data));
|
|
||||||
|
postToThread([chan, reward] {
|
||||||
|
auto channel = dynamic_cast<TwitchChannel *>(chan.get());
|
||||||
|
channel->addChannelPointReward(reward);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -98,6 +98,7 @@ public:
|
||||||
/// signals.
|
/// signals.
|
||||||
int append(const T &item, void *caller = nullptr)
|
int append(const T &item, void *caller = nullptr)
|
||||||
{
|
{
|
||||||
|
assertInGuiThread();
|
||||||
return this->insert(item, -1, caller);
|
return this->insert(item, -1, caller);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -237,6 +237,8 @@ void TwitchChannel::refreshFFZChannelEmotes(bool manualRefresh)
|
||||||
|
|
||||||
void TwitchChannel::addChannelPointReward(const ChannelPointReward &reward)
|
void TwitchChannel::addChannelPointReward(const ChannelPointReward &reward)
|
||||||
{
|
{
|
||||||
|
assertInGuiThread();
|
||||||
|
|
||||||
if (!reward.hasParsedSuccessfully)
|
if (!reward.hasParsedSuccessfully)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -34,7 +34,9 @@ ConcurrentSettings::ConcurrentSettings()
|
||||||
|
|
||||||
bool ConcurrentSettings::isHighlightedUser(const QString &username)
|
bool ConcurrentSettings::isHighlightedUser(const QString &username)
|
||||||
{
|
{
|
||||||
for (const auto &highlightedUser : this->highlightedUsers)
|
auto items = this->highlightedUsers.readOnly();
|
||||||
|
|
||||||
|
for (const auto &highlightedUser : *items)
|
||||||
{
|
{
|
||||||
if (highlightedUser.isMatch(username))
|
if (highlightedUser.isMatch(username))
|
||||||
return true;
|
return true;
|
||||||
|
@ -58,7 +60,9 @@ bool ConcurrentSettings::isBlacklistedUser(const QString &username)
|
||||||
|
|
||||||
bool ConcurrentSettings::isMutedChannel(const QString &channelName)
|
bool ConcurrentSettings::isMutedChannel(const QString &channelName)
|
||||||
{
|
{
|
||||||
for (const auto &channel : this->mutedChannels)
|
auto items = this->mutedChannels.readOnly();
|
||||||
|
|
||||||
|
for (const auto &channel : *items)
|
||||||
{
|
{
|
||||||
if (channelName.toLower() == channel.toLower())
|
if (channelName.toLower() == channel.toLower())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue