MM-22706: pass along set_online flag in websocket response (#14591)

* MM-22706: pass along set_online flag in websocket response

To let the client know whether a user has created a post without
being online or not, we get the set_online query param and
pass it down to the websocket event being passed down to the client.

With this PR, the "data" field of the `posted` event will contain
a `set_online` boolean field set to true/false depending on the
query_param set_online value set in the createPost call.

* Setting to false for auto responder

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Agniva De Sarker
2020-05-27 17:35:02 +05:30
коммит произвёл GitHub
родитель b9309b2af1
Коммит 14f7118dde
22 изменённых файлов: 211 добавлений и 176 удалений

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

@@ -388,14 +388,14 @@ func TestExportDMandGMPost(t *testing.T) {
Message: "aa" + model.NewId() + "a",
UserId: th1.BasicUser.Id,
}
th1.App.CreatePost(p1, dmChannel, false)
th1.App.CreatePost(p1, dmChannel, false, true)
p2 := &model.Post{
ChannelId: dmChannel.Id,
Message: "bb" + model.NewId() + "a",
UserId: th1.BasicUser.Id,
}
th1.App.CreatePost(p2, dmChannel, false)
th1.App.CreatePost(p2, dmChannel, false, true)
// GM posts
p3 := &model.Post{
@@ -403,14 +403,14 @@ func TestExportDMandGMPost(t *testing.T) {
Message: "cc" + model.NewId() + "a",
UserId: th1.BasicUser.Id,
}
th1.App.CreatePost(p3, gmChannel, false)
th1.App.CreatePost(p3, gmChannel, false, true)
p4 := &model.Post{
ChannelId: gmChannel.Id,
Message: "dd" + model.NewId() + "a",
UserId: th1.BasicUser.Id,
}
th1.App.CreatePost(p4, gmChannel, false)
th1.App.CreatePost(p4, gmChannel, false, true)
posts, err := th1.App.Srv().Store.Post().GetDirectPostParentsForExportAfter(1000, "0000000")
require.Nil(t, err)
@@ -473,7 +473,7 @@ func TestExportPostWithProps(t *testing.T) {
},
UserId: th1.BasicUser.Id,
}
th1.App.CreatePost(p1, dmChannel, false)
th1.App.CreatePost(p1, dmChannel, false, true)
p2 := &model.Post{
ChannelId: gmChannel.Id,
@@ -483,7 +483,7 @@ func TestExportPostWithProps(t *testing.T) {
},
UserId: th1.BasicUser.Id,
}
th1.App.CreatePost(p2, gmChannel, false)
th1.App.CreatePost(p2, gmChannel, false, true)
posts, err := th1.App.Srv().Store.Post().GetDirectPostParentsForExportAfter(1000, "0000000")
require.Nil(t, err)