Temporarily add second participant information for self dms
Этот коммит содержится в:
@@ -3027,11 +3027,11 @@ func postProcessTopDMs(s *SqlPostStore, userID string, topDMs []*model.TopDM) ([
|
|||||||
} else {
|
} else {
|
||||||
secondParticipantId = participants[0]
|
secondParticipantId = participants[0]
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// filter topDM out if second user is bot
|
// filter topDM out if second user is bot
|
||||||
users, err := s.User().GetProfileByIds(context.Background(), []string{secondParticipantId}, &store.UserGetByIdsOpts{}, true)
|
users, err := s.User().GetProfileByIds(context.Background(), []string{secondParticipantId}, &store.UserGetByIdsOpts{}, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrapf(err, "failed to get second participant information for user-id: %s", topDM.SecondParticipant)
|
return nil, errors.Wrapf(err, "failed to get second participant information for user-id: %s", topDM.SecondParticipant.Id)
|
||||||
}
|
}
|
||||||
if users[0].IsBot {
|
if users[0].IsBot {
|
||||||
continue
|
continue
|
||||||
@@ -3048,8 +3048,6 @@ func postProcessTopDMs(s *SqlPostStore, userID string, topDMs []*model.TopDM) ([
|
|||||||
},
|
},
|
||||||
Position: user.Position,
|
Position: user.Position,
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
topDMsFiltered = append(topDMsFiltered, topDM)
|
topDMsFiltered = append(topDMsFiltered, topDM)
|
||||||
}
|
}
|
||||||
return topDMsFiltered, nil
|
return topDMsFiltered, nil
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user