mirror of
https://github.com/celisej567/abaddon.git
synced 2026-09-19 20:11:59 +03:00
pins: separate msgs, sort and store
This commit is contained in:
@@ -718,6 +718,9 @@ void DiscordClient::FetchPinned(Snowflake id, sigc::slot<void(std::vector<Messag
|
||||
}
|
||||
|
||||
auto data = nlohmann::json::parse(response.text).get<std::vector<Message>>();
|
||||
std::sort(data.begin(), data.end(), [](const Message &a, const Message &b) { return a.ID < b.ID; });
|
||||
for (auto &msg : data)
|
||||
StoreMessageData(msg);
|
||||
callback(std::move(data), DiscordError::NONE);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user