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 удалений

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

@@ -731,10 +731,10 @@ func (s *TimerLayerChannelStore) ClearSidebarOnTeamLeave(userID string, teamID s
return err
}
func (s *TimerLayerChannelStore) CountPostsAfter(channelID string, timestamp int64, userID string) (int, int, error) {
func (s *TimerLayerChannelStore) CountPostsAfter(channelID string, timestamp int64, excludedUserID string) (int, int, error) {
start := time.Now()
result, resultVar1, err := s.ChannelStore.CountPostsAfter(channelID, timestamp, userID)
result, resultVar1, err := s.ChannelStore.CountPostsAfter(channelID, timestamp, excludedUserID)
elapsed := float64(time.Since(start)) / float64(time.Second)
if s.Root.Metrics != nil {
@@ -747,10 +747,10 @@ func (s *TimerLayerChannelStore) CountPostsAfter(channelID string, timestamp int
return result, resultVar1, err
}
func (s *TimerLayerChannelStore) CountUrgentPostsAfter(channelID string, timestamp int64, userID string) (int, error) {
func (s *TimerLayerChannelStore) CountUrgentPostsAfter(channelID string, timestamp int64, excludedUserID string) (int, error) {
start := time.Now()
result, err := s.ChannelStore.CountUrgentPostsAfter(channelID, timestamp, userID)
result, err := s.ChannelStore.CountUrgentPostsAfter(channelID, timestamp, excludedUserID)
elapsed := float64(time.Since(start)) / float64(time.Second)
if s.Root.Metrics != nil {