summaryrefslogtreecommitdiff
path: root/src/timer.cpp
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2024-05-16 21:58:52 +0500
committerilotterytea <iltsu@alright.party>2024-05-16 21:58:52 +0500
commit4ebfa4f82679b5edafca70b2da1646d5d1b2decc (patch)
treea7fb2a89954cb23a712816d491b2a3163668ffcd /src/timer.cpp
parent49e41eaff5c219e4e8452188f19974bf019c33e4 (diff)
upd: send nothing if the channel is opted out
Diffstat (limited to 'src/timer.cpp')
-rw-r--r--src/timer.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/timer.cpp b/src/timer.cpp
index ccdf176..055dde0 100644
--- a/src/timer.cpp
+++ b/src/timer.cpp
@@ -38,11 +38,11 @@ namespace bot {
now - last_executed_at);
if (difference.count() > interval_sec) {
- pqxx::result channels =
- work->exec("SELECT alias_name FROM channels WHERE id = " +
- std::to_string(channel_id));
+ pqxx::result channels = work->exec(
+ "SELECT alias_name, opted_out_at FROM channels WHERE id = " +
+ std::to_string(channel_id));
- if (!channels.empty()) {
+ if (!channels.empty() && channels[0][1].is_null()) {
std::string alias_name = channels[0][0].as<std::string>();
irc_client->say(alias_name, message);