This commit is contained in:
wangchuxiao
2023-05-23 10:38:43 +08:00
parent 02f8003b4d
commit 219d57528b
3 changed files with 23 additions and 177 deletions
+1 -23
View File
@@ -5,7 +5,6 @@ import (
"strconv"
"strings"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant"
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
)
@@ -51,17 +50,7 @@ func (MsgDocModel) GetSingleGocMsgNum() int64 {
}
func (m *MsgDocModel) IsFull() bool {
index, _ := strconv.Atoi(strings.Split(m.DocID, ":")[1])
if index == 0 {
if len(m.Msg) >= singleGocMsgNum-1 {
return true
}
}
if len(m.Msg) >= singleGocMsgNum {
return true
}
return false
return m.Msg[len(m.Msg)-1].SendTime != 0
}
func (m MsgDocModel) GetDocID(conversationID string, seq int64) string {
@@ -127,14 +116,3 @@ func (MsgDocModel) GenExceptionMessageBySeqs(seqs []int64) (exceptionMsg []*sdkw
}
return exceptionMsg
}
func (MsgDocModel) GenExceptionSuperGroupMessageBySeqs(seqs []int64, groupID string) (exceptionMsg []*sdkws.MsgData) {
for _, v := range seqs {
msg := new(sdkws.MsgData)
msg.Seq = v
msg.GroupID = groupID
msg.SessionType = constant.SuperGroupChatType
exceptionMsg = append(exceptionMsg, msg)
}
return exceptionMsg
}