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.
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
f639122376
Коммит
a46840e96b
@@ -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)
|
||||
|
||||
Ссылка в новой задаче
Block a user