-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Make possible for apps to define their own avatar types #24579
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
Closed
danxuliu
wants to merge
53
commits into
master
from
make-possible-for-apps-to-define-their-own-avatar-types
Closed
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
b553b43
Make possible to send requests as anonymous users in integration tests
danxuliu 184742e
Make possible to set body in requesttoken requests in integration tests
danxuliu 2cc22a0
Add integration tests for user avatars
danxuliu 1552add
Add integration tests for resized user avatars
danxuliu b4b3276
Add integration tests for getting guest avatars
danxuliu 1de8dc3
Add getter for generic avatars to IAvatarManager
danxuliu bcce5a6
Add OCS endpoint for avatars
danxuliu 2522439
Make possible to set body in OCS requests in integration tests
danxuliu b190431
Add integration tests for getting and setting generic avatars
danxuliu 63cbd7b
fixup! Add OCS endpoint for avatars
danxuliu a31a7fd
fixup! Add OCS endpoint for avatars
danxuliu 92c9fc0
Make possible to define custom avatar types
danxuliu a836608
fixup! Add OCS endpoint for avatars
danxuliu 95e0177
Move registration of IAvatarProviders to IRegistrationContext
danxuliu f04a16a
fixup! Make possible to define custom avatar types
danxuliu ebf242a
fixup! Add OCS endpoint for avatars
danxuliu bf9169e
fixup! Add getter for generic avatars to IAvatarManager
danxuliu 1e13309
fixup! Make possible to define custom avatar types
danxuliu 6e43ce7
fixup! Add OCS endpoint for avatars
danxuliu 90ac35d
fixup! Make possible to define custom avatar types
danxuliu 5d0102e
fixup! Move registration of IAvatarProviders to IRegistrationContext
danxuliu ab910ec
fixup! Move registration of IAvatarProviders to IRegistrationContext
danxuliu a2c63ff
fixup! Make possible to define custom avatar types
danxuliu 76e4bd2
Move deprecated ILogger to LoggerInterface in avatar private classes
danxuliu 612dbe6
Add explicit providers for user and guest avatars
danxuliu 0e953eb
Remove no longer needed attributes from AvatarManager
danxuliu 0bb311f
Get the avatar provider rather than the avatar itself from the manager
danxuliu 611881b
Add method to get the cache duration of an avatar to IAvatarProvider
danxuliu 6c99a9a
fixup! Add method to get the cache duration of an avatar to IAvatarPr…
danxuliu 6079793
fixup! Add explicit providers for user and guest avatars
danxuliu bcd2074
fixup! Move registration of IAvatarProviders to IRegistrationContext
danxuliu 23f4c1d
fixup! Get the avatar provider rather than the avatar itself from the…
danxuliu e88d3b6
fixup! Make possible to define custom avatar types
danxuliu 4a26943
fixup! Add explicit providers for user and guest avatars
danxuliu fa0342a
fixup! Add explicit providers for user and guest avatars
danxuliu ebc3f14
fixup! Get the avatar provider rather than the avatar itself from the…
danxuliu 03eed3e
fixup! Add integration tests for getting and setting generic avatars
danxuliu 1348cab
fixup! Add integration tests for getting and setting generic avatars
danxuliu 8d69a4e
fixup! Add OCS endpoint for avatars
danxuliu 4368ec0
fixup! Make possible to define custom avatar types
danxuliu 6b8f290
fixup! Add integration tests for getting and setting generic avatars
danxuliu 68b298e
fixup! Add method to get the cache duration of an avatar to IAvatarPr…
danxuliu cc7cd18
Split try/catch blocks to catch only the relevant exceptions
danxuliu 6ed5fde
Add method to check if an avatar can be accessed by the current user
danxuliu 65c8c22
Add method to check if an avatar can be modified by the current user
danxuliu 135d14b
Add integration tests for unauthorized modification of avatars
danxuliu 330fac8
Add method to get the version of an avatar
danxuliu 68fa045
Limit the returned sizes of the avatars to a predefined set
danxuliu 601d741
fixup! Get the avatar provider rather than the avatar itself from the…
danxuliu 6391a2b
fixup! Add explicit providers for user and guest avatars
danxuliu 029d22c
fixup! Add method to check if an avatar can be modified by the curren…
danxuliu 3a4b926
fixup! Add explicit providers for user and guest avatars
danxuliu 6895199
fixup! Make possible to define custom avatar types
danxuliu 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
Add method to get the version of an avatar
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
- Loading branch information
commit 330fac872282eec66ff114cb315b23df9f51908b
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -80,6 +80,22 @@ public function canBeAccessedByCurrentUser(IAvatar $avatar): bool; | |
| */ | ||
| public function canBeModifiedByCurrentUser(IAvatar $avatar): bool; | ||
|
|
||
| /** | ||
| * Returns the latest value of the avatar version | ||
| * | ||
| * Implementers of IAvatarProvider may not throw \InvalidArgumentException | ||
| * if the behaviour does not depend on specific avatar instances (for | ||
| * example, if versions are not supported and the same version is always | ||
| * returned). | ||
| * | ||
|
Comment on lines
+84
to
+90
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now you described what it does. But what is it used for? Caching of the avatars? Do we need to bump it on each patch we do? |
||
| * @param IAvatar $avatar the avatar to check | ||
| * @return int the latest value of the avatar version | ||
| * @throws \InvalidArgumentException if the given avatar is not supported by | ||
| * this provider | ||
| * @since 21.0.0 | ||
| */ | ||
| public function getVersion(IAvatar $avatar): int; | ||
|
|
||
| /** | ||
| * Returns the cache duration in seconds | ||
| * | ||
|
|
||
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 agree with @ChristophWurst that we should inject the user here