diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-12-13 00:34:19 -0500 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-12-13 00:34:19 -0500 |
commit | f19dcc01145edd2e69a8cccbc59258b6b73bd704 (patch) | |
tree | a891d4b12478b1d6cfb5d7eecac4950a37e3524d /src/discord | |
parent | 38a49d172cb934a16f9203f8f6d1b21b1adc31df (diff) | |
parent | 246140688714936820b5c977665ad2a904fa7222 (diff) | |
download | abaddon-portaudio-f19dcc01145edd2e69a8cccbc59258b6b73bd704.tar.gz abaddon-portaudio-f19dcc01145edd2e69a8cccbc59258b6b73bd704.zip |
Merge branch 'master' into msys
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; |