From 3b1c1b835c6439507b68d7666df61fa96e61095c Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Sun, 24 Jan 2021 00:49:53 -0500 Subject: Support echo-message capability Only request it with labeled-response, since it is impossible to correlate messages to clients without. For clients without echo-message, synthesize a label on PRIVMSG/NOTICE/TAGMSG, then filter out received messages with that label. --- state.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'state.c') diff --git a/state.c b/state.c index 41ffdd0..6b26589 100644 --- a/state.c +++ b/state.c @@ -90,6 +90,9 @@ static void handleCap(struct Message *msg) { if (!strcmp(msg->params[1], "LS") || !strcmp(msg->params[1], "NEW")) { caps &= ~(CapSASL | CapSTS | CapUnsupported); + if (caps & CapEchoMessage && !(caps & CapLabeledResponse)) { + caps &= ~CapEchoMessage; + } if (caps) { serverFormat("CAP REQ :%s\r\n", capList(caps, NULL)); } else { -- cgit 1.4.1