xbot/irc_parse_thread.cpp

21 lines
544 B
C++
Raw Normal View History

2023-11-25 09:22:55 -08:00
#include "irc_parse_thread.hpp"
#include "connection.hpp"
IrcParseThread::IrcParseThread(Connection * connection) noexcept
: connection_{connection} {}
auto IrcParseThread::priority() const -> priority_type
{
return 0;
}
auto IrcParseThread::on_event(Event const& event) -> callback_result
{
if (auto line_event = dynamic_cast<LineEvent const*>(&event))
{
connection_->make_event<IrcMsgEvent>(parse_irc_message(line_event->line));
return { ThreadOutcome::Continue, EventOutcome::Consume };
}
return {};
}