Merge branch 'master' into msys

This commit is contained in:
ouwou
2021-12-13 00:34:19 -05:00
9 changed files with 602 additions and 579 deletions

View File

@@ -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 ||

View File

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

View File

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