From d1e0d677e7135de3c17034638a7d697d8f0e7c2f Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Fri, 17 May 2024 23:39:18 +0500 Subject: upd: Stream is now class --- src/stream.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/stream.cpp') diff --git a/src/stream.cpp b/src/stream.cpp index 818d4de..86d35cc 100644 --- a/src/stream.cpp +++ b/src/stream.cpp @@ -52,10 +52,10 @@ namespace bot::stream { for (const auto &stream : streams) { bool is_already_live = std::any_of(this->online_ids.begin(), this->online_ids.end(), - [&](const auto &x) { return x == stream.user_id; }); + [&](const auto &x) { return x == stream.get_user_id(); }); if (!is_already_live) { - this->online_ids.insert(stream.user_id); + this->online_ids.insert(stream.get_user_id()); this->handler(schemas::EventType::LIVE, stream); } } @@ -64,7 +64,7 @@ namespace bot::stream { for (auto i = this->online_ids.begin(); i != this->online_ids.end();) { auto stream = std::find_if(streams.begin(), streams.end(), - [&](const auto &x) { return x.user_id == *i; }); + [&](const auto &x) { return x.get_user_id() == *i; }); if (stream == streams.end()) { this->handler(schemas::EventType::OFFLINE, @@ -85,7 +85,7 @@ namespace bot::stream { "SELECT id, channel_id, message, flags FROM events WHERE event_type " "= " + std::to_string(type) + - " AND target_alias_id = " + std::to_string(stream.user_id)); + " AND target_alias_id = " + std::to_string(stream.get_user_id())); for (const auto &event : events) { pqxx::row channel = work.exec1( -- cgit v1.2.3