diff --git a/pkg/config/config.go b/pkg/config/config.go index a26d3c2..5ce6b04 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -125,7 +125,6 @@ const ( // NOTE: search code base for PublicAvatar or "public avatar" for related feature code. var ( PublicAvatarEnforcementDate = time.Date(2024, time.August, 30, 12, 0, 0, 0, time.UTC) - PublicAvatarForumThread = "https://www.nonshy.com/forum/thread/667" ) // Forum settings diff --git a/pkg/middleware/public_avatar_consent.go b/pkg/middleware/public_avatar_consent.go index c1cd08b..e05ff77 100644 --- a/pkg/middleware/public_avatar_consent.go +++ b/pkg/middleware/public_avatar_consent.go @@ -18,7 +18,11 @@ func PublicAvatarConsent(user *models.User, w http.ResponseWriter, r *http.Reque } // If the current user has a non-public avatar and has not consented. - if user.NeedsPublicAvatarConsent() { + if user.ProfilePhoto.ID > 0 && user.ProfilePhoto.Visibility != models.PhotoPublic { + if user.GetProfileField("public_avatar_consent") == "true" { + return + } + templates.Redirect(w, "/settings/public-avatar-consent?next="+url.QueryEscape(r.URL.String())) return true } diff --git a/pkg/models/shy_accounts.go b/pkg/models/shy_accounts.go index 7bd87c4..4d037c9 100644 --- a/pkg/models/shy_accounts.go +++ b/pkg/models/shy_accounts.go @@ -97,13 +97,6 @@ func (um ShyMap) Get(id uint64) bool { return um[id] } -// NeedsPublicAvatarConsent returns true if the user will be impacted by the Public Avatar policy. -// -// That is, their default profile picture is non-public and they have not answered the consent form. -func (u *User) NeedsPublicAvatarConsent() bool { - return u.ProfilePhoto.ID > 0 && u.ProfilePhoto.Visibility != PhotoPublic && u.GetProfileField("public_avatar_consent") != "true" -} - // MapPublicAvatarConsent checks a set of users if they have answered the public avatar consent form. func MapPublicAvatarConsent(users []*User) (map[uint64]bool, error) { var ( diff --git a/pkg/templates/template_vars.go b/pkg/templates/template_vars.go index 02ec866..339adc2 100644 --- a/pkg/templates/template_vars.go +++ b/pkg/templates/template_vars.go @@ -25,7 +25,6 @@ func MergeVars(r *http.Request, m map[string]interface{}) { // Temporary? variables for migration efforts on PublicAvatar consent. m["PublicAvatarEnforcementDate"] = config.PublicAvatarEnforcementDate - m["PublicAvatarForumThread"] = config.PublicAvatarForumThread if r == nil { return diff --git a/web/templates/account/dashboard.html b/web/templates/account/dashboard.html index ca1346a..087bd50 100644 --- a/web/templates/account/dashboard.html +++ b/web/templates/account/dashboard.html @@ -13,48 +13,6 @@
- - {{if and (.CurrentUser.Certified) (.CurrentUser.NeedsPublicAvatarConsent)}} -
-
-

- - Notification about an upcoming change in Profile Picture policy -

-
- -
-

- Beginning on {{.PublicAvatarEnforcementDate.Format "January 2, 2006"}}, - {{PrettyTitle}} will begin to require that your square cropped profile picture (your "avatar" image) - will need be visible to all members of the website. -

- -

- Please see the announcement thread in the forum - about the upcoming change, and visit the Public Avatar Consent page - for more information. -

- -

- You are seeing this message because your default profile picture is set to - {{if eq .CurrentUser.ProfilePhoto.Visibility "friends"}} - "Friends-only" - {{else if eq .CurrentUser.ProfilePhoto.Visibility "private"}} - "Private" - {{else if eq .CurrentUser.ProfilePhoto.Visibility "circle"}} - "Inner circle only" - {{else}} - "{{.CurrentUser.ProfilePhoto.Visibility}}" - {{end}} and your avatar currently shows as a placeholder image to members - who are not allowed to see it. This message will disappear after you have - accepted the upcoming change in policy - or you set a "Public" photo as your profile picture. -

-
-
- {{end}} - {{if or (not .CurrentUser.Certified) (not .CurrentUser.ProfilePhoto.ID)}}
diff --git a/web/templates/account/public_avatar_consent.html b/web/templates/account/public_avatar_consent.html index 9566b82..c23d9da 100644 --- a/web/templates/account/public_avatar_consent.html +++ b/web/templates/account/public_avatar_consent.html @@ -42,12 +42,6 @@ have responded to this consent form by answering the prompt at the bottom of this page.

-

- If your profile picture is already set to "Public" visibility: no action is needed from - you at this time. However, you may be asked to respond to this consent form in the future - if you set a non-public photo to be your default profile picture. -

-
  • Summary of the change diff --git a/web/templates/chat.html b/web/templates/chat.html index da6ba4d..f7b57d6 100644 --- a/web/templates/chat.html +++ b/web/templates/chat.html @@ -56,19 +56,6 @@
{{end}} - - {{if Now.Before .PublicAvatarEnforcementDate}} -
- - Notice of an upcoming website policy change: beginning on {{.PublicAvatarEnforcementDate.Format "January 2, 2006"}}, - all square cropped default profile pictures will need to be made visible to all {{PrettyTitle}} members. The - yellow and - purple placeholder avatars - that you sometimes see in the chat room will be going away after that time.

- Please see the announcement post on the forum for more information. -
- {{end}} -

{{PrettyTitle}} has a chat room! Come and check it out. It features some public rooms, direct