summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2023-06-04 10:48:03 +0200
committerGravatar default2023-06-04 10:48:03 +0200
commit0d817340e245f2426ced10eddee9f7d5faf90a29 (patch)
tree8114ac775301c11d2e7d81e3d5a7718f41c6a4b6
parentUpdated some data types. (diff)
downloadsnac2-0d817340e245f2426ced10eddee9f7d5faf90a29.tar.gz
snac2-0d817340e245f2426ced10eddee9f7d5faf90a29.tar.xz
snac2-0d817340e245f2426ced10eddee9f7d5faf90a29.zip
If a user config field 'bot' is set to true, identies as such.
-rw-r--r--activitypub.c4
-rw-r--r--snac.h2
2 files changed, 5 insertions, 1 deletions
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)
803 keys = xs_dict_append(keys, "publicKeyPem", xs_dict_get(snac->key, "public")); 803 keys = xs_dict_append(keys, "publicKeyPem", xs_dict_get(snac->key, "public"));
804 msg = xs_dict_set(msg, "publicKey", keys); 804 msg = xs_dict_set(msg, "publicKey", keys);
805 805
806 /* if the "bot" config field is set to true, change type to "Service" */
807 if (xs_type(xs_dict_get(snac->config, "bot")) == XSTYPE_TRUE)
808 msg = xs_dict_set(msg, "type", "Service");
809
806 return msg; 810 return msg;
807} 811}
808 812
diff --git a/snac.h b/snac.h
index 2263656..cfe64f5 100644
--- a/snac.h
+++ b/snac.h
@@ -1,7 +1,7 @@
1/* snac - A simple, minimalistic ActivityPub instance */ 1/* snac - A simple, minimalistic ActivityPub instance */
2/* copyright (c) 2022 - 2023 grunfink / MIT license */ 2/* copyright (c) 2022 - 2023 grunfink / MIT license */
3 3
4#define VERSION "2.34" 4#define VERSION "2.35-dev"
5 5
6#define USER_AGENT "snac/" VERSION 6#define USER_AGENT "snac/" VERSION
7 7