Avoid counting top channel posts for posts made by plugins and OAuth apps (#20943)
* add from_integration prop to oauth posts to: - oauth app posts - plugin posts - slash command responses - incoming webhook posts * tests * include check for bot posts * use from_plugin and from_oauth_app props * fix test * avoid counting top channel posts for posts made by plugins and oauth apps
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
3e4c44c478
Коммит
15b5b1c191
@@ -1383,6 +1383,25 @@ func TestPluginCreatePostWithUploadedFile(t *testing.T) {
|
||||
assert.Equal(t, model.StringArray{fileInfo.Id}, actualPost.FileIds)
|
||||
}
|
||||
|
||||
func TestPluginCreatePostAddsFromPluginProp(t *testing.T) {
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
api := th.SetupPluginAPI()
|
||||
|
||||
channelID := th.BasicChannel.Id
|
||||
userID := th.BasicUser.Id
|
||||
post, err := api.CreatePost(&model.Post{
|
||||
Message: "test",
|
||||
ChannelId: channelID,
|
||||
UserId: userID,
|
||||
})
|
||||
require.Nil(t, err)
|
||||
|
||||
actualPost, err := api.GetPost(post.Id)
|
||||
require.Nil(t, err)
|
||||
assert.Equal(t, "true", actualPost.GetProp("from_plugin"))
|
||||
}
|
||||
|
||||
func TestPluginAPIGetConfig(t *testing.T) {
|
||||
th := Setup(t)
|
||||
defer th.TearDown()
|
||||
|
||||
Ссылка в новой задаче
Block a user