Compare commits
7 commits
3e196558ef
...
31859a0c69
Author | SHA1 | Date | |
---|---|---|---|
31859a0c69 | |||
731c22826c | |||
8b2deba6de | |||
d8f256bedc | |||
e5f2bac00c | |||
022e6bcbb0 | |||
f50cb40cf0 |
1 changed files with 4 additions and 3 deletions
|
@ -1,4 +1,5 @@
|
|||
//
|
||||
|
||||
use actix::prelude::*;
|
||||
use git_next_config::server::NotificationType;
|
||||
use git_next_repo_actor::messages::NotifyUser;
|
||||
|
@ -12,8 +13,8 @@ impl Handler<NotifyUser> for ServerActor {
|
|||
let Some(server_config) = &self.server_config else {
|
||||
return;
|
||||
};
|
||||
let notification = &server_config.notification();
|
||||
match notification.r#type() {
|
||||
let notification_type = server_config.notification().r#type();
|
||||
match notification_type {
|
||||
NotificationType::None => { /* do nothing */ }
|
||||
NotificationType::Webhook => {
|
||||
let message_id = format!("msg_{}", ulid::Ulid::new());
|
||||
|
@ -22,7 +23,7 @@ impl Handler<NotifyUser> for ServerActor {
|
|||
let timestamp = timestamp.unix_timestamp();
|
||||
let to_sign = format!("{message_id}.{timestamp}.{payload}");
|
||||
tracing::info!(?to_sign, "");
|
||||
let Some(webhook) = notification.webhook.as_ref() else {
|
||||
let Some(webhook) = self.webhook.as_ref() else {
|
||||
tracing::warn!("Invalid notification configuration - can't sent notification");
|
||||
return;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue