summaryrefslogtreecommitdiff
path: root/src/irc/proxy
diff options
context:
space:
mode:
Diffstat (limited to 'src/irc/proxy')
-rw-r--r--src/irc/proxy/listen.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/irc/proxy/listen.c b/src/irc/proxy/listen.c
index e30cc9ba..7874ed60 100644
--- a/src/irc/proxy/listen.c
+++ b/src/irc/proxy/listen.c
@@ -126,6 +126,21 @@ static void handle_client_cmd(CLIENT_REC *client, char *cmd, char *args,
if (strcmp(cmd, "QUIT") == 0) {
remove_client(client);
return;
+ } if (strcmp(cmd, "PING") == 0) {
+ /* Reply to PING, if the parameter is either proxy_adress,
+ our own nick or empty. */
+ char *server = args;
+ if (*server == ':') server++;
+
+ if (*server == '\0' ||
+ g_strncasecmp(server, client->proxy_address,
+ strlen(client->proxy_address)) == 0 ||
+ g_strncasecmp(server, client->nick,
+ strlen(client->nick)) == 0) {
+ if (*server == '\0') args = client->nick;
+ proxy_outdata(client, ":%s PONG %s\n", client->proxy_address, args);
+ return;
+ }
}
if (client->server == NULL || !client->server->connected) {