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 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;
|
||||||
|
@ -12,8 +13,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 = &server_config.notification();
|
let notification_type = server_config.notification().r#type();
|
||||||
match notification.r#type() {
|
match notification_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());
|
||||||
|
@ -22,7 +23,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) = notification.webhook.as_ref() else {
|
let Some(webhook) = self.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