MM-54778 Fix mark as unread on GMs (#24880)

* Fix mark as unread on GMs

* Don't count own messages in gms when marking as unread

* Change argument name

* Rename userId

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Daniel Espino García
2023-10-24 15:27:30 +02:00
коммит произвёл GitHub
родитель 5d3ba7483b
Коммит 6125b0ca7f
9 изменённых файлов: 115 добавлений и 49 удалений

Просмотреть файл

@@ -808,11 +808,11 @@ func (s *RetryLayerChannelStore) ClearSidebarOnTeamLeave(userID string, teamID s
}
func (s *RetryLayerChannelStore) CountPostsAfter(channelID string, timestamp int64, userID string) (int, int, error) {
func (s *RetryLayerChannelStore) CountPostsAfter(channelID string, timestamp int64, excludedUserID string) (int, int, error) {
tries := 0
for {
result, resultVar1, err := s.ChannelStore.CountPostsAfter(channelID, timestamp, userID)
result, resultVar1, err := s.ChannelStore.CountPostsAfter(channelID, timestamp, excludedUserID)
if err == nil {
return result, resultVar1, nil
}
@@ -829,11 +829,11 @@ func (s *RetryLayerChannelStore) CountPostsAfter(channelID string, timestamp int
}
func (s *RetryLayerChannelStore) CountUrgentPostsAfter(channelID string, timestamp int64, userID string) (int, error) {
func (s *RetryLayerChannelStore) CountUrgentPostsAfter(channelID string, timestamp int64, excludedUserID string) (int, error) {
tries := 0
for {
result, err := s.ChannelStore.CountUrgentPostsAfter(channelID, timestamp, userID)
result, err := s.ChannelStore.CountUrgentPostsAfter(channelID, timestamp, excludedUserID)
if err == nil {
return result, nil
}