Skip to content

Commit af71f5a

Browse files
committed
Customize Zulip message for already seconded major change
1 parent 95218f2 commit af71f5a

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

src/handlers/major_change.rs

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -268,20 +268,37 @@ pub(super) async fn handle_command(
268268
false
269269
};
270270

271+
let already_seconded = issue
272+
.labels()
273+
.iter()
274+
.any(|l| &l.name == &config.second_label);
275+
271276
let zulip_ping = &config.zulip_ping;
272277
let issue_number = issue.number;
273278
let issue_url = &issue.html_url;
274279
let bot_username = &ctx.username;
275280
let waiting_period = config.waiting_period;
276281

277-
let zulip_msg = if has_concerns {
278-
format!(
279-
"@*{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.",
280-
)
282+
let zulip_msg = if already_seconded {
283+
if has_concerns {
284+
format!(
285+
"@*{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.",
286+
)
287+
} else {
288+
format!(
289+
"@*{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.",
290+
)
291+
}
281292
} else {
282-
format!(
283-
"@*{zulip_ping}*: Proposal [#{issue_number}]({issue_url}) has been seconded, and will be approved in {waiting_period} days if no objections are raised.",
284-
)
293+
if has_concerns {
294+
format!(
295+
"@*{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.",
296+
)
297+
} else {
298+
format!(
299+
"@*{zulip_ping}*: Proposal [#{issue_number}]({issue_url}) has been seconded, and will be approved in {waiting_period} days if no objections are raised.",
300+
)
301+
}
285302
};
286303

287304
handle(

0 commit comments

Comments
 (0)