Compare commits
7 commits
31859a0c69
...
3e196558ef
Author | SHA1 | Date | |
---|---|---|---|
3e196558ef | |||
94b618c962 | |||
16b8bc40dd | |||
acc4725124 | |||
eb3dbe4696 | |||
7d77ef8a84 | |||
3c0b7096e2 |
1 changed files with 3 additions and 4 deletions
|
@ -1,5 +1,4 @@
|
|||
//
|
||||
|
||||
use actix::prelude::*;
|
||||
use git_next_config::server::NotificationType;
|
||||
use git_next_repo_actor::messages::NotifyUser;
|
||||
|
@ -13,8 +12,8 @@ impl Handler<NotifyUser> for ServerActor {
|
|||
let Some(server_config) = &self.server_config else {
|
||||
return;
|
||||
};
|
||||
let notification_type = server_config.notification().r#type();
|
||||
match notification_type {
|
||||
let notification = &server_config.notification();
|
||||
match notification.r#type() {
|
||||
NotificationType::None => { /* do nothing */ }
|
||||
NotificationType::Webhook => {
|
||||
let message_id = format!("msg_{}", ulid::Ulid::new());
|
||||
|
@ -23,7 +22,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) = self.webhook.as_ref() else {
|
||||
let Some(webhook) = notification.webhook.as_ref() else {
|
||||
tracing::warn!("Invalid notification configuration - can't sent notification");
|
||||
return;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue