about summary refs log tree commit diff
path: root/state.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-01-24 00:49:53 -0500
committerJune McEnroe <june@causal.agency>2021-01-24 12:59:15 -0500
commit3b1c1b835c6439507b68d7666df61fa96e61095c (patch)
treed5e64d09827726188ba103d3407876664a5655b3 /state.c
parentAdd -o and -t options to trust self-signed certificates (diff)
downloadpounce-3b1c1b835c6439507b68d7666df61fa96e61095c.tar.gz
pounce-3b1c1b835c6439507b68d7666df61fa96e61095c.zip
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.
Diffstat (limited to 'state.c')
-rw-r--r--state.c3
1 files changed, 3 insertions, 0 deletions
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 {