2023-01-30 16:55:44 +08:00
|
|
|
package utils
|
2022-08-04 14:21:03 +08:00
|
|
|
|
|
|
|
|
import (
|
2023-03-16 10:46:06 +08:00
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant"
|
|
|
|
|
sdkws "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
|
2022-08-04 14:21:03 +08:00
|
|
|
"github.com/golang/protobuf/proto"
|
|
|
|
|
)
|
|
|
|
|
|
2023-02-09 20:36:34 +08:00
|
|
|
func GetContent(msg *sdkws.MsgData) string {
|
2022-08-04 14:21:03 +08:00
|
|
|
if msg.ContentType >= constant.NotificationBegin && msg.ContentType <= constant.NotificationEnd {
|
2023-02-09 20:36:34 +08:00
|
|
|
var tips sdkws.TipsComm
|
2022-08-04 14:21:03 +08:00
|
|
|
_ = proto.Unmarshal(msg.Content, &tips)
|
2022-08-04 16:27:39 +08:00
|
|
|
content := tips.JsonDetail
|
2022-08-04 14:21:03 +08:00
|
|
|
return content
|
|
|
|
|
} else {
|
|
|
|
|
return string(msg.Content)
|
|
|
|
|
}
|
|
|
|
|
}
|