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 actix::prelude::*;
|
||||||
use git_next_config::server::NotificationType;
|
use git_next_config::server::NotificationType;
|
||||||
use git_next_repo_actor::messages::NotifyUser;
|
use git_next_repo_actor::messages::NotifyUser;
|
||||||
|
@ -13,8 +12,8 @@ impl Handler<NotifyUser> for ServerActor {
|
||||||
let Some(server_config) = &self.server_config else {
|
let Some(server_config) = &self.server_config else {
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
let notification_type = server_config.notification().r#type();
|
let notification = &server_config.notification();
|
||||||
match notification_type {
|
match notification.r#type() {
|
||||||
NotificationType::None => { /* do nothing */ }
|
NotificationType::None => { /* do nothing */ }
|
||||||
NotificationType::Webhook => {
|
NotificationType::Webhook => {
|
||||||
let message_id = format!("msg_{}", ulid::Ulid::new());
|
let message_id = format!("msg_{}", ulid::Ulid::new());
|
||||||
|
@ -23,7 +22,7 @@ impl Handler<NotifyUser> for ServerActor {
|
||||||
let timestamp = timestamp.unix_timestamp();
|
let timestamp = timestamp.unix_timestamp();
|
||||||
let to_sign = format!("{message_id}.{timestamp}.{payload}");
|
let to_sign = format!("{message_id}.{timestamp}.{payload}");
|
||||||
tracing::info!(?to_sign, "");
|
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");
|
tracing::warn!("Invalid notification configuration - can't sent notification");
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue