fix: 优化群成员分页并补齐头像资料
This commit is contained in:
+15
-2
@@ -2904,7 +2904,7 @@ func refreshUserProfileProjections(tenantID types.TenantID, uid types.Uid, profi
|
||||
items, nextCursor, err := Relations.ListFriends(tenantID, uid, "", "", cursor, 100)
|
||||
if err != nil {
|
||||
logs.Warn.Printf("profile %s: refresh friend subscription projections failed: %v", uid, err)
|
||||
return
|
||||
break
|
||||
}
|
||||
for _, item := range items {
|
||||
if item.Friendship.Topic == "" || item.Friendship.PeerID.IsZero() {
|
||||
@@ -2915,10 +2915,23 @@ func refreshUserProfileProjections(tenantID types.TenantID, uid types.Uid, profi
|
||||
}
|
||||
}
|
||||
if nextCursor == "" {
|
||||
return
|
||||
break
|
||||
}
|
||||
cursor = nextCursor
|
||||
}
|
||||
if topics, err := Users.GetTopics(tenantID, uid, &types.QueryOpt{Limit: 1000}); err != nil {
|
||||
logs.Warn.Printf("profile %s: refresh group member projections failed: %v", uid, err)
|
||||
} else {
|
||||
for _, sub := range topics {
|
||||
if types.GetTopicCat(sub.Topic) != types.TopicCatGrp {
|
||||
continue
|
||||
}
|
||||
if err := Subs.Update(tenantID, sub.Topic, uid, map[string]any{"Public": public}); err != nil {
|
||||
logs.Warn.Printf("profile %s: refresh group subscription %s public failed: %v", uid, sub.Topic, err)
|
||||
}
|
||||
invalidateGroupMemberPages(tenantID, sub.Topic)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func userProfilePublicProjection(profile *types.UserProfile) map[string]any {
|
||||
|
||||
Reference in New Issue
Block a user