2023-11-25 09:22:55 -08:00
|
|
|
#include "ping_thread.hpp"
|
|
|
|
|
2023-11-27 19:09:45 -08:00
|
|
|
#include "connection.hpp"
|
2023-11-25 09:22:55 -08:00
|
|
|
#include "write_irc.hpp"
|
|
|
|
|
2023-11-27 14:12:20 -08:00
|
|
|
auto PingThread::start(Connection& connection) -> void
|
2023-11-25 09:22:55 -08:00
|
|
|
{
|
2025-01-22 23:49:48 -08:00
|
|
|
connection.sig_ircmsg.connect([&connection](auto cmd, auto& msg)
|
2023-11-25 09:22:55 -08:00
|
|
|
{
|
2025-01-22 23:49:48 -08:00
|
|
|
if (IrcCommand::PING == cmd)
|
2023-11-25 09:22:55 -08:00
|
|
|
{
|
2025-01-22 23:49:48 -08:00
|
|
|
send_pong(connection, msg.args[0]);
|
2023-11-25 09:22:55 -08:00
|
|
|
}
|
2023-11-25 20:09:20 -08:00
|
|
|
});
|
2023-11-25 09:22:55 -08:00
|
|
|
}
|