18 lines
419 B
C++
18 lines
419 B
C++
#include "ping_thread.hpp"
|
|
|
|
#include "irc_parse_thread.hpp"
|
|
#include "write_irc.hpp"
|
|
|
|
auto ping_thread(Connection * connection) -> void
|
|
{
|
|
connection->add_listener<IrcMsgEvent>([connection](IrcMsgEvent& event)
|
|
{
|
|
auto& irc = event.irc;
|
|
if (IrcCommand::PING == event.command)
|
|
{
|
|
write_irc(*connection, "PONG", irc.args[0]);
|
|
event.handled_ = true;
|
|
}
|
|
});
|
|
}
|