Compare commits
5 commits
3e196558ef
...
e3a36d4c24
Author | SHA1 | Date | |
---|---|---|---|
e3a36d4c24 | |||
7365b619fe | |||
08d302ec65 | |||
7b4fd52264 | |||
1e169856e9 |
3 changed files with 7 additions and 3 deletions
|
@ -199,7 +199,7 @@ impl Notification {
|
|||
webhook: None,
|
||||
}
|
||||
}
|
||||
pub const fn webhook(webhook: OutboundWebhook) -> Self {
|
||||
pub const fn new_webhook(webhook: OutboundWebhook) -> Self {
|
||||
Self {
|
||||
r#type: NotificationType::Webhook,
|
||||
webhook: Some(webhook),
|
||||
|
@ -210,6 +210,10 @@ impl Notification {
|
|||
self.r#type
|
||||
}
|
||||
|
||||
pub const fn webhook(&self) -> Option<&OutboundWebhook> {
|
||||
self.webhook.as_ref()
|
||||
}
|
||||
|
||||
pub fn webhook_url(&self) -> Option<String> {
|
||||
self.webhook.clone().map(|x| x.url)
|
||||
}
|
||||
|
|
|
@ -751,7 +751,7 @@ mod given {
|
|||
ServerStorage::new(a_name().into())
|
||||
}
|
||||
pub fn a_notification_config() -> Notification {
|
||||
Notification::webhook(an_outbound_webhook())
|
||||
Notification::new_webhook(an_outbound_webhook())
|
||||
}
|
||||
pub fn some_forge_configs() -> BTreeMap<String, ForgeConfig> {
|
||||
[(a_name(), a_forge_config())].into()
|
||||
|
|
|
@ -22,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) = notification.webhook.as_ref() else {
|
||||
let Some(webhook) = notification.webhook() else {
|
||||
tracing::warn!("Invalid notification configuration - can't sent notification");
|
||||
return;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue