Skip to content

Commit

Permalink
Print the total number of aliases for /list
Browse files Browse the repository at this point in the history
  • Loading branch information
necto committed Jan 15, 2025
1 parent 4c7898d commit 5b9f213
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/bot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ async fn help(bot: Bot, msg: Message) -> HandlerResult {
async fn list_aliases(bot: Bot, domain: DomainName, client: Arc<KMailApi>, msg: Message) -> HandlerResult {
match client.list_aliases().await {
Ok(aliases) => {
let mut reply: String = "Aliases:".into();
let mut reply: String = format!("{} aliases:", aliases.len());
for alias in aliases {
let full_email = domain.full_email(&alias);
reply = reply + &format!("\n - {full_email}");
Expand Down
2 changes: 1 addition & 1 deletion src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ async fn test_list_aliases_success() {
.await;
let (bot, _) = mock_bot(message_text("/list"), &server.url());
bot.dispatch_and_check_last_text(
"Aliases:
"3 aliases:
- aaa@mock_domain
- bbb@mock_domain
- ccc@mock_domain").await;
Expand Down

0 comments on commit 5b9f213

Please sign in to comment.