From 01adec60035201bcd2611f22afad2671230cfe4a Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Fri, 29 Jul 2022 19:08:56 +0800 Subject: [PATCH] fix bug --- internal/push/logic/push_handler.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/internal/push/logic/push_handler.go b/internal/push/logic/push_handler.go index 950841313..65f59a9f0 100644 --- a/internal/push/logic/push_handler.go +++ b/internal/push/logic/push_handler.go @@ -8,6 +8,7 @@ package logic import ( "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" kfk "Open_IM/pkg/common/kafka" "Open_IM/pkg/common/log" pbChat "Open_IM/pkg/proto/msg" @@ -37,8 +38,19 @@ func (ms *PushConsumerHandler) handleMs2PsChat(msg []byte) { log.ErrorByKv("push Unmarshal msg err", "", "msg", string(msg), "err", err.Error()) return } + pbData := &pbPush.PushMsgReq{ + OperationID: msgFromMQ.OperationID, + MsgData: msgFromMQ.MsgData, + PushToUserID: msgFromMQ.PushToUserID, + } + switch msgFromMQ.MsgData.SessionType { + case constant.SuperGroupChatType: + MsgToSuperGroupUser(pbData) + default: + MsgToUser(pbData) + } //Call push module to send message to the user - MsgToUser((*pbPush.PushMsgReq)(&msgFromMQ)) + //MsgToUser((*pbPush.PushMsgReq)(&msgFromMQ)) } func (PushConsumerHandler) Setup(_ sarama.ConsumerGroupSession) error { return nil } func (PushConsumerHandler) Cleanup(_ sarama.ConsumerGroupSession) error { return nil }