fix: online notifications do not push to herself. (#1534)

* fix: online notifications do not push to herself.

* fix: online notifications do not push to herself.

* fix: online notifications do not push to herself.
pull/1601/head
Gordon 1 year ago committed by GitHub
parent 11a147792d
commit de451d4cea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -67,13 +67,14 @@ func (c *ConsumerHandler) handleMs2PsChat(ctx context.Context, msg []byte) {
case constant.SuperGroupChatType:
err = c.pusher.Push2SuperGroup(ctx, pbData.MsgData.GroupID, pbData.MsgData)
default:
var pushUserIDs []string
if pbData.MsgData.SendID != pbData.MsgData.RecvID {
pushUserIDs = []string{pbData.MsgData.SendID, pbData.MsgData.RecvID}
var pushUserIDList []string
isSenderSync := utils.GetSwitchFromOptions(pbData.MsgData.Options, constant.IsSenderSync)
if !isSenderSync || pbData.MsgData.SendID == pbData.MsgData.RecvID {
pushUserIDList = append(pushUserIDList, pbData.MsgData.RecvID)
} else {
pushUserIDs = []string{pbData.MsgData.SendID}
pushUserIDList = append(pushUserIDList, pbData.MsgData.RecvID, pbData.MsgData.SendID)
}
err = c.pusher.Push2User(ctx, pushUserIDs, pbData.MsgData)
err = c.pusher.Push2User(ctx, pushUserIDList, pbData.MsgData)
}
if err != nil {
if err == errNoOfflinePusher {

@ -16,9 +16,8 @@ package push
import (
"context"
"sync"
"github.com/OpenIMSDK/tools/utils"
"sync"
"google.golang.org/grpc"

Loading…
Cancel
Save