diff --git a/src/handlers/major_change.rs b/src/handlers/major_change.rs index 835b331c..661dde46 100644 --- a/src/handlers/major_change.rs +++ b/src/handlers/major_change.rs @@ -268,22 +268,37 @@ pub(super) async fn handle_command( false }; - let zulip_msg = if has_concerns { - format!( - "@*{}*: Proposal [#{}]({}) has been seconded, but there are unresolved concerns preventing approval, use `@{} resolve concern-name` in the GitHub thread to resolve them.", - config.zulip_ping, - issue.number, - event.html_url().unwrap(), - &ctx.username, - ) + let already_seconded = issue + .labels() + .iter() + .any(|l| &l.name == &config.second_label); + + let zulip_ping = &config.zulip_ping; + let issue_number = issue.number; + let issue_url = &issue.html_url; + let bot_username = &ctx.username; + let waiting_period = config.waiting_period; + + let zulip_msg = if already_seconded { + if has_concerns { + format!( + "@*{zulip_ping}*: Proposal [#{issue_number}]({issue_url}) has been seconded again, but there are unresolved concerns preventing approval, use `@{bot_username} resolve concern-name` in the GitHub thread to resolve them.", + ) + } else { + format!( + "@*{zulip_ping}*: Proposal [#{issue_number}]({issue_url}) has been seconded again, and will be approved in maximum {waiting_period} days if no objections are raised.", + ) + } } else { - format!( - "@*{}*: Proposal [#{}]({}) has been seconded, and will be approved in {} days if no objections are raised.", - config.zulip_ping, - issue.number, - event.html_url().unwrap(), - config.waiting_period, - ) + if has_concerns { + format!( + "@*{zulip_ping}*: Proposal [#{issue_number}]({issue_url}) has been seconded, but there are unresolved concerns preventing approval, use `@{bot_username} resolve concern-name` in the GitHub thread to resolve them.", + ) + } else { + format!( + "@*{zulip_ping}*: Proposal [#{issue_number}]({issue_url}) has been seconded, and will be approved in {waiting_period} days if no objections are raised.", + ) + } }; handle(