Merge branch 'v2.3.0release' of https://github.com/OpenIMSDK/Open-IM-Server into v2.3.0release

pull/351/head
wangchuxiao 2 years ago
commit 0ebaefb8be

@ -50,6 +50,8 @@ func newUserSendMsgReq(params *api.ManagementSendMsgReq) *pbChat.SendMsgReq {
case constant.Video:
fallthrough
case constant.File:
fallthrough
case constant.AdvancedRevoke:
newContent = utils.StructToJsonString(params.Content)
case constant.Revoke:
newContent = params.Content["revokeMsgClientID"].(string)
@ -145,6 +147,8 @@ func ManagementSendMsg(c *gin.Context) {
data = CustomElem{}
case constant.Revoke:
data = RevokeElem{}
case constant.AdvancedRevoke:
data = MessageRevoked{}
case constant.OANotification:
data = OANotificationElem{}
params.SessionType = constant.NotificationChatType
@ -189,7 +193,7 @@ func ManagementSendMsg(c *gin.Context) {
c.JSON(http.StatusBadRequest, gin.H{"errCode": 405, "errMsg": "recvID is a null string", "sendTime": 0, "MsgID": ""})
return
}
case constant.GroupChatType:
case constant.GroupChatType, constant.SuperGroupChatType:
if len(params.GroupID) == 0 {
log.NewError(params.OperationID, "groupID is a null string")
c.JSON(http.StatusBadRequest, gin.H{"errCode": 405, "errMsg": "groupID is a null string", "sendTime": 0, "MsgID": ""})
@ -473,3 +477,10 @@ type OANotificationElem struct {
FileElem FileElem `mapstructure:"fileElem" json:"fileElem"`
Ex string `mapstructure:"ex" json:"ex"`
}
type MessageRevoked struct {
RevokerID string `mapstructure:"notificationName" json:"revokerID" validate:"required"`
RevokerRole int32 `mapstructure:"notificationName" json:"revokerRole" validate:"required"`
ClientMsgID string `mapstructure:"notificationName" json:"clientMsgID" validate:"required"`
RevokerNickname string `mapstructure:"notificationName" json:"revokerNickname"`
SessionType int32 `mapstructure:"notificationName" json:"sessionType" validate:"required"`
}

@ -133,7 +133,7 @@ func (g *Getui) Push(userIDList []string, alert, detailContent, operationID stri
}
pushReq.PushMessage.Notification = Notification{
Title: alert,
Body: alert,
Body: detailContent,
ClickType: "startapp",
}
pushReq.PushChannel.Ios.Aps.Sound = "default"

@ -94,6 +94,7 @@ func MsgToUser(pushMsg *pbPush.PushMsgReq) {
var content string
if pushMsg.MsgData.OfflinePushInfo != nil {
content = pushMsg.MsgData.OfflinePushInfo.Title
jsonCustomContent = pushMsg.MsgData.OfflinePushInfo.Desc
} else {
switch pushMsg.MsgData.ContentType {
@ -225,6 +226,7 @@ func MsgToSuperGroupUser(pushMsg *pbPush.PushMsgReq) {
var content string
if pushMsg.MsgData.OfflinePushInfo != nil {
content = pushMsg.MsgData.OfflinePushInfo.Title
jsonCustomContent = pushMsg.MsgData.OfflinePushInfo.Desc
} else {
switch pushMsg.MsgData.ContentType {

Loading…
Cancel
Save