Compare commits

..

2 Commits

Author SHA1 Message Date
72a2e694f8 Merge pull request '🎨 优化好友列表同步处理逻辑' (#56) from hotfix into main
All checks were successful
BuildImage / build-image (push) Successful in 1m22s
Reviewed-on: #56
2024-06-13 07:02:45 +08:00
2238e23c8d 🎨 优化好友列表同步处理逻辑 2024-06-13 07:02:00 +08:00

View File

@ -134,7 +134,19 @@ func Sync() {
}
// 清理不在列表中的好友
err = tx.Model(&entity.Friend{}).Where("wxid NOT IN (?)", nowIds).Update("is_ok", false).Error
clearPm := map[string]any{
"is_ok": false,
"enable_chat_rank": false,
"enable_welcome": false,
"enable_summary": false,
"enable_news": false,
"clear_member": false,
"enable_ai": false,
}
err = tx.Model(&entity.Friend{}).Where("wxid NOT IN (?)", nowIds).Updates(clearPm).Error
if err != nil {
log.Printf("清理好友失败: %s", err.Error())
}
log.Println("同步好友列表完成")
}