commit c0333ea
default
·
2024-06-18 04:40:35 +0000 UTC
parent 9be8016
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.
1 files changed,
+8,
-0
+8,
-0
1@@ -934,6 +934,14 @@ void notify(snac *snac, const char *type, const char *utype, const char *actor,
2 if (!xs_is_null(ntfy_server) && *ntfy_server)
3 enqueue_ntfy(body, ntfy_server, ntfy_token);
4
5+ /* auto boost */
6+ if (xs_match(type, "Create") && xs_type(xs_dict_get(snac->config, "auto_boost")) == XSTYPE_TRUE) {
7+ xs *msg = msg_admiration(snac, objid, "Announce");
8+ enqueue_message(snac, msg);
9+
10+ snac_debug(snac, 1, xs_fmt("auto boosted %s", objid));
11+ }
12+
13 /* finally, store it in the notification folder */
14 if (strcmp(type, "Follow") == 0)
15 objid = id;