Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for #121 (multiple identical first names) #201

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

fix for #121 (multiple identical first names) #201

wants to merge 3 commits into from

Conversation

dlenski
Copy link
Contributor

@dlenski dlenski commented Jan 4, 2016

This builds on top of #200, and fixes the issue of identical first names leading to a hard-to-follow conversations.

As a Daniel with many friends named Dan or Daniel, I feel the pain of the folks who reported #121 👍.

Any time a new user appears in the user list, this patch revisits the UserList and ensures that each name is represented uniquely by including (only if necessary) either the last initial or the whole name.

For example, this userlist would be mapped as follows:

Daniel Smith   -> Daniel S
Daniel Jones   -> Daniel Jones
Daniel Johnson -> Daniel Johnson
Daniel Lenski  -> Daniel L
Steve Jones    -> Steve

Now, if a new user ("Daniel Schmidt") joins the party, both Daniel Smith and Daniel Schmidt's full last names will be added.

…irst_name was an empty string, but not None

Actually inserting a User with full_name or first_name of None into the UserList would cause errors in utils.get_conv_name()
Google Voice participants often first appear with
no name at all, and then get upgraded unpredictably
to numbers (e.g. "+18005551212") or real names when
their ConversationParticipantData message is re-sent.

The official Android and Chrome clients appear to
share this behavior in some cases: they inexplicably
show some users as numbers only, even when those users
and their numbers are in my Google Contacts and have
been for a long time.
@dlenski
Copy link
Contributor Author

dlenski commented Jan 4, 2016

Perhaps this is not immediately relevant, but the unique_name strategy will make a bit of a mess of names that don't follow the typical English-speaking world's convention of Firstname Middlename Lastname.

I wonder if there are existing libraries out there that deal with this problem in a multilingual way… ?

@vista-
Copy link

vista- commented Jan 4, 2016

Seems to be working fine on my end. I do have one guy whose first name only appears once in the user list, however, his name has the first letter of his last name appended to it.

I come from a land where Lastname Firstname is the default writing way, but seems like Google does the switching nevertheless. (So it works fine)

@dlenski
Copy link
Contributor Author

dlenski commented Jan 4, 2016

Ah, that may be a problem. I am not sure how the full_name and first_name fields are actually provided by Google's server in such an environment. (I'm going to guess the language is Magyar since you mentioned typical Western-sounding first names.)

You might try commenting out user.py lines 113-118 and see if that fixes the problem for you, by allowing only two alternatives, either first_name or full_name as unique_name (rather than the third possibility of first_name last_initial).

@tdryer
Copy link
Owner

tdryer commented Jan 9, 2016

Nice solution! Do any of Google's clients solve the issue this way?

Since this is a UI issue, I think it would be more appropriate to solve it purely in the UI code (eg. have hangups/ui/utils.py handle choosing the unique names).

@dlenski
Copy link
Contributor Author

dlenski commented Jan 9, 2016

I don't believe Google's own Hangouts clients do this, exactly. Although Gmail does something pretty similar when an email is addressed to multiple people with the same first name.

It probably would be more appropriate to handle this in ui/utils.py, but I couldn't really figure out a clean way to do that, since the only place that stateful information about the users is stored is in UserList. Do you have any suggestions?

@tdryer
Copy link
Owner

tdryer commented Jan 9, 2016

We could add a stateful NameFormatter class to be used by the UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants