properly store permission overwrites & updates

This commit is contained in:
ouwou 2021-04-28 20:32:44 -04:00
parent 3deb2b1002
commit 87e23ec583
2 changed files with 5 additions and 1 deletions

View File

@ -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);
}
}

View File

@ -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)
)
)";