summaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2022-11-18 08:21:40 +0100
committerdefault <nobody@localhost>2022-11-18 08:21:40 +0100
commit654326aa8bb1cae5105ffca2f227b71e5981290a (patch)
treeff4df0c3e747c936286049b7e86694c85c583931 /data.c
parente01f23cbe27d9acbe3279a78364e11bec4517aac (diff)
New function enqueue_output_to_actor().
Diffstat (limited to 'data.c')
-rw-r--r--data.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/data.c b/data.c
index 2fbb49e..3f0ccf7 100644
--- a/data.c
+++ b/data.c
@@ -1064,7 +1064,7 @@ void enqueue_input(snac *snac, char *msg, char *req, int retries)
void enqueue_output(snac *snac, char *msg, char *inbox, int retries)
-/* enqueues an output message for an actor */
+/* enqueues an output message to an inbox */
{
if (xs_startswith(inbox, snac->actor)) {
snac_debug(snac, 1, xs_str_new("refusing enqueue to myself"));
@@ -1088,6 +1088,18 @@ void enqueue_output(snac *snac, char *msg, char *inbox, int retries)
}
+void enqueue_output_by_actor(snac *snac, char *msg, char *actor, int retries)
+/* enqueues an output message for an actor */
+{
+ xs *inbox = get_actor_inbox(snac, actor);
+
+ if (!xs_is_null(inbox))
+ enqueue_output(snac, msg, inbox, retries);
+ else
+ snac_log(snac, xs_fmt("enqueue_output_by_actor cannot get inbox %s", actor));
+}
+
+
void enqueue_email(snac *snac, char *msg, int retries)
/* enqueues an email message to be sent */
{