summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2017-08-23 23:11:11 +0200
committerSébastien Helleu <flashcode@flashtux.org>2017-08-23 23:11:11 +0200
commitde9f77167498cb0853e62b6b2737460919c31895 (patch)
treeb1f4c3b940b077a16eca65d9af97e325326f1bc1
parent3d8980d91a4f48d8fae6b29f26845a3cb15b1a45 (diff)
downloadweechat-de9f77167498cb0853e62b6b2737460919c31895.zip
irc: fix CTCP PING reply when the option irc.ctcp.ping is set to non-empty value
-rw-r--r--ChangeLog.adoc1
-rw-r--r--src/plugins/irc/irc-ctcp.c17
2 files changed, 16 insertions, 2 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc
index dec34de2c..8847ce19b 100644
--- a/ChangeLog.adoc
+++ b/ChangeLog.adoc
@@ -39,6 +39,7 @@ Bug fixes::
* api: change type of arguments status/gnutls_rc/sock in hook_connect() callback from string to integer (in scripts)
* api: change type of argument fd in hook_fd() callback from string to integer (in scripts)
* buflist: fix crash in auto-scroll of bar when the buflist item is not the first item in the bar
+ * irc: fix CTCP PING reply when the option irc.ctcp.ping is set to non-empty value
* relay: fix send of "PART" command in backlog (irc protocol)
* relay: fix parsing of CAP command without arguments in irc protocol, send ACK only if all capabilities received are OK and NAK otherwise (issue #1040)
diff --git a/src/plugins/irc/irc-ctcp.c b/src/plugins/irc/irc-ctcp.c
index 8afee681c..f875322db 100644
--- a/src/plugins/irc/irc-ctcp.c
+++ b/src/plugins/irc/irc-ctcp.c
@@ -1084,8 +1084,21 @@ irc_ctcp_recv (struct t_irc_server *server, time_t date, const char *command,
address, arguments + 1, pos_args, reply);
if (!reply || reply[0])
{
- irc_ctcp_reply_to_nick (server, command, channel, nick,
- arguments + 1, pos_args);
+ if (reply)
+ {
+ decoded_reply = irc_ctcp_replace_variables (server, reply);
+ if (decoded_reply)
+ {
+ irc_ctcp_reply_to_nick (server, command, channel, nick,
+ arguments + 1, decoded_reply);
+ free (decoded_reply);
+ }
+ }
+ else
+ {
+ irc_ctcp_reply_to_nick (server, command, channel, nick,
+ arguments + 1, pos_args);
+ }
}
}
/* CTCP DCC */