Skip to content

history: Keep the first distinct match when migrating db

We prefer the chat name to be the first item in the list.

Say for example if the user has messages sent to "+1 123 456 789" first and then to "+1123456789" We wan't to keep "+1 123 456 789" as the chat thread name (as that will be whom the user have started chat to)

Currently, if have several such different number formats we get all non- duplicated items and use the first one there to create the list. And currently the duplicate items are removed from the start, which might be result in a different format of phone number used to set as chat name. Instead let's keep the first match intact and remove other duplicates so that the first match won't change.

Say for example, with the following rows "+1123456789" "+1 123 456 789" "+1123456789"

we shall have "+1123456789" "+1 123 456 789"

instead of "+1 123 456 789" "+1123456789"

Fixes #646 (closed)

/cc @lafleur (let me know if this fixes the tests)

Merge request reports