Improved user references reset patch
This commit is contained in:
@ -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.")
|
||||
|
Reference in New Issue
Block a user