#pragma once #include "event.hpp" #include #include #include class Connection; struct hs_database; struct hs_scratch; enum class SnoteTag { ClientConnecting, ClientExiting, RejectingKlined, NickChange, CreateChannel, TemporaryKlineExpired, PropagatedBanExpired, DisconnectingKlined, NewPropagatedKline, NewTemporaryKline, LoginAttempts, PossibleFlooder, Killed, }; struct SnoteEvent : Event { SnoteEvent(SnoteTag tag, std::vector parts) : tag{tag} , parts{std::move(parts)} {} SnoteTag tag; std::vector parts; }; struct SnoteThread { struct DbDeleter { auto operator()(hs_database * db) const -> void; }; struct ScratchDeleter { auto operator()(hs_scratch * scratch) const -> void; }; std::unique_ptr db_; std::unique_ptr scratch_; static auto start(Connection& connection) -> std::shared_ptr; };