mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
reformat/cleanup
This commit is contained in:
parent
95878dc7db
commit
ea21aa5dea
3 changed files with 23 additions and 19 deletions
|
@ -59,6 +59,6 @@ private:
|
||||||
messages::LimitedQueue<messages::MessagePtr> messages;
|
messages::LimitedQueue<messages::MessagePtr> messages;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::shared_ptr<Channel> ChannelPtr;
|
using ChannelPtr = std::shared_ptr<Channel>;
|
||||||
|
|
||||||
} // namespace chatterino
|
} // namespace chatterino
|
||||||
|
|
|
@ -265,15 +265,20 @@ void TwitchChannel::fetchRecentMessages()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
TwitchChannel *channel = dynamic_cast<TwitchChannel *>(shared.get());
|
auto channel = dynamic_cast<TwitchChannel *>(shared.get());
|
||||||
|
assert(channel != nullptr);
|
||||||
|
|
||||||
static auto readConnection = channel->readConnecetion;
|
static auto readConnection = channel->readConnecetion;
|
||||||
|
|
||||||
auto msgArray = obj.value("messages").toArray();
|
QJsonArray msgArray = obj.value("messages").toArray();
|
||||||
if (msgArray.size() > 0) {
|
if (msgArray.empty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<messages::MessagePtr> messages;
|
std::vector<messages::MessagePtr> messages;
|
||||||
|
|
||||||
for (int i = 0; i < msgArray.size(); i++) {
|
for (const QJsonValueRef _msg : msgArray) {
|
||||||
QByteArray content = msgArray[i].toString().toUtf8();
|
QByteArray content = _msg.toString().toUtf8();
|
||||||
auto msg = Communi::IrcMessage::fromData(content, readConnection);
|
auto msg = Communi::IrcMessage::fromData(content, readConnection);
|
||||||
auto privMsg = static_cast<Communi::IrcPrivateMessage *>(msg);
|
auto privMsg = static_cast<Communi::IrcPrivateMessage *>(msg);
|
||||||
|
|
||||||
|
@ -284,7 +289,6 @@ void TwitchChannel::fetchRecentMessages()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
channel->addMessagesAtStart(messages);
|
channel->addMessagesAtStart(messages);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ class TwitchChannel final : public Channel
|
||||||
QTimer *chattersListTimer;
|
QTimer *chattersListTimer;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
~TwitchChannel();
|
~TwitchChannel() final;
|
||||||
|
|
||||||
void reloadChannelEmotes();
|
void reloadChannelEmotes();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue