Merge pull request #3906 from thelounge/xpaw/ctcp-server

Reply to the server if that's where CTCP VERSION originated
This commit is contained in:
Pavel Djundik 2020-06-14 12:33:08 +03:00 committed by GitHub
commit fd9863d919
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -67,17 +67,18 @@ module.exports = function (irc, network) {
return; return;
} }
const target = data.from_server ? data.hostname : data.nick;
const response = ctcpResponses[data.type]; const response = ctcpResponses[data.type];
if (response) { if (response) {
irc.ctcpResponse(data.nick, data.type, response(data)); irc.ctcpResponse(target, data.type, response(data));
} }
// Let user know someone is making a CTCP request against their nick // Let user know someone is making a CTCP request against their nick
const msg = new Msg({ const msg = new Msg({
type: Msg.Type.CTCP_REQUEST, type: Msg.Type.CTCP_REQUEST,
time: data.time, time: data.time,
from: new User({nick: data.nick}), from: new User({nick: target}),
hostmask: data.ident + "@" + data.hostname, hostmask: data.ident + "@" + data.hostname,
ctcpMessage: data.message, ctcpMessage: data.message,
}); });