contact: simplify name normalization

This removes one indexing operation and reduces surprises when comma
means something other than first name and last name separator.
This commit is contained in:
Alexander Krotov
2020-06-19 02:01:54 +03:00
committed by link2xt
parent 53bee68acb
commit ad531876fd
2 changed files with 5 additions and 16 deletions

View File

@@ -2242,7 +2242,7 @@ mod tests {
.await
.unwrap()
.get_authname(),
"Фамилия Имя", // The name was "Имя, Фамилия" and ("lastname, firstname") and should be swapped to "firstname, lastname"
"Имя, Фамилия",
);
let msgs = chat::get_chat_msgs(&t.ctx, chat_id, 0, None).await;
assert_eq!(msgs.len(), 1);