Files
open-im-server/pkg/utils/callback.go
T

20 lines
486 B
Go
Raw Normal View History

2023-06-30 09:45:02 +08:00
package utils
import (
2023-07-03 16:29:22 +08:00
"google.golang.org/protobuf/proto"
2023-06-30 09:45:02 +08:00
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant"
sdkws "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
)
func GetContent(msg *sdkws.MsgData) string {
if msg.ContentType >= constant.NotificationBegin && msg.ContentType <= constant.NotificationEnd {
var tips sdkws.TipsComm
_ = proto.Unmarshal(msg.Content, &tips)
content := tips.JsonDetail
return content
} else {
return string(msg.Content)
}
}