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>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
6939623e11
Коммит
64677dd554
@@ -878,8 +878,11 @@ func (o *Post) ForPlugin() *Post {
|
||||
}
|
||||
|
||||
func (o *Post) GetPreviewPost() *PreviewPost {
|
||||
if o.Metadata == nil {
|
||||
return nil
|
||||
}
|
||||
for _, embed := range o.Metadata.Embeds {
|
||||
if embed.Type == PostEmbedPermalink {
|
||||
if embed != nil && embed.Type == PostEmbedPermalink {
|
||||
if previewPost, ok := embed.Data.(*PreviewPost); ok {
|
||||
return previewPost
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user