diff options
author | default <nobody@localhost> | 2023-02-07 07:37:23 +0100 |
---|---|---|
committer | default <nobody@localhost> | 2023-02-07 07:37:23 +0100 |
commit | 2db57c9df96f4bf7c9dd996f19c104da3cae6263 (patch) | |
tree | ccdaf03c90686442cf32a44a60b4b10394b9d918 /data.c | |
parent | f6d51357afcb047a0804600a19694944f64e82bc (diff) |
Added internals for Telegram notifications.
Diffstat (limited to 'data.c')
-rw-r--r-- | data.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -1420,6 +1420,22 @@ void enqueue_email(xs_str *msg, int retries) } +void enqueue_telegram(const xs_str *msg, const char *bot, const char *chat_id) +/* enqueues a message to be sent via Telegram */ +{ + xs *qmsg = _new_qmsg("telegram", msg, 0); + char *ntid = xs_dict_get(qmsg, "ntid"); + xs *fn = xs_fmt("%s/queue/%s.json", srv_basedir, ntid); + + qmsg = xs_dict_append(qmsg, "bot", bot); + qmsg = xs_dict_append(qmsg, "chat_id", chat_id); + + qmsg = _enqueue_put(fn, qmsg); + + srv_debug(1, xs_fmt("enqueue_email %s %s", bot, chat_id)); +} + + void enqueue_message(snac *snac, xs_dict *msg) /* enqueues an output message */ { |