summaryrefslogtreecommitdiff
path: root/src/protocol.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/protocol.cpp')
-rw-r--r--src/protocol.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/protocol.cpp b/src/protocol.cpp
index 3b75b29f3..4f8603368 100644
--- a/src/protocol.cpp
+++ b/src/protocol.cpp
@@ -160,9 +160,19 @@ void IRCDProto::SendQuit(BotInfo *bi, const char *fmt, ...)
va_end(args);
SendQuitInternal(bi, buf);
}
+
+/**
+ * Send a PONG reply to a received PING.
+ * servname should be left NULL to send a one param reply.
+ * @param servname Daemon or client that is responding to the PING.
+ * @param who Origin of the PING and destination of the PONG message.
+ **/
void IRCDProto::SendPong(const char *servname, const char *who)
{
- send_cmd(servname, "PONG %s", who);
+ if (!servname)
+ send_cmd(ircd->ts6 ? TS6SID : ServerName, "PONG %s", who);
+ else
+ send_cmd(ircd->ts6 ? TS6SID : ServerName, "PONG %s %s", servname, who);
}
void IRCDProto::SendInvite(BotInfo *bi, const char *chan, const char *nick)