diff options
author | June McEnroe <june@causal.agency> | 2023-07-16 21:23:33 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2023-07-16 21:23:33 -0400 |
commit | a6c37817668f5b0e1d2cce3ee949470a0a440bfe (patch) | |
tree | f25fc1c5f8d98b3447f01faed185848c78f21d7a /bounce.h | |
parent | Factor out caps pounce doesn't request from the server (diff) | |
download | pounce-a6c37817668f5b0e1d2cce3ee949470a0a440bfe.tar.gz pounce-a6c37817668f5b0e1d2cce3ee949470a0a440bfe.zip |
Implement draft/read-marker
Diffstat (limited to '')
-rw-r--r-- | bounce.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bounce.h b/bounce.h index 8df85fc..e670ff3 100644 --- a/bounce.h +++ b/bounce.h @@ -25,6 +25,7 @@ * covered work. */ +#include <err.h> #include <limits.h> #include <stdarg.h> #include <stdbool.h> @@ -32,6 +33,7 @@ #include <stdlib.h> #include <string.h> #include <sys/time.h> +#include <sysexits.h> #include <tls.h> #ifndef OPENSSL_BIN @@ -57,6 +59,12 @@ static inline char *seprintf(char *ptr, char *end, const char *fmt, ...) { return ptr + n; } +static inline void set(char **field, const char *value) { + if (*field) free(*field); + *field = strdup(value); + if (!*field) err(EX_OSERR, "strdup"); +} + enum { MessageCap = 8191 + 512 }; enum { ParamCap = 15 }; @@ -92,6 +100,7 @@ static inline struct Message parse(char *line) { X("causal.agency/consumer", CapConsumer) \ X("causal.agency/passive", CapPassive) \ X("chghost", CapChghost) \ + X("draft/read-marker", CapReadMarker) \ X("echo-message", CapEchoMessage) \ X("extended-join", CapExtendedJoin) \ X("extended-monitor", CapExtendedMonitor) \ @@ -238,6 +247,7 @@ void clientSend(struct Client *client, const char *ptr, size_t len); void clientFormat(struct Client *client, const char *format, ...) __attribute__((format(printf, 2, 3))); void clientConsume(struct Client *client); +void clientGetMarker(struct Client *client, const char *target); extern bool stateNoNames; extern enum Cap stateCaps; |