MCPcopy
hub / github.com/writefreely/writefreely / IsUserSilenced

Method IsUserSilenced

database.go:360–373  ·  view source on GitHub ↗

IsUserSilenced returns true if the user account associated with id is currently silenced.

(id int64)

Source from the content-addressed store, hash-verified

358// IsUserSilenced returns true if the user account associated with id is
359// currently silenced.
360func (db *datastore) IsUserSilenced(id int64) (bool, error) {
361 u := &User{ID: id}
362
363 err := db.QueryRow("SELECT status FROM users WHERE id = ?", id).Scan(&u.Status)
364 switch {
365 case err == sql.ErrNoRows:
366 return false, ErrUserNotFound
367 case err != nil:
368 log.Error("Couldn't SELECT user status: %v", err)
369 return false, fmt.Errorf("is user silenced: %v", err)
370 }
371
372 return u.IsSilenced(), nil
373}
374
375// DoesUserNeedAuth returns true if the user hasn't provided any methods for
376// authenticating with the account, such a passphrase or email address.

Callers 15

handleViewPostFunction · 0.80
newPostFunction · 0.80
existingPostFunction · 0.80
addPostFunction · 0.80
pinPostFunction · 0.80
fetchPostFunction · 0.80
viewCollectionPostFunction · 0.80
viewArticlesFunction · 0.80
viewCollectionsFunction · 0.80
viewEditCollectionFunction · 0.80
viewStatsFunction · 0.80
newCollectionFunction · 0.80

Calls 1

IsSilencedMethod · 0.95

Tested by

no test coverage detected