diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-04-28 20:32:44 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-04-28 20:32:44 -0400 |
commit | 87e23ec583e62c0ae9396981d25803e90191645e (patch) | |
tree | 9e46127698e87a3a99de3980cf5119f10c940fc8 /discord | |
parent | 3deb2b10020529ac36cf7ab298e0be425887c88f (diff) | |
download | abaddon-portaudio-87e23ec583e62c0ae9396981d25803e90191645e.tar.gz abaddon-portaudio-87e23ec583e62c0ae9396981d25803e90191645e.zip |
properly store permission overwrites & updates
Diffstat (limited to 'discord')
-rw-r--r-- | discord/discord.cpp | 3 | ||||
-rw-r--r-- | discord/store.cpp | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/discord/discord.cpp b/discord/discord.cpp index 93e5ff4..e0de3e9 100644 --- a/discord/discord.cpp +++ b/discord/discord.cpp @@ -1218,6 +1218,9 @@ void DiscordClient::HandleGatewayChannelUpdate(const GatewayMessage &msg) { if (cur.has_value()) { cur->update_from_json(msg.Data); m_store.SetChannel(id, *cur); + if (cur->PermissionOverwrites.has_value()) + for (const auto &p : *cur->PermissionOverwrites) + m_store.SetPermissionOverwrite(id, p.ID, p); m_signal_channel_update.emit(id); } } diff --git a/discord/store.cpp b/discord/store.cpp index d2b2375..bd9ad32 100644 --- a/discord/store.cpp +++ b/discord/store.cpp @@ -753,7 +753,8 @@ bool Store::CreateTables() { channel_id INTEGER NOT NULL, type INTEGER NOT NULL, allow INTEGER NOT NULL, - deny INTEGER NOT NULL + deny INTEGER NOT NULL, + PRIMARY KEY(id, channel_id) ) )"; |