Compare commits
5 commits
e3a36d4c24
...
3e196558ef
Author | SHA1 | Date | |
---|---|---|---|
3e196558ef | |||
94b618c962 | |||
16b8bc40dd | |||
acc4725124 | |||
eb3dbe4696 |
3 changed files with 3 additions and 7 deletions
|
@ -199,7 +199,7 @@ impl Notification {
|
||||||
webhook: None,
|
webhook: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub const fn new_webhook(webhook: OutboundWebhook) -> Self {
|
pub const fn webhook(webhook: OutboundWebhook) -> Self {
|
||||||
Self {
|
Self {
|
||||||
r#type: NotificationType::Webhook,
|
r#type: NotificationType::Webhook,
|
||||||
webhook: Some(webhook),
|
webhook: Some(webhook),
|
||||||
|
@ -210,10 +210,6 @@ impl Notification {
|
||||||
self.r#type
|
self.r#type
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const fn webhook(&self) -> Option<&OutboundWebhook> {
|
|
||||||
self.webhook.as_ref()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn webhook_url(&self) -> Option<String> {
|
pub fn webhook_url(&self) -> Option<String> {
|
||||||
self.webhook.clone().map(|x| x.url)
|
self.webhook.clone().map(|x| x.url)
|
||||||
}
|
}
|
||||||
|
|
|
@ -751,7 +751,7 @@ mod given {
|
||||||
ServerStorage::new(a_name().into())
|
ServerStorage::new(a_name().into())
|
||||||
}
|
}
|
||||||
pub fn a_notification_config() -> Notification {
|
pub fn a_notification_config() -> Notification {
|
||||||
Notification::new_webhook(an_outbound_webhook())
|
Notification::webhook(an_outbound_webhook())
|
||||||
}
|
}
|
||||||
pub fn some_forge_configs() -> BTreeMap<String, ForgeConfig> {
|
pub fn some_forge_configs() -> BTreeMap<String, ForgeConfig> {
|
||||||
[(a_name(), a_forge_config())].into()
|
[(a_name(), a_forge_config())].into()
|
||||||
|
|
|
@ -22,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) = notification.webhook() 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