Преглед на файлове

If a user config field 'bot' is set to true, identies as such.

default преди 3 години
родител
ревизия
0d817340e2
променени са 2 файла, в които са добавени 5 реда и са изтрити 1 реда
  1. 4 0
      activitypub.c
  2. 1 1
      snac.h

+ 4 - 0
activitypub.c

@@ -803,6 +803,10 @@ xs_dict *msg_actor(snac *snac)
     keys = xs_dict_append(keys, "publicKeyPem", xs_dict_get(snac->key, "public"));
     keys = xs_dict_append(keys, "publicKeyPem", xs_dict_get(snac->key, "public"));
     msg = xs_dict_set(msg, "publicKey", keys);
     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;
     return msg;
 }
 }
 
 

+ 1 - 1
snac.h

@@ -1,7 +1,7 @@
 /* snac - A simple, minimalistic ActivityPub instance */
 /* snac - A simple, minimalistic ActivityPub instance */
 /* copyright (c) 2022 - 2023 grunfink / MIT license */
 /* copyright (c) 2022 - 2023 grunfink / MIT license */
 
 
-#define VERSION "2.34"
+#define VERSION "2.35-dev"
 
 
 #define USER_AGENT "snac/" VERSION
 #define USER_AGENT "snac/" VERSION