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 11 months 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: case constant.SuperGroupChatType:
err = c.pusher.Push2SuperGroup(ctx, pbData.MsgData.GroupID, pbData.MsgData) err = c.pusher.Push2SuperGroup(ctx, pbData.MsgData.GroupID, pbData.MsgData)
default: default:
var pushUserIDs []string var pushUserIDList []string
if pbData.MsgData.SendID != pbData.MsgData.RecvID { isSenderSync := utils.GetSwitchFromOptions(pbData.MsgData.Options, constant.IsSenderSync)
pushUserIDs = []string{pbData.MsgData.SendID, pbData.MsgData.RecvID} if !isSenderSync || pbData.MsgData.SendID == pbData.MsgData.RecvID {
pushUserIDList = append(pushUserIDList, pbData.MsgData.RecvID)
} else { } 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 != nil {
if err == errNoOfflinePusher { if err == errNoOfflinePusher {

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

Loading…
Cancel
Save