MCPcopy
hub / github.com/openimsdk/open-im-server / GetContent

Function GetContent

internal/push/callback.go:139–149  ·  view source on GitHub ↗
(msg *sdkws.MsgData)

Source from the content-addressed store, hash-verified

137}
138
139func GetContent(msg *sdkws.MsgData) string {
140 if msg.ContentType >= constant.NotificationBegin && msg.ContentType <= constant.NotificationEnd {
141 var notification sdkws.NotificationElem
142 if err := json.Unmarshal(msg.Content, &notification); err != nil {
143 return ""
144 }
145 return notification.Detail
146 } else {
147 return string(msg.Content)
148 }
149}

Callers 3

Calls 1

UnmarshalMethod · 0.80

Tested by

no test coverage detected