summaryrefslogtreecommitdiff
path: root/src/discord/store.cpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2024-06-22 04:25:56 -0400
committerouwou <26526779+ouwou@users.noreply.github.com>2024-06-22 04:25:56 -0400
commite65174f5aab55fe3917dd52f97b1b00a07d30d38 (patch)
treefed590caf0440fd47b72a51e21e692fe703860bd /src/discord/store.cpp
parent3dc8fa8e65bdd1bd45dfa0171a06dfbb448baf0d (diff)
parent7af15b326df5a638b24c5e637d5f37396276f906 (diff)
downloadabaddon-portaudio-e65174f5aab55fe3917dd52f97b1b00a07d30d38.tar.gz
abaddon-portaudio-e65174f5aab55fe3917dd52f97b1b00a07d30d38.zip
Merge branch 'master' into stages
Diffstat (limited to 'src/discord/store.cpp')
-rw-r--r--src/discord/store.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/discord/store.cpp b/src/discord/store.cpp
index bf630aa..4de5d63 100644
--- a/src/discord/store.cpp
+++ b/src/discord/store.cpp
@@ -638,16 +638,16 @@ std::vector<ChannelData> Store::GetActiveThreads(Snowflake channel_id) const {
return ret;
}
-std::vector<Snowflake> Store::GetChannelIDsWithParentID(Snowflake channel_id) const {
+std::vector<std::pair<Snowflake, ChannelType>> Store::GetChannelIDsWithParentID(Snowflake channel_id) const {
auto &s = m_stmt_get_chan_ids_parent;
s->Bind(1, channel_id);
- std::vector<Snowflake> ret;
+ std::vector<std::pair<Snowflake, ChannelType>> ret;
while (s->FetchOne()) {
- Snowflake x;
- s->Get(0, x);
- ret.push_back(x);
+ auto &p = ret.emplace_back();
+ s->Get(0, p.first);
+ s->Get(1, p.second);
}
s->Reset();
@@ -2315,7 +2315,7 @@ bool Store::CreateStatements() {
}
m_stmt_get_chan_ids_parent = std::make_unique<Statement>(m_db, R"(
- SELECT id FROM channels WHERE parent_id = ?
+ SELECT id, type 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());