You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Open-IM-Server/pkg/utils/callback.go

19 lines
427 B

2 years ago
package utils
2 years ago
import (
2 years ago
"OpenIM/pkg/common/constant"
sdkws "OpenIM/pkg/proto/sdkws"
2 years ago
"github.com/golang/protobuf/proto"
)
2 years ago
func GetContent(msg *sdkws.MsgData) string {
2 years ago
if msg.ContentType >= constant.NotificationBegin && msg.ContentType <= constant.NotificationEnd {
2 years ago
var tips sdkws.TipsComm
2 years ago
_ = proto.Unmarshal(msg.Content, &tips)
content := tips.JsonDetail
2 years ago
return content
} else {
return string(msg.Content)
}
}