This reverts commit 0da249c651.
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
d0724d8b00
Коммит
a55bd001b4
@@ -3704,32 +3704,3 @@ func (s SqlChannelStore) GetTeamForChannel(channelID string) (*model.Team, error
|
||||
}
|
||||
return &team, nil
|
||||
}
|
||||
|
||||
func (s SqlChannelStore) GetCRTUnfixedChannelMembershipsAfter(channelID, userID string, count int) ([]model.ChannelMember, error) {
|
||||
// we want both channelID and userID, or neither of them specified
|
||||
if (userID == "" || channelID == "") && (channelID != userID) {
|
||||
return nil, fmt.Errorf("channelID=%q userID=%q, got one empty param, both need to be empty or specified", channelID, userID)
|
||||
}
|
||||
getUnfixedCMQuery := `
|
||||
SELECT ChannelMembers.*
|
||||
FROM ChannelMembers, Channels
|
||||
WHERE ChannelId = Id AND (ChannelMembers.UserId, ChannelMembers.ChannelId) > (:userId, :channelId) AND Channels.TotalMsgCountRoot > ChannelMembers.MsgCountRoot
|
||||
ORDER BY UserId, ChannelId
|
||||
LIMIT :count;
|
||||
`
|
||||
if userID == "" && channelID == "" {
|
||||
getUnfixedCMQuery = `
|
||||
SELECT ChannelMembers.*
|
||||
FROM ChannelMembers, Channels
|
||||
WHERE ChannelId = Id AND Channels.TotalMsgCountRoot > ChannelMembers.MsgCountRoot
|
||||
ORDER BY UserId, ChannelId
|
||||
LIMIT :count;
|
||||
`
|
||||
}
|
||||
var dbMembers channelMemberWithSchemeRolesList
|
||||
|
||||
if _, err := s.GetReplica().Select(&dbMembers, getUnfixedCMQuery, map[string]interface{}{"channelId": channelID, "userId": userID, "count": count}); err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to get %d ChannelMembers after channelId=%q and userId=%q", count, channelID, userID)
|
||||
}
|
||||
return dbMembers.ToModel(), nil
|
||||
}
|
||||
|
||||
@@ -2734,23 +2734,3 @@ func (s *SqlPostStore) updateThreadsFromPosts(transaction *sqlxTxWrapper, posts
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetUniquePostTypesSince returns the unique post types in a channel after the given timestamp
|
||||
func (s *SqlPostStore) GetUniquePostTypesSince(channelId string, timestamp int64) ([]string, error) {
|
||||
query, args, err := s.getQueryBuilder().
|
||||
Select("DISTINCT Type").
|
||||
From("Posts").
|
||||
Where(sq.And{
|
||||
sq.Eq{"ChannelId": channelId},
|
||||
sq.GtOrEq{"CreateAt": timestamp},
|
||||
sq.Eq{"DeleteAt": 0},
|
||||
}).ToSql()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
types := []string{}
|
||||
if err := s.GetReplicaX().Select(&types, query, args...); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return types, nil
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user