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;
|
||||
};
|
||||
|
||||
typedef std::shared_ptr<Channel> ChannelPtr;
|
||||
using ChannelPtr = std::shared_ptr<Channel>;
|
||||
|
||||
} // namespace chatterino
|
||||
|
|
|
@ -265,26 +265,30 @@ void TwitchChannel::fetchRecentMessages()
|
|||
return;
|
||||
}
|
||||
|
||||
TwitchChannel *channel = dynamic_cast<TwitchChannel *>(shared.get());
|
||||
auto channel = dynamic_cast<TwitchChannel *>(shared.get());
|
||||
assert(channel != nullptr);
|
||||
|
||||
static auto readConnection = channel->readConnecetion;
|
||||
|
||||
auto msgArray = obj.value("messages").toArray();
|
||||
if (msgArray.size() > 0) {
|
||||
std::vector<messages::MessagePtr> messages;
|
||||
|
||||
for (int i = 0; i < msgArray.size(); i++) {
|
||||
QByteArray content = msgArray[i].toString().toUtf8();
|
||||
auto msg = Communi::IrcMessage::fromData(content, readConnection);
|
||||
auto privMsg = static_cast<Communi::IrcPrivateMessage *>(msg);
|
||||
|
||||
messages::MessageParseArgs args;
|
||||
twitch::TwitchMessageBuilder builder(channel, privMsg, args);
|
||||
if (!builder.isIgnored()) {
|
||||
messages.push_back(builder.build());
|
||||
}
|
||||
}
|
||||
channel->addMessagesAtStart(messages);
|
||||
QJsonArray msgArray = obj.value("messages").toArray();
|
||||
if (msgArray.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::vector<messages::MessagePtr> messages;
|
||||
|
||||
for (const QJsonValueRef _msg : msgArray) {
|
||||
QByteArray content = _msg.toString().toUtf8();
|
||||
auto msg = Communi::IrcMessage::fromData(content, readConnection);
|
||||
auto privMsg = static_cast<Communi::IrcPrivateMessage *>(msg);
|
||||
|
||||
messages::MessageParseArgs args;
|
||||
twitch::TwitchMessageBuilder builder(channel, privMsg, args);
|
||||
if (!builder.isIgnored()) {
|
||||
messages.push_back(builder.build());
|
||||
}
|
||||
}
|
||||
channel->addMessagesAtStart(messages);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ class TwitchChannel final : public Channel
|
|||
QTimer *chattersListTimer;
|
||||
|
||||
public:
|
||||
~TwitchChannel();
|
||||
~TwitchChannel() final;
|
||||
|
||||
void reloadChannelEmotes();
|
||||
|
||||
|
|
Loading…
Reference in a new issue