diff options
| author | 2025-05-30 12:12:19 +0200 | |
|---|---|---|
| committer | 2025-05-30 12:12:19 +0200 | |
| commit | 5a2aef8666a82a30dff329992bd41baa53d4e123 (patch) | |
| tree | bf64325bf2f2bed44567484563775e9e2fc5296f /data.c | |
| parent | New function enqueue_notify_webhook(). (diff) | |
| download | penes-snac2-5a2aef8666a82a30dff329992bd41baa53d4e123.tar.gz penes-snac2-5a2aef8666a82a30dff329992bd41baa53d4e123.tar.xz penes-snac2-5a2aef8666a82a30dff329992bd41baa53d4e123.zip | |
More notify_webhook work.
Diffstat (limited to 'data.c')
| -rw-r--r-- | data.c | 11 |
1 files changed, 10 insertions, 1 deletions
| @@ -3529,7 +3529,16 @@ void enqueue_notify_webhook(snac *user, const xs_dict *noti, int retries) | |||
| 3529 | const char *webhook = xs_dict_get(user->config, "notify_webhook"); | 3529 | const char *webhook = xs_dict_get(user->config, "notify_webhook"); |
| 3530 | 3530 | ||
| 3531 | if (xs_is_string(webhook)) { | 3531 | if (xs_is_string(webhook)) { |
| 3532 | xs *qmsg = _new_qmsg("notify_webhook", noti, retries); | 3532 | xs *msg = xs_dup(noti); |
| 3533 | |||
| 3534 | /* add more data */ | ||
| 3535 | msg = xs_dict_set(msg, "target", user->actor); | ||
| 3536 | xs *actor_obj = NULL; | ||
| 3537 | |||
| 3538 | if (valid_status(object_get(xs_dict_get(noti, "actor"), &actor_obj)) && actor_obj) | ||
| 3539 | msg = xs_dict_set(msg, "account", actor_obj); | ||
| 3540 | |||
| 3541 | xs *qmsg = _new_qmsg("notify_webhook", msg, retries); | ||
| 3533 | const char *ntid = xs_dict_get(qmsg, "ntid"); | 3542 | const char *ntid = xs_dict_get(qmsg, "ntid"); |
| 3534 | xs *fn = xs_fmt("%s/queue/%s.json", user->basedir, ntid); | 3543 | xs *fn = xs_fmt("%s/queue/%s.json", user->basedir, ntid); |
| 3535 | 3544 | ||