Attempt at Forgejo Webhook support
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
2ef603151e
commit
8e94435604
7 changed files with 124 additions and 27 deletions
|
|
@ -24,7 +24,7 @@ mod webhook;
|
|||
use crate::bot::XmppClient;
|
||||
use crate::error::Error;
|
||||
use crate::web::webhooks;
|
||||
use crate::webhook::WebHook;
|
||||
use crate::webhook::Hook;
|
||||
|
||||
use std::fs::File;
|
||||
use std::io::{Error as IoError, ErrorKind as IoErrorKind, Read};
|
||||
|
|
@ -130,7 +130,7 @@ async fn main() -> Result<!, Error> {
|
|||
}
|
||||
};
|
||||
|
||||
let (value_tx, mut value_rx) = mpsc::unbounded_channel::<WebHook>();
|
||||
let (value_tx, mut value_rx) = mpsc::unbounded_channel::<Hook>();
|
||||
|
||||
let mut client = XmppClient::new(
|
||||
config.jid,
|
||||
|
|
@ -169,8 +169,8 @@ async fn main() -> Result<!, Error> {
|
|||
}
|
||||
}
|
||||
wh = value_rx.recv() => {
|
||||
if let Some(wh) = wh {
|
||||
client.webhook(wh).await
|
||||
if let Some(Hook::Gitlab(hook)) = wh {
|
||||
client.webhook(hook).await
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue