gitea/services
wxiaoguang f0ba87fda8
Avatar refactor, move avatar code from `models` to `models.avatars`, remove duplicated code (#17123)
Why this refactor

The goal is to move most files from `models` package to `models.xxx` package. Many models depend on avatar model, so just move this first.

And the existing logic is not clear, there are too many function like `AvatarLink`, `RelAvatarLink`, `SizedRelAvatarLink`, `SizedAvatarLink`, `MakeFinalAvatarURL`, `HashedAvatarLink`, etc. This refactor make everything clear:

* user.AvatarLink()
* user.AvatarLinkWithSize(size)
* avatars.GenerateEmailAvatarFastLink(email, size)
* avatars.GenerateEmailAvatarFinalLink(email, size)

And many duplicated code are deleted in route handler, the handler and the model share the same avatar logic now.
2021-10-06 01:25:46 +02:00
..
agit
archiver
attachment
auth Avatar refactor, move avatar code from `models` to `models.avatars`, remove duplicated code (#17123) 2021-10-06 01:25:46 +02:00
comments
externalaccount
forms Kanban colored boards (#16647) 2021-09-29 22:53:12 +02:00
gitdiff
issue
lfs
mailer Always set a unique Message-ID header. (#17206) 2021-10-01 11:24:43 -04:00
mirror
pull Don't return binary file changes in raw PR diffs by default (#17158) 2021-09-27 17:09:49 -04:00
release
repository
webhook Add specific event type to header (#17222) 2021-10-05 12:12:17 -05:00
wiki