mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-12-25 16:53:37 +00:00
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.
This commit is contained in:
parent
9be801630a
commit
c0333ea0c8
1 changed files with 8 additions and 0 deletions
|
@ -934,6 +934,14 @@ void notify(snac *snac, const char *type, const char *utype, const char *actor,
|
|||
if (!xs_is_null(ntfy_server) && *ntfy_server)
|
||||
enqueue_ntfy(body, ntfy_server, ntfy_token);
|
||||
|
||||
/* auto boost */
|
||||
if (xs_match(type, "Create") && xs_type(xs_dict_get(snac->config, "auto_boost")) == XSTYPE_TRUE) {
|
||||
xs *msg = msg_admiration(snac, objid, "Announce");
|
||||
enqueue_message(snac, msg);
|
||||
|
||||
snac_debug(snac, 1, xs_fmt("auto boosted %s", objid));
|
||||
}
|
||||
|
||||
/* finally, store it in the notification folder */
|
||||
if (strcmp(type, "Follow") == 0)
|
||||
objid = id;
|
||||
|
|
Loading…
Reference in a new issue