diff options
Diffstat (limited to 'src/discord')
-rw-r--r-- | src/discord/channel.cpp | 5 | ||||
-rw-r--r-- | src/discord/channel.hpp | 1 | ||||
-rw-r--r-- | src/discord/store.cpp | 2 |
3 files changed, 7 insertions, 1 deletions
diff --git a/src/discord/channel.cpp b/src/discord/channel.cpp index 80b1760..d2828eb 100644 --- a/src/discord/channel.cpp +++ b/src/discord/channel.cpp @@ -63,6 +63,11 @@ bool ChannelData::NSFW() const { return IsNSFW.has_value() && *IsNSFW; } +bool ChannelData::IsDM() const noexcept { + return Type == ChannelType::DM || + Type == ChannelType::GROUP_DM; +} + bool ChannelData::IsThread() const noexcept { return Type == ChannelType::GUILD_PUBLIC_THREAD || Type == ChannelType::GUILD_PRIVATE_THREAD || diff --git a/src/discord/channel.hpp b/src/discord/channel.hpp index 942d555..fd76d3a 100644 --- a/src/discord/channel.hpp +++ b/src/discord/channel.hpp @@ -85,6 +85,7 @@ struct ChannelData { void update_from_json(const nlohmann::json &j); bool NSFW() const; + bool IsDM() const noexcept; bool IsThread() const noexcept; bool IsJoinedThread() const; std::optional<PermissionOverwrite> GetOverwrite(Snowflake id) const; diff --git a/src/discord/store.cpp b/src/discord/store.cpp index 1cb7231..5e4e3b3 100644 --- a/src/discord/store.cpp +++ b/src/discord/store.cpp @@ -15,7 +15,7 @@ Store::Store(bool mem_store) m_db.Execute(R"( PRAGMA writable_schema = 1; - DELETE FROM sqlite_master; + DELETE FROM sqlite_master WHERE TYPE IN ("view", "table", "index", "trigger"); PRAGMA writable_schema = 0; VACUUM; PRAGMA integrity_check; |