mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-11 23:47:32 +08:00
revert changes.
This commit is contained in:
parent
ae54b7a9ce
commit
e321e5d47e
@ -146,8 +146,7 @@ func (m *msgServer) MarkConversationAsRead(ctx context.Context, req *msg.MarkCon
|
|||||||
var seqs []int64
|
var seqs []int64
|
||||||
|
|
||||||
log.ZDebug(ctx, "MarkConversationAsRead", "hasReadSeq", hasReadSeq, "req.HasReadSeq", req.HasReadSeq)
|
log.ZDebug(ctx, "MarkConversationAsRead", "hasReadSeq", hasReadSeq, "req.HasReadSeq", req.HasReadSeq)
|
||||||
switch conversation.ConversationType {
|
if conversation.ConversationType == constant.SingleChatType {
|
||||||
case constant.SingleChatType:
|
|
||||||
for i := hasReadSeq + 1; i <= req.HasReadSeq; i++ {
|
for i := hasReadSeq + 1; i <= req.HasReadSeq; i++ {
|
||||||
seqs = append(seqs, i)
|
seqs = append(seqs, i)
|
||||||
}
|
}
|
||||||
@ -172,7 +171,8 @@ func (m *msgServer) MarkConversationAsRead(ctx context.Context, req *msg.MarkCon
|
|||||||
}
|
}
|
||||||
m.sendMarkAsReadNotification(ctx, req.ConversationID, conversation.ConversationType, req.UserID,
|
m.sendMarkAsReadNotification(ctx, req.ConversationID, conversation.ConversationType, req.UserID,
|
||||||
m.conversationAndGetRecvID(conversation, req.UserID), seqs, hasReadSeq)
|
m.conversationAndGetRecvID(conversation, req.UserID), seqs, hasReadSeq)
|
||||||
case constant.ReadGroupChatType, constant.NotificationChatType:
|
} else if conversation.ConversationType == constant.ReadGroupChatType ||
|
||||||
|
conversation.ConversationType == constant.NotificationChatType {
|
||||||
if req.HasReadSeq > hasReadSeq {
|
if req.HasReadSeq > hasReadSeq {
|
||||||
err = m.MsgDatabase.SetHasReadSeq(ctx, req.UserID, req.ConversationID, req.HasReadSeq)
|
err = m.MsgDatabase.SetHasReadSeq(ctx, req.UserID, req.ConversationID, req.HasReadSeq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -184,8 +184,7 @@ func (m *msgServer) MarkConversationAsRead(ctx context.Context, req *msg.MarkCon
|
|||||||
req.UserID, seqs, hasReadSeq)
|
req.UserID, seqs, hasReadSeq)
|
||||||
}
|
}
|
||||||
|
|
||||||
switch conversation.ConversationType {
|
if conversation.ConversationType == constant.SingleChatType {
|
||||||
case constant.SingleChatType:
|
|
||||||
reqCall := &cbapi.CallbackSingleMsgReadReq{
|
reqCall := &cbapi.CallbackSingleMsgReadReq{
|
||||||
ConversationID: conversation.ConversationID,
|
ConversationID: conversation.ConversationID,
|
||||||
UserID: conversation.OwnerUserID,
|
UserID: conversation.OwnerUserID,
|
||||||
@ -193,7 +192,7 @@ func (m *msgServer) MarkConversationAsRead(ctx context.Context, req *msg.MarkCon
|
|||||||
ContentType: conversation.ConversationType,
|
ContentType: conversation.ConversationType,
|
||||||
}
|
}
|
||||||
m.webhookAfterSingleMsgRead(ctx, &m.config.WebhooksConfig.AfterSingleMsgRead, reqCall)
|
m.webhookAfterSingleMsgRead(ctx, &m.config.WebhooksConfig.AfterSingleMsgRead, reqCall)
|
||||||
case constant.ReadGroupChatType:
|
} else if conversation.ConversationType == constant.ReadGroupChatType {
|
||||||
reqCall := &cbapi.CallbackGroupMsgReadReq{
|
reqCall := &cbapi.CallbackGroupMsgReadReq{
|
||||||
SendID: conversation.OwnerUserID,
|
SendID: conversation.OwnerUserID,
|
||||||
ReceiveID: req.UserID,
|
ReceiveID: req.UserID,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user