Improved user references reset patch
This commit is contained in:
parent
1ae8547721
commit
94d8104925
@ -51,7 +51,7 @@ func Get(ctx *aero.Context) string {
|
||||
}
|
||||
}
|
||||
|
||||
arn.SortUsersLastSeen(friends)
|
||||
arn.SortUsersLastSeenFirst(friends)
|
||||
}
|
||||
|
||||
// Sort relations by start date
|
||||
|
@ -19,7 +19,7 @@ func GetFollowers(ctx *aero.Context) string {
|
||||
}
|
||||
|
||||
followers := viewUser.Followers()
|
||||
arn.SortUsersLastSeen(followers)
|
||||
arn.SortUsersLastSeenFirst(followers)
|
||||
|
||||
return ctx.HTML(components.ProfileFollowers(followers, viewUser, utils.GetUser(ctx), ctx.URI()))
|
||||
|
||||
|
@ -17,7 +17,16 @@ func main() {
|
||||
// Iterate over the stream
|
||||
count := 0
|
||||
|
||||
for user := range arn.StreamUsers() {
|
||||
users, err := arn.AllUsers()
|
||||
arn.PanicOnError(err)
|
||||
|
||||
// Make the most recently seen users overwrite the references of older accounts.
|
||||
// Some people accidentally created 2 accounts and in case of overlaps we want
|
||||
// to keep the references for the account that is more likely used.
|
||||
arn.SortUsersLastSeenLast(users)
|
||||
|
||||
// Write new references
|
||||
for _, user := range users {
|
||||
count++
|
||||
println(count, user.Nick)
|
||||
|
||||
@ -34,6 +43,8 @@ func main() {
|
||||
if user.Accounts.Facebook.ID != "" {
|
||||
user.ConnectFacebook(user.Accounts.Facebook.ID)
|
||||
}
|
||||
|
||||
user.Save()
|
||||
}
|
||||
|
||||
color.Green("Finished.")
|
||||
|
Loading…
Reference in New Issue
Block a user