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 }