This repository was archived by the owner on Aug 27, 2018. It is now read-only.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Copied over from
notifications-clientpull #449Resolves #357 - we want to be able to use the favicon for a site if they don't have a blavatar.
What happens before this PR:
In the notification builder, we attempt to retrieve the blavatar_url(), if it's blank, we set the image for these pingback header blocks to a default blavatar url (mystery man).
What we want:
We would like to load the favicon.ico (if they have one).
What happens after this PR:
In building this user block, we check the image url, if it's the same as the default blavatar url, we switch it for the favicon.ico url. We add an error handler in case the site does not have a favicon. If there's an error loading, then we swap the image for the original default blavatar (mystery man image).
Now then:
If the site has a blavatar => use the blavatar like before
If the site has no blavatar and a favicon.ico => uses the favicon.ico (for wordpress.com sites, this means the default image becomes the W logo instead of the mystery man)
If the site has no blavatar and no favicon.ico => falls back to the default blavatar (mystery man)