mirror of
https://github.com/uowuo/abaddon.git
synced 2024-11-10 06:00:10 +00:00
store READY user data into client
This commit is contained in:
parent
af4f659aaa
commit
facb89012a
@ -51,6 +51,12 @@ const UserSettingsData &DiscordClient::GetUserSettings() const {
|
||||
return m_user_settings;
|
||||
}
|
||||
|
||||
const UserData &DiscordClient::GetUserData() const {
|
||||
std::scoped_lock<std::mutex> guard(m_mutex);
|
||||
assert(m_ready_received);
|
||||
return m_user_data;
|
||||
}
|
||||
|
||||
std::vector<std::pair<Snowflake, GuildData>> DiscordClient::GetUserSortedGuilds() const {
|
||||
std::vector<std::pair<Snowflake, GuildData>> sorted_guilds;
|
||||
|
||||
@ -283,6 +289,7 @@ void DiscordClient::HandleGatewayReady(const GatewayMessage &msg) {
|
||||
}
|
||||
|
||||
m_abaddon->DiscordNotifyReady();
|
||||
m_user_data = data.User;
|
||||
m_user_settings = data.UserSettings;
|
||||
}
|
||||
|
||||
|
@ -62,6 +62,7 @@ public:
|
||||
using Messages_t = std::unordered_map<Snowflake, MessageData>;
|
||||
|
||||
const Guilds_t &GetGuilds() const;
|
||||
const UserData &GetUserData() const;
|
||||
const UserSettingsData &GetUserSettings() const;
|
||||
std::vector<std::pair<Snowflake, GuildData>> GetUserSortedGuilds() const;
|
||||
std::unordered_set<const MessageData *> GetMessagesForChannel(Snowflake id) const;
|
||||
@ -110,6 +111,7 @@ private:
|
||||
void StoreChannel(Snowflake id, const ChannelData &c);
|
||||
Channels_t m_channels;
|
||||
|
||||
UserData m_user_data;
|
||||
UserSettingsData m_user_settings;
|
||||
|
||||
Websocket m_websocket;
|
||||
|
Loading…
Reference in New Issue
Block a user