mirror of
https://github.com/celisej567/abaddon.git
synced 2026-09-19 20:11:59 +03:00
fix edited/deleted being reset on channel change
This commit is contained in:
@@ -24,6 +24,13 @@ void Store::SetGuildMemberData(Snowflake guild_id, Snowflake user_id, const Guil
|
||||
m_members[guild_id][user_id] = data;
|
||||
}
|
||||
|
||||
User *Store::GetUser(Snowflake id) {
|
||||
auto it = m_users.find(id);
|
||||
if (it == m_users.end())
|
||||
return nullptr;
|
||||
return &it->second;
|
||||
}
|
||||
|
||||
const User *Store::GetUser(Snowflake id) const {
|
||||
auto it = m_users.find(id);
|
||||
if (it == m_users.end())
|
||||
@@ -31,6 +38,13 @@ const User *Store::GetUser(Snowflake id) const {
|
||||
return &it->second;
|
||||
}
|
||||
|
||||
Channel *Store::GetChannel(Snowflake id) {
|
||||
auto it = m_channels.find(id);
|
||||
if (it == m_channels.end())
|
||||
return nullptr;
|
||||
return &it->second;
|
||||
}
|
||||
|
||||
const Channel *Store::GetChannel(Snowflake id) const {
|
||||
auto it = m_channels.find(id);
|
||||
if (it == m_channels.end())
|
||||
@@ -38,6 +52,13 @@ const Channel *Store::GetChannel(Snowflake id) const {
|
||||
return &it->second;
|
||||
}
|
||||
|
||||
Guild *Store::GetGuild(Snowflake id) {
|
||||
auto it = m_guilds.find(id);
|
||||
if (it == m_guilds.end())
|
||||
return nullptr;
|
||||
return &it->second;
|
||||
}
|
||||
|
||||
const Guild *Store::GetGuild(Snowflake id) const {
|
||||
auto it = m_guilds.find(id);
|
||||
if (it == m_guilds.end())
|
||||
@@ -45,6 +66,13 @@ const Guild *Store::GetGuild(Snowflake id) const {
|
||||
return &it->second;
|
||||
}
|
||||
|
||||
Role *Store::GetRole(Snowflake id) {
|
||||
auto it = m_roles.find(id);
|
||||
if (it == m_roles.end())
|
||||
return nullptr;
|
||||
return &it->second;
|
||||
}
|
||||
|
||||
const Role *Store::GetRole(Snowflake id) const {
|
||||
auto it = m_roles.find(id);
|
||||
if (it == m_roles.end())
|
||||
@@ -52,6 +80,13 @@ const Role *Store::GetRole(Snowflake id) const {
|
||||
return &it->second;
|
||||
}
|
||||
|
||||
Message *Store::GetMessage(Snowflake id) {
|
||||
auto it = m_messages.find(id);
|
||||
if (it == m_messages.end())
|
||||
return nullptr;
|
||||
return &it->second;
|
||||
}
|
||||
|
||||
const Message *Store::GetMessage(Snowflake id) const {
|
||||
auto it = m_messages.find(id);
|
||||
if (it == m_messages.end())
|
||||
@@ -59,6 +94,16 @@ const Message *Store::GetMessage(Snowflake id) const {
|
||||
return &it->second;
|
||||
}
|
||||
|
||||
GuildMember *Store::GetGuildMemberData(Snowflake guild_id, Snowflake user_id) {
|
||||
auto git = m_members.find(guild_id);
|
||||
if (git == m_members.end())
|
||||
return nullptr;
|
||||
auto mit = git->second.find(user_id);
|
||||
if (mit == git->second.end())
|
||||
return nullptr;
|
||||
return &mit->second;
|
||||
}
|
||||
|
||||
const GuildMember *Store::GetGuildMemberData(Snowflake guild_id, Snowflake user_id) const {
|
||||
auto git = m_members.find(guild_id);
|
||||
if (git == m_members.end())
|
||||
|
||||
Reference in New Issue
Block a user