From 7023b74d12da19a8c43646e455b07bca71cab034 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Sun, 9 Feb 2020 11:24:48 -0500 Subject: [PATCH] Update calls and vars for Invites and elsewhere Ref T661 --- collections.go | 2 +- invites.go | 6 +++--- posts.go | 4 ++-- templates/user/invite.tmpl | 10 +++++----- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/collections.go b/collections.go index 32ffd80..9688ad9 100644 --- a/collections.go +++ b/collections.go @@ -656,7 +656,7 @@ func processCollectionPermissions(app *App, cr *collectionReq, u *User, w http.R } // TODO: move this to all permission checks? - suspended, err := app.db.IsUserSuspended(c.OwnerID) + suspended, err := app.db.IsUserSilenced(c.OwnerID) if err != nil { log.Error("process protected collection permissions: %v", err) return nil, err diff --git a/invites.go b/invites.go index ed2b953..d5d024a 100644 --- a/invites.go +++ b/invites.go @@ -56,15 +56,15 @@ func handleViewUserInvites(app *App, u *User, w http.ResponseWriter, r *http.Req p := struct { *UserPage - Invites *[]Invite - Suspended bool + Invites *[]Invite + Silenced bool }{ UserPage: NewUserPage(app, r, u, "Invite People", f), } var err error - p.Suspended, err = app.db.IsUserSuspended(u.ID) + p.Silenced, err = app.db.IsUserSilenced(u.ID) if err != nil { log.Error("view invites: %v", err) } diff --git a/posts.go b/posts.go index 67435b7..a0e4588 100644 --- a/posts.go +++ b/posts.go @@ -386,7 +386,7 @@ func handleViewPost(app *App, w http.ResponseWriter, r *http.Request) error { var silenced bool if found { - silenced, err = app.db.IsUserSuspended(ownerID.Int64) + silenced, err = app.db.IsUserSilenced(ownerID.Int64) if err != nil { log.Error("view post: %v", err) } @@ -1365,7 +1365,7 @@ func viewCollectionPost(app *App, w http.ResponseWriter, r *http.Request) error return ErrPostNotFound } if c.IsProtected() && (u == nil || u.ID != c.OwnerID) { - if suspended { + if silenced { return ErrPostNotFound } else if !isAuthorizedForCollection(app, c.Alias, r) { return impart.HTTPError{http.StatusFound, c.CanonicalURL() + "/?g=" + slug} diff --git a/templates/user/invite.tmpl b/templates/user/invite.tmpl index 3d94392..ea22f22 100644 --- a/templates/user/invite.tmpl +++ b/templates/user/invite.tmpl @@ -20,8 +20,8 @@ table td {
- {{if .Suspended}} - {{template "user-suspended"}} + {{if .Silenced}} + {{template "user-silenced"}} {{end}}

Invite people

Invite others to join {{.SiteName}} by generating and sharing invite links below.

@@ -30,7 +30,7 @@ table td {
- @@ -42,7 +42,7 @@ table td {
- @@ -55,7 +55,7 @@ table td {
- +