MM-42810: Using websocket broadcast hook for permalink preview (#28627)

We use the newly introduced websocket broadcast hook system
to implement permalink preview efficiently. This is essentially
a re-do of https://github.com/mattermost/mattermost/pull/23812
using the new system.

https://mattermost.atlassian.net/browse/MM-42810
```release-note
NONE
```

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Agniva De Sarker
2024-10-21 09:35:32 +05:30
коммит произвёл GitHub
родитель 6939623e11
Коммит 64677dd554
11 изменённых файлов: 226 добавлений и 126 удалений

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

@@ -1593,12 +1593,12 @@ func TestUpdatePost(t *testing.T) {
testPost, err = th.App.CreatePost(th.Context, testPost, channelForTestPost, false, false)
require.Nil(t, err)
assert.Equal(t, testPost.GetProps(), model.StringInterface{})
assert.Equal(t, model.StringInterface{}, testPost.GetProps())
testPost.Message = permalink
testPost, err = th.App.UpdatePost(th.Context, testPost, false)
require.Nil(t, err)
assert.Equal(t, testPost.GetProps(), model.StringInterface{"previewed_post": referencedPost.Id})
assert.Equal(t, model.StringInterface{model.PostPropsPreviewedPost: referencedPost.Id}, testPost.GetProps())
})
t.Run("sanitizes post metadata appropriately", func(t *testing.T) {