feat: migrate IM identity and snowflake primary keys
This commit is contained in:
@@ -2034,7 +2034,7 @@ func validUserPrivacyPatch(patch types.UserPrivacyPatch) bool {
|
||||
}
|
||||
|
||||
func validUserProfilePatch(patch types.UserProfilePatch) bool {
|
||||
if patch.AvatarFileID == nil && patch.Nickname == nil && patch.BirthDate == nil && patch.Signature == nil && patch.Gender == nil && patch.Region == nil {
|
||||
if patch.AvatarFileID == nil && patch.Nickname == nil && patch.BirthDate == nil && patch.Signature == nil && patch.Gender == nil && patch.Region == nil && patch.Email == nil {
|
||||
return false
|
||||
}
|
||||
if patch.Nickname != nil {
|
||||
@@ -2046,6 +2046,9 @@ func validUserProfilePatch(patch types.UserProfilePatch) bool {
|
||||
if patch.Signature != nil && len([]rune(*patch.Signature)) > 120 {
|
||||
return false
|
||||
}
|
||||
if patch.Email != nil && len([]rune(strings.TrimSpace(*patch.Email))) > 128 {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ type UserProfile struct {
|
||||
Signature string
|
||||
Gender string
|
||||
Region string
|
||||
Email string
|
||||
PublicAccount string
|
||||
Version int
|
||||
CreatedAt time.Time
|
||||
@@ -23,6 +24,7 @@ type UserProfilePatch struct {
|
||||
Signature *string
|
||||
Gender *string
|
||||
Region *string
|
||||
Email *string
|
||||
Version int
|
||||
}
|
||||
|
||||
|
||||
@@ -519,6 +519,8 @@ type User struct {
|
||||
LastSeen *time.Time
|
||||
// User agent provided when accessing the topic last time
|
||||
UserAgent string
|
||||
// Canonical mobile number used for registration and account recovery.
|
||||
Phone string
|
||||
|
||||
Public any
|
||||
Trusted any
|
||||
|
||||
Reference in New Issue
Block a user