From 0d817340e245f2426ced10eddee9f7d5faf90a29 Mon Sep 17 00:00:00 2001 From: default Date: Sun, 4 Jun 2023 10:48:03 +0200 Subject: If a user config field 'bot' is set to true, identies as such. --- activitypub.c | 4 ++++ snac.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/activitypub.c b/activitypub.c index d8e01e8..80d6662 100644 --- a/activitypub.c +++ b/activitypub.c @@ -803,6 +803,10 @@ xs_dict *msg_actor(snac *snac) keys = xs_dict_append(keys, "publicKeyPem", xs_dict_get(snac->key, "public")); msg = xs_dict_set(msg, "publicKey", keys); + /* if the "bot" config field is set to true, change type to "Service" */ + if (xs_type(xs_dict_get(snac->config, "bot")) == XSTYPE_TRUE) + msg = xs_dict_set(msg, "type", "Service"); + return msg; } diff --git a/snac.h b/snac.h index 2263656..cfe64f5 100644 --- a/snac.h +++ b/snac.h @@ -1,7 +1,7 @@ /* snac - A simple, minimalistic ActivityPub instance */ /* copyright (c) 2022 - 2023 grunfink / MIT license */ -#define VERSION "2.34" +#define VERSION "2.35-dev" #define USER_AGENT "snac/" VERSION -- cgit v1.2.3