From e9877ca9fa0addf3f018527712355ca0c3d9eb77 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Fri, 19 Jul 2024 07:53:46 +0100 Subject: [PATCH] feat: support sending messages to the user --- crates/webhook-actor/src/handlers/mod.rs | 1 + crates/webhook-actor/src/handlers/notify_user.rs | 12 ++++++++++++ crates/webhook-actor/src/messages.rs | 2 ++ 3 files changed, 15 insertions(+) create mode 100644 crates/webhook-actor/src/handlers/notify_user.rs diff --git a/crates/webhook-actor/src/handlers/mod.rs b/crates/webhook-actor/src/handlers/mod.rs index 418e9f6f..3fa92722 100644 --- a/crates/webhook-actor/src/handlers/mod.rs +++ b/crates/webhook-actor/src/handlers/mod.rs @@ -1 +1,2 @@ +mod notify_user; mod shutdown_webhook; diff --git a/crates/webhook-actor/src/handlers/notify_user.rs b/crates/webhook-actor/src/handlers/notify_user.rs new file mode 100644 index 00000000..adf866a0 --- /dev/null +++ b/crates/webhook-actor/src/handlers/notify_user.rs @@ -0,0 +1,12 @@ +// +use actix::prelude::*; + +use crate::{messages::NotifyUser, WebhookActor}; + +impl Handler for WebhookActor { + type Result = (); + + fn handle(&mut self, _msg: NotifyUser, _ctx: &mut Self::Context) -> Self::Result { + // TODO: (#95) should notify user + } +} diff --git a/crates/webhook-actor/src/messages.rs b/crates/webhook-actor/src/messages.rs index 97cf082f..82af9c1c 100644 --- a/crates/webhook-actor/src/messages.rs +++ b/crates/webhook-actor/src/messages.rs @@ -2,3 +2,5 @@ use git_next_actor_macros::message; message!(ShutdownWebhook: "Request to shutdown the Webhook actor"); + +message!(NotifyUser: String: "Request to send the message payload to the notification webhook");