summaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-06-04 10:48:03 +0200
committerdefault <nobody@localhost>2023-06-04 10:48:03 +0200
commit0d817340e245f2426ced10eddee9f7d5faf90a29 (patch)
tree8114ac775301c11d2e7d81e3d5a7718f41c6a4b6 /activitypub.c
parent3a8005f9bf768e17a086f033c90661c9d8c8f8e5 (diff)
If a user config field 'bot' is set to true, identies as such.
Diffstat (limited to 'activitypub.c')
-rw-r--r--activitypub.c4
1 files changed, 4 insertions, 0 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)
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;
}