From f46d6d177ab9c68c59c7bb3b1f22e0a2bbefa8c3 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Fri, 19 Jul 2024 07:53:46 +0100 Subject: [PATCH] WIP: feat: support sending messages to a notification webhook --- 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 418e9f6..3fa9272 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 0000000..adf866a --- /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 97cf082..82af9c1 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");