mirror of
https://github.com/uowuo/abaddon.git
synced 2024-11-10 06:00:10 +00:00
crash fixes
This commit is contained in:
parent
713ed0f927
commit
4b637b6ff2
@ -160,6 +160,7 @@ void ChannelList::SetListingFromGuildsInternal() {
|
||||
AddPrivateChannels();
|
||||
|
||||
// map each category to its channels
|
||||
|
||||
std::unordered_map<Snowflake, std::vector<const ChannelData *>> cat_to_channels;
|
||||
std::unordered_map<Snowflake, std::vector<const ChannelData *>> orphan_channels;
|
||||
for (const auto &[gid, guild] : *guilds) {
|
||||
|
@ -53,7 +53,7 @@ protected:
|
||||
std::queue<DiscordClient::Guilds_t> m_update_queue;
|
||||
void AddPrivateChannels(); // retard moment
|
||||
void SetListingFromGuildsInternal();
|
||||
void AttachMenuHandler(Gtk::ListBoxRow* row);
|
||||
void AttachMenuHandler(Gtk::ListBoxRow *row);
|
||||
|
||||
Abaddon *m_abaddon = nullptr;
|
||||
};
|
||||
|
@ -65,11 +65,13 @@ std::vector<std::pair<Snowflake, GuildData>> DiscordClient::GetUserSortedGuilds(
|
||||
|
||||
// unpositioned_guilds now has unpositioned guilds in ascending order
|
||||
for (auto it = unpositioned_guilds.rbegin(); it != unpositioned_guilds.rend(); it++)
|
||||
sorted_guilds.push_back(std::make_pair(*it, m_guilds.at(*it)));
|
||||
if (m_guilds.find(*it) != m_guilds.end())
|
||||
sorted_guilds.push_back(std::make_pair(*it, m_guilds.at(*it)));
|
||||
|
||||
// now the rest go at the end in the order they are sorted
|
||||
for (const auto &id : m_user_settings.GuildPositions) {
|
||||
sorted_guilds.push_back(std::make_pair(id, m_guilds.at(id)));
|
||||
if (m_guilds.find(id) != m_guilds.end())
|
||||
sorted_guilds.push_back(std::make_pair(id, m_guilds.at(id)));
|
||||
}
|
||||
} else { // default sort is alphabetic
|
||||
for (auto &it : m_guilds)
|
||||
|
@ -44,7 +44,7 @@ void from_json(const nlohmann::json &j, UserData &m) {
|
||||
JS_O("verified", m.IsVerified);
|
||||
JS_O("email", m.Email);
|
||||
JS_O("flags", m.Flags);
|
||||
JS_O("premium_type", m.PremiumType);
|
||||
JS_ON("premium_type", m.PremiumType);
|
||||
JS_O("public_flags", m.PublicFlags);
|
||||
JS_O("desktop", m.IsDesktop);
|
||||
JS_O("mobile", m.IsMobile);
|
||||
@ -113,7 +113,7 @@ void from_json(const nlohmann::json &j, ChannelData &m) {
|
||||
JS_O("guild_id", m.GuildID);
|
||||
JS_O("position", m.Position);
|
||||
// JS_O("permission_overwrites", m.PermissionOverwrites);
|
||||
JS_O("name", m.Name);
|
||||
JS_ON("name", m.Name);
|
||||
JS_ON("topic", m.Topic);
|
||||
JS_O("nsfw", m.IsNSFW);
|
||||
JS_ON("last_message_id", m.LastMessageID);
|
||||
|
@ -101,7 +101,7 @@ struct UserData {
|
||||
bool IsVerified = false; // opt
|
||||
std::string Email; // opt, null
|
||||
int Flags = 0; // opt
|
||||
int PremiumType = 0; // opt
|
||||
int PremiumType = 0; // opt, null (docs wrong)
|
||||
int PublicFlags = 0; // opt
|
||||
|
||||
// undocumented (opt)
|
||||
@ -119,7 +119,7 @@ struct ChannelData {
|
||||
Snowflake GuildID; // opt
|
||||
int Position = -1; // opt
|
||||
// std::vector<PermissionOverwriteData> PermissionOverwrites; // opt
|
||||
std::string Name; // opt
|
||||
std::string Name; // opt, null (null for dm's)
|
||||
std::string Topic; // opt, null
|
||||
bool IsNSFW = false; // opt
|
||||
Snowflake LastMessageID; // opt, null
|
||||
|
Loading…
Reference in New Issue
Block a user