mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-04-28 14:29:19 +08:00
feat: add a new message type: Markdown text (#3162)
This commit is contained in:
@@ -21,6 +21,7 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/go-playground/validator/v10"
|
||||
"github.com/mitchellh/mapstructure"
|
||||
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/apistruct"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/authverify"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
|
||||
@@ -175,6 +176,8 @@ func (m *MessageApi) getSendMsgReq(c *gin.Context, req apistruct.SendMsg) (sendM
|
||||
data = apistruct.AtElem{}
|
||||
case constant.Custom:
|
||||
data = apistruct.CustomElem{}
|
||||
case constant.MarkdownText:
|
||||
data = apistruct.MarkdownTextElem{}
|
||||
case constant.OANotification:
|
||||
data = apistruct.OANotificationElem{}
|
||||
req.SessionType = constant.NotificationChatType
|
||||
|
||||
@@ -16,13 +16,14 @@ package msg
|
||||
|
||||
import (
|
||||
"context"
|
||||
"math/rand"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/servererrs"
|
||||
"github.com/openimsdk/tools/utils/datautil"
|
||||
"github.com/openimsdk/tools/utils/encrypt"
|
||||
"github.com/openimsdk/tools/utils/timeutil"
|
||||
"math/rand"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/openimsdk/protocol/constant"
|
||||
"github.com/openimsdk/protocol/msg"
|
||||
@@ -137,27 +138,9 @@ func (m *msgServer) encapsulateMsgData(msg *sdkws.MsgData) {
|
||||
msg.SendTime = timeutil.GetCurrentTimestampByMill()
|
||||
}
|
||||
switch msg.ContentType {
|
||||
case constant.Text:
|
||||
fallthrough
|
||||
case constant.Picture:
|
||||
fallthrough
|
||||
case constant.Voice:
|
||||
fallthrough
|
||||
case constant.Video:
|
||||
fallthrough
|
||||
case constant.File:
|
||||
fallthrough
|
||||
case constant.AtText:
|
||||
fallthrough
|
||||
case constant.Merger:
|
||||
fallthrough
|
||||
case constant.Card:
|
||||
fallthrough
|
||||
case constant.Location:
|
||||
fallthrough
|
||||
case constant.Custom:
|
||||
fallthrough
|
||||
case constant.Quote:
|
||||
case constant.Text, constant.Picture, constant.Voice, constant.Video,
|
||||
constant.File, constant.AtText, constant.Merger, constant.Card,
|
||||
constant.Location, constant.Custom, constant.Quote, constant.AdvancedText, constant.MarkdownText:
|
||||
case constant.Revoke:
|
||||
datautil.SetSwitchFromOptions(msg.Options, constant.IsUnreadCount, false)
|
||||
datautil.SetSwitchFromOptions(msg.Options, constant.IsOfflinePush, false)
|
||||
|
||||
Reference in New Issue
Block a user