Migrate to new follows storage

This commit is contained in:
2019-11-19 13:51:54 +09:00
parent 99f5ae1b4f
commit 803d303420
14 changed files with 237 additions and 241 deletions

View File

@ -20,17 +20,10 @@ import (
gravatar "github.com/ungerik/go-gravatar"
)
var setNickMutex sync.Mutex
var setEmailMutex sync.Mutex
// Register data lists.
func init() {
DataLists["genders"] = []*Option{
// &Option{"", "Prefer not to say"},
{"male", "Male"},
{"female", "Female"},
}
}
var (
setNickMutex sync.Mutex
setEmailMutex sync.Mutex
)
// UserID represents a user ID.
type UserID = ID
@ -62,6 +55,7 @@ type User struct {
Browser UserBrowser `json:"browser" private:"true"`
OS UserOS `json:"os" private:"true"`
Location *Location `json:"location" private:"true"`
FollowIDs []UserID `json:"follows"`
hasPosts
@ -124,9 +118,6 @@ func RegisterUser(user *User) {
Items: []*PushSubscription{},
})
// Add empty follow list
NewUserFollows(user.ID).Save()
// Add empty notifications list
NewUserNotifications(user.ID).Save()