21 lines
544 B
C++
21 lines
544 B
C++
|
#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 {};
|
||
|
}
|