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

fallback to initials when thumbnail image not available #428

Merged
merged 3 commits into from Nov 29, 2016

Conversation

averissimo
Copy link
Member

@averissimo averissimo commented Oct 27, 2016

It was reported in issue #196 that some user's avatar do not show up with an error on the console log.

These were replaced by a generic image. This fix uses the user's initials instead.

This problem seem to only affect contacts that have a "private" avatar, that requires a login in google's infrastructure to get.

TODO:

  • Messages show either all initials or all images
    • Problem is that when using the same logic as contact list / conversation add there is a bigger bug
  • Group chats have repetitive initials
  • Details of the chat show default image
  • Avatar has a lag changing when switching between conversations that have a valid avatar and problematic one

@sander-adhese
Copy link

sander-adhese commented Oct 28, 2016

Does not work entirely, I can see that initials = initialsof entity[p.id] generates the correct initials, but they aren't shown instead of the broken image.

@averissimo
Copy link
Member Author

It works on the conversation list? I was assuming the messages were using that one and did not test it.

Sorry about that, working on a global fix :)

Without fix

selection_00129

With fix

selection_00130

@sander-adhese
Copy link

Hah yes it works on the conversation list, I didn't notice that at first. Well done :)

@averissimo
Copy link
Member Author

This latest commit should fix avatar in messages and when adding user to conversation (or seeing details)

@sander-adhese I appreciate if you can test this and think of other use cases

@averissimo
Copy link
Member Author

I think there is still a bug when having one of these users in a group chat

One of these should be VF

image

@sander-adhese
Copy link

Still some issues, some photo's are overwritten with the initials (I can still see the right picture in the conversation list, not in the message window), some group conversations have multiple times the same initials in it, details of a chat is ok. Will try to think of other uses.

@averissimo
Copy link
Member Author

ahhh.. I have to think of a better solution then. Completely ignored the avatar that were supposed to exist.

The problem on implementing the same logic as in contact list is that for some reason when changing conversations initials were inherit from the previous conversation (only latest avatar showed correctly, others took a while to replace)

I'll update the first comment with a TODO of fixes.

Thanks a lot @sander-adhese

@sander-adhese
Copy link

You're welcome!

@averissimo
Copy link
Member Author

I'm getting OCD over this xD

I'm not 100% happy with implementation, think I still need to clean it up, as it uses two approaches depending on messages or "conversation list"/"details".

Fixed group chatting

by using a data-initials on the element, and setting onerror according to this data-initials

image

Fixed messages

Although it seems to be a lag (microseconds) when switching between conversations that had a valid avatar and the ones that have a problematic avatar

image

@averissimo
Copy link
Member Author

@sander-adhese , can you test this when you have the opportunity? :)

Thanks

@sander-adhese
Copy link

Sorry for the delay, yesterday was a holiday ;-)

It works like a charm, thank you for your work! Well done 👍

@sander-adhese
Copy link

Probably unrelated, but I can't cut and paste with my keyboard (apple keyboard, macOS Sierra) in the build of this branch, it still works by rightclicking though.

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.

None yet

3 participants