Skip to content

Commit

Permalink
fix: online notifications do not push to herself.
Browse files Browse the repository at this point in the history
  • Loading branch information
FGadvancer committed Dec 8, 2023
1 parent d65a078 commit 306087f
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions internal/msggateway/message_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package msggateway

import (
"context"
"github.com/OpenIMSDK/protocol/msg"
"sync"

"github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics"
Expand Down Expand Up @@ -139,23 +140,23 @@ func (g GrpcHandler) GetSeq(context context.Context, data *Req) ([]byte, error)
func (g GrpcHandler) SendMessage(context context.Context, data *Req) ([]byte, error) {
prommetrics.GateWaySendMsgTotalCounter.Inc()
//log.ZWarn(context, "SendMessage for statistic", nil, "operationID", data.OperationID)
//msgData := sdkws.MsgData{}
//if err := proto.Unmarshal(data.Data, &msgData); err != nil {
// return nil, err
//}
//if err := g.validate.Struct(&msgData); err != nil {
// return nil, err
//}
//req := msg.SendMsgReq{MsgData: &msgData}
//resp, err := g.msgRpcClient.SendMsg(context, &req)
//if err != nil {
// return nil, err
//}
//c, err := proto.Marshal(resp)
//if err != nil {
// return nil, err
//}
return nil, nil
msgData := sdkws.MsgData{}
if err := proto.Unmarshal(data.Data, &msgData); err != nil {
return nil, err
}
if err := g.validate.Struct(&msgData); err != nil {
return nil, err
}
req := msg.SendMsgReq{MsgData: &msgData}
resp, err := g.msgRpcClient.SendMsg(context, &req)
if err != nil {
return nil, err
}
c, err := proto.Marshal(resp)
if err != nil {
return nil, err
}
return c, nil
}

func (g GrpcHandler) SendSignalMessage(context context.Context, data *Req) ([]byte, error) {
Expand Down

0 comments on commit 306087f

Please sign in to comment.