mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
Merge remote-tracking branch 'origin/errcode' into errcode
This commit is contained in:
commit
87d64c6afe
@ -55,10 +55,16 @@ func (m *msgServer) MarkMsgsAsRead(ctx context.Context, req *msg.MarkMsgsAsReadR
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
err = m.MsgDatabase.SetHasReadSeq(ctx, req.UserID, req.ConversationID, hasReadSeq)
|
currentHasReadSeq, err := m.MsgDatabase.GetHasReadSeq(ctx, req.UserID, req.ConversationID)
|
||||||
if err != nil {
|
if err != nil && errors.Unwrap(err) != redis.Nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if hasReadSeq > currentHasReadSeq {
|
||||||
|
err = m.MsgDatabase.SetHasReadSeq(ctx, req.UserID, req.ConversationID, hasReadSeq)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
if err = m.sendMarkAsReadNotification(ctx, req.ConversationID, conversations[0].ConversationType, req.UserID, m.conversationAndGetRecvID(conversations[0], req.UserID), req.Seqs, hasReadSeq); err != nil {
|
if err = m.sendMarkAsReadNotification(ctx, req.ConversationID, conversations[0].ConversationType, req.UserID, m.conversationAndGetRecvID(conversations[0], req.UserID), req.Seqs, hasReadSeq); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -78,15 +78,15 @@ func (m *msgServer) messageVerification(ctx context.Context, data *msg.SendMsgRe
|
|||||||
}
|
}
|
||||||
if data.MsgData.ContentType <= constant.NotificationEnd && data.MsgData.ContentType >= constant.NotificationBegin {
|
if data.MsgData.ContentType <= constant.NotificationEnd && data.MsgData.ContentType >= constant.NotificationBegin {
|
||||||
return nil
|
return nil
|
||||||
} else {
|
|
||||||
memberIDs, err := m.GroupLocalCache.GetGroupMemberIDs(ctx, data.MsgData.GroupID)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if !utils.IsContain(data.MsgData.SendID, memberIDs) {
|
|
||||||
return errs.ErrNotInGroupYet.Wrap()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// memberIDs, err := m.GroupLocalCache.GetGroupMemberIDs(ctx, data.MsgData.GroupID)
|
||||||
|
// if err != nil {
|
||||||
|
// return err
|
||||||
|
// }
|
||||||
|
// if !utils.IsContain(data.MsgData.SendID, memberIDs) {
|
||||||
|
// return errs.ErrNotInGroupYet.Wrap()
|
||||||
|
// }
|
||||||
|
|
||||||
groupMemberInfo, err := m.Group.GetGroupMemberCache(ctx, data.MsgData.GroupID, data.MsgData.SendID)
|
groupMemberInfo, err := m.Group.GetGroupMemberCache(ctx, data.MsgData.GroupID, data.MsgData.SendID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -241,15 +241,15 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var ContentType2PushContent = map[int64]string{
|
var ContentType2PushContent = map[int64]string{
|
||||||
Picture: "[图片]",
|
Picture: "[PICTURE]",
|
||||||
Voice: "[语音]",
|
Voice: "[VOICE]",
|
||||||
Video: "[视频]",
|
Video: "[VIDEO]",
|
||||||
File: "[文件]",
|
File: "[File]",
|
||||||
Text: "你收到了一条文本消息",
|
Text: "[TEXT]",
|
||||||
AtText: "[有人@你]",
|
AtText: "[@TEXT]",
|
||||||
GroupMsg: "你收到一条群聊消息",
|
GroupMsg: "[GROUPMSG]]",
|
||||||
Common: "你收到一条新消息",
|
Common: "[NEWMSG]",
|
||||||
SignalMsg: "音视频通话邀请",
|
SignalMsg: "[SIGNALINVITE]",
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user