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

19 lines
429 B
Go
Raw Normal View History

2023-01-30 16:55:44 +08:00
package utils
2022-08-04 14:21:03 +08:00
import (
"Open_IM/pkg/common/constant"
2023-02-09 20:36:34 +08:00
sdkws "Open_IM/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)
}
}