From fe0d18a3a9fe27d56f8551c5fe91aeca5e1b415b Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Wed, 26 Feb 2020 03:15:14 -0500 Subject: Support labeled-response --- bounce.h | 7 ++++++- client.c | 5 +++++ pounce.1 | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/bounce.h b/bounce.h index 4718cce..e87d7bb 100644 --- a/bounce.h +++ b/bounce.h @@ -73,6 +73,7 @@ static inline struct Message parse(char *line) { X("chghost", CapChghost) \ X("extended-join", CapExtendedJoin) \ X("invite-notify", CapInviteNotify) \ + X("labeled-response", CapLabeledResponse) \ X("message-tags", CapMessageTags) \ X("multi-prefix", CapMultiPrefix) \ X("sasl", CapSASL) \ @@ -84,7 +85,11 @@ enum Cap { #define X(name, id) BIT(id), ENUM_CAP #undef X - TagCaps = CapAccountTag | CapBatch | CapMessageTags | CapServerTime, + TagCaps = CapAccountTag + | CapBatch + | CapLabeledResponse + | CapMessageTags + | CapServerTime, }; static const char *CapNames[] = { diff --git a/client.c b/client.c index d890cb9..61cd7d0 100644 --- a/client.c +++ b/client.c @@ -437,6 +437,10 @@ static const char *filterInviteNotify(const char *line) { return (wordcmp(line, 1, stateNick()) ? NULL : line); } +static const char *filterLabeledResponse(const char *line) { + return (wordcmp(line, 0, "ACK") ? line : NULL); +} + static const char *filterMessageTags(const char *line) { return (wordcmp(line, 0, "TAGMSG") ? line : NULL); } @@ -483,6 +487,7 @@ static Filter *Filters[] = { [CapChghostBit] = filterChghost, [CapExtendedJoinBit] = filterExtendedJoin, [CapInviteNotifyBit] = filterInviteNotify, + [CapLabeledResponseBit] = filterLabeledResponse, [CapMessageTagsBit] = filterMessageTags, [CapMultiPrefixBit] = filterMultiPrefix, [CapUserhostInNamesBit] = filterUserhostInNames, diff --git a/pounce.1 b/pounce.1 index 59e94b6..470324d 100644 --- a/pounce.1 +++ b/pounce.1 @@ -344,6 +344,7 @@ is supported: .Sy chghost , .Sy extended-join , .Sy invite-notify , +.Sy labeled-response , .Sy message-tags , .Sy multi-prefix , .Sy server-time , -- cgit 1.4.1