diff --git a/src/webhook.rs b/src/webhook.rs index 946697e..6c42527 100644 --- a/src/webhook.rs +++ b/src/webhook.rs @@ -21,10 +21,10 @@ pub fn format_webhook(wh: &WebHook) -> Option { WebHook::Push(push) => { if push.commits.len() != 0 { let mut text = format!( - "{} pushed {} commits to {} branch {}", + "[{}] {} pushed {} commits branch {}", + push.project.name, push.user_name, push.commits.len(), - push.project.name, push.ref_, ); for commit in &push.commits { @@ -38,10 +38,10 @@ pub fn format_webhook(wh: &WebHook) -> Option { text } else { format!( - "{} deleted branch {} from {}", + "[{}] {} deleted branch {}", + push.project.name, push.user_name, push.ref_, - push.project.name, ) } } @@ -54,11 +54,11 @@ pub fn format_webhook(wh: &WebHook) -> Option { None => return None, }; format!( - "{} {} issue {} in {}: {}{}", + "[{}] {} {} issue {}: {}{}", + issue.project.name, issue.user.name, action, issue.object_attributes.iid, - issue.project.name, issue.object_attributes.title, issue .object_attributes @@ -79,11 +79,11 @@ pub fn format_webhook(wh: &WebHook) -> Option { _ => todo!(), }; format!( - "{} {} merge request {} in {}: {}{}", + "[{}] {} {} merge request {}: {}{}", + merge_req.project.name, merge_req.user.name, action, merge_req.object_attributes.iid, - merge_req.project.name, merge_req.object_attributes.title, merge_req .object_attributes @@ -107,10 +107,10 @@ pub fn format_webhook(wh: &WebHook) -> Option { WikiPageAction::Create => "created", }; format!( - "{} {} {} wiki page {} <{}>", + "[{}] {} {} wiki page {} <{}>", + page.project.name, page.user.name, action, - page.project.name, page.object_attributes.title, page.object_attributes.url, )