xbot/irc_thread.hpp

28 lines
569 B
C++
Raw Normal View History

2023-11-22 19:59:34 -08:00
#pragma once
#include "ircmsg.hpp"
enum class EventOutcome
{
Pass,
Consume,
};
enum class ThreadOutcome
{
Continue,
Finish,
};
struct IrcThread
{
using priority_type = std::uint64_t;
using callback_result = std::pair<ThreadOutcome, EventOutcome>;
virtual ~IrcThread() {}
virtual auto on_connect() -> callback_result { return {}; }
virtual auto on_disconnect() -> callback_result { return {}; };
virtual auto on_msg(ircmsg const&) -> callback_result { return {}; };
virtual auto priority() const -> priority_type = 0;
};