make chat names always searchable (#3377)

* test contact name changes applied everywhere

this test is failing on current master,
a changed authname is set to `contact.authname` but not cached at `chat.name`;
resulting in `dc_chat_get_name()` returning a name
undiscoverable by `dc_get_chatlist(name)`.

* fix: update chat.name on contact.authname changes

* do read contact.display_name from database only of chat.name is empty

* update CHANGELOG
This commit is contained in:
bjoern
2022-05-30 18:35:11 +02:00
committed by GitHub
parent d5c488cc7e
commit 3b420c7b43
3 changed files with 121 additions and 3 deletions

View File

@@ -1041,7 +1041,9 @@ impl Chat {
if chat.id.is_archived_link() {
chat.name = stock_str::archived_chats(context).await;
} else {
if chat.typ == Chattype::Single {
if chat.typ == Chattype::Single && chat.name.is_empty() {
// chat.name is set to contact.display_name on changes,
// however, if things went wrong somehow, we do this here explicitly.
let mut chat_name = "Err [Name not found]".to_owned();
match get_chat_contacts(context, chat.id).await {
Ok(contacts) => {