MM-45395: Exclude bot and webhook posts from Top Team Channels. Exclude webhook posts from My Top Channels. (#20599)

* MM-45395: Exclude bot and webhook posts from Top Team Channels. Exclude webhook posts from My Top Channels.

* MM-45395: Adds missing error test.

* MM-45395: Adds missing whitespace.
Этот коммит содержится в:
Martin Kraft
2022-07-11 08:58:40 -04:00
коммит произвёл GitHub
родитель f639122376
Коммит a46840e96b
3 изменённых файлов: 88 добавлений и 11 удалений

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

@@ -7935,6 +7935,26 @@ func testChannelPostCountsByDuration(t *testing.T, ss store.Store) {
})
require.NoError(t, err)
_, err = ss.Post().Save(&model.Post{
UserId: userID,
ChannelId: channel.Id,
Message: "test",
Props: model.StringInterface{
"from_bot": true,
},
})
require.NoError(t, err)
_, err = ss.Post().Save(&model.Post{
UserId: userID,
ChannelId: channel.Id,
Message: "test",
Props: model.StringInterface{
"from_webhook": true,
},
})
require.NoError(t, err)
dpc, err := ss.Channel().PostCountsByDuration([]string{channelSaved.Id}, 0, &userID, model.PostsByDay, time.Now().Location())
require.NoError(t, err)
require.Len(t, dpc, 1)