Commit Graph

45 Commits

Author SHA1 Message Date
Joas Schilling
aa5f037af7
chore: apply changes from Nextcloud coding standards 1.1.1
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2023-11-23 10:36:13 +01:00
Faraz Samapoor
57ff06576a Fixes psalm errors: RedundantCondition and TypeDoesNotContainNull.
Signed-off-by: Faraz Samapoor <fsa@adlas.at>
2023-06-27 21:21:21 +03:30
Faraz Samapoor
dd67635560 Refactors lib/private/Avatar.
Mainly using PHP8's constructor property promotion.

Signed-off-by: Faraz Samapoor <fsa@adlas.at>
2023-06-25 13:36:36 +03:30
jld3103
e294045223
Properly clear cached avatars
Signed-off-by: jld3103 <jld3103yt@gmail.com>
2023-05-15 18:18:21 +02:00
Simon L
6a91d105b9 another approach to fixing the avatar generation
Signed-off-by: Simon L <szaimen@e.mail.de>
2023-03-29 12:42:58 +02:00
Côme Chilliet
f5c361cf44
composer run cs:fix
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-01-20 11:45:08 +01:00
Simon L
f57a810276 Revert "avatar generation - disable setimageformat"
Signed-off-by: Simon L <szaimen@e.mail.de>
2022-12-29 11:06:22 +01:00
Simon L
a0f21800fe avatar generation - disable setimageformat
Signed-off-by: Simon L <szaimen@e.mail.de>
2022-12-27 13:25:04 +01:00
Carl Schwan
bc9a488046
Update avatars on update
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-09-09 14:23:41 +02:00
Carl Schwan
76d0165330
Dark theme for guest avatar
And better caching policy

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-09-09 13:37:51 +02:00
Carl Schwan
f98ae2b5b0
Avatar new style
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-09-09 13:37:51 +02:00
luz paz
368f83095d Fix typos in lib/private subdirectory
Found via `codespell -q 3 -S l10n -L jus ./lib/private`

Signed-off-by: luz paz <luzpaz@github.com>
2022-07-27 08:52:17 -04:00
Carl Schwan
ec5cbdeb7f Make Color class public
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-07-05 14:44:44 +02:00
Carl Schwan
812016d626 Cleanup avatar related code
- Move event listener to new event handling
- Add typing almost everywhere
- Fix inconsistent interface parameter

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-06-22 16:11:42 +02:00
Pytal
e76d8bb901
Merge pull request #32697 from nextcloud/fix/get-avatar-authz 2022-06-08 16:27:31 -07:00
Christopher Ng
7455cd9dd7 Fix get avatar authorization
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2022-06-07 23:57:21 +00:00
Christopher Ng
57c66bf7cb Use Image class from public API
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2022-06-02 00:37:36 +00:00
Robin Appelman
215fa17d04
catch storage not available when deleting avatar
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-02-25 15:14:32 +01:00
Côme Chilliet
3631789651
Fix resource usages in OC_Image
This makes sure using resource or GdImage (PHP>=8) behaves the same.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-10-28 17:48:43 +02:00
Arthur Schiwon
506227b509
adjust internal data handling logic to fix store and load
- format as stored previously in oc_accounts table is kept

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-06-30 00:48:01 +02:00
John Molakvoæ (skjnldsv)
215aef3cbd
Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-06-04 22:02:41 +02:00
Joas Schilling
56ae87c281
Less ILogger
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-04-27 14:34:32 +02:00
Vincent Petry
cc54f718f5
Add known user check in avatar when v2-private scope
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-03-26 13:07:10 +01:00
Vincent Petry
bb008be28a
Added PlaceholderAvatar with own cached images
When avatar scope is private, the PlaceholderAvatar is used to deliver a
placeholder avatar based on the user's initials.

This was implemented as a separate class for now to avoid messing with
the existing UserAvatar implementation and its generated vs
non-generated logic.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-03-26 13:07:09 +01:00
Vincent Petry
b81a1c1bdb
Add new v2-private account scope
Added new v2-private account manager scope that restricts the scope
further by excluding public link access.

Avatars with v2-private account scope are now showing the guest avatar
instead of the real avatar.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-03-26 13:07:05 +01:00
Robin Appelman
db0e198fe0
improve type handling of Avatar::generateAvatarFromSv
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-03-24 17:09:53 +01:00
dependabot-preview[bot]
eb502c02ff
Bump nextcloud/coding-standard from 0.3.0 to 0.5.0
Bumps [nextcloud/coding-standard](https://github.com/nextcloud/coding-standard) from 0.3.0 to 0.5.0.
- [Release notes](https://github.com/nextcloud/coding-standard/releases)
- [Changelog](https://github.com/nextcloud/coding-standard/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nextcloud/coding-standard/compare/v0.3.0...v0.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-02-18 13:31:24 +01:00
Christoph Wurst
cb057829f7
Update license headers for 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-29 11:57:22 +02:00
Julius Härtl
d74e9045ac
Delete avatar if a user is deleted
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-04-24 16:27:17 +02:00
Christoph Wurst
caff1023ea
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds
unified formatting for control structures like if and loops as well as
classes, their methods and anonymous functions. This basically forces
the constructs to start on the same line. This is not exactly what PSR2
wants, but I think we can have a few exceptions with "our" style. The
starting of braces on the same line is pracrically standard for our
code.

This also removes and empty lines from method/function bodies at the
beginning and end.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 14:19:56 +02:00
Christoph Wurst
44577e4345
Remove trailing and in between spaces
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 16:07:47 +02:00
Christoph Wurst
1a9330cd69
Update the license headers for Nextcloud 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-31 14:52:54 +02:00
Christoph Wurst
b80ebc9674
Use the short array syntax, everywhere
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-26 16:34:56 +01:00
Joas Schilling
f3a5bd6753
Fix generated avatars and nophoto cache files
Since nextcloud/server#19493 newFile() by default does not write the file anymore.
Setting an empty string as content will make it write the file immediate,
without having to call putContent() afterwards.

Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-03-24 18:23:38 +01:00
Roeland Jago Douma
55c17a3571
Fix tests after #18745
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-01-27 20:17:16 +01:00
Sergey Shliakhov
acc0df1d13 Change avatar placeholder from single letter to 2 letters
https://github.com/nextcloud/server/issues/18717
Signed-off-by: Sergey Shliakhov <husband.sergey@gmail.com>
2020-01-27 09:42:45 +01:00
Christoph Wurst
6127c288e8 Fix license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-01-13 14:23:49 +01:00
Joas Schilling
e37af2d81c
Always set the generated flag to false when an avatar is being set
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-12-20 15:34:36 +01:00
Christoph Wurst
5bf3d1bb38
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-12-05 15:38:45 +01:00
Roeland Jago Douma
68748d4f85
Some php-cs fixes
* Order the imports
* No leading slash on imports
* Empty line before namespace
* One line per import
* Empty after imports
* Emmpty line at bottom of file

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-22 20:52:10 +01:00
Arthur Schiwon
3ce5d4e545
reduce adressbook change events and handling
... from four to one on avatar updates

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2019-09-04 13:46:25 +02:00
Jan-Christoph Borchardt
d14c0f2ed7
Move font from Nunito to Noto Sans
Signed-off-by: Jan-Christoph Borchardt <hey@jancborchardt.net>
2019-06-22 11:23:44 +02:00
Joas Schilling
38f8f7cbf4
Don't get the avatar when we don't operate anyway
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-04-09 11:23:06 +02:00
Michael Weimann
2a8118e459
Switch guest avatars to PNG
Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
2019-02-07 14:23:16 +01:00
Michael Weimann
bf1253cb49
Implement guest avatar endpoint
Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
2019-02-07 14:23:16 +01:00