mirror of
https://github.com/celisej567/abaddon.git
synced 2026-09-19 20:11:59 +03:00
handle mutable categories
This commit is contained in:
@@ -571,6 +571,21 @@ std::vector<ChannelData> Store::GetActiveThreads(Snowflake channel_id) const {
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::vector<Snowflake> Store::GetChannelIDsWithParentID(Snowflake channel_id) const {
|
||||
auto &s = m_stmt_get_chan_ids_parent;
|
||||
|
||||
s->Bind(1, channel_id);
|
||||
|
||||
std::vector<Snowflake> ret;
|
||||
while (s->FetchOne()) {
|
||||
Snowflake x;
|
||||
s->Get(0, x);
|
||||
ret.push_back(x);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void Store::AddReaction(const MessageReactionAddObject &data, bool byself) {
|
||||
auto &s = m_stmt_add_reaction;
|
||||
|
||||
@@ -2120,6 +2135,14 @@ bool Store::CreateStatements() {
|
||||
return false;
|
||||
}
|
||||
|
||||
m_stmt_get_chan_ids_parent = std::make_unique<Statement>(m_db, R"(
|
||||
SELECT id FROM channels WHERE parent_id = ?
|
||||
)");
|
||||
if (!m_stmt_get_chan_ids_parent->OK()) {
|
||||
fprintf(stderr, "failed to prepare get channel ids for parent statement: %s\n", m_db.ErrStr());
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user