forgejo/models
Sandro Santilli 90dd0657b5 Add support for federated avatars (#3320)
* Add support for federated avatars

Fixes #3105

Removes avatar fetching duplication code
Adds an "Enable Federated Avatar" checkbox in user settings
(defaults to unchecked)

Moves avatar settings all in the same form, making
local and remote avatars mutually exclusive

Renames UploadAvatarForm to AvatarForm
as it's not anymore only for uploading

* Run gofmt on all modified files

* Move Avatar form in its own page

* Add go-libravatar dependency to vendor/ dir

Hopefully helps with accepting the contribution.
See also #3214

* Revert "Add go-libravatar dependency to vendor/ dir"

This reverts commit a8cb93ae640bbb90f7d25012fc257bda9fae9b82.

* Make federated avatar setting a global configuration

Removes the per-user setting

* Move avatar handling back to base tool, disable federated avatar in offline mode

* Format, handle error

* Properly set fallback host

* Use unsupported github.com mirror for importing go-libravatar

* Remove comment showing life exists outside of github.com

... pity, but contribution would not be accepted otherwise

* Use Combo for Get and Post methods over /avatar

* FEDERATED_AVATAR -> ENABLE_FEDERATED_AVATAR

* Fix persistance of federated avatar lookup checkbox at install time

* Federated Avatars -> Enable Federated Avatars

* Use len(string) == 0 instead of string == ""

* Move import line where it belong

See
https://github.com/Unknwon/go-code-convention/blob/master/en-US/import_packages.md

Pity the import url is still the unofficial one, but oh well...

* Save a line (and waste much more expensive time)

* Remove redundant parens

* Remove an empty line

* Remove empty lines

* Reorder lines to make diff smaller

* Remove another newline

Unknwon review got me start a fight against newlines

* Move DISABLE_GRAVATAR and ENABLE_FEDERATED_AVATAR after OFFLINE_MODE

On re-reading the diff I figured what Unknwon meant here:
https://github.com/gogits/gogs/pull/3320/files#r73741106

* Remove newlines that weren't there before my intervention
2016-08-07 10:27:38 -07:00
..
migrations Remove redundant Unix timestamp method call 2016-07-23 20:24:44 +08:00
access.go #1384 add pagination for repositories 2016-07-24 14:32:46 +08:00
action.go #3348 always use relative avatar link in the template 2016-08-05 12:12:54 -07:00
admin.go Remove redundant Unix timestamp method call 2016-07-23 20:24:44 +08:00
error.go #3290 better code structure and batch minor improvements 2016-08-03 11:51:22 -07:00
git_diff.go Improve diff highlight (#3390) 2016-08-07 09:49:47 -07:00
git_diff_test.go Improve diff highlight (#3390) 2016-08-07 09:49:47 -07:00
issue.go #3290 better code structure and batch minor improvements 2016-08-03 11:51:22 -07:00
issue_comment.go #1601 support delete issue comment 2016-07-26 02:48:17 +08:00
issue_label.go #3290 better code structure and batch minor improvements 2016-08-03 11:51:22 -07:00
issue_mail.go Refactor User.Id to User.ID 2016-07-24 01:08:22 +08:00
login.go Refactor User.Id to User.ID 2016-07-24 01:08:22 +08:00
mail.go Refactor User.Id to User.ID 2016-07-24 01:08:22 +08:00
models.go #3281 fix x.Iterate returns nothing inside session scope with SQLite3 2016-07-26 17:26:48 +08:00
models_sqlite.go
models_tidb.go
org.go Add org.getUserTeams to reduce redundant code 2016-07-24 18:09:45 +08:00
org_team.go Refactor User.Id to User.ID 2016-07-24 01:08:22 +08:00
pull.go #3393 fix missing sub-url prefix in relative avatar link 2016-08-07 10:13:05 -07:00
release.go Fix #3315: Release dont use tag creation date (#3374) 2016-08-06 10:02:15 -07:00
repo.go #1384 add pagination for repositories 2016-07-24 14:32:46 +08:00
repo_branch.go Minor fix for #2506 2016-02-02 17:07:40 -05:00
repo_collaboration.go Refactor User.Id to User.ID 2016-07-24 01:08:22 +08:00
repo_test.go The pruning for the synchronized mirrors is a option now. Default value: enable_prune = true (#3246) 2016-07-09 13:22:28 +08:00
ssh_key.go #3281 fix x.Iterate returns nothing inside session scope with SQLite3 2016-07-26 17:26:48 +08:00
ssh_key_test.go Post work for #2637 2016-02-27 20:48:39 -05:00
token.go Remove redundant Unix timestamp method call 2016-07-23 20:24:44 +08:00
update.go Refactor User.Id to User.ID 2016-07-24 01:08:22 +08:00
user.go Add support for federated avatars (#3320) 2016-08-07 10:27:38 -07:00
user_mail.go Refactor User.Id to User.ID 2016-07-24 01:08:22 +08:00
webhook.go Remove redundant Unix timestamp method call 2016-07-23 20:24:44 +08:00
webhook_slack.go
wiki.go Fix wiki vulnerabilities 2016-07-01 15:33:35 +08:00