summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2024-06-18 06:40:35 +0200
committerGravatar default2024-06-18 06:40:35 +0200
commitc0333ea0c84e544c84dafcab48dbaa595d6d34b1 (patch)
tree4a09ef1df0d1aa8f8aa8eb21539f1ece1dfff2b5
parentDon't show the instance announcement in public pages. (diff)
downloadsnac2-c0333ea0c84e544c84dafcab48dbaa595d6d34b1.tar.gz
snac2-c0333ea0c84e544c84dafcab48dbaa595d6d34b1.tar.xz
snac2-c0333ea0c84e544c84dafcab48dbaa595d6d34b1.zip
Added auto boosting (contributed by sarahpw).
If `auto_boost` is set to `true` in am account's user.json, all mentions to that account are automatically boosted to all its followers. This is very similar to the behaviour of a 'Group' actor.
-rw-r--r--activitypub.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/activitypub.c b/activitypub.c
index cfc5abc..5b75506 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -934,6 +934,14 @@ void notify(snac *snac, const char *type, const char *utype, const char *actor,
934 if (!xs_is_null(ntfy_server) && *ntfy_server) 934 if (!xs_is_null(ntfy_server) && *ntfy_server)
935 enqueue_ntfy(body, ntfy_server, ntfy_token); 935 enqueue_ntfy(body, ntfy_server, ntfy_token);
936 936
937 /* auto boost */
938 if (xs_match(type, "Create") && xs_type(xs_dict_get(snac->config, "auto_boost")) == XSTYPE_TRUE) {
939 xs *msg = msg_admiration(snac, objid, "Announce");
940 enqueue_message(snac, msg);
941
942 snac_debug(snac, 1, xs_fmt("auto boosted %s", objid));
943 }
944
937 /* finally, store it in the notification folder */ 945 /* finally, store it in the notification folder */
938 if (strcmp(type, "Follow") == 0) 946 if (strcmp(type, "Follow") == 0)
939 objid = id; 947 objid = id;