feat: create_group_ex(): Log and replace invalid chat name with "…"

We can't just fail on an invalid chat name because the user would lose the work already done in the
UI like selecting members. Sometimes happens to me when i put space into name.
This commit is contained in:
iequidoo
2025-08-21 09:49:48 -03:00
committed by iequidoo
parent 2cd54b72b0
commit 11e3480fe8
2 changed files with 17 additions and 2 deletions

View File

@@ -4749,6 +4749,16 @@ async fn test_create_unencrypted_group_chat() -> Result<()> {
Ok(())
}
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn test_create_group_invalid_name() -> Result<()> {
let mut tcm = TestContextManager::new();
let alice = &tcm.alice().await;
let chat_id = create_group_ex(alice, None, " ").await?;
let chat = Chat::load_from_db(alice, chat_id).await?;
assert_eq!(chat.get_name(), "");
Ok(())
}
/// Tests that avatar cannot be set in ad hoc groups.
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn test_no_avatar_in_adhoc_chats() -> Result<()> {