summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mattermost/mattermost-server/v6/model/websocket_message.go
diff options
context:
space:
mode:
authordependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2022-01-18 20:24:14 +0100
committerGitHub <noreply@github.com>2022-01-18 20:24:14 +0100
commitaad60c882e16cd2c8769a49e6d9f87a040590d62 (patch)
tree3bfe1f8953b40f9beb39c69db3a7647ea6de54d2 /vendor/github.com/mattermost/mattermost-server/v6/model/websocket_message.go
parentfecca575078a21dedb0cab213dde7fd97161c0fa (diff)
downloadmatterbridge-msglm-aad60c882e16cd2c8769a49e6d9f87a040590d62.tar.gz
matterbridge-msglm-aad60c882e16cd2c8769a49e6d9f87a040590d62.tar.bz2
matterbridge-msglm-aad60c882e16cd2c8769a49e6d9f87a040590d62.zip
Bump github.com/mattermost/mattermost-server/v6 from 6.1.0 to 6.3.0 (#1686)
Bumps [github.com/mattermost/mattermost-server/v6](https://github.com/mattermost/mattermost-server) from 6.1.0 to 6.3.0. - [Release notes](https://github.com/mattermost/mattermost-server/releases) - [Changelog](https://github.com/mattermost/mattermost-server/blob/master/CHANGELOG.md) - [Commits](https://github.com/mattermost/mattermost-server/compare/v6.1.0...v6.3.0) --- updated-dependencies: - dependency-name: github.com/mattermost/mattermost-server/v6 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Diffstat (limited to 'vendor/github.com/mattermost/mattermost-server/v6/model/websocket_message.go')
-rw-r--r--vendor/github.com/mattermost/mattermost-server/v6/model/websocket_message.go65
1 files changed, 65 insertions, 0 deletions
diff --git a/vendor/github.com/mattermost/mattermost-server/v6/model/websocket_message.go b/vendor/github.com/mattermost/mattermost-server/v6/model/websocket_message.go
index 005eed33..8827a001 100644
--- a/vendor/github.com/mattermost/mattermost-server/v6/model/websocket_message.go
+++ b/vendor/github.com/mattermost/mattermost-server/v6/model/websocket_message.go
@@ -90,12 +90,58 @@ type WebsocketBroadcast struct {
ContainsSensitiveData bool `json:"-"`
}
+func (wb *WebsocketBroadcast) copy() *WebsocketBroadcast {
+ if wb == nil {
+ return nil
+ }
+
+ var c WebsocketBroadcast
+ if wb.OmitUsers != nil {
+ c.OmitUsers = make(map[string]bool, len(wb.OmitUsers))
+ for k, v := range wb.OmitUsers {
+ c.OmitUsers[k] = v
+ }
+ }
+ c.UserId = wb.UserId
+ c.ChannelId = wb.ChannelId
+ c.TeamId = wb.TeamId
+ c.ContainsSanitizedData = wb.ContainsSanitizedData
+ c.ContainsSensitiveData = wb.ContainsSensitiveData
+
+ return &c
+}
+
type precomputedWebSocketEventJSON struct {
Event json.RawMessage
Data json.RawMessage
Broadcast json.RawMessage
}
+func (p *precomputedWebSocketEventJSON) copy() *precomputedWebSocketEventJSON {
+ if p == nil {
+ return nil
+ }
+
+ var c precomputedWebSocketEventJSON
+
+ if p.Event != nil {
+ c.Event = make([]byte, len(p.Event))
+ copy(c.Event, p.Event)
+ }
+
+ if p.Data != nil {
+ c.Data = make([]byte, len(p.Data))
+ copy(c.Data, p.Data)
+ }
+
+ if p.Broadcast != nil {
+ c.Broadcast = make([]byte, len(p.Broadcast))
+ copy(c.Broadcast, p.Broadcast)
+ }
+
+ return &c
+}
+
// webSocketEventJSON mirrors WebSocketEvent to make some of its unexported fields serializable
type webSocketEventJSON struct {
Event string `json:"event"`
@@ -154,6 +200,25 @@ func (ev *WebSocketEvent) Copy() *WebSocketEvent {
return copy
}
+func (ev *WebSocketEvent) DeepCopy() *WebSocketEvent {
+ var dataCopy map[string]interface{}
+ if ev.data != nil {
+ dataCopy = make(map[string]interface{}, len(ev.data))
+ for k, v := range ev.data {
+ dataCopy[k] = v
+ }
+ }
+
+ copy := &WebSocketEvent{
+ event: ev.event,
+ data: dataCopy,
+ broadcast: ev.broadcast.copy(),
+ sequence: ev.sequence,
+ precomputedJSON: ev.precomputedJSON.copy(),
+ }
+ return copy
+}
+
func (ev *WebSocketEvent) GetData() map[string]interface{} {
return ev.data
}