-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Remove Gravatar related deprecated types and replace with Gravatar SDK #23429
Merged
Merged
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
1f9893f
Remove & replace Gravatar related deprecated code
pinarol 81adf3d
Add Gravatar SPM packages to WPAuthenticator target
pinarol f1122d2
Pass preferred size
pinarol 3dae631
Revert "Add Gravatar SPM packages to WPAuthenticator target"
pinarol 375a2ef
Add Gravatar as dependency to WPAuthenticator in Package.swift
pinarol 6bec74a
Add `listenForGravatarChanges(...)`
pinarol 892f1ba
Add default placeholder like the removed method
pinarol 2cf21d2
Remove sha256Hash
pinarol File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
148 changes: 0 additions & 148 deletions
148
Modules/Sources/WordPressUI/Extensions/Gravatar/Gravatar.swift
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
21 changes: 21 additions & 0 deletions
21
WordPressAuthenticator/Sources/Signin/UIImageView+Additions.swift
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import UIKit | ||
import WordPressUI | ||
import GravatarUI | ||
|
||
extension UIImageView { | ||
func setGravatarImage(with email: String, placeholder: UIImage? = nil, rating: Rating = .general, preferredSize: CGSize? = nil) async throws { | ||
var options: [ImageSettingOption]? | ||
if let cache = WordPressUI.ImageCache.shared as? Gravatar.ImageCaching { | ||
options = [.imageCache(cache)] | ||
} | ||
else { | ||
assertionFailure("WordPressUI.ImageCache.shared should conform to Gravatar.ImageCaching") | ||
} | ||
try await gravatar.setImage(avatarID: .email(email), | ||
placeholder: placeholder, | ||
rating: .x, | ||
preferredSize: preferredSize, | ||
defaultAvatarOption: .status404, | ||
options: options) | ||
} | ||
} |
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't able to make this code run even though I followed the email link flow. Maybe I am missing something.
But this is the same method we call from
GravatarEmailTableViewCell.swift
. And I was able to test that.