diff --git a/cmd/open_im_api/main.go b/cmd/open_im_api/main.go index dc217c752..c99094c83 100644 --- a/cmd/open_im_api/main.go +++ b/cmd/open_im_api/main.go @@ -163,6 +163,11 @@ func main() { chatGroup.POST("/batch_send_msg", manage.ManagementBatchSendMsg) chatGroup.POST("/check_msg_is_send_success", manage.CheckMsgIsSendSuccess) chatGroup.POST("/set_msg_min_seq", apiChat.SetMsgMinSeq) + + chatGroup.POST("/set_message_reaction_extensions", apiChat.SetMessageReactionExtensions) + chatGroup.POST("/get_message_list_reaction_extensions", apiChat.GetMessageListReactionExtensions) + chatGroup.POST("/add_message_reaction_extensions", apiChat.AddMessageReactionExtensions) + chatGroup.POST("/delete_message_reaction_extensions", apiChat.DeleteMessageReactionExtensions) } //Conversation conversationGroup := r.Group("/conversation") diff --git a/config/config.yaml b/config/config.yaml index 474832f34..61aadf2b3 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -62,12 +62,15 @@ kafka: ms2pschat: addr: [ 127.0.0.1:9092 ] #kafka配置,默认即可 topic: "ms2ps_chat" #消息push + msgtomodify: + addr: [ 127.0.0.1:9092 ] #kafka配置,默认即可 + topic: "msg_to_modify" consumergroupid: msgToTransfer: mongo msgToMongo: mongo_ex msgToMySql: mysql msgToPush: push - + msgToModify: modify #---------------Internal service configuration---------------------# @@ -349,6 +352,11 @@ callback: enable: false callbackTimeOut: 2 callbackFailedContinue: true # 回调超时是否继续 + callbackSetMessageReactionExtensions: + enable: false + callbackTimeOut: 2 + callbackFailedContinue: true # 回调超时是否继续 + notification: groupCreated: diff --git a/internal/api/msg/extend_msg.go b/internal/api/msg/extend_msg.go new file mode 100644 index 000000000..b6920825d --- /dev/null +++ b/internal/api/msg/extend_msg.go @@ -0,0 +1,203 @@ +package msg + +import ( + api "Open_IM/pkg/base_info" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + rpc "Open_IM/pkg/proto/msg" + "Open_IM/pkg/utils" + "context" + "github.com/gin-gonic/gin" + "net/http" + "strings" +) + +func SetMessageReactionExtensions(c *gin.Context) { + var ( + req api.SetMessageReactionExtensionsCallbackReq + resp api.SetMessageReactionExtensionsCallbackResp + reqPb rpc.SetMessageReactionExtensionsReq + ) + + if err := c.BindJSON(&req); err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req:", req) + + if err := utils.CopyStructFields(&reqPb, &req); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields", err.Error()) + } + var ok bool + var errInfo string + ok, reqPb.OpUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + + grpcConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMsgName, req.OperationID) + if grpcConn == nil { + errMsg := req.OperationID + " getcdv3.GetDefaultConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + msgClient := rpc.NewMsgClient(grpcConn) + respPb, err := msgClient.SetMessageReactionExtensions(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "DelMsgList failed", err.Error(), reqPb) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": constant.ErrServer.ErrCode, "errMsg": constant.ErrServer.ErrMsg + err.Error()}) + return + } + resp.ErrCode = respPb.ErrCode + resp.ErrMsg = respPb.ErrMsg + resp.Data.ResultKeyValue = respPb.Result + resp.Data.MsgFirstModifyTime = reqPb.MsgFirstModifyTime + resp.Data.IsReact = reqPb.IsReact + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), resp) + c.JSON(http.StatusOK, resp) + +} + +func GetMessageListReactionExtensions(c *gin.Context) { + var ( + req api.GetMessageListReactionExtensionsReq + resp api.GetMessageListReactionExtensionsResp + reqPb rpc.GetMessageListReactionExtensionsReq + ) + if err := c.BindJSON(&req); err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req:", req) + + if err := utils.CopyStructFields(&reqPb, &req); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields", err.Error()) + } + var ok bool + var errInfo string + ok, reqPb.OpUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + + grpcConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMsgName, req.OperationID) + if grpcConn == nil { + errMsg := req.OperationID + " getcdv3.GetDefaultConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + msgClient := rpc.NewMsgClient(grpcConn) + respPb, err := msgClient.GetMessageListReactionExtensions(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "DelMsgList failed", err.Error(), reqPb) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": constant.ErrServer.ErrCode, "errMsg": constant.ErrServer.ErrMsg + err.Error()}) + return + } + resp.ErrCode = respPb.ErrCode + resp.ErrMsg = respPb.ErrMsg + resp.Data = respPb.SingleMessageResult + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), resp) + c.JSON(http.StatusOK, resp) +} + +func AddMessageReactionExtensions(c *gin.Context) { + var ( + req api.AddMessageReactionExtensionsReq + resp api.AddMessageReactionExtensionsResp + reqPb rpc.ModifyMessageReactionExtensionsReq + ) + if err := c.BindJSON(&req); err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req:", req) + + if err := utils.CopyStructFields(&reqPb, &req); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields", err.Error()) + } + var ok bool + var errInfo string + ok, reqPb.OpUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + + grpcConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMsgName, req.OperationID) + if grpcConn == nil { + errMsg := req.OperationID + " getcdv3.GetDefaultConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + msgClient := rpc.NewMsgClient(grpcConn) + respPb, err := msgClient.AddMessageReactionExtensions(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "DelMsgList failed", err.Error(), reqPb) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": constant.ErrServer.ErrCode, "errMsg": constant.ErrServer.ErrMsg + err.Error()}) + return + } + resp.ErrCode = respPb.ErrCode + resp.ErrMsg = respPb.ErrMsg + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), resp) + c.JSON(http.StatusOK, resp) +} + +func DeleteMessageReactionExtensions(c *gin.Context) { + var ( + req api.DeleteMessageReactionExtensionsReq + resp api.DeleteMessageReactionExtensionsResp + reqPb rpc.DeleteMessageListReactionExtensionsReq + ) + if err := c.BindJSON(&req); err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req:", req) + + if err := utils.CopyStructFields(&reqPb, &req); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields", err.Error()) + } + var ok bool + var errInfo string + ok, reqPb.OpUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + + grpcConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMsgName, req.OperationID) + if grpcConn == nil { + errMsg := req.OperationID + " getcdv3.GetDefaultConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + msgClient := rpc.NewMsgClient(grpcConn) + respPb, err := msgClient.DeleteMessageReactionExtensions(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "DelMsgList failed", err.Error(), reqPb) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": constant.ErrServer.ErrCode, "errMsg": constant.ErrServer.ErrMsg + err.Error()}) + return + } + resp.ErrCode = respPb.ErrCode + resp.ErrMsg = respPb.ErrMsg + resp.Data = respPb.Result + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), resp) + c.JSON(http.StatusOK, resp) +} diff --git a/internal/msg_transfer/logic/init.go b/internal/msg_transfer/logic/init.go index 201c6ee41..ebe0d1aa9 100644 --- a/internal/msg_transfer/logic/init.go +++ b/internal/msg_transfer/logic/init.go @@ -22,7 +22,9 @@ var ( persistentCH PersistentConsumerHandler historyCH OnlineHistoryRedisConsumerHandler historyMongoCH OnlineHistoryMongoConsumerHandler + modifyCH ModifyMsgConsumerHandler producer *kafka.Producer + producerToModify *kafka.Producer producerToMongo *kafka.Producer cmdCh chan Cmd2Value onlineTopicStatus int @@ -43,11 +45,13 @@ func Init() { persistentCH.Init() // ws2mschat save mysql historyCH.Init(cmdCh) // historyMongoCH.Init() + modifyCH.Init() onlineTopicStatus = OnlineTopicVacancy //offlineHistoryCH.Init(cmdCh) statistics.NewStatistics(&singleMsgSuccessCount, config.Config.ModuleName.MsgTransferName, fmt.Sprintf("%d second singleMsgCount insert to mongo", constant.StatisticsTimeInterval), constant.StatisticsTimeInterval) statistics.NewStatistics(&groupMsgCount, config.Config.ModuleName.MsgTransferName, fmt.Sprintf("%d second groupMsgCount insert to mongo", constant.StatisticsTimeInterval), constant.StatisticsTimeInterval) producer = kafka.NewKafkaProducer(config.Config.Kafka.Ms2pschat.Addr, config.Config.Kafka.Ms2pschat.Topic) + producerToModify = kafka.NewKafkaProducer(config.Config.Kafka.MsgToModify.Addr, config.Config.Kafka.MsgToModify.Topic) producerToMongo = kafka.NewKafkaProducer(config.Config.Kafka.MsgToMongo.Addr, config.Config.Kafka.MsgToMongo.Topic) } func Run(promethuesPort int) { @@ -59,6 +63,7 @@ func Run(promethuesPort int) { } go historyCH.historyConsumerGroup.RegisterHandleAndConsumer(&historyCH) go historyMongoCH.historyConsumerGroup.RegisterHandleAndConsumer(&historyMongoCH) + go modifyCH.modifyMsgConsumerGroup.RegisterHandleAndConsumer(&modifyCH) //go offlineHistoryCH.historyConsumerGroup.RegisterHandleAndConsumer(&offlineHistoryCH) go func() { err := promePkg.StartPromeSrv(promethuesPort) diff --git a/internal/msg_transfer/logic/modify_msg_handler.go b/internal/msg_transfer/logic/modify_msg_handler.go new file mode 100644 index 000000000..782c6fcc0 --- /dev/null +++ b/internal/msg_transfer/logic/modify_msg_handler.go @@ -0,0 +1,121 @@ +package logic + +import ( + "Open_IM/pkg/base_info" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + kfk "Open_IM/pkg/common/kafka" + "Open_IM/pkg/common/log" + pbMsg "Open_IM/pkg/proto/msg" + server_api_params "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "encoding/json" + "github.com/Shopify/sarama" + + "github.com/golang/protobuf/proto" +) + +type ModifyMsgConsumerHandler struct { + msgHandle map[string]fcb + modifyMsgConsumerGroup *kfk.MConsumerGroup +} + +func (mmc *ModifyMsgConsumerHandler) Init() { + mmc.msgHandle = make(map[string]fcb) + mmc.msgHandle[config.Config.Kafka.MsgToModify.Topic] = mmc.ModifyMsg + mmc.modifyMsgConsumerGroup = kfk.NewMConsumerGroup(&kfk.MConsumerGroupConfig{KafkaVersion: sarama.V2_0_0_0, + OffsetsInitial: sarama.OffsetNewest, IsReturnErr: false}, []string{config.Config.Kafka.MsgToModify.Topic}, + config.Config.Kafka.MsgToModify.Addr, config.Config.Kafka.ConsumerGroupID.MsgToModify) +} + +func (ModifyMsgConsumerHandler) Setup(_ sarama.ConsumerGroupSession) error { return nil } +func (ModifyMsgConsumerHandler) Cleanup(_ sarama.ConsumerGroupSession) error { return nil } +func (mmc *ModifyMsgConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupSession, + claim sarama.ConsumerGroupClaim) error { + for msg := range claim.Messages() { + log.NewDebug("", "kafka get info to mysql", "ModifyMsgConsumerHandler", msg.Topic, "msgPartition", msg.Partition, "msg", string(msg.Value), "key", string(msg.Key)) + if len(msg.Value) != 0 { + mmc.msgHandle[msg.Topic](msg, string(msg.Key), sess) + } else { + log.Error("", "msg get from kafka but is nil", msg.Key) + } + sess.MarkMessage(msg, "") + } + return nil +} + +func (mmc *ModifyMsgConsumerHandler) ModifyMsg(cMsg *sarama.ConsumerMessage, msgKey string, _ sarama.ConsumerGroupSession) { + log.NewInfo("msg come here ModifyMsg!!!", "", "msg", string(cMsg.Value), msgKey) + msgFromMQ := pbMsg.MsgDataToModifyByMQ{} + err := proto.Unmarshal(cMsg.Value, &msgFromMQ) + if err != nil { + log.NewError(msgFromMQ.TriggerID, "msg_transfer Unmarshal msg err", "msg", string(cMsg.Value), "err", err.Error()) + return + } + log.Debug(msgFromMQ.TriggerID, "proto.Unmarshal MsgDataToMQ", msgFromMQ.String()) + for _, msgDataToMQ := range msgFromMQ.MessageList { + isReactionFromCache := utils.GetSwitchFromOptions(msgDataToMQ.MsgData.Options, constant.IsReactionFromCache) + if !isReactionFromCache { + continue + } + if msgDataToMQ.MsgData.ContentType == constant.ReactionMessageModifier { + notification := &base_info.ReactionMessageModifierNotification{} + if err := json.Unmarshal(msgDataToMQ.MsgData.Content, notification); err != nil { + continue + } + if notification.IsExternalExtensions { + log.NewInfo(msgDataToMQ.OperationID, "msg:", notification, "this is external extensions") + continue + } + if !notification.IsReact { + // first time to modify + var reactionExtensionList = make(map[string]db.KeyValue) + extendMsg := db.ExtendMsg{ + ReactionExtensionList: reactionExtensionList, + ClientMsgID: notification.ClientMsgID, + MsgFirstModifyTime: notification.MsgFirstModifyTime, + } + for _, v := range notification.SuccessReactionExtensionList { + reactionExtensionList[v.TypeKey] = db.KeyValue{ + TypeKey: v.TypeKey, + Value: v.Value, + LatestUpdateTime: v.LatestUpdateTime, + } + } + + if err := db.DB.InsertExtendMsg(notification.SourceID, notification.SessionType, &extendMsg); err != nil { + log.NewError(msgDataToMQ.OperationID, "MsgFirstModify InsertExtendMsg failed", notification.SourceID, notification.SessionType, extendMsg, err.Error()) + continue + } + } else { + var reactionExtensionList = make(map[string]*server_api_params.KeyValue) + for _, v := range notification.SuccessReactionExtensionList { + reactionExtensionList[v.TypeKey] = &server_api_params.KeyValue{ + TypeKey: v.TypeKey, + Value: v.Value, + LatestUpdateTime: v.LatestUpdateTime, + } + } + // is already modify + if err := db.DB.InsertOrUpdateReactionExtendMsgSet(notification.SourceID, notification.SessionType, notification.ClientMsgID, notification.MsgFirstModifyTime, reactionExtensionList); err != nil { + log.NewError(msgDataToMQ.OperationID, "InsertOrUpdateReactionExtendMsgSet failed") + } + } + } else if msgDataToMQ.MsgData.ContentType == constant.ReactionMessageDeleter { + notification := &base_info.ReactionMessageDeleteNotification{} + if err := json.Unmarshal(msgDataToMQ.MsgData.Content, notification); err != nil { + continue + } + if err := db.DB.DeleteReactionExtendMsgSet(notification.SourceID, notification.SessionType, notification.ClientMsgID, notification.MsgFirstModifyTime, notification.SuccessReactionExtensionList); err != nil { + log.NewError(msgDataToMQ.OperationID, "InsertOrUpdateReactionExtendMsgSet failed") + } + } + } + +} + +func UnMarshallSetReactionMsgContent(content []byte) (notification *base_info.ReactionMessageModifierNotification, err error) { + + return notification, nil +} diff --git a/internal/msg_transfer/logic/online_history_msg_handler.go b/internal/msg_transfer/logic/online_history_msg_handler.go index 35a388e8e..af22e9259 100644 --- a/internal/msg_transfer/logic/online_history_msg_handler.go +++ b/internal/msg_transfer/logic/online_history_msg_handler.go @@ -72,6 +72,7 @@ func (och *OnlineHistoryRedisConsumerHandler) Run(channelID int) { storageMsgList := make([]*pbMsg.MsgDataToMQ, 0, 80) notStoragePushMsgList := make([]*pbMsg.MsgDataToMQ, 0, 80) log.Debug(triggerID, "msg arrived channel", "channel id", channelID, msgList, msgChannelValue.aggregationID, len(msgList)) + var modifyMsgList []*pbMsg.MsgDataToMQ for _, v := range msgList { log.Debug(triggerID, "msg come to storage center", v.String()) isHistory := utils.GetSwitchFromOptions(v.MsgData.Options, constant.IsHistory) @@ -83,11 +84,15 @@ func (och *OnlineHistoryRedisConsumerHandler) Run(channelID int) { if !(!isSenderSync && msgChannelValue.aggregationID == v.MsgData.SendID) { notStoragePushMsgList = append(notStoragePushMsgList, v) } - } + if v.MsgData.ContentType == constant.ReactionMessageModifier || v.MsgData.ContentType == constant.ReactionMessageDeleter { + modifyMsgList = append(modifyMsgList, v) + } + } + if len(modifyMsgList) > 0 { + sendMessageToModifyMQ(msgChannelValue.aggregationID, triggerID, modifyMsgList) } - //switch msgChannelValue.msg.MsgData.SessionType { //case constant.SingleChatType: //case constant.GroupChatType: @@ -107,6 +112,7 @@ func (och *OnlineHistoryRedisConsumerHandler) Run(channelID int) { singleMsgSuccessCount += uint64(len(storageMsgList)) singleMsgSuccessCountMutex.Unlock() och.SendMessageToMongoCH(msgChannelValue.aggregationID, triggerID, storageMsgList, lastSeq) + for _, v := range storageMsgList { sendMessageToPushMQ(v, msgChannelValue.aggregationID) } @@ -552,6 +558,17 @@ func sendMessageToPushMQ(message *pbMsg.MsgDataToMQ, pushToUserID string) { return } +func sendMessageToModifyMQ(aggregationID string, triggerID string, messages []*pbMsg.MsgDataToMQ) { + if len(messages) > 0 { + pid, offset, err := producerToModify.SendMessage(&pbMsg.MsgDataToModifyByMQ{AggregationID: aggregationID, MessageList: messages, TriggerID: triggerID}, aggregationID, triggerID) + if err != nil { + log.Error(triggerID, "kafka send failed", "send data", len(messages), "pid", pid, "offset", offset, "err", err.Error(), "key", aggregationID) + } else { + // log.NewWarn(m.OperationID, "sendMsgToKafka client msgID ", m.MsgData.ClientMsgID) + } + } +} + // String hashes a string to a unique hashcode. // // crc32 returns a uint32, but for our use we need diff --git a/internal/msg_transfer/logic/online_msg_to_mongo_handler.go b/internal/msg_transfer/logic/online_msg_to_mongo_handler.go index 11bc399ad..4a6362a05 100644 --- a/internal/msg_transfer/logic/online_msg_to_mongo_handler.go +++ b/internal/msg_transfer/logic/online_msg_to_mongo_handler.go @@ -61,7 +61,6 @@ func (mc *OnlineHistoryMongoConsumerHandler) handleChatWs2Mongo(cMsg *sarama.Con if unexistSeqList, err := db.DB.DelMsgBySeqList(DeleteMessageTips.UserID, DeleteMessageTips.SeqList, v.OperationID); err != nil { log.NewError(v.OperationID, utils.GetSelfFuncName(), "DelMsgBySeqList args: ", DeleteMessageTips.UserID, DeleteMessageTips.SeqList, v.OperationID, err.Error(), unexistSeqList) } - //if v.MsgData.ContentType == ? {} } } } diff --git a/internal/push/push_interface.go b/internal/push/push_interface.go index 187c2d296..4cd8bae9a 100644 --- a/internal/push/push_interface.go +++ b/internal/push/push_interface.go @@ -2,7 +2,7 @@ package push import "Open_IM/pkg/common/constant" -var PushTerminal = []int{constant.IOSPlatformID, constant.AndroidPlatformID} +var PushTerminal = []int{constant.IOSPlatformID, constant.AndroidPlatformID, constant.WebPlatformID} type OfflinePusher interface { Push(userIDList []string, title, detailContent, operationID string, opts PushOpts) (resp string, err error) diff --git a/internal/rpc/msg/callback.go b/internal/rpc/msg/callback.go index b4ae38418..5fae1e133 100644 --- a/internal/rpc/msg/callback.go +++ b/internal/rpc/msg/callback.go @@ -221,9 +221,3 @@ func callbackMsgModify(msg *pbChat.SendMsgReq) cbApi.CommonCallbackResp { log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), string(msg.MsgData.Content)) return callbackResp } - -func CallbackBeforeExtendMsgModify() cbApi.CommonCallbackResp { - callbackResp := cbApi.CommonCallbackResp{OperationID: ""} - - return callbackResp -} diff --git a/internal/rpc/msg/extend_msg.go b/internal/rpc/msg/extend_msg.go index 6cb5870b7..a7ba9ddd1 100644 --- a/internal/rpc/msg/extend_msg.go +++ b/internal/rpc/msg/extend_msg.go @@ -1 +1,424 @@ package msg + +import ( + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/log" + "Open_IM/pkg/proto/msg" + "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" + go_redis "github.com/go-redis/redis/v8" + + "time" +) + +func (rpc *rpcChat) SetMessageReactionExtensions(ctx context.Context, req *msg.SetMessageReactionExtensionsReq) (resp *msg.SetMessageReactionExtensionsResp, err error) { + log.Debug(req.OperationID, utils.GetSelfFuncName(), "rpc args is:", req.String()) + var rResp msg.SetMessageReactionExtensionsResp + rResp.ClientMsgID = req.ClientMsgID + rResp.MsgFirstModifyTime = req.MsgFirstModifyTime + callbackResp := callbackSetMessageReactionExtensions(req) + if callbackResp.ActionCode != constant.ActionAllow || callbackResp.ErrCode != 0 { + rResp.ErrCode = int32(callbackResp.ErrCode) + rResp.ErrMsg = callbackResp.ErrMsg + for _, value := range req.ReactionExtensionList { + temp := new(msg.KeyValueResp) + temp.KeyValue = value + temp.ErrMsg = callbackResp.ErrMsg + temp.ErrCode = 100 + rResp.Result = append(rResp.Result, temp) + } + return &rResp, nil + } + //if ExternalExtension + if req.IsExternalExtensions { + var isHistory bool + if req.IsReact { + isHistory = false + } else { + isHistory = true + } + rResp.MsgFirstModifyTime = callbackResp.MsgFirstModifyTime + rResp.Result = callbackResp.ResultReactionExtensionList + ExtendMessageUpdatedNotification(req.OperationID, req.OpUserID, req.SourceID, req.SessionType, req, &rResp, isHistory, false) + return &rResp, nil + } + for _, v := range callbackResp.ResultReactionExtensionList { + if v.ErrCode == 0 { + req.ReactionExtensionList[v.KeyValue.TypeKey] = v.KeyValue + } else { + delete(req.ReactionExtensionList, v.KeyValue.TypeKey) + rResp.Result = append(rResp.Result, v) + } + } + isExists, err := db.DB.JudgeMessageReactionEXISTS(req.ClientMsgID, req.SessionType) + if err != nil { + rResp.ErrCode = 100 + rResp.ErrMsg = err.Error() + for _, value := range req.ReactionExtensionList { + temp := new(msg.KeyValueResp) + temp.KeyValue = value + temp.ErrMsg = err.Error() + temp.ErrCode = 100 + rResp.Result = append(rResp.Result, temp) + } + return &rResp, nil + } + + if !isExists { + if !req.IsReact { + log.Debug(req.OperationID, "redis handle firstly", req.String()) + rResp.MsgFirstModifyTime = utils.GetCurrentTimestampByMill() + for k, v := range req.ReactionExtensionList { + err := rpc.dMessageLocker.LockMessageTypeKey(req.ClientMsgID, k) + if err != nil { + setKeyResultInfo(&rResp, 100, err.Error(), req.ClientMsgID, k, v) + continue + } + v.LatestUpdateTime = utils.GetCurrentTimestampByMill() + newerr := db.DB.SetMessageTypeKeyValue(req.ClientMsgID, req.SessionType, k, utils.StructToJsonString(v)) + if newerr != nil { + setKeyResultInfo(&rResp, 201, newerr.Error(), req.ClientMsgID, k, v) + continue + } + setKeyResultInfo(&rResp, 0, "", req.ClientMsgID, k, v) + } + rResp.IsReact = true + _, err := db.DB.SetMessageReactionExpire(req.ClientMsgID, req.SessionType, time.Duration(24*3)*time.Hour) + if err != nil { + log.Error(req.OperationID, "SetMessageReactionExpire err:", err.Error(), req.String()) + } + } else { + err := rpc.dMessageLocker.LockGlobalMessage(req.ClientMsgID) + if err != nil { + rResp.ErrCode = 100 + rResp.ErrMsg = err.Error() + for _, value := range req.ReactionExtensionList { + temp := new(msg.KeyValueResp) + temp.KeyValue = value + temp.ErrMsg = err.Error() + temp.ErrCode = 100 + rResp.Result = append(rResp.Result, temp) + } + return &rResp, nil + } + mongoValue, err := db.DB.GetExtendMsg(req.SourceID, req.SessionType, req.ClientMsgID, req.MsgFirstModifyTime) + if err != nil { + rResp.ErrCode = 200 + rResp.ErrMsg = err.Error() + for _, value := range req.ReactionExtensionList { + temp := new(msg.KeyValueResp) + temp.KeyValue = value + temp.ErrMsg = err.Error() + temp.ErrCode = 100 + rResp.Result = append(rResp.Result, temp) + } + return &rResp, nil + } + setValue := make(map[string]*server_api_params.KeyValue) + for k, v := range req.ReactionExtensionList { + + temp := new(server_api_params.KeyValue) + if vv, ok := mongoValue.ReactionExtensionList[k]; ok { + utils.CopyStructFields(temp, &vv) + if v.LatestUpdateTime != vv.LatestUpdateTime { + setKeyResultInfo(&rResp, 300, "message have update", req.ClientMsgID, k, temp) + continue + } + } + temp.TypeKey = k + temp.Value = v.Value + temp.LatestUpdateTime = utils.GetCurrentTimestampByMill() + setValue[k] = temp + } + err = db.DB.InsertOrUpdateReactionExtendMsgSet(req.SourceID, req.SessionType, req.ClientMsgID, req.MsgFirstModifyTime, setValue) + if err != nil { + for _, value := range setValue { + temp := new(msg.KeyValueResp) + temp.KeyValue = value + temp.ErrMsg = err.Error() + temp.ErrCode = 100 + rResp.Result = append(rResp.Result, temp) + } + } else { + for _, value := range setValue { + temp := new(msg.KeyValueResp) + temp.KeyValue = value + rResp.Result = append(rResp.Result, temp) + } + } + lockErr := rpc.dMessageLocker.UnLockGlobalMessage(req.ClientMsgID) + if lockErr != nil { + log.Error(req.OperationID, "UnLockGlobalMessage err:", lockErr.Error()) + } + } + + } else { + log.Debug(req.OperationID, "redis handle secondly", req.String()) + + for k, v := range req.ReactionExtensionList { + err := rpc.dMessageLocker.LockMessageTypeKey(req.ClientMsgID, k) + if err != nil { + setKeyResultInfo(&rResp, 100, err.Error(), req.ClientMsgID, k, v) + continue + } + redisValue, err := db.DB.GetMessageTypeKeyValue(req.ClientMsgID, req.SessionType, k) + if err != nil && err != go_redis.Nil { + setKeyResultInfo(&rResp, 200, err.Error(), req.ClientMsgID, k, v) + continue + } + temp := new(server_api_params.KeyValue) + utils.JsonStringToStruct(redisValue, temp) + if v.LatestUpdateTime != temp.LatestUpdateTime { + setKeyResultInfo(&rResp, 300, "message have update", req.ClientMsgID, k, temp) + continue + } else { + v.LatestUpdateTime = utils.GetCurrentTimestampByMill() + newerr := db.DB.SetMessageTypeKeyValue(req.ClientMsgID, req.SessionType, k, utils.StructToJsonString(v)) + if newerr != nil { + setKeyResultInfo(&rResp, 201, newerr.Error(), req.ClientMsgID, k, temp) + continue + } + setKeyResultInfo(&rResp, 0, "", req.ClientMsgID, k, v) + } + + } + } + if !isExists { + if !req.IsReact { + ExtendMessageUpdatedNotification(req.OperationID, req.OpUserID, req.SourceID, req.SessionType, req, &rResp, true, true) + } else { + ExtendMessageUpdatedNotification(req.OperationID, req.OpUserID, req.SourceID, req.SessionType, req, &rResp, false, false) + } + } else { + ExtendMessageUpdatedNotification(req.OperationID, req.OpUserID, req.SourceID, req.SessionType, req, &rResp, false, true) + } + log.Debug(req.OperationID, utils.GetSelfFuncName(), "rpc return is:", rResp.String()) + return &rResp, nil + +} +func setKeyResultInfo(r *msg.SetMessageReactionExtensionsResp, errCode int32, errMsg, clientMsgID, typeKey string, keyValue *server_api_params.KeyValue) { + temp := new(msg.KeyValueResp) + temp.KeyValue = keyValue + temp.ErrCode = errCode + temp.ErrMsg = errMsg + r.Result = append(r.Result, temp) + _ = db.DB.UnLockMessageTypeKey(clientMsgID, typeKey) +} +func setDeleteKeyResultInfo(r *msg.DeleteMessageListReactionExtensionsResp, errCode int32, errMsg, clientMsgID, typeKey string, keyValue *server_api_params.KeyValue) { + temp := new(msg.KeyValueResp) + temp.KeyValue = keyValue + temp.ErrCode = errCode + temp.ErrMsg = errMsg + r.Result = append(r.Result, temp) + _ = db.DB.UnLockMessageTypeKey(clientMsgID, typeKey) +} + +func (rpc *rpcChat) GetMessageListReactionExtensions(ctx context.Context, req *msg.GetMessageListReactionExtensionsReq) (resp *msg.GetMessageListReactionExtensionsResp, err error) { + log.Debug(req.OperationID, utils.GetSelfFuncName(), "rpc args is:", req.String()) + var rResp msg.GetMessageListReactionExtensionsResp + for _, messageValue := range req.MessageReactionKeyList { + var oneMessage msg.SingleMessageExtensionResult + oneMessage.ClientMsgID = messageValue.ClientMsgID + + isExists, err := db.DB.JudgeMessageReactionEXISTS(messageValue.ClientMsgID, req.SessionType) + if err != nil { + rResp.ErrCode = 100 + rResp.ErrMsg = err.Error() + return &rResp, nil + } + if isExists { + redisValue, err := db.DB.GetOneMessageAllReactionList(messageValue.ClientMsgID, req.SessionType) + if err != nil { + oneMessage.ErrCode = 100 + oneMessage.ErrMsg = err.Error() + rResp.SingleMessageResult = append(rResp.SingleMessageResult, &oneMessage) + continue + } + keyMap := make(map[string]*server_api_params.KeyValue) + + for k, v := range redisValue { + temp := new(server_api_params.KeyValue) + utils.JsonStringToStruct(v, temp) + keyMap[k] = temp + } + oneMessage.ReactionExtensionList = keyMap + + } else { + mongoValue, err := db.DB.GetExtendMsg(req.SourceID, req.SessionType, messageValue.ClientMsgID, messageValue.MsgFirstModifyTime) + if err != nil { + oneMessage.ErrCode = 100 + oneMessage.ErrMsg = err.Error() + rResp.SingleMessageResult = append(rResp.SingleMessageResult, &oneMessage) + continue + } + keyMap := make(map[string]*server_api_params.KeyValue) + + for k, v := range mongoValue.ReactionExtensionList { + temp := new(server_api_params.KeyValue) + temp.TypeKey = v.TypeKey + temp.Value = v.Value + temp.LatestUpdateTime = v.LatestUpdateTime + keyMap[k] = temp + } + oneMessage.ReactionExtensionList = keyMap + } + rResp.SingleMessageResult = append(rResp.SingleMessageResult, &oneMessage) + } + log.Debug(req.OperationID, utils.GetSelfFuncName(), "rpc return is:", rResp.String()) + return &rResp, nil + +} + +func (rpc *rpcChat) AddMessageReactionExtensions(ctx context.Context, req *msg.ModifyMessageReactionExtensionsReq) (resp *msg.ModifyMessageReactionExtensionsResp, err error) { + return +} + +func (rpc *rpcChat) DeleteMessageReactionExtensions(ctx context.Context, req *msg.DeleteMessageListReactionExtensionsReq) (resp *msg.DeleteMessageListReactionExtensionsResp, err error) { + log.Debug(req.OperationID, utils.GetSelfFuncName(), "rpc args is:", req.String()) + var rResp msg.DeleteMessageListReactionExtensionsResp + callbackResp := callbackDeleteMessageReactionExtensions(req) + if callbackResp.ActionCode != constant.ActionAllow || callbackResp.ErrCode != 0 { + rResp.ErrCode = int32(callbackResp.ErrCode) + rResp.ErrMsg = callbackResp.ErrMsg + for _, value := range req.ReactionExtensionList { + temp := new(msg.KeyValueResp) + temp.KeyValue = value + temp.ErrMsg = callbackResp.ErrMsg + temp.ErrCode = 100 + rResp.Result = append(rResp.Result, temp) + } + return &rResp, nil + } + //if ExternalExtension + if req.IsExternalExtensions { + rResp.Result = callbackResp.ResultReactionExtensionList + ExtendMessageDeleteNotification(req.OperationID, req.OpUserID, req.SourceID, req.SessionType, req, &rResp, false, false) + return &rResp, nil + + } + for _, v := range callbackResp.ResultReactionExtensionList { + if v.ErrCode != 0 { + func(req *[]*server_api_params.KeyValue, typeKey string) { + for i := 0; i < len(*req); i++ { + if (*req)[i].TypeKey == typeKey { + *req = append((*req)[:i], (*req)[i+1:]...) + } + } + }(&req.ReactionExtensionList, v.KeyValue.TypeKey) + rResp.Result = append(rResp.Result, v) + } + } + isExists, err := db.DB.JudgeMessageReactionEXISTS(req.ClientMsgID, req.SessionType) + if err != nil { + rResp.ErrCode = 100 + rResp.ErrMsg = err.Error() + for _, value := range req.ReactionExtensionList { + temp := new(msg.KeyValueResp) + temp.KeyValue = value + temp.ErrMsg = err.Error() + temp.ErrCode = 100 + rResp.Result = append(rResp.Result, temp) + } + return &rResp, nil + } + + if isExists { + log.Debug(req.OperationID, "redis handle this delete", req.String()) + for _, v := range req.ReactionExtensionList { + err := rpc.dMessageLocker.LockMessageTypeKey(req.ClientMsgID, v.TypeKey) + if err != nil { + setDeleteKeyResultInfo(&rResp, 100, err.Error(), req.ClientMsgID, v.TypeKey, v) + continue + } + + redisValue, err := db.DB.GetMessageTypeKeyValue(req.ClientMsgID, req.SessionType, v.TypeKey) + if err != nil && err != go_redis.Nil { + setDeleteKeyResultInfo(&rResp, 200, err.Error(), req.ClientMsgID, v.TypeKey, v) + continue + } + temp := new(server_api_params.KeyValue) + utils.JsonStringToStruct(redisValue, temp) + if v.LatestUpdateTime != temp.LatestUpdateTime { + setDeleteKeyResultInfo(&rResp, 300, "message have update", req.ClientMsgID, v.TypeKey, temp) + continue + } else { + newErr := db.DB.DeleteOneMessageKey(req.ClientMsgID, req.SessionType, v.TypeKey) + if newErr != nil { + setDeleteKeyResultInfo(&rResp, 201, newErr.Error(), req.ClientMsgID, v.TypeKey, temp) + continue + } + setDeleteKeyResultInfo(&rResp, 0, "", req.ClientMsgID, v.TypeKey, v) + } + } + } else { + err := rpc.dMessageLocker.LockGlobalMessage(req.ClientMsgID) + if err != nil { + rResp.ErrCode = 100 + rResp.ErrMsg = err.Error() + for _, value := range req.ReactionExtensionList { + temp := new(msg.KeyValueResp) + temp.KeyValue = value + temp.ErrMsg = err.Error() + temp.ErrCode = 100 + rResp.Result = append(rResp.Result, temp) + } + return &rResp, nil + } + mongoValue, err := db.DB.GetExtendMsg(req.SourceID, req.SessionType, req.ClientMsgID, req.MsgFirstModifyTime) + if err != nil { + rResp.ErrCode = 200 + rResp.ErrMsg = err.Error() + for _, value := range req.ReactionExtensionList { + temp := new(msg.KeyValueResp) + temp.KeyValue = value + temp.ErrMsg = err.Error() + temp.ErrCode = 100 + rResp.Result = append(rResp.Result, temp) + } + return &rResp, nil + } + setValue := make(map[string]*server_api_params.KeyValue) + for _, v := range req.ReactionExtensionList { + + temp := new(server_api_params.KeyValue) + if vv, ok := mongoValue.ReactionExtensionList[v.TypeKey]; ok { + utils.CopyStructFields(temp, &vv) + if v.LatestUpdateTime != vv.LatestUpdateTime { + setDeleteKeyResultInfo(&rResp, 300, "message have update", req.ClientMsgID, v.TypeKey, temp) + continue + } + } else { + setDeleteKeyResultInfo(&rResp, 400, "key not in", req.ClientMsgID, v.TypeKey, v) + continue + } + temp.TypeKey = v.TypeKey + setValue[v.TypeKey] = temp + } + err = db.DB.DeleteReactionExtendMsgSet(req.SourceID, req.SessionType, req.ClientMsgID, req.MsgFirstModifyTime, setValue) + if err != nil { + for _, value := range setValue { + temp := new(msg.KeyValueResp) + temp.KeyValue = value + temp.ErrMsg = err.Error() + temp.ErrCode = 100 + rResp.Result = append(rResp.Result, temp) + } + } else { + for _, value := range setValue { + temp := new(msg.KeyValueResp) + temp.KeyValue = value + rResp.Result = append(rResp.Result, temp) + } + } + lockErr := rpc.dMessageLocker.UnLockGlobalMessage(req.ClientMsgID) + if lockErr != nil { + log.Error(req.OperationID, "UnLockGlobalMessage err:", lockErr.Error()) + } + + } + ExtendMessageDeleteNotification(req.OperationID, req.OpUserID, req.SourceID, req.SessionType, req, &rResp, false, isExists) + log.Debug(req.OperationID, utils.GetSelfFuncName(), "rpc return is:", rResp.String()) + return &rResp, nil +} diff --git a/internal/rpc/msg/extend_msg.notification.go b/internal/rpc/msg/extend_msg.notification.go new file mode 100644 index 000000000..971f2f797 --- /dev/null +++ b/internal/rpc/msg/extend_msg.notification.go @@ -0,0 +1,106 @@ +package msg + +import ( + "Open_IM/pkg/base_info" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + "Open_IM/pkg/proto/msg" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" + "strings" +) + +func ExtendMessageUpdatedNotification(operationID, sendID string, sourceID string, sessionType int32, + req *msg.SetMessageReactionExtensionsReq, resp *msg.SetMessageReactionExtensionsResp, isHistory bool, isReactionFromCache bool) { + var m base_info.ReactionMessageModifierNotification + m.SourceID = req.SourceID + m.OpUserID = req.OpUserID + m.SessionType = req.SessionType + keyMap := make(map[string]*open_im_sdk.KeyValue) + for _, valueResp := range resp.Result { + if valueResp.ErrCode == 0 { + keyMap[valueResp.KeyValue.TypeKey] = valueResp.KeyValue + } + } + if len(keyMap) == 0 { + log.NewWarn(operationID, "all key set failed can not send notification", *req) + return + } + m.SuccessReactionExtensionList = keyMap + m.ClientMsgID = req.ClientMsgID + m.IsReact = resp.IsReact + m.IsExternalExtensions = req.IsExternalExtensions + m.MsgFirstModifyTime = resp.MsgFirstModifyTime + messageReactionSender(operationID, sendID, sourceID, sessionType, constant.ReactionMessageModifier, utils.StructToJsonString(m), isHistory, isReactionFromCache) +} +func ExtendMessageDeleteNotification(operationID, sendID string, sourceID string, sessionType int32, + req *msg.DeleteMessageListReactionExtensionsReq, resp *msg.DeleteMessageListReactionExtensionsResp, isHistory bool, isReactionFromCache bool) { + var m base_info.ReactionMessageDeleteNotification + m.SourceID = req.SourceID + m.OpUserID = req.OpUserID + m.SessionType = req.SessionType + keyMap := make(map[string]*open_im_sdk.KeyValue) + for _, valueResp := range resp.Result { + if valueResp.ErrCode == 0 { + keyMap[valueResp.KeyValue.TypeKey] = valueResp.KeyValue + } + } + if len(keyMap) == 0 { + log.NewWarn(operationID, "all key set failed can not send notification", *req) + return + } + m.SuccessReactionExtensionList = keyMap + m.ClientMsgID = req.ClientMsgID + m.MsgFirstModifyTime = req.MsgFirstModifyTime + + messageReactionSender(operationID, sendID, sourceID, sessionType, constant.ReactionMessageDeleter, utils.StructToJsonString(m), isHistory, isReactionFromCache) +} +func messageReactionSender(operationID, sendID string, sourceID string, sessionType, contentType int32, content string, isHistory bool, isReactionFromCache bool) { + options := make(map[string]bool, 5) + utils.SetSwitchFromOptions(options, constant.IsOfflinePush, false) + utils.SetSwitchFromOptions(options, constant.IsConversationUpdate, false) + utils.SetSwitchFromOptions(options, constant.IsSenderConversationUpdate, false) + utils.SetSwitchFromOptions(options, constant.IsUnreadCount, false) + utils.SetSwitchFromOptions(options, constant.IsReactionFromCache, isReactionFromCache) + if !isHistory { + utils.SetSwitchFromOptions(options, constant.IsHistory, false) + utils.SetSwitchFromOptions(options, constant.IsPersistent, false) + } + pbData := msg.SendMsgReq{ + OperationID: operationID, + MsgData: &open_im_sdk.MsgData{ + SendID: sendID, + ClientMsgID: utils.GetMsgID(sendID), + SessionType: sessionType, + MsgFrom: constant.SysMsgType, + ContentType: contentType, + Content: []byte(content), + // ForceList: params.ForceList, + CreateTime: utils.GetCurrentTimestampByMill(), + Options: options, + }, + } + switch sessionType { + case constant.SingleChatType, constant.NotificationChatType: + pbData.MsgData.RecvID = sourceID + case constant.GroupChatType, constant.SuperGroupChatType: + pbData.MsgData.GroupID = sourceID + } + etcdConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMsgName, operationID) + if etcdConn == nil { + errMsg := operationID + "getcdv3.GetDefaultConn == nil" + log.NewError(operationID, errMsg) + return + } + client := msg.NewMsgClient(etcdConn) + reply, err := client.SendMsg(context.Background(), &pbData) + if err != nil { + log.NewError(operationID, "SendMsg rpc failed, ", pbData.String(), err.Error()) + } else if reply.ErrCode != 0 { + log.NewError(operationID, "SendMsg rpc failed, ", pbData.String(), reply.ErrCode, reply.ErrMsg) + } + +} diff --git a/internal/rpc/msg/extend_msg_callback.go b/internal/rpc/msg/extend_msg_callback.go new file mode 100644 index 000000000..65ae8d7b3 --- /dev/null +++ b/internal/rpc/msg/extend_msg_callback.go @@ -0,0 +1,60 @@ +package msg + +import ( + cbApi "Open_IM/pkg/call_back_struct" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/http" + "Open_IM/pkg/common/log" + "Open_IM/pkg/proto/msg" + "Open_IM/pkg/utils" + http2 "net/http" +) + +func callbackSetMessageReactionExtensions(setReq *msg.SetMessageReactionExtensionsReq) *cbApi.CallbackBeforeSetMessageReactionExtResp { + callbackResp := cbApi.CommonCallbackResp{OperationID: setReq.OperationID} + log.NewDebug(setReq.OperationID, utils.GetSelfFuncName(), setReq.String()) + req := cbApi.CallbackBeforeSetMessageReactionExtReq{ + OperationID: setReq.OperationID, + CallbackCommand: constant.CallbackBeforeSetMessageReactionExtensionCommand, + SourceID: setReq.SourceID, + OpUserID: setReq.OpUserID, + SessionType: setReq.SessionType, + ReactionExtensionList: setReq.ReactionExtensionList, + ClientMsgID: setReq.ClientMsgID, + IsReact: setReq.IsReact, + IsExternalExtensions: setReq.IsExternalExtensions, + MsgFirstModifyTime: setReq.MsgFirstModifyTime, + } + resp := &cbApi.CallbackBeforeSetMessageReactionExtResp{CommonCallbackResp: &callbackResp} + defer log.NewDebug(setReq.OperationID, utils.GetSelfFuncName(), req, *resp) + if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackBeforeSetMessageReactionExtensionCommand, req, resp, config.Config.Callback.CallbackAfterSendGroupMsg.CallbackTimeOut); err != nil { + callbackResp.ErrCode = http2.StatusInternalServerError + callbackResp.ErrMsg = err.Error() + } + return resp + +} + +func callbackDeleteMessageReactionExtensions(setReq *msg.DeleteMessageListReactionExtensionsReq) *cbApi.CallbackDeleteMessageReactionExtResp { + callbackResp := cbApi.CommonCallbackResp{OperationID: setReq.OperationID} + log.NewDebug(setReq.OperationID, utils.GetSelfFuncName(), setReq.String()) + req := cbApi.CallbackDeleteMessageReactionExtReq{ + OperationID: setReq.OperationID, + CallbackCommand: constant.CallbackBeforeDeleteMessageReactionExtensionsCommand, + SourceID: setReq.SourceID, + OpUserID: setReq.OpUserID, + SessionType: setReq.SessionType, + ReactionExtensionList: setReq.ReactionExtensionList, + ClientMsgID: setReq.ClientMsgID, + IsExternalExtensions: setReq.IsExternalExtensions, + MsgFirstModifyTime: setReq.MsgFirstModifyTime, + } + resp := &cbApi.CallbackDeleteMessageReactionExtResp{CommonCallbackResp: &callbackResp} + defer log.NewDebug(setReq.OperationID, utils.GetSelfFuncName(), req, *resp) + if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackBeforeDeleteMessageReactionExtensionsCommand, req, resp, config.Config.Callback.CallbackAfterSendGroupMsg.CallbackTimeOut); err != nil { + callbackResp.ErrCode = http2.StatusInternalServerError + callbackResp.ErrMsg = err.Error() + } + return resp +} diff --git a/internal/rpc/msg/lock.go b/internal/rpc/msg/lock.go new file mode 100644 index 000000000..cef59cb1a --- /dev/null +++ b/internal/rpc/msg/lock.go @@ -0,0 +1,52 @@ +package msg + +import ( + "Open_IM/pkg/common/db" + "time" +) + +const GlOBLLOCK = "GLOBAL_LOCK" + +type MessageLocker interface { + LockMessageTypeKey(clientMsgID, typeKey string) (err error) + UnLockMessageTypeKey(clientMsgID string, typeKey string) error + LockGlobalMessage(clientMsgID string) (err error) + UnLockGlobalMessage(clientMsgID string) (err error) +} +type LockerMessage struct{} + +func NewLockerMessage() *LockerMessage { + return &LockerMessage{} +} +func (l *LockerMessage) LockMessageTypeKey(clientMsgID, typeKey string) (err error) { + for i := 0; i < 3; i++ { + err = db.DB.LockMessageTypeKey(clientMsgID, typeKey) + if err != nil { + time.Sleep(time.Millisecond * 100) + continue + } else { + break + } + } + return err + +} +func (l *LockerMessage) LockGlobalMessage(clientMsgID string) (err error) { + for i := 0; i < 3; i++ { + err = db.DB.LockMessageTypeKey(clientMsgID, GlOBLLOCK) + if err != nil { + time.Sleep(time.Millisecond * 100) + continue + } else { + break + } + } + return err + +} +func (l *LockerMessage) UnLockMessageTypeKey(clientMsgID string, typeKey string) error { + return db.DB.UnLockMessageTypeKey(clientMsgID, typeKey) +} +func (l *LockerMessage) UnLockGlobalMessage(clientMsgID string) error { + return db.DB.UnLockMessageTypeKey(clientMsgID, GlOBLLOCK) +} diff --git a/internal/rpc/msg/rpcChat.go b/internal/rpc/msg/rpcChat.go index f1329d47a..470325deb 100644 --- a/internal/rpc/msg/rpcChat.go +++ b/internal/rpc/msg/rpcChat.go @@ -31,7 +31,8 @@ type rpcChat struct { etcdAddr []string messageWriter MessageWriter //offlineProducer *kafka.Producer - delMsgCh chan deleteMsg + delMsgCh chan deleteMsg + dMessageLocker MessageLocker } type deleteMsg struct { @@ -48,6 +49,7 @@ func NewRpcChatServer(port int) *rpcChat { rpcRegisterName: config.Config.RpcRegisterName.OpenImMsgName, etcdSchema: config.Config.Etcd.EtcdSchema, etcdAddr: config.Config.Etcd.EtcdAddr, + dMessageLocker: NewLockerMessage(), } rc.messageWriter = kafka.NewKafkaProducer(config.Config.Kafka.Ws2mschat.Addr, config.Config.Kafka.Ws2mschat.Topic) //rc.offlineProducer = kafka.NewKafkaProducer(config.Config.Kafka.Ws2mschatOffline.Addr, config.Config.Kafka.Ws2mschatOffline.Topic) diff --git a/pkg/base_info/msg.go b/pkg/base_info/msg.go index 2b12a2b2e..5a7c7f538 100644 --- a/pkg/base_info/msg.go +++ b/pkg/base_info/msg.go @@ -1,5 +1,10 @@ package base_info +import ( + "Open_IM/pkg/proto/msg" + sdk_ws "Open_IM/pkg/proto/sdk_ws" +) + type DelMsgReq struct { UserID string `json:"userID,omitempty" binding:"required"` SeqList []uint32 `json:"seqList,omitempty" binding:"required"` @@ -18,6 +23,7 @@ type CleanUpMsgReq struct { type CleanUpMsgResp struct { CommResp } + type DelSuperGroupMsgReq struct { UserID string `json:"userID" binding:"required"` GroupID string `json:"groupID" binding:"required"` @@ -29,23 +35,107 @@ type DelSuperGroupMsgReq struct { type DelSuperGroupMsgResp struct { CommResp } + type MsgDeleteNotificationElem struct { GroupID string `json:"groupID"` IsAllDelete bool `json:"isAllDelete"` SeqList []uint32 `json:"seqList"` } -//UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` -// GroupID string `protobuf:"bytes,2,opt,name=groupID" json:"groupID,omitempty"` -// MinSeq uint32 `protobuf:"varint,3,opt,name=minSeq" json:"minSeq,omitempty"` -// OperationID string `protobuf:"bytes,4,opt,name=operationID" json:"operationID,omitempty"` -// OpUserID string `protobuf:"bytes,5,opt,name=opUserID" json:"opUserID,omitempty"` type SetMsgMinSeqReq struct { UserID string `json:"userID" binding:"required"` GroupID string `json:"groupID"` MinSeq uint32 `json:"minSeq" binding:"required"` OperationID string `json:"operationID" binding:"required"` } + type SetMsgMinSeqResp struct { CommResp } + +type ModifyMessageReactionExtensionsReq struct { + OperationID string `json:"operationID" binding:"required"` + SourceID string `json:"sourceID" binding:"required"` + SessionType int32 `json:"sessionType" binding:"required"` + ReactionExtensionList map[string]*sdk_ws.KeyValue `json:"reactionExtensionList,omitempty" binding:"required"` + ClientMsgID string `json:"clientMsgID" binding:"required"` + Ex *string `json:"ex"` + AttachedInfo *string `json:"attachedInfo"` + IsReact bool `json:"isReact"` + IsExternalExtensions bool `json:"isExternalExtensions"` + MsgFirstModifyTime int64 `json:"msgFirstModifyTime"` +} + +type ModifyMessageReactionExtensionsResp struct { + CommResp + Data struct { + ResultKeyValue []*msg.KeyValueResp `json:"result"` + MsgFirstModifyTime int64 `json:"msgFirstModifyTime"` + IsReact bool `json:"isReact"` + } `json:"data"` +} + +type OperateMessageListReactionExtensionsReq struct { + OperationID string `json:"operationID" binding:"required"` + SourceID string `json:"sourceID" binding:"required"` + SessionType string `json:"sessionType" binding:"required"` + MessageReactionKeyList []*msg.GetMessageListReactionExtensionsReq_MessageReactionKey `json:"messageReactionKeyList" binding:"required"` +} + +type OperateMessageListReactionExtensionsResp struct { + CommResp + Data struct { + SuccessList []*msg.ExtendMsgResp `json:"successList"` + FailedList []*msg.ExtendMsgResp `json:"failedList"` + } `json:"data"` +} + +type SetMessageReactionExtensionsCallbackReq ModifyMessageReactionExtensionsReq + +type SetMessageReactionExtensionsCallbackResp ModifyMessageReactionExtensionsResp + +type GetMessageListReactionExtensionsReq OperateMessageListReactionExtensionsReq + +type GetMessageListReactionExtensionsResp struct { + CommResp + Data []*msg.SingleMessageExtensionResult `json:"data"` +} + +type AddMessageReactionExtensionsReq ModifyMessageReactionExtensionsReq + +type AddMessageReactionExtensionsResp ModifyMessageReactionExtensionsResp + +type DeleteMessageReactionExtensionsReq struct { + OperationID string `json:"operationID" binding:"required"` + SourceID string `json:"sourceID" binding:"required"` + SessionType int32 `json:"sessionType" binding:"required"` + ClientMsgID string `json:"clientMsgID" binding:"required"` + IsExternalExtensions bool `json:"isExternalExtensions"` + MsgFirstModifyTime int64 `json:"msgFirstModifyTime" binding:"required"` + ReactionExtensionList []*sdk_ws.KeyValue `json:"reactionExtensionList" binding:"required"` +} + +type DeleteMessageReactionExtensionsResp struct { + CommResp + Data []*msg.KeyValueResp +} + +type ReactionMessageModifierNotification struct { + SourceID string `json:"sourceID" binding:"required"` + OpUserID string `json:"opUserID" binding:"required"` + SessionType int32 `json:"sessionType" binding:"required"` + SuccessReactionExtensionList map[string]*sdk_ws.KeyValue `json:"reactionExtensionList,omitempty" binding:"required"` + ClientMsgID string `json:"clientMsgID" binding:"required"` + IsReact bool `json:"isReact"` + IsExternalExtensions bool `json:"isExternalExtensions"` + MsgFirstModifyTime int64 `json:"msgFirstModifyTime"` +} + +type ReactionMessageDeleteNotification struct { + SourceID string `json:"sourceID" binding:"required"` + OpUserID string `json:"opUserID" binding:"required"` + SessionType int32 `json:"sessionType" binding:"required"` + SuccessReactionExtensionList map[string]*sdk_ws.KeyValue `json:"reactionExtensionList,omitempty" binding:"required"` + ClientMsgID string `json:"clientMsgID" binding:"required"` + MsgFirstModifyTime int64 `json:"msgFirstModifyTime"` +} diff --git a/pkg/call_back_struct/message.go b/pkg/call_back_struct/message.go index b28615030..00e142878 100644 --- a/pkg/call_back_struct/message.go +++ b/pkg/call_back_struct/message.go @@ -1,6 +1,9 @@ package call_back_struct -import sdk_ws "Open_IM/pkg/proto/sdk_ws" +import ( + "Open_IM/pkg/proto/msg" + sdk_ws "Open_IM/pkg/proto/sdk_ws" +) type CallbackBeforeSendSingleMsgReq struct { CommonCallbackReq @@ -63,3 +66,36 @@ type CallbackMsgModifyCommandResp struct { AttachedInfo *string `json:"attachedInfo"` Ex *string `json:"ex"` } +type CallbackBeforeSetMessageReactionExtReq struct { + OperationID string `json:"operationID"` + CallbackCommand string `json:"callbackCommand"` + SourceID string `json:"sourceID"` + OpUserID string `json:"opUserID"` + SessionType int32 `json:"sessionType"` + ReactionExtensionList map[string]*sdk_ws.KeyValue `json:"reactionExtensionList"` + ClientMsgID string `json:"clientMsgID"` + IsReact bool `json:"isReact"` + IsExternalExtensions bool `json:"isExternalExtensions"` + MsgFirstModifyTime int64 `json:"msgFirstModifyTime"` +} +type CallbackBeforeSetMessageReactionExtResp struct { + *CommonCallbackResp + ResultReactionExtensionList []*msg.KeyValueResp `json:"resultReactionExtensionList"` + MsgFirstModifyTime int64 `json:"msgFirstModifyTime"` +} +type CallbackDeleteMessageReactionExtReq struct { + OperationID string `json:"operationID"` + CallbackCommand string `json:"callbackCommand"` + SourceID string `json:"sourceID"` + OpUserID string `json:"opUserID"` + SessionType int32 `json:"sessionType"` + ReactionExtensionList []*sdk_ws.KeyValue `json:"reactionExtensionList"` + ClientMsgID string `json:"clientMsgID"` + IsExternalExtensions bool `json:"isExternalExtensions"` + MsgFirstModifyTime int64 `json:"msgFirstModifyTime"` +} +type CallbackDeleteMessageReactionExtResp struct { + *CommonCallbackResp + ResultReactionExtensionList []*msg.KeyValueResp `json:"resultReactionExtensionList"` + MsgFirstModifyTime int64 `json:"msgFirstModifyTime"` +} diff --git a/pkg/common/config/config.go b/pkg/common/config/config.go index 32ad9391b..1913bac79 100644 --- a/pkg/common/config/config.go +++ b/pkg/common/config/config.go @@ -248,11 +248,16 @@ type config struct { Addr []string `yaml:"addr"` Topic string `yaml:"topic"` } + MsgToModify struct { + Addr []string `yaml:"addr"` + Topic string `yaml:"topic"` + } ConsumerGroupID struct { - MsgToRedis string `yaml:"msgToTransfer"` - MsgToMongo string `yaml:"msgToMongo"` - MsgToMySql string `yaml:"msgToMySql"` - MsgToPush string `yaml:"msgToPush"` + MsgToRedis string `yaml:"msgToTransfer"` + MsgToMongo string `yaml:"msgToMongo"` + MsgToMySql string `yaml:"msgToMySql"` + MsgToPush string `yaml:"msgToPush"` + MsgToModify string `yaml:"msgToModify"` } } Secret string `yaml:"secret"` diff --git a/pkg/common/constant/constant.go b/pkg/common/constant/constant.go index 250bf5856..12541e639 100644 --- a/pkg/common/constant/constant.go +++ b/pkg/common/constant/constant.go @@ -48,6 +48,8 @@ const ( AdvancedRevoke = 118 //影响前者消息 CustomNotTriggerConversation = 119 CustomOnlineOnly = 120 + ReactionMessageModifier = 121 + ReactionMessageDeleter = 122 Common = 200 GroupMsg = 201 @@ -169,6 +171,7 @@ const ( IsNotPrivate = "notPrivate" IsSenderConversationUpdate = "senderConversationUpdate" IsSenderNotificationPush = "senderNotificationPush" + IsReactionFromCache = "reactionFromCache" //GroupStatus GroupOk = 0 @@ -217,6 +220,8 @@ const ( CallbackBeforeCreateGroupCommand = "callbackBeforeCreateGroupCommand" CallbackBeforeMemberJoinGroupCommand = "callbackBeforeMemberJoinGroupCommand" CallbackBeforeSetGroupMemberInfoCommand = "CallbackBeforeSetGroupMemberInfoCommand" + CallbackBeforeSetMessageReactionExtensionCommand = "callbackBeforeSetMessageReactionExtensionCommand" + CallbackBeforeDeleteMessageReactionExtensionsCommand = "callbackBeforeDeleteMessageReactionExtensionsCommand" //callback actionCode ActionAllow = 0 diff --git a/pkg/common/db/RedisModel.go b/pkg/common/db/RedisModel.go index 9e1a5096c..29e2772a0 100644 --- a/pkg/common/db/RedisModel.go +++ b/pkg/common/db/RedisModel.go @@ -39,6 +39,7 @@ const ( groupMinSeq = "GROUP_MIN_SEQ:" sendMsgFailedFlag = "SEND_MSG_FAILED_FLAG:" userBadgeUnreadCountSum = "USER_BADGE_UNREAD_COUNT_SUM:" + exTypeKeyLocker = "EX_LOCK:" ) func (d *DataBases) JudgeAccountEXISTS(account string) (bool, error) { @@ -447,3 +448,61 @@ func (d *DataBases) GetUserBadgeUnreadCountSum(uid string) (int, error) { seq, err := d.RDB.Get(context.Background(), key).Result() return utils.StringToInt(seq), err } +func (d *DataBases) JudgeMessageReactionEXISTS(clientMsgID string, sessionType int32) (bool, error) { + key := getMessageReactionExPrefix(clientMsgID, sessionType) + n, err := d.RDB.Exists(context.Background(), key).Result() + if n > 0 { + return true, err + } else { + return false, err + } +} + +func (d *DataBases) GetOneMessageAllReactionList(clientMsgID string, sessionType int32) (map[string]string, error) { + key := getMessageReactionExPrefix(clientMsgID, sessionType) + return d.RDB.HGetAll(context.Background(), key).Result() + +} +func (d *DataBases) DeleteOneMessageKey(clientMsgID string, sessionType int32, subKey string) error { + key := getMessageReactionExPrefix(clientMsgID, sessionType) + return d.RDB.HDel(context.Background(), key, subKey).Err() + +} +func (d *DataBases) SetMessageReactionExpire(clientMsgID string, sessionType int32, expiration time.Duration) (bool, error) { + key := getMessageReactionExPrefix(clientMsgID, sessionType) + return d.RDB.Expire(context.Background(), key, expiration).Result() +} +func (d *DataBases) GetMessageTypeKeyValue(clientMsgID string, sessionType int32, typeKey string) (string, error) { + key := getMessageReactionExPrefix(clientMsgID, sessionType) + result, err := d.RDB.HGet(context.Background(), key, typeKey).Result() + return result, err + +} +func (d *DataBases) SetMessageTypeKeyValue(clientMsgID string, sessionType int32, typeKey, value string) error { + key := getMessageReactionExPrefix(clientMsgID, sessionType) + return d.RDB.HSet(context.Background(), key, typeKey, value).Err() + +} +func (d *DataBases) LockMessageTypeKey(clientMsgID string, TypeKey string) error { + key := exTypeKeyLocker + clientMsgID + "_" + TypeKey + return d.RDB.SetNX(context.Background(), key, 1, time.Minute).Err() +} +func (d *DataBases) UnLockMessageTypeKey(clientMsgID string, TypeKey string) error { + key := exTypeKeyLocker + clientMsgID + "_" + TypeKey + return d.RDB.Del(context.Background(), key).Err() + +} + +func getMessageReactionExPrefix(clientMsgID string, sessionType int32) string { + switch sessionType { + case constant.SingleChatType: + return "EX_SINGLE_" + clientMsgID + case constant.GroupChatType: + return "EX_GROUP_" + clientMsgID + case constant.SuperGroupChatType: + return "EX_SUPER_GROUP_" + clientMsgID + case constant.NotificationChatType: + return "EX_NOTIFICATION" + clientMsgID + } + return "" +} diff --git a/pkg/common/db/extend_msg_mongo_model.go b/pkg/common/db/extend_msg_mongo_model.go index 45e97ee25..07d853418 100644 --- a/pkg/common/db/extend_msg_mongo_model.go +++ b/pkg/common/db/extend_msg_mongo_model.go @@ -2,46 +2,61 @@ package db import ( "Open_IM/pkg/common/config" + server_api_params "Open_IM/pkg/proto/sdk_ws" "Open_IM/pkg/utils" "context" + "errors" "fmt" "go.mongodb.org/mongo-driver/bson/primitive" + "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" "strconv" + "strings" "time" "go.mongodb.org/mongo-driver/bson" ) const cExtendMsgSet = "extend_msgs" +const MaxNum = 100 type ExtendMsgSet struct { - ID string `bson:"id" json:"ID"` + SourceID string `bson:"source_id" json:"sourceID"` + SessionType int32 `bson:"session_type" json:"sessionType"` ExtendMsgs map[string]ExtendMsg `bson:"extend_msgs" json:"extendMsgs"` - LatestUpdateTime int32 `bson:"latest_update_time" json:"latestUpdateTime"` - AttachedInfo *string `bson:"attached_info" json:"attachedInfo"` - Ex *string `bson:"ex" json:"ex"` ExtendMsgNum int32 `bson:"extend_msg_num" json:"extendMsgNum"` - CreateTime int32 `bson:"create_time" json:"createTime"` + CreateTime int64 `bson:"create_time" json:"createTime"` // this block's create time + MaxMsgUpdateTime int64 `bson:"max_msg_update_time" json:"maxMsgUpdateTime"` // index find msg } -type ReactionExtendMsgSet struct { - UserKey string `bson:"user_key" json:"userKey"` +type KeyValue struct { + TypeKey string `bson:"type_key" json:"typeKey"` Value string `bson:"value" json:"value"` - LatestUpdateTime int32 `bson:"latest_update_time" json:"latestUpdateTime"` + LatestUpdateTime int64 `bson:"latest_update_time" json:"latestUpdateTime"` } type ExtendMsg struct { - Content map[string]ReactionExtendMsgSet `bson:"content" json:"content"` - ClientMsgID string `bson:"client_msg_id" json:"clientMsgID"` - CreateTime int32 `bson:"create_time" json:"createTime"` - LatestUpdateTime int32 `bson:"latest_update_time" json:"latestUpdateTime"` + ReactionExtensionList map[string]KeyValue `bson:"reaction_extension_list" json:"reactionExtensionList"` + ClientMsgID string `bson:"client_msg_id" json:"clientMsgID"` + MsgFirstModifyTime int64 `bson:"msg_first_modify_time" json:"msgFirstModifyTime"` // this extendMsg create time + AttachedInfo string `bson:"attached_info" json:"attachedInfo"` + Ex string `bson:"ex" json:"ex"` } -func GetExtendMsgSetID(ID string, index int32) string { +func GetExtendMsgMaxNum() int32 { + return MaxNum +} + +func GetExtendMsgSourceID(ID string, index int32) string { return ID + ":" + strconv.Itoa(int(index)) } +func SplitSourceIDAndGetIndex(sourceID string) int32 { + l := strings.Split(sourceID, ":") + index, _ := strconv.Atoi(l[len(l)-1]) + return int32(index) +} + func (d *DataBases) CreateExtendMsgSet(set *ExtendMsgSet) error { ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cExtendMsgSet) @@ -75,61 +90,116 @@ func (d *DataBases) GetAllExtendMsgSet(ID string, opts *GetAllExtendMsgSetOpts) return sets, nil } -type GetExtendMsgSetOpts struct { - ExcludeExtendMsgs bool -} - -func (d *DataBases) GetExtendMsgSet(ID string, index int32, opts *GetExtendMsgSetOpts) (*ExtendMsgSet, error) { - ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) - c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cExtendMsgSet) - var set ExtendMsgSet - var findOneOpt *options.FindOneOptions - if opts != nil { - if opts.ExcludeExtendMsgs { - findOneOpt = &options.FindOneOptions{} - findOneOpt.SetProjection(bson.M{"extend_msgs": 0}) - } +func (d *DataBases) GetExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, maxMsgUpdateTime int64, c *mongo.Collection) (*ExtendMsgSet, error) { + regex := fmt.Sprintf("^%s", sourceID) + var err error + findOpts := options.Find().SetLimit(1).SetSkip(0).SetSort(bson.M{"source_id": -1}).SetProjection(bson.M{"extend_msgs": 0}) + // update newest + find := bson.M{"source_id": primitive.Regex{Pattern: regex}, "session_type": sessionType} + if maxMsgUpdateTime > 0 { + find["max_msg_update_time"] = maxMsgUpdateTime } - err := c.FindOne(ctx, bson.M{"uid": GetExtendMsgSetID(ID, index)}, findOneOpt).Decode(&set) - return &set, err + result, err := c.Find(ctx, find, findOpts) + if err != nil { + return nil, utils.Wrap(err, "") + } + var setList []ExtendMsgSet + if err := result.All(ctx, &setList); err != nil { + return nil, utils.Wrap(err, "") + } + if len(setList) == 0 { + return nil, nil + } + return &setList[0], nil } // first modify msg -func (d *DataBases) InsertExtendMsgAndGetIndex(ID string, index int32, msg *ExtendMsg) error { +func (d *DataBases) InsertExtendMsg(sourceID string, sessionType int32, msg *ExtendMsg) error { ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cExtendMsgSet) - _, err := c.UpdateOne(ctx, bson.M{"uid": GetExtendMsgSetID(ID, index)}, bson.M{"$set": bson.M{"latest_update_time": utils.GetCurrentTimestampBySecond(), "$inc": bson.M{"extend_msg_num": 1}, fmt.Sprintf("extend_msgs.%s", msg.ClientMsgID): msg}}) - return err + set, err := d.GetExtendMsgSet(ctx, sourceID, sessionType, 0, c) + if err != nil { + return utils.Wrap(err, "") + } + if set == nil || set.ExtendMsgNum >= GetExtendMsgMaxNum() { + var index int32 + if set != nil { + index = SplitSourceIDAndGetIndex(set.SourceID) + } + err = d.CreateExtendMsgSet(&ExtendMsgSet{ + SourceID: GetExtendMsgSourceID(sourceID, index), + SessionType: sessionType, + ExtendMsgs: map[string]ExtendMsg{msg.ClientMsgID: *msg}, + ExtendMsgNum: 1, + CreateTime: msg.MsgFirstModifyTime, + MaxMsgUpdateTime: msg.MsgFirstModifyTime, + }) + } else { + _, err = c.UpdateOne(ctx, bson.M{"source_id": set.SourceID, "session_type": sessionType}, bson.M{"$set": bson.M{"max_msg_update_time": msg.MsgFirstModifyTime, "$inc": bson.M{"extend_msg_num": 1}, fmt.Sprintf("extend_msgs.%s", msg.ClientMsgID): msg}}) + } + return utils.Wrap(err, "") } // insert or update -func (d *DataBases) InsertOrUpdateReactionExtendMsgSet(ID string, index int32, clientMsgID, userID, value string) error { +func (d *DataBases) InsertOrUpdateReactionExtendMsgSet(sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*server_api_params.KeyValue) error { ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cExtendMsgSet) - reactionExtendMsgSet := ReactionExtendMsgSet{ - UserKey: userID, - Value: value, - LatestUpdateTime: int32(utils.GetCurrentTimestampBySecond()), + var updateBson = bson.M{} + for _, v := range reactionExtensionList { + updateBson[fmt.Sprintf("extend_msgs.%s.%s", clientMsgID, v.TypeKey)] = v } upsert := true opt := &options.UpdateOptions{ Upsert: &upsert, } - _, err := c.UpdateOne(ctx, bson.M{"uid": GetExtendMsgSetID(ID, index)}, bson.M{"$set": bson.M{"latest_update_time": utils.GetCurrentTimestampBySecond()}, fmt.Sprintf("extend_msgs.%s.%s", clientMsgID, userID): reactionExtendMsgSet}, opt) + set, err := d.GetExtendMsgSet(ctx, sourceID, sessionType, msgFirstModifyTime, c) + if err != nil { + return utils.Wrap(err, "") + } + if set == nil { + return errors.New(fmt.Sprintf("sourceID %s has no set", sourceID)) + } + _, err = c.UpdateOne(ctx, bson.M{"source_id": set.SourceID, "session_type": sessionType}, bson.M{"$set": updateBson}, opt) + return utils.Wrap(err, "") +} + +// delete TypeKey +func (d *DataBases) DeleteReactionExtendMsgSet(sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*server_api_params.KeyValue) error { + ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cExtendMsgSet) + var updateBson = bson.M{} + for _, v := range reactionExtensionList { + updateBson[fmt.Sprintf("extend_msgs.%s.%s", clientMsgID, v.TypeKey)] = "" + } + set, err := d.GetExtendMsgSet(ctx, sourceID, sessionType, msgFirstModifyTime, c) + if err != nil { + return utils.Wrap(err, "") + } + if set == nil { + return errors.New(fmt.Sprintf("sourceID %s has no set", sourceID)) + } + _, err = c.UpdateOne(ctx, bson.M{"source_id": set.SourceID, "session_type": sessionType}, bson.M{"$unset": updateBson}) return err } -func (d *DataBases) DeleteReactionExtendMsgSet(ID string, index int32, clientMsgID, userID string) error { +func (d *DataBases) GetExtendMsg(sourceID string, sessionType int32, clientMsgID string, maxMsgUpdateTime int64) (extendMsg *ExtendMsg, err error) { ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cExtendMsgSet) - _, err := c.UpdateOne(ctx, bson.M{"uid": GetExtendMsgSetID(ID, index)}, bson.M{"$unset": bson.M{}}) - return err -} - -// by index start end -func (d *DataBases) GetExtendMsgList(ID string, index int32, clientMsgID string) (extendMsg *ExtendMsg, err error) { - ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) - c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cExtendMsgSet) - err = c.FindOne(ctx, bson.M{"uid": GetExtendMsgSetID(ID, index), "extend_msgs": bson.M{}}).Decode(&extendMsg) - return extendMsg, err + findOpts := options.Find().SetLimit(1).SetSkip(0).SetSort(bson.M{"source_id": -1}).SetProjection(bson.M{fmt.Sprintf("extend_msgs.%s", clientMsgID): 1}) + regex := fmt.Sprintf("^%s", sourceID) + result, err := c.Find(ctx, bson.M{"source_id": primitive.Regex{Pattern: regex}, "session_type": sessionType, "max_msg_update_time": bson.M{"$lte": maxMsgUpdateTime}}, findOpts) + if err != nil { + return nil, utils.Wrap(err, "") + } + var setList []ExtendMsgSet + if err := result.All(ctx, &setList); err != nil { + return nil, utils.Wrap(err, "") + } + if len(setList) == 0 { + return nil, utils.Wrap(errors.New("GetExtendMsg failed, len(setList) == 0"), "") + } + if v, ok := setList[0].ExtendMsgs[clientMsgID]; ok { + return &v, nil + } + return nil, errors.New(fmt.Sprintf("cant find client msg id: %s", clientMsgID)) } diff --git a/pkg/common/db/rocks_cache/rocks_cache.go b/pkg/common/db/rocks_cache/rocks_cache.go index 3edb9f238..3b054d37f 100644 --- a/pkg/common/db/rocks_cache/rocks_cache.go +++ b/pkg/common/db/rocks_cache/rocks_cache.go @@ -567,37 +567,9 @@ func DelConversationFromCache(ownerUserID, conversationID string) error { return utils.Wrap(db.DB.Rc.TagAsDeleted(conversationCache+ownerUserID+":"+conversationID), "DelConversationFromCache err") } -func GetExtendMsgSetFromCache(ID string, index int32) (*db.ExtendMsgSet, error) { - getExtendMsgSet := func() (string, error) { - extendMsgSet, err := db.DB.GetExtendMsgSet(ID, index, &db.GetExtendMsgSetOpts{ExcludeExtendMsgs: false}) - if err != nil { - return "", utils.Wrap(err, "GetExtendMsgSet failed") - } - bytes, err := json.Marshal(extendMsgSet) - if err != nil { - return "", utils.Wrap(err, "Marshal failed") - } - return string(bytes), nil - } - extendMsgSetStr, err := db.DB.Rc.Fetch(extendMsgSetCache+db.GetExtendMsgSetID(ID, index), time.Second*30*60, getExtendMsgSet) - if err != nil { - return nil, utils.Wrap(err, "Fetch failed") - } - extendMsgSet := &db.ExtendMsgSet{} - err = json.Unmarshal([]byte(extendMsgSetStr), extendMsgSet) - if err != nil { - return nil, utils.Wrap(err, "Unmarshal failed") - } - return extendMsgSet, nil -} - -func DelExtendMsgSetFromCache(ID string, index int32) error { - return utils.Wrap(db.DB.Rc.TagAsDeleted(extendMsgSetCache+db.GetExtendMsgSetID(ID, index)), "DelExtendMsgSetFromCache err") -} - -func GetExtendMsg(ID string, index int32, clientMsgID string) (*db.ExtendMsg, error) { +func GetExtendMsg(sourceID string, sessionType int32, clientMsgID string, firstModifyTime int64) (*db.ExtendMsg, error) { getExtendMsg := func() (string, error) { - extendMsg, err := db.DB.GetExtendMsgList(ID, index, clientMsgID) + extendMsg, err := db.DB.GetExtendMsg(sourceID, sessionType, clientMsgID, firstModifyTime) if err != nil { return "", utils.Wrap(err, "GetExtendMsgList failed") } @@ -608,7 +580,7 @@ func GetExtendMsg(ID string, index int32, clientMsgID string) (*db.ExtendMsg, er return string(bytes), nil } - extendMsgStr, err := db.DB.Rc.Fetch(extendMsgCache+db.GetExtendMsgSetID(ID, index)+":"+clientMsgID, time.Second*30*60, getExtendMsg) + extendMsgStr, err := db.DB.Rc.Fetch(extendMsgCache+clientMsgID, time.Second*30*60, getExtendMsg) if err != nil { return nil, utils.Wrap(err, "Fetch failed") } @@ -621,5 +593,5 @@ func GetExtendMsg(ID string, index int32, clientMsgID string) (*db.ExtendMsg, er } func DelExtendMsg(ID string, index int32, clientMsgID string) error { - return utils.Wrap(db.DB.Rc.TagAsDeleted(extendMsgCache+db.GetExtendMsgSetID(ID, index)+":"+clientMsgID), "DelExtendMsg err") + return utils.Wrap(db.DB.Rc.TagAsDeleted(extendMsgCache+clientMsgID), "DelExtendMsg err") } diff --git a/pkg/proto/msg/msg.pb.go b/pkg/proto/msg/msg.pb.go index 532c73b84..bdb1e3464 100644 --- a/pkg/proto/msg/msg.pb.go +++ b/pkg/proto/msg/msg.pb.go @@ -7,6 +7,7 @@ import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" import sdk_ws "Open_IM/pkg/proto/sdk_ws" +import wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" import ( context "golang.org/x/net/context" @@ -37,7 +38,7 @@ func (m *MsgDataToMQ) Reset() { *m = MsgDataToMQ{} } func (m *MsgDataToMQ) String() string { return proto.CompactTextString(m) } func (*MsgDataToMQ) ProtoMessage() {} func (*MsgDataToMQ) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_3f0146015dfd26d9, []int{0} + return fileDescriptor_msg_4f5a59ae8be91efc, []int{0} } func (m *MsgDataToMQ) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MsgDataToMQ.Unmarshal(m, b) @@ -90,7 +91,7 @@ func (m *MsgDataToDB) Reset() { *m = MsgDataToDB{} } func (m *MsgDataToDB) String() string { return proto.CompactTextString(m) } func (*MsgDataToDB) ProtoMessage() {} func (*MsgDataToDB) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_3f0146015dfd26d9, []int{1} + return fileDescriptor_msg_4f5a59ae8be91efc, []int{1} } func (m *MsgDataToDB) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MsgDataToDB.Unmarshal(m, b) @@ -137,7 +138,7 @@ func (m *PushMsgDataToMQ) Reset() { *m = PushMsgDataToMQ{} } func (m *PushMsgDataToMQ) String() string { return proto.CompactTextString(m) } func (*PushMsgDataToMQ) ProtoMessage() {} func (*PushMsgDataToMQ) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_3f0146015dfd26d9, []int{2} + return fileDescriptor_msg_4f5a59ae8be91efc, []int{2} } func (m *PushMsgDataToMQ) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PushMsgDataToMQ.Unmarshal(m, b) @@ -192,7 +193,7 @@ func (m *MsgDataToMongoByMQ) Reset() { *m = MsgDataToMongoByMQ{} } func (m *MsgDataToMongoByMQ) String() string { return proto.CompactTextString(m) } func (*MsgDataToMongoByMQ) ProtoMessage() {} func (*MsgDataToMongoByMQ) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_3f0146015dfd26d9, []int{3} + return fileDescriptor_msg_4f5a59ae8be91efc, []int{3} } func (m *MsgDataToMongoByMQ) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MsgDataToMongoByMQ.Unmarshal(m, b) @@ -272,7 +273,7 @@ func (m *GetMaxAndMinSeqReq) Reset() { *m = GetMaxAndMinSeqReq{} } func (m *GetMaxAndMinSeqReq) String() string { return proto.CompactTextString(m) } func (*GetMaxAndMinSeqReq) ProtoMessage() {} func (*GetMaxAndMinSeqReq) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_3f0146015dfd26d9, []int{4} + return fileDescriptor_msg_4f5a59ae8be91efc, []int{4} } func (m *GetMaxAndMinSeqReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetMaxAndMinSeqReq.Unmarshal(m, b) @@ -320,7 +321,7 @@ func (m *GetMaxAndMinSeqResp) Reset() { *m = GetMaxAndMinSeqResp{} } func (m *GetMaxAndMinSeqResp) String() string { return proto.CompactTextString(m) } func (*GetMaxAndMinSeqResp) ProtoMessage() {} func (*GetMaxAndMinSeqResp) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_3f0146015dfd26d9, []int{5} + return fileDescriptor_msg_4f5a59ae8be91efc, []int{5} } func (m *GetMaxAndMinSeqResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetMaxAndMinSeqResp.Unmarshal(m, b) @@ -381,7 +382,7 @@ func (m *SendMsgReq) Reset() { *m = SendMsgReq{} } func (m *SendMsgReq) String() string { return proto.CompactTextString(m) } func (*SendMsgReq) ProtoMessage() {} func (*SendMsgReq) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_3f0146015dfd26d9, []int{6} + return fileDescriptor_msg_4f5a59ae8be91efc, []int{6} } func (m *SendMsgReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SendMsgReq.Unmarshal(m, b) @@ -437,7 +438,7 @@ func (m *SendMsgResp) Reset() { *m = SendMsgResp{} } func (m *SendMsgResp) String() string { return proto.CompactTextString(m) } func (*SendMsgResp) ProtoMessage() {} func (*SendMsgResp) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_3f0146015dfd26d9, []int{7} + return fileDescriptor_msg_4f5a59ae8be91efc, []int{7} } func (m *SendMsgResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SendMsgResp.Unmarshal(m, b) @@ -505,7 +506,7 @@ func (m *ClearMsgReq) Reset() { *m = ClearMsgReq{} } func (m *ClearMsgReq) String() string { return proto.CompactTextString(m) } func (*ClearMsgReq) ProtoMessage() {} func (*ClearMsgReq) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_3f0146015dfd26d9, []int{8} + return fileDescriptor_msg_4f5a59ae8be91efc, []int{8} } func (m *ClearMsgReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ClearMsgReq.Unmarshal(m, b) @@ -558,7 +559,7 @@ func (m *ClearMsgResp) Reset() { *m = ClearMsgResp{} } func (m *ClearMsgResp) String() string { return proto.CompactTextString(m) } func (*ClearMsgResp) ProtoMessage() {} func (*ClearMsgResp) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_3f0146015dfd26d9, []int{9} + return fileDescriptor_msg_4f5a59ae8be91efc, []int{9} } func (m *ClearMsgResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ClearMsgResp.Unmarshal(m, b) @@ -607,7 +608,7 @@ func (m *SetMsgMinSeqReq) Reset() { *m = SetMsgMinSeqReq{} } func (m *SetMsgMinSeqReq) String() string { return proto.CompactTextString(m) } func (*SetMsgMinSeqReq) ProtoMessage() {} func (*SetMsgMinSeqReq) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_3f0146015dfd26d9, []int{10} + return fileDescriptor_msg_4f5a59ae8be91efc, []int{10} } func (m *SetMsgMinSeqReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SetMsgMinSeqReq.Unmarshal(m, b) @@ -674,7 +675,7 @@ func (m *SetMsgMinSeqResp) Reset() { *m = SetMsgMinSeqResp{} } func (m *SetMsgMinSeqResp) String() string { return proto.CompactTextString(m) } func (*SetMsgMinSeqResp) ProtoMessage() {} func (*SetMsgMinSeqResp) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_3f0146015dfd26d9, []int{11} + return fileDescriptor_msg_4f5a59ae8be91efc, []int{11} } func (m *SetMsgMinSeqResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SetMsgMinSeqResp.Unmarshal(m, b) @@ -720,7 +721,7 @@ func (m *SetSendMsgStatusReq) Reset() { *m = SetSendMsgStatusReq{} } func (m *SetSendMsgStatusReq) String() string { return proto.CompactTextString(m) } func (*SetSendMsgStatusReq) ProtoMessage() {} func (*SetSendMsgStatusReq) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_3f0146015dfd26d9, []int{12} + return fileDescriptor_msg_4f5a59ae8be91efc, []int{12} } func (m *SetSendMsgStatusReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SetSendMsgStatusReq.Unmarshal(m, b) @@ -766,7 +767,7 @@ func (m *SetSendMsgStatusResp) Reset() { *m = SetSendMsgStatusResp{} } func (m *SetSendMsgStatusResp) String() string { return proto.CompactTextString(m) } func (*SetSendMsgStatusResp) ProtoMessage() {} func (*SetSendMsgStatusResp) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_3f0146015dfd26d9, []int{13} + return fileDescriptor_msg_4f5a59ae8be91efc, []int{13} } func (m *SetSendMsgStatusResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SetSendMsgStatusResp.Unmarshal(m, b) @@ -811,7 +812,7 @@ func (m *GetSendMsgStatusReq) Reset() { *m = GetSendMsgStatusReq{} } func (m *GetSendMsgStatusReq) String() string { return proto.CompactTextString(m) } func (*GetSendMsgStatusReq) ProtoMessage() {} func (*GetSendMsgStatusReq) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_3f0146015dfd26d9, []int{14} + return fileDescriptor_msg_4f5a59ae8be91efc, []int{14} } func (m *GetSendMsgStatusReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetSendMsgStatusReq.Unmarshal(m, b) @@ -851,7 +852,7 @@ func (m *GetSendMsgStatusResp) Reset() { *m = GetSendMsgStatusResp{} } func (m *GetSendMsgStatusResp) String() string { return proto.CompactTextString(m) } func (*GetSendMsgStatusResp) ProtoMessage() {} func (*GetSendMsgStatusResp) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_3f0146015dfd26d9, []int{15} + return fileDescriptor_msg_4f5a59ae8be91efc, []int{15} } func (m *GetSendMsgStatusResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetSendMsgStatusResp.Unmarshal(m, b) @@ -906,7 +907,7 @@ func (m *DelSuperGroupMsgReq) Reset() { *m = DelSuperGroupMsgReq{} } func (m *DelSuperGroupMsgReq) String() string { return proto.CompactTextString(m) } func (*DelSuperGroupMsgReq) ProtoMessage() {} func (*DelSuperGroupMsgReq) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_3f0146015dfd26d9, []int{16} + return fileDescriptor_msg_4f5a59ae8be91efc, []int{16} } func (m *DelSuperGroupMsgReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DelSuperGroupMsgReq.Unmarshal(m, b) @@ -966,7 +967,7 @@ func (m *DelSuperGroupMsgResp) Reset() { *m = DelSuperGroupMsgResp{} } func (m *DelSuperGroupMsgResp) String() string { return proto.CompactTextString(m) } func (*DelSuperGroupMsgResp) ProtoMessage() {} func (*DelSuperGroupMsgResp) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_3f0146015dfd26d9, []int{17} + return fileDescriptor_msg_4f5a59ae8be91efc, []int{17} } func (m *DelSuperGroupMsgResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DelSuperGroupMsgResp.Unmarshal(m, b) @@ -1013,7 +1014,7 @@ func (m *GetSuperGroupMsgReq) Reset() { *m = GetSuperGroupMsgReq{} } func (m *GetSuperGroupMsgReq) String() string { return proto.CompactTextString(m) } func (*GetSuperGroupMsgReq) ProtoMessage() {} func (*GetSuperGroupMsgReq) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_3f0146015dfd26d9, []int{18} + return fileDescriptor_msg_4f5a59ae8be91efc, []int{18} } func (m *GetSuperGroupMsgReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetSuperGroupMsgReq.Unmarshal(m, b) @@ -1067,7 +1068,7 @@ func (m *GetSuperGroupMsgResp) Reset() { *m = GetSuperGroupMsgResp{} } func (m *GetSuperGroupMsgResp) String() string { return proto.CompactTextString(m) } func (*GetSuperGroupMsgResp) ProtoMessage() {} func (*GetSuperGroupMsgResp) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_3f0146015dfd26d9, []int{19} + return fileDescriptor_msg_4f5a59ae8be91efc, []int{19} } func (m *GetSuperGroupMsgResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetSuperGroupMsgResp.Unmarshal(m, b) @@ -1120,7 +1121,7 @@ func (m *GetWriteDiffMsgReq) Reset() { *m = GetWriteDiffMsgReq{} } func (m *GetWriteDiffMsgReq) String() string { return proto.CompactTextString(m) } func (*GetWriteDiffMsgReq) ProtoMessage() {} func (*GetWriteDiffMsgReq) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_3f0146015dfd26d9, []int{20} + return fileDescriptor_msg_4f5a59ae8be91efc, []int{20} } func (m *GetWriteDiffMsgReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetWriteDiffMsgReq.Unmarshal(m, b) @@ -1167,7 +1168,7 @@ func (m *GetWriteDiffMsgResp) Reset() { *m = GetWriteDiffMsgResp{} } func (m *GetWriteDiffMsgResp) String() string { return proto.CompactTextString(m) } func (*GetWriteDiffMsgResp) ProtoMessage() {} func (*GetWriteDiffMsgResp) Descriptor() ([]byte, []int) { - return fileDescriptor_msg_3f0146015dfd26d9, []int{21} + return fileDescriptor_msg_4f5a59ae8be91efc, []int{21} } func (m *GetWriteDiffMsgResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetWriteDiffMsgResp.Unmarshal(m, b) @@ -1208,6 +1209,1002 @@ func (m *GetWriteDiffMsgResp) GetMsgData() *sdk_ws.MsgData { return nil } +type ModifyMessageReactionExtensionsReq struct { + OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"` + SourceID string `protobuf:"bytes,2,opt,name=sourceID" json:"sourceID,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=opUserID" json:"opUserID,omitempty"` + SessionType int32 `protobuf:"varint,4,opt,name=sessionType" json:"sessionType,omitempty"` + ReactionExtensionList map[string]*sdk_ws.KeyValue `protobuf:"bytes,5,rep,name=reactionExtensionList" json:"reactionExtensionList,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + ClientMsgID string `protobuf:"bytes,6,opt,name=clientMsgID" json:"clientMsgID,omitempty"` + Ex *wrapperspb.StringValue `protobuf:"bytes,7,opt,name=ex" json:"ex,omitempty"` + AttachedInfo *wrapperspb.StringValue `protobuf:"bytes,8,opt,name=attachedInfo" json:"attachedInfo,omitempty"` + IsReact bool `protobuf:"varint,9,opt,name=isReact" json:"isReact,omitempty"` + IsExternalExtensions bool `protobuf:"varint,10,opt,name=isExternalExtensions" json:"isExternalExtensions,omitempty"` + MsgFirstModifyTime int64 `protobuf:"varint,11,opt,name=msgFirstModifyTime" json:"msgFirstModifyTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ModifyMessageReactionExtensionsReq) Reset() { *m = ModifyMessageReactionExtensionsReq{} } +func (m *ModifyMessageReactionExtensionsReq) String() string { return proto.CompactTextString(m) } +func (*ModifyMessageReactionExtensionsReq) ProtoMessage() {} +func (*ModifyMessageReactionExtensionsReq) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_4f5a59ae8be91efc, []int{22} +} +func (m *ModifyMessageReactionExtensionsReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ModifyMessageReactionExtensionsReq.Unmarshal(m, b) +} +func (m *ModifyMessageReactionExtensionsReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ModifyMessageReactionExtensionsReq.Marshal(b, m, deterministic) +} +func (dst *ModifyMessageReactionExtensionsReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_ModifyMessageReactionExtensionsReq.Merge(dst, src) +} +func (m *ModifyMessageReactionExtensionsReq) XXX_Size() int { + return xxx_messageInfo_ModifyMessageReactionExtensionsReq.Size(m) +} +func (m *ModifyMessageReactionExtensionsReq) XXX_DiscardUnknown() { + xxx_messageInfo_ModifyMessageReactionExtensionsReq.DiscardUnknown(m) +} + +var xxx_messageInfo_ModifyMessageReactionExtensionsReq proto.InternalMessageInfo + +func (m *ModifyMessageReactionExtensionsReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *ModifyMessageReactionExtensionsReq) GetSourceID() string { + if m != nil { + return m.SourceID + } + return "" +} + +func (m *ModifyMessageReactionExtensionsReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *ModifyMessageReactionExtensionsReq) GetSessionType() int32 { + if m != nil { + return m.SessionType + } + return 0 +} + +func (m *ModifyMessageReactionExtensionsReq) GetReactionExtensionList() map[string]*sdk_ws.KeyValue { + if m != nil { + return m.ReactionExtensionList + } + return nil +} + +func (m *ModifyMessageReactionExtensionsReq) GetClientMsgID() string { + if m != nil { + return m.ClientMsgID + } + return "" +} + +func (m *ModifyMessageReactionExtensionsReq) GetEx() *wrapperspb.StringValue { + if m != nil { + return m.Ex + } + return nil +} + +func (m *ModifyMessageReactionExtensionsReq) GetAttachedInfo() *wrapperspb.StringValue { + if m != nil { + return m.AttachedInfo + } + return nil +} + +func (m *ModifyMessageReactionExtensionsReq) GetIsReact() bool { + if m != nil { + return m.IsReact + } + return false +} + +func (m *ModifyMessageReactionExtensionsReq) GetIsExternalExtensions() bool { + if m != nil { + return m.IsExternalExtensions + } + return false +} + +func (m *ModifyMessageReactionExtensionsReq) GetMsgFirstModifyTime() int64 { + if m != nil { + return m.MsgFirstModifyTime + } + return 0 +} + +type SetMessageReactionExtensionsReq struct { + OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"` + SourceID string `protobuf:"bytes,2,opt,name=sourceID" json:"sourceID,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=opUserID" json:"opUserID,omitempty"` + SessionType int32 `protobuf:"varint,4,opt,name=sessionType" json:"sessionType,omitempty"` + ReactionExtensionList map[string]*sdk_ws.KeyValue `protobuf:"bytes,5,rep,name=reactionExtensionList" json:"reactionExtensionList,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + ClientMsgID string `protobuf:"bytes,6,opt,name=clientMsgID" json:"clientMsgID,omitempty"` + Ex *wrapperspb.StringValue `protobuf:"bytes,7,opt,name=ex" json:"ex,omitempty"` + AttachedInfo *wrapperspb.StringValue `protobuf:"bytes,8,opt,name=attachedInfo" json:"attachedInfo,omitempty"` + IsReact bool `protobuf:"varint,9,opt,name=isReact" json:"isReact,omitempty"` + IsExternalExtensions bool `protobuf:"varint,10,opt,name=isExternalExtensions" json:"isExternalExtensions,omitempty"` + MsgFirstModifyTime int64 `protobuf:"varint,11,opt,name=msgFirstModifyTime" json:"msgFirstModifyTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetMessageReactionExtensionsReq) Reset() { *m = SetMessageReactionExtensionsReq{} } +func (m *SetMessageReactionExtensionsReq) String() string { return proto.CompactTextString(m) } +func (*SetMessageReactionExtensionsReq) ProtoMessage() {} +func (*SetMessageReactionExtensionsReq) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_4f5a59ae8be91efc, []int{23} +} +func (m *SetMessageReactionExtensionsReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetMessageReactionExtensionsReq.Unmarshal(m, b) +} +func (m *SetMessageReactionExtensionsReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetMessageReactionExtensionsReq.Marshal(b, m, deterministic) +} +func (dst *SetMessageReactionExtensionsReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetMessageReactionExtensionsReq.Merge(dst, src) +} +func (m *SetMessageReactionExtensionsReq) XXX_Size() int { + return xxx_messageInfo_SetMessageReactionExtensionsReq.Size(m) +} +func (m *SetMessageReactionExtensionsReq) XXX_DiscardUnknown() { + xxx_messageInfo_SetMessageReactionExtensionsReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SetMessageReactionExtensionsReq proto.InternalMessageInfo + +func (m *SetMessageReactionExtensionsReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *SetMessageReactionExtensionsReq) GetSourceID() string { + if m != nil { + return m.SourceID + } + return "" +} + +func (m *SetMessageReactionExtensionsReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *SetMessageReactionExtensionsReq) GetSessionType() int32 { + if m != nil { + return m.SessionType + } + return 0 +} + +func (m *SetMessageReactionExtensionsReq) GetReactionExtensionList() map[string]*sdk_ws.KeyValue { + if m != nil { + return m.ReactionExtensionList + } + return nil +} + +func (m *SetMessageReactionExtensionsReq) GetClientMsgID() string { + if m != nil { + return m.ClientMsgID + } + return "" +} + +func (m *SetMessageReactionExtensionsReq) GetEx() *wrapperspb.StringValue { + if m != nil { + return m.Ex + } + return nil +} + +func (m *SetMessageReactionExtensionsReq) GetAttachedInfo() *wrapperspb.StringValue { + if m != nil { + return m.AttachedInfo + } + return nil +} + +func (m *SetMessageReactionExtensionsReq) GetIsReact() bool { + if m != nil { + return m.IsReact + } + return false +} + +func (m *SetMessageReactionExtensionsReq) GetIsExternalExtensions() bool { + if m != nil { + return m.IsExternalExtensions + } + return false +} + +func (m *SetMessageReactionExtensionsReq) GetMsgFirstModifyTime() int64 { + if m != nil { + return m.MsgFirstModifyTime + } + return 0 +} + +type SetMessageReactionExtensionsResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + ClientMsgID string `protobuf:"bytes,3,opt,name=clientMsgID" json:"clientMsgID,omitempty"` + MsgFirstModifyTime int64 `protobuf:"varint,4,opt,name=msgFirstModifyTime" json:"msgFirstModifyTime,omitempty"` + IsReact bool `protobuf:"varint,5,opt,name=isReact" json:"isReact,omitempty"` + Result []*KeyValueResp `protobuf:"bytes,6,rep,name=result" json:"result,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetMessageReactionExtensionsResp) Reset() { *m = SetMessageReactionExtensionsResp{} } +func (m *SetMessageReactionExtensionsResp) String() string { return proto.CompactTextString(m) } +func (*SetMessageReactionExtensionsResp) ProtoMessage() {} +func (*SetMessageReactionExtensionsResp) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_4f5a59ae8be91efc, []int{24} +} +func (m *SetMessageReactionExtensionsResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetMessageReactionExtensionsResp.Unmarshal(m, b) +} +func (m *SetMessageReactionExtensionsResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetMessageReactionExtensionsResp.Marshal(b, m, deterministic) +} +func (dst *SetMessageReactionExtensionsResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetMessageReactionExtensionsResp.Merge(dst, src) +} +func (m *SetMessageReactionExtensionsResp) XXX_Size() int { + return xxx_messageInfo_SetMessageReactionExtensionsResp.Size(m) +} +func (m *SetMessageReactionExtensionsResp) XXX_DiscardUnknown() { + xxx_messageInfo_SetMessageReactionExtensionsResp.DiscardUnknown(m) +} + +var xxx_messageInfo_SetMessageReactionExtensionsResp proto.InternalMessageInfo + +func (m *SetMessageReactionExtensionsResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *SetMessageReactionExtensionsResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *SetMessageReactionExtensionsResp) GetClientMsgID() string { + if m != nil { + return m.ClientMsgID + } + return "" +} + +func (m *SetMessageReactionExtensionsResp) GetMsgFirstModifyTime() int64 { + if m != nil { + return m.MsgFirstModifyTime + } + return 0 +} + +func (m *SetMessageReactionExtensionsResp) GetIsReact() bool { + if m != nil { + return m.IsReact + } + return false +} + +func (m *SetMessageReactionExtensionsResp) GetResult() []*KeyValueResp { + if m != nil { + return m.Result + } + return nil +} + +type GetMessageListReactionExtensionsReq struct { + OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"` + OpUserID string `protobuf:"bytes,2,opt,name=opUserID" json:"opUserID,omitempty"` + SourceID string `protobuf:"bytes,3,opt,name=sourceID" json:"sourceID,omitempty"` + SessionType int32 `protobuf:"varint,4,opt,name=sessionType" json:"sessionType,omitempty"` + MessageReactionKeyList []*GetMessageListReactionExtensionsReq_MessageReactionKey `protobuf:"bytes,5,rep,name=messageReactionKeyList" json:"messageReactionKeyList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetMessageListReactionExtensionsReq) Reset() { *m = GetMessageListReactionExtensionsReq{} } +func (m *GetMessageListReactionExtensionsReq) String() string { return proto.CompactTextString(m) } +func (*GetMessageListReactionExtensionsReq) ProtoMessage() {} +func (*GetMessageListReactionExtensionsReq) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_4f5a59ae8be91efc, []int{25} +} +func (m *GetMessageListReactionExtensionsReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetMessageListReactionExtensionsReq.Unmarshal(m, b) +} +func (m *GetMessageListReactionExtensionsReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetMessageListReactionExtensionsReq.Marshal(b, m, deterministic) +} +func (dst *GetMessageListReactionExtensionsReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetMessageListReactionExtensionsReq.Merge(dst, src) +} +func (m *GetMessageListReactionExtensionsReq) XXX_Size() int { + return xxx_messageInfo_GetMessageListReactionExtensionsReq.Size(m) +} +func (m *GetMessageListReactionExtensionsReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetMessageListReactionExtensionsReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetMessageListReactionExtensionsReq proto.InternalMessageInfo + +func (m *GetMessageListReactionExtensionsReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *GetMessageListReactionExtensionsReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *GetMessageListReactionExtensionsReq) GetSourceID() string { + if m != nil { + return m.SourceID + } + return "" +} + +func (m *GetMessageListReactionExtensionsReq) GetSessionType() int32 { + if m != nil { + return m.SessionType + } + return 0 +} + +func (m *GetMessageListReactionExtensionsReq) GetMessageReactionKeyList() []*GetMessageListReactionExtensionsReq_MessageReactionKey { + if m != nil { + return m.MessageReactionKeyList + } + return nil +} + +type GetMessageListReactionExtensionsReq_MessageReactionKey struct { + ClientMsgID string `protobuf:"bytes,1,opt,name=clientMsgID" json:"clientMsgID,omitempty"` + MsgFirstModifyTime int64 `protobuf:"varint,2,opt,name=msgFirstModifyTime" json:"msgFirstModifyTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetMessageListReactionExtensionsReq_MessageReactionKey) Reset() { + *m = GetMessageListReactionExtensionsReq_MessageReactionKey{} +} +func (m *GetMessageListReactionExtensionsReq_MessageReactionKey) String() string { + return proto.CompactTextString(m) +} +func (*GetMessageListReactionExtensionsReq_MessageReactionKey) ProtoMessage() {} +func (*GetMessageListReactionExtensionsReq_MessageReactionKey) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_4f5a59ae8be91efc, []int{25, 0} +} +func (m *GetMessageListReactionExtensionsReq_MessageReactionKey) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetMessageListReactionExtensionsReq_MessageReactionKey.Unmarshal(m, b) +} +func (m *GetMessageListReactionExtensionsReq_MessageReactionKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetMessageListReactionExtensionsReq_MessageReactionKey.Marshal(b, m, deterministic) +} +func (dst *GetMessageListReactionExtensionsReq_MessageReactionKey) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetMessageListReactionExtensionsReq_MessageReactionKey.Merge(dst, src) +} +func (m *GetMessageListReactionExtensionsReq_MessageReactionKey) XXX_Size() int { + return xxx_messageInfo_GetMessageListReactionExtensionsReq_MessageReactionKey.Size(m) +} +func (m *GetMessageListReactionExtensionsReq_MessageReactionKey) XXX_DiscardUnknown() { + xxx_messageInfo_GetMessageListReactionExtensionsReq_MessageReactionKey.DiscardUnknown(m) +} + +var xxx_messageInfo_GetMessageListReactionExtensionsReq_MessageReactionKey proto.InternalMessageInfo + +func (m *GetMessageListReactionExtensionsReq_MessageReactionKey) GetClientMsgID() string { + if m != nil { + return m.ClientMsgID + } + return "" +} + +func (m *GetMessageListReactionExtensionsReq_MessageReactionKey) GetMsgFirstModifyTime() int64 { + if m != nil { + return m.MsgFirstModifyTime + } + return 0 +} + +type GetMessageListReactionExtensionsResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + SingleMessageResult []*SingleMessageExtensionResult `protobuf:"bytes,3,rep,name=singleMessageResult" json:"singleMessageResult,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetMessageListReactionExtensionsResp) Reset() { *m = GetMessageListReactionExtensionsResp{} } +func (m *GetMessageListReactionExtensionsResp) String() string { return proto.CompactTextString(m) } +func (*GetMessageListReactionExtensionsResp) ProtoMessage() {} +func (*GetMessageListReactionExtensionsResp) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_4f5a59ae8be91efc, []int{26} +} +func (m *GetMessageListReactionExtensionsResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetMessageListReactionExtensionsResp.Unmarshal(m, b) +} +func (m *GetMessageListReactionExtensionsResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetMessageListReactionExtensionsResp.Marshal(b, m, deterministic) +} +func (dst *GetMessageListReactionExtensionsResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetMessageListReactionExtensionsResp.Merge(dst, src) +} +func (m *GetMessageListReactionExtensionsResp) XXX_Size() int { + return xxx_messageInfo_GetMessageListReactionExtensionsResp.Size(m) +} +func (m *GetMessageListReactionExtensionsResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetMessageListReactionExtensionsResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetMessageListReactionExtensionsResp proto.InternalMessageInfo + +func (m *GetMessageListReactionExtensionsResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *GetMessageListReactionExtensionsResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *GetMessageListReactionExtensionsResp) GetSingleMessageResult() []*SingleMessageExtensionResult { + if m != nil { + return m.SingleMessageResult + } + return nil +} + +type SingleMessageExtensionResult struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + ReactionExtensionList map[string]*sdk_ws.KeyValue `protobuf:"bytes,3,rep,name=reactionExtensionList" json:"reactionExtensionList,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + ClientMsgID string `protobuf:"bytes,4,opt,name=clientMsgID" json:"clientMsgID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SingleMessageExtensionResult) Reset() { *m = SingleMessageExtensionResult{} } +func (m *SingleMessageExtensionResult) String() string { return proto.CompactTextString(m) } +func (*SingleMessageExtensionResult) ProtoMessage() {} +func (*SingleMessageExtensionResult) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_4f5a59ae8be91efc, []int{27} +} +func (m *SingleMessageExtensionResult) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SingleMessageExtensionResult.Unmarshal(m, b) +} +func (m *SingleMessageExtensionResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SingleMessageExtensionResult.Marshal(b, m, deterministic) +} +func (dst *SingleMessageExtensionResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_SingleMessageExtensionResult.Merge(dst, src) +} +func (m *SingleMessageExtensionResult) XXX_Size() int { + return xxx_messageInfo_SingleMessageExtensionResult.Size(m) +} +func (m *SingleMessageExtensionResult) XXX_DiscardUnknown() { + xxx_messageInfo_SingleMessageExtensionResult.DiscardUnknown(m) +} + +var xxx_messageInfo_SingleMessageExtensionResult proto.InternalMessageInfo + +func (m *SingleMessageExtensionResult) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *SingleMessageExtensionResult) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *SingleMessageExtensionResult) GetReactionExtensionList() map[string]*sdk_ws.KeyValue { + if m != nil { + return m.ReactionExtensionList + } + return nil +} + +func (m *SingleMessageExtensionResult) GetClientMsgID() string { + if m != nil { + return m.ClientMsgID + } + return "" +} + +type ModifyMessageReactionExtensionsResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + SuccessList []*ExtendMsgResp `protobuf:"bytes,3,rep,name=successList" json:"successList,omitempty"` + FailedList []*ExtendMsgResp `protobuf:"bytes,4,rep,name=failedList" json:"failedList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ModifyMessageReactionExtensionsResp) Reset() { *m = ModifyMessageReactionExtensionsResp{} } +func (m *ModifyMessageReactionExtensionsResp) String() string { return proto.CompactTextString(m) } +func (*ModifyMessageReactionExtensionsResp) ProtoMessage() {} +func (*ModifyMessageReactionExtensionsResp) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_4f5a59ae8be91efc, []int{28} +} +func (m *ModifyMessageReactionExtensionsResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ModifyMessageReactionExtensionsResp.Unmarshal(m, b) +} +func (m *ModifyMessageReactionExtensionsResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ModifyMessageReactionExtensionsResp.Marshal(b, m, deterministic) +} +func (dst *ModifyMessageReactionExtensionsResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_ModifyMessageReactionExtensionsResp.Merge(dst, src) +} +func (m *ModifyMessageReactionExtensionsResp) XXX_Size() int { + return xxx_messageInfo_ModifyMessageReactionExtensionsResp.Size(m) +} +func (m *ModifyMessageReactionExtensionsResp) XXX_DiscardUnknown() { + xxx_messageInfo_ModifyMessageReactionExtensionsResp.DiscardUnknown(m) +} + +var xxx_messageInfo_ModifyMessageReactionExtensionsResp proto.InternalMessageInfo + +func (m *ModifyMessageReactionExtensionsResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *ModifyMessageReactionExtensionsResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *ModifyMessageReactionExtensionsResp) GetSuccessList() []*ExtendMsgResp { + if m != nil { + return m.SuccessList + } + return nil +} + +func (m *ModifyMessageReactionExtensionsResp) GetFailedList() []*ExtendMsgResp { + if m != nil { + return m.FailedList + } + return nil +} + +type DeleteMessageListReactionExtensionsReq struct { + OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"` + OpUserID string `protobuf:"bytes,2,opt,name=opUserID" json:"opUserID,omitempty"` + SourceID string `protobuf:"bytes,3,opt,name=sourceID" json:"sourceID,omitempty"` + SessionType int32 `protobuf:"varint,4,opt,name=sessionType" json:"sessionType,omitempty"` + ClientMsgID string `protobuf:"bytes,5,opt,name=clientMsgID" json:"clientMsgID,omitempty"` + IsExternalExtensions bool `protobuf:"varint,6,opt,name=isExternalExtensions" json:"isExternalExtensions,omitempty"` + MsgFirstModifyTime int64 `protobuf:"varint,7,opt,name=msgFirstModifyTime" json:"msgFirstModifyTime,omitempty"` + ReactionExtensionList []*sdk_ws.KeyValue `protobuf:"bytes,8,rep,name=reactionExtensionList" json:"reactionExtensionList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteMessageListReactionExtensionsReq) Reset() { + *m = DeleteMessageListReactionExtensionsReq{} +} +func (m *DeleteMessageListReactionExtensionsReq) String() string { return proto.CompactTextString(m) } +func (*DeleteMessageListReactionExtensionsReq) ProtoMessage() {} +func (*DeleteMessageListReactionExtensionsReq) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_4f5a59ae8be91efc, []int{29} +} +func (m *DeleteMessageListReactionExtensionsReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteMessageListReactionExtensionsReq.Unmarshal(m, b) +} +func (m *DeleteMessageListReactionExtensionsReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteMessageListReactionExtensionsReq.Marshal(b, m, deterministic) +} +func (dst *DeleteMessageListReactionExtensionsReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteMessageListReactionExtensionsReq.Merge(dst, src) +} +func (m *DeleteMessageListReactionExtensionsReq) XXX_Size() int { + return xxx_messageInfo_DeleteMessageListReactionExtensionsReq.Size(m) +} +func (m *DeleteMessageListReactionExtensionsReq) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteMessageListReactionExtensionsReq.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteMessageListReactionExtensionsReq proto.InternalMessageInfo + +func (m *DeleteMessageListReactionExtensionsReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *DeleteMessageListReactionExtensionsReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *DeleteMessageListReactionExtensionsReq) GetSourceID() string { + if m != nil { + return m.SourceID + } + return "" +} + +func (m *DeleteMessageListReactionExtensionsReq) GetSessionType() int32 { + if m != nil { + return m.SessionType + } + return 0 +} + +func (m *DeleteMessageListReactionExtensionsReq) GetClientMsgID() string { + if m != nil { + return m.ClientMsgID + } + return "" +} + +func (m *DeleteMessageListReactionExtensionsReq) GetIsExternalExtensions() bool { + if m != nil { + return m.IsExternalExtensions + } + return false +} + +func (m *DeleteMessageListReactionExtensionsReq) GetMsgFirstModifyTime() int64 { + if m != nil { + return m.MsgFirstModifyTime + } + return 0 +} + +func (m *DeleteMessageListReactionExtensionsReq) GetReactionExtensionList() []*sdk_ws.KeyValue { + if m != nil { + return m.ReactionExtensionList + } + return nil +} + +type DeleteMessageListReactionExtensionsResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + Result []*KeyValueResp `protobuf:"bytes,6,rep,name=result" json:"result,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteMessageListReactionExtensionsResp) Reset() { + *m = DeleteMessageListReactionExtensionsResp{} +} +func (m *DeleteMessageListReactionExtensionsResp) String() string { return proto.CompactTextString(m) } +func (*DeleteMessageListReactionExtensionsResp) ProtoMessage() {} +func (*DeleteMessageListReactionExtensionsResp) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_4f5a59ae8be91efc, []int{30} +} +func (m *DeleteMessageListReactionExtensionsResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteMessageListReactionExtensionsResp.Unmarshal(m, b) +} +func (m *DeleteMessageListReactionExtensionsResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteMessageListReactionExtensionsResp.Marshal(b, m, deterministic) +} +func (dst *DeleteMessageListReactionExtensionsResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteMessageListReactionExtensionsResp.Merge(dst, src) +} +func (m *DeleteMessageListReactionExtensionsResp) XXX_Size() int { + return xxx_messageInfo_DeleteMessageListReactionExtensionsResp.Size(m) +} +func (m *DeleteMessageListReactionExtensionsResp) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteMessageListReactionExtensionsResp.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteMessageListReactionExtensionsResp proto.InternalMessageInfo + +func (m *DeleteMessageListReactionExtensionsResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *DeleteMessageListReactionExtensionsResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *DeleteMessageListReactionExtensionsResp) GetResult() []*KeyValueResp { + if m != nil { + return m.Result + } + return nil +} + +type ExtendMsgResp struct { + ExtendMsg *ExtendMsg `protobuf:"bytes,1,opt,name=extendMsg" json:"extendMsg,omitempty"` + ErrCode int32 `protobuf:"varint,2,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,3,opt,name=errMsg" json:"errMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ExtendMsgResp) Reset() { *m = ExtendMsgResp{} } +func (m *ExtendMsgResp) String() string { return proto.CompactTextString(m) } +func (*ExtendMsgResp) ProtoMessage() {} +func (*ExtendMsgResp) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_4f5a59ae8be91efc, []int{31} +} +func (m *ExtendMsgResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ExtendMsgResp.Unmarshal(m, b) +} +func (m *ExtendMsgResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ExtendMsgResp.Marshal(b, m, deterministic) +} +func (dst *ExtendMsgResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExtendMsgResp.Merge(dst, src) +} +func (m *ExtendMsgResp) XXX_Size() int { + return xxx_messageInfo_ExtendMsgResp.Size(m) +} +func (m *ExtendMsgResp) XXX_DiscardUnknown() { + xxx_messageInfo_ExtendMsgResp.DiscardUnknown(m) +} + +var xxx_messageInfo_ExtendMsgResp proto.InternalMessageInfo + +func (m *ExtendMsgResp) GetExtendMsg() *ExtendMsg { + if m != nil { + return m.ExtendMsg + } + return nil +} + +func (m *ExtendMsgResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *ExtendMsgResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +type ExtendMsg struct { + ReactionExtensionList map[string]*KeyValueResp `protobuf:"bytes,1,rep,name=reactionExtensionList" json:"reactionExtensionList,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + ClientMsgID string `protobuf:"bytes,2,opt,name=clientMsgID" json:"clientMsgID,omitempty"` + MsgFirstModifyTime int64 `protobuf:"varint,3,opt,name=msgFirstModifyTime" json:"msgFirstModifyTime,omitempty"` + AttachedInfo string `protobuf:"bytes,4,opt,name=attachedInfo" json:"attachedInfo,omitempty"` + Ex string `protobuf:"bytes,5,opt,name=ex" json:"ex,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ExtendMsg) Reset() { *m = ExtendMsg{} } +func (m *ExtendMsg) String() string { return proto.CompactTextString(m) } +func (*ExtendMsg) ProtoMessage() {} +func (*ExtendMsg) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_4f5a59ae8be91efc, []int{32} +} +func (m *ExtendMsg) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ExtendMsg.Unmarshal(m, b) +} +func (m *ExtendMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ExtendMsg.Marshal(b, m, deterministic) +} +func (dst *ExtendMsg) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExtendMsg.Merge(dst, src) +} +func (m *ExtendMsg) XXX_Size() int { + return xxx_messageInfo_ExtendMsg.Size(m) +} +func (m *ExtendMsg) XXX_DiscardUnknown() { + xxx_messageInfo_ExtendMsg.DiscardUnknown(m) +} + +var xxx_messageInfo_ExtendMsg proto.InternalMessageInfo + +func (m *ExtendMsg) GetReactionExtensionList() map[string]*KeyValueResp { + if m != nil { + return m.ReactionExtensionList + } + return nil +} + +func (m *ExtendMsg) GetClientMsgID() string { + if m != nil { + return m.ClientMsgID + } + return "" +} + +func (m *ExtendMsg) GetMsgFirstModifyTime() int64 { + if m != nil { + return m.MsgFirstModifyTime + } + return 0 +} + +func (m *ExtendMsg) GetAttachedInfo() string { + if m != nil { + return m.AttachedInfo + } + return "" +} + +func (m *ExtendMsg) GetEx() string { + if m != nil { + return m.Ex + } + return "" +} + +type KeyValueResp struct { + KeyValue *sdk_ws.KeyValue `protobuf:"bytes,1,opt,name=keyValue" json:"keyValue,omitempty"` + ErrCode int32 `protobuf:"varint,2,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,3,opt,name=errMsg" json:"errMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *KeyValueResp) Reset() { *m = KeyValueResp{} } +func (m *KeyValueResp) String() string { return proto.CompactTextString(m) } +func (*KeyValueResp) ProtoMessage() {} +func (*KeyValueResp) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_4f5a59ae8be91efc, []int{33} +} +func (m *KeyValueResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_KeyValueResp.Unmarshal(m, b) +} +func (m *KeyValueResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_KeyValueResp.Marshal(b, m, deterministic) +} +func (dst *KeyValueResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_KeyValueResp.Merge(dst, src) +} +func (m *KeyValueResp) XXX_Size() int { + return xxx_messageInfo_KeyValueResp.Size(m) +} +func (m *KeyValueResp) XXX_DiscardUnknown() { + xxx_messageInfo_KeyValueResp.DiscardUnknown(m) +} + +var xxx_messageInfo_KeyValueResp proto.InternalMessageInfo + +func (m *KeyValueResp) GetKeyValue() *sdk_ws.KeyValue { + if m != nil { + return m.KeyValue + } + return nil +} + +func (m *KeyValueResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *KeyValueResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +type MsgDataToModifyByMQ struct { + AggregationID string `protobuf:"bytes,1,opt,name=aggregationID" json:"aggregationID,omitempty"` + MessageList []*MsgDataToMQ `protobuf:"bytes,2,rep,name=messageList" json:"messageList,omitempty"` + TriggerID string `protobuf:"bytes,3,opt,name=triggerID" json:"triggerID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MsgDataToModifyByMQ) Reset() { *m = MsgDataToModifyByMQ{} } +func (m *MsgDataToModifyByMQ) String() string { return proto.CompactTextString(m) } +func (*MsgDataToModifyByMQ) ProtoMessage() {} +func (*MsgDataToModifyByMQ) Descriptor() ([]byte, []int) { + return fileDescriptor_msg_4f5a59ae8be91efc, []int{34} +} +func (m *MsgDataToModifyByMQ) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MsgDataToModifyByMQ.Unmarshal(m, b) +} +func (m *MsgDataToModifyByMQ) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MsgDataToModifyByMQ.Marshal(b, m, deterministic) +} +func (dst *MsgDataToModifyByMQ) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDataToModifyByMQ.Merge(dst, src) +} +func (m *MsgDataToModifyByMQ) XXX_Size() int { + return xxx_messageInfo_MsgDataToModifyByMQ.Size(m) +} +func (m *MsgDataToModifyByMQ) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDataToModifyByMQ.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDataToModifyByMQ proto.InternalMessageInfo + +func (m *MsgDataToModifyByMQ) GetAggregationID() string { + if m != nil { + return m.AggregationID + } + return "" +} + +func (m *MsgDataToModifyByMQ) GetMessageList() []*MsgDataToMQ { + if m != nil { + return m.MessageList + } + return nil +} + +func (m *MsgDataToModifyByMQ) GetTriggerID() string { + if m != nil { + return m.TriggerID + } + return "" +} + func init() { proto.RegisterType((*MsgDataToMQ)(nil), "msg.MsgDataToMQ") proto.RegisterType((*MsgDataToDB)(nil), "msg.MsgDataToDB") @@ -1231,6 +2228,24 @@ func init() { proto.RegisterType((*GetSuperGroupMsgResp)(nil), "msg.GetSuperGroupMsgResp") proto.RegisterType((*GetWriteDiffMsgReq)(nil), "msg.GetWriteDiffMsgReq") proto.RegisterType((*GetWriteDiffMsgResp)(nil), "msg.GetWriteDiffMsgResp") + proto.RegisterType((*ModifyMessageReactionExtensionsReq)(nil), "msg.ModifyMessageReactionExtensionsReq") + proto.RegisterMapType((map[string]*sdk_ws.KeyValue)(nil), "msg.ModifyMessageReactionExtensionsReq.ReactionExtensionListEntry") + proto.RegisterType((*SetMessageReactionExtensionsReq)(nil), "msg.SetMessageReactionExtensionsReq") + proto.RegisterMapType((map[string]*sdk_ws.KeyValue)(nil), "msg.SetMessageReactionExtensionsReq.ReactionExtensionListEntry") + proto.RegisterType((*SetMessageReactionExtensionsResp)(nil), "msg.SetMessageReactionExtensionsResp") + proto.RegisterType((*GetMessageListReactionExtensionsReq)(nil), "msg.GetMessageListReactionExtensionsReq") + proto.RegisterType((*GetMessageListReactionExtensionsReq_MessageReactionKey)(nil), "msg.GetMessageListReactionExtensionsReq.MessageReactionKey") + proto.RegisterType((*GetMessageListReactionExtensionsResp)(nil), "msg.GetMessageListReactionExtensionsResp") + proto.RegisterType((*SingleMessageExtensionResult)(nil), "msg.SingleMessageExtensionResult") + proto.RegisterMapType((map[string]*sdk_ws.KeyValue)(nil), "msg.SingleMessageExtensionResult.ReactionExtensionListEntry") + proto.RegisterType((*ModifyMessageReactionExtensionsResp)(nil), "msg.ModifyMessageReactionExtensionsResp") + proto.RegisterType((*DeleteMessageListReactionExtensionsReq)(nil), "msg.DeleteMessageListReactionExtensionsReq") + proto.RegisterType((*DeleteMessageListReactionExtensionsResp)(nil), "msg.DeleteMessageListReactionExtensionsResp") + proto.RegisterType((*ExtendMsgResp)(nil), "msg.ExtendMsgResp") + proto.RegisterType((*ExtendMsg)(nil), "msg.ExtendMsg") + proto.RegisterMapType((map[string]*KeyValueResp)(nil), "msg.ExtendMsg.ReactionExtensionListEntry") + proto.RegisterType((*KeyValueResp)(nil), "msg.KeyValueResp") + proto.RegisterType((*MsgDataToModifyByMQ)(nil), "msg.MsgDataToModifyByMQ") } // Reference imports to suppress errors if they are not otherwise used. @@ -1255,6 +2270,11 @@ type MsgClient interface { GetSendMsgStatus(ctx context.Context, in *GetSendMsgStatusReq, opts ...grpc.CallOption) (*GetSendMsgStatusResp, error) GetSuperGroupMsg(ctx context.Context, in *GetSuperGroupMsgReq, opts ...grpc.CallOption) (*GetSuperGroupMsgResp, error) GetWriteDiffMsg(ctx context.Context, in *GetWriteDiffMsgReq, opts ...grpc.CallOption) (*GetWriteDiffMsgResp, error) + // modify msg + SetMessageReactionExtensions(ctx context.Context, in *SetMessageReactionExtensionsReq, opts ...grpc.CallOption) (*SetMessageReactionExtensionsResp, error) + GetMessageListReactionExtensions(ctx context.Context, in *GetMessageListReactionExtensionsReq, opts ...grpc.CallOption) (*GetMessageListReactionExtensionsResp, error) + AddMessageReactionExtensions(ctx context.Context, in *ModifyMessageReactionExtensionsReq, opts ...grpc.CallOption) (*ModifyMessageReactionExtensionsResp, error) + DeleteMessageReactionExtensions(ctx context.Context, in *DeleteMessageListReactionExtensionsReq, opts ...grpc.CallOption) (*DeleteMessageListReactionExtensionsResp, error) } type msgClient struct { @@ -1364,6 +2384,42 @@ func (c *msgClient) GetWriteDiffMsg(ctx context.Context, in *GetWriteDiffMsgReq, return out, nil } +func (c *msgClient) SetMessageReactionExtensions(ctx context.Context, in *SetMessageReactionExtensionsReq, opts ...grpc.CallOption) (*SetMessageReactionExtensionsResp, error) { + out := new(SetMessageReactionExtensionsResp) + err := grpc.Invoke(ctx, "/msg.msg/SetMessageReactionExtensions", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) GetMessageListReactionExtensions(ctx context.Context, in *GetMessageListReactionExtensionsReq, opts ...grpc.CallOption) (*GetMessageListReactionExtensionsResp, error) { + out := new(GetMessageListReactionExtensionsResp) + err := grpc.Invoke(ctx, "/msg.msg/GetMessageListReactionExtensions", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) AddMessageReactionExtensions(ctx context.Context, in *ModifyMessageReactionExtensionsReq, opts ...grpc.CallOption) (*ModifyMessageReactionExtensionsResp, error) { + out := new(ModifyMessageReactionExtensionsResp) + err := grpc.Invoke(ctx, "/msg.msg/AddMessageReactionExtensions", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) DeleteMessageReactionExtensions(ctx context.Context, in *DeleteMessageListReactionExtensionsReq, opts ...grpc.CallOption) (*DeleteMessageListReactionExtensionsResp, error) { + out := new(DeleteMessageListReactionExtensionsResp) + err := grpc.Invoke(ctx, "/msg.msg/DeleteMessageReactionExtensions", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // Server API for Msg service type MsgServer interface { @@ -1378,6 +2434,11 @@ type MsgServer interface { GetSendMsgStatus(context.Context, *GetSendMsgStatusReq) (*GetSendMsgStatusResp, error) GetSuperGroupMsg(context.Context, *GetSuperGroupMsgReq) (*GetSuperGroupMsgResp, error) GetWriteDiffMsg(context.Context, *GetWriteDiffMsgReq) (*GetWriteDiffMsgResp, error) + // modify msg + SetMessageReactionExtensions(context.Context, *SetMessageReactionExtensionsReq) (*SetMessageReactionExtensionsResp, error) + GetMessageListReactionExtensions(context.Context, *GetMessageListReactionExtensionsReq) (*GetMessageListReactionExtensionsResp, error) + AddMessageReactionExtensions(context.Context, *ModifyMessageReactionExtensionsReq) (*ModifyMessageReactionExtensionsResp, error) + DeleteMessageReactionExtensions(context.Context, *DeleteMessageListReactionExtensionsReq) (*DeleteMessageListReactionExtensionsResp, error) } func RegisterMsgServer(s *grpc.Server, srv MsgServer) { @@ -1582,6 +2643,78 @@ func _Msg_GetWriteDiffMsg_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _Msg_SetMessageReactionExtensions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetMessageReactionExtensionsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetMessageReactionExtensions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/msg.msg/SetMessageReactionExtensions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetMessageReactionExtensions(ctx, req.(*SetMessageReactionExtensionsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_GetMessageListReactionExtensions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetMessageListReactionExtensionsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).GetMessageListReactionExtensions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/msg.msg/GetMessageListReactionExtensions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).GetMessageListReactionExtensions(ctx, req.(*GetMessageListReactionExtensionsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_AddMessageReactionExtensions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ModifyMessageReactionExtensionsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).AddMessageReactionExtensions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/msg.msg/AddMessageReactionExtensions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).AddMessageReactionExtensions(ctx, req.(*ModifyMessageReactionExtensionsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_DeleteMessageReactionExtensions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteMessageListReactionExtensionsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).DeleteMessageReactionExtensions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/msg.msg/DeleteMessageReactionExtensions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).DeleteMessageReactionExtensions(ctx, req.(*DeleteMessageListReactionExtensionsReq)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "msg.msg", HandlerType: (*MsgServer)(nil), @@ -1630,71 +2763,134 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "GetWriteDiffMsg", Handler: _Msg_GetWriteDiffMsg_Handler, }, + { + MethodName: "SetMessageReactionExtensions", + Handler: _Msg_SetMessageReactionExtensions_Handler, + }, + { + MethodName: "GetMessageListReactionExtensions", + Handler: _Msg_GetMessageListReactionExtensions_Handler, + }, + { + MethodName: "AddMessageReactionExtensions", + Handler: _Msg_AddMessageReactionExtensions_Handler, + }, + { + MethodName: "DeleteMessageReactionExtensions", + Handler: _Msg_DeleteMessageReactionExtensions_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "msg/msg.proto", } -func init() { proto.RegisterFile("msg/msg.proto", fileDescriptor_msg_3f0146015dfd26d9) } +func init() { proto.RegisterFile("msg/msg.proto", fileDescriptor_msg_4f5a59ae8be91efc) } -var fileDescriptor_msg_3f0146015dfd26d9 = []byte{ - // 928 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0xcf, 0x6f, 0xe3, 0x44, - 0x14, 0x96, 0xe3, 0x26, 0xdd, 0xbe, 0xb4, 0x6a, 0x98, 0x86, 0xe2, 0x35, 0x1c, 0x82, 0x05, 0x28, - 0x02, 0xb6, 0x91, 0x0a, 0x12, 0x87, 0xbd, 0x40, 0xd7, 0x2b, 0x6f, 0x25, 0x4c, 0xb7, 0x76, 0x11, - 0x12, 0x97, 0xae, 0x69, 0x66, 0x67, 0xad, 0xc6, 0xf6, 0xd4, 0xcf, 0xa1, 0xbb, 0x20, 0xb8, 0x71, - 0xe4, 0x0f, 0xe0, 0xc4, 0x8d, 0x3b, 0xff, 0x21, 0x9a, 0x19, 0x27, 0x19, 0xff, 0x28, 0x2d, 0x61, - 0xb5, 0xb7, 0xbc, 0x37, 0x6f, 0xbe, 0xf7, 0x7d, 0x6f, 0xde, 0xcc, 0x8b, 0x61, 0x27, 0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, 0x0f, 0x72, 0xf2, 0x10, 0xb6, 0xf5, 0x17, 0x9d, - 0x0c, 0x4b, 0xb9, 0x95, 0xf9, 0x63, 0xbf, 0xdd, 0xe2, 0x55, 0xb4, 0xeb, 0xef, 0x6e, 0x49, 0xbb, - 0xe5, 0x7d, 0x2f, 0x69, 0xb7, 0x3e, 0xd4, 0x1e, 0x0c, 0xbc, 0x76, 0x20, 0xef, 0x46, 0x20, 0xef, - 0x5f, 0x80, 0x5a, 0x0a, 0xd9, 0xf2, 0xd2, 0x68, 0x40, 0x8d, 0x42, 0xba, 0xb2, 0xcb, 0xf5, 0xcb, - 0x46, 0xde, 0x59, 0x44, 0xd7, 0x2e, 0xb3, 0x6d, 0xb5, 0x2f, 0x20, 0x3f, 0x7a, 0xf7, 0xfb, 0xfb, - 0xe2, 0x13, 0xe5, 0xfc, 0xd8, 0xd7, 0xbe, 0x4d, 0x12, 0x64, 0x0f, 0x13, 0x64, 0x3f, 0xf4, 0xa4, - 0xf9, 0xd9, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x68, 0xc1, 0xb8, 0x4c, 0xda, 0x0c, 0x00, 0x00, +var fileDescriptor_msg_4f5a59ae8be91efc = []byte{ + // 1672 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x59, 0xcd, 0x6e, 0xdb, 0xc6, + 0x16, 0x06, 0x49, 0x4b, 0xb6, 0x8f, 0xec, 0xd8, 0x19, 0x3b, 0xbe, 0x0a, 0x63, 0x20, 0x0a, 0xf3, + 0xa7, 0xdc, 0x24, 0x32, 0xae, 0xef, 0x05, 0x72, 0xd1, 0x14, 0x68, 0xe2, 0xc8, 0x55, 0x8c, 0x94, + 0x75, 0x4c, 0xb9, 0x2d, 0xd0, 0x2e, 0x1c, 0x46, 0x1a, 0x33, 0x84, 0x25, 0x92, 0xe6, 0x50, 0xb1, + 0xd5, 0xbf, 0x5d, 0x8b, 0x02, 0x45, 0x16, 0x5d, 0x76, 0xd5, 0x5d, 0x77, 0x7d, 0x88, 0x3e, 0x40, + 0xd1, 0x07, 0xe9, 0x33, 0xb4, 0x28, 0x66, 0x86, 0x92, 0x86, 0x7f, 0x16, 0x2d, 0x17, 0x41, 0x0a, + 0x74, 0xa7, 0x99, 0x39, 0x73, 0xe6, 0xfb, 0xce, 0xf9, 0xe6, 0x87, 0x47, 0x30, 0xdf, 0x25, 0xd6, + 0x5a, 0x97, 0x58, 0x35, 0xcf, 0x77, 0x03, 0x17, 0x29, 0x5d, 0x62, 0xa9, 0xd5, 0x6d, 0x0f, 0x3b, + 0x77, 0xb7, 0xf4, 0xbb, 0x4d, 0xec, 0xbf, 0xc4, 0xfe, 0x9a, 0x77, 0x60, 0xad, 0xb1, 0xe1, 0x35, + 0xd2, 0x3e, 0xd8, 0x3b, 0x22, 0x6b, 0x47, 0x84, 0x9b, 0xab, 0xb5, 0xb1, 0x96, 0xbe, 0xe9, 0x79, + 0xd8, 0x0f, 0xed, 0xb5, 0xcf, 0xa0, 0xa4, 0x13, 0xab, 0x6e, 0x06, 0xe6, 0xae, 0xab, 0xef, 0xa0, + 0x65, 0x28, 0x04, 0xee, 0x01, 0x76, 0xca, 0x52, 0x45, 0xaa, 0xce, 0x1a, 0xbc, 0x81, 0x2a, 0x50, + 0x72, 0x3d, 0xec, 0x9b, 0x81, 0xed, 0x3a, 0x5b, 0xf5, 0xb2, 0xcc, 0xc6, 0xc4, 0x2e, 0xf4, 0x3f, + 0x98, 0xee, 0x72, 0x37, 0x65, 0xa5, 0x22, 0x55, 0x4b, 0xeb, 0x6a, 0x8d, 0x30, 0x00, 0x7b, 0xa6, + 0x67, 0xef, 0x79, 0xa6, 0x6f, 0x76, 0x49, 0x2d, 0x5c, 0xc8, 0x18, 0x98, 0x6a, 0x58, 0x58, 0xbc, + 0xbe, 0x21, 0x3a, 0x91, 0x72, 0x3b, 0x19, 0x0f, 0x4e, 0x7b, 0x25, 0xc1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xa4, 0x3b, 0x6a, 0x64, 0x3a, 0x6a, 0x9c, + 0xe0, 0x28, 0x25, 0x90, 0x29, 0x55, 0x39, 0xc1, 0x51, 0x22, 0x90, 0x75, 0xa6, 0x72, 0xb1, 0x30, + 0x85, 0xfe, 0x35, 0xb0, 0x8e, 0x15, 0xbe, 0xd4, 0x72, 0xfa, 0x00, 0xf1, 0xd0, 0x01, 0xac, 0x9e, + 0xf4, 0xf1, 0x84, 0xae, 0xe5, 0xf9, 0x58, 0x56, 0xaf, 0xe7, 0xb0, 0x22, 0x1e, 0x3a, 0x82, 0xca, + 0xb8, 0xa7, 0x33, 0xaa, 0xe6, 0xfd, 0x38, 0x50, 0x6f, 0xe5, 0xb4, 0x24, 0x1e, 0x3a, 0x84, 0xd5, + 0x87, 0xed, 0x76, 0x36, 0xcb, 0x9b, 0x39, 0x6b, 0x54, 0x6a, 0x35, 0x9f, 0x21, 0xf1, 0xd0, 0xe7, + 0x70, 0x39, 0x72, 0xc5, 0xa7, 0xac, 0x7a, 0x7b, 0xb0, 0x4b, 0x72, 0x3c, 0xc4, 0xd4, 0x3b, 0xf9, + 0x8d, 0x89, 0xb7, 0x71, 0xe9, 0xe3, 0x8b, 0xdb, 0x1e, 0x76, 0xf6, 0xb6, 0x74, 0xe1, 0x4f, 0xda, + 0x2e, 0xb1, 0xee, 0x77, 0x89, 0xf5, 0xbc, 0xc8, 0x9a, 0xff, 0xfd, 0x33, 0x00, 0x00, 0xff, 0xff, + 0xd4, 0xae, 0xa9, 0xee, 0x0d, 0x1e, 0x00, 0x00, } diff --git a/pkg/proto/msg/msg.proto b/pkg/proto/msg/msg.proto index 38144eec9..287340517 100644 --- a/pkg/proto/msg/msg.proto +++ b/pkg/proto/msg/msg.proto @@ -154,27 +154,118 @@ message GetWriteDiffMsgResp{ server_api_params.MsgData msgData = 3; } -message ModifyMsgReq { +message ModifyMessageReactionExtensionsReq { string operationID = 1; - string ID = 2; - int32 Index = 3; - int32 msgIndex = 4; - string opUserID = 5; - string userID = 6; - bool isFirstModify = 7; - string clientMsgID = 8; - google.protobuf.StringValue value = 9; - google.protobuf.StringValue ex = 10; - google.protobuf.StringValue attachedInfo = 11; + string sourceID = 2; + string opUserID = 3; + int32 sessionType = 4; + map reactionExtensionList = 5; + string clientMsgID = 6; + google.protobuf.StringValue ex = 7; + google.protobuf.StringValue attachedInfo = 8; + bool isReact = 9; + bool isExternalExtensions = 10; + int64 msgFirstModifyTime = 11; } - -message ModifyMsgResp { +message SetMessageReactionExtensionsReq { + string operationID = 1; + string sourceID = 2; + string opUserID = 3; + int32 sessionType = 4; + map reactionExtensionList = 5; + string clientMsgID = 6; + google.protobuf.StringValue ex = 7; + google.protobuf.StringValue attachedInfo = 8; + bool isReact = 9; + bool isExternalExtensions = 10; + int64 msgFirstModifyTime = 11; +} +message SetMessageReactionExtensionsResp { int32 errCode = 1; string errMsg = 2; - int32 Index = 4; - int32 msgIndex = 3; + string clientMsgID = 3; + int64 msgFirstModifyTime = 4; + bool isReact = 5; + repeated KeyValueResp result = 6; } + +message GetMessageListReactionExtensionsReq { + string operationID = 1; + string opUserID = 2; + string sourceID = 3; + int32 sessionType = 4; + message MessageReactionKey { + string clientMsgID = 1; + int64 msgFirstModifyTime = 2; + } + repeated MessageReactionKey messageReactionKeyList = 5; +} +message GetMessageListReactionExtensionsResp{ + int32 errCode = 1; + string errMsg = 2; + repeated SingleMessageExtensionResult singleMessageResult =3; + +} +message SingleMessageExtensionResult { + int32 errCode = 1; + string errMsg = 2; + map reactionExtensionList = 3; + string clientMsgID = 4; +} + + +message ModifyMessageReactionExtensionsResp { + int32 errCode = 1; + string errMsg = 2; + repeated ExtendMsgResp successList = 3; + repeated ExtendMsgResp failedList = 4; +} + +message DeleteMessageListReactionExtensionsReq { + string operationID = 1; + string opUserID = 2; + string sourceID = 3; + int32 sessionType = 4; + string clientMsgID = 5; + bool isExternalExtensions = 6; + int64 msgFirstModifyTime = 7; + repeated server_api_params.KeyValue reactionExtensionList = 8; +} + +message DeleteMessageListReactionExtensionsResp { + int32 errCode = 1; + string errMsg = 2; + repeated KeyValueResp result = 6; +} + +message ExtendMsgResp { + ExtendMsg extendMsg = 1; + int32 errCode = 2; + string errMsg = 3; +} + +message ExtendMsg { + map reactionExtensionList = 1; + string clientMsgID = 2; + int64 msgFirstModifyTime = 3; + string attachedInfo = 4; + string ex = 5; +} + +message KeyValueResp { + server_api_params.KeyValue keyValue = 1; + int32 errCode = 2; + string errMsg = 3; +} + +message MsgDataToModifyByMQ{ + string aggregationID = 1; + repeated MsgDataToMQ messageList = 2; + string triggerID = 3; +} + + service msg { rpc GetMaxAndMinSeq(server_api_params.GetMaxAndMinSeqReq) returns(server_api_params.GetMaxAndMinSeqResp); rpc PullMessageBySeqList(server_api_params.PullMessageBySeqListReq) returns(server_api_params.PullMessageBySeqListResp); @@ -189,5 +280,8 @@ service msg { rpc GetWriteDiffMsg(GetWriteDiffMsgReq) returns(GetWriteDiffMsgResp); // modify msg - rpc ModifyMsg(ModifyMsgReq) returns(ModifyMsgResp); + rpc SetMessageReactionExtensions(SetMessageReactionExtensionsReq) returns(SetMessageReactionExtensionsResp); + rpc GetMessageListReactionExtensions(GetMessageListReactionExtensionsReq) returns(GetMessageListReactionExtensionsResp); + rpc AddMessageReactionExtensions(ModifyMessageReactionExtensionsReq) returns(ModifyMessageReactionExtensionsResp); + rpc DeleteMessageReactionExtensions(DeleteMessageListReactionExtensionsReq) returns(DeleteMessageListReactionExtensionsResp); } diff --git a/pkg/proto/sdk_ws/ws.proto b/pkg/proto/sdk_ws/ws.proto index f687ddb5b..843771ee7 100644 --- a/pkg/proto/sdk_ws/ws.proto +++ b/pkg/proto/sdk_ws/ws.proto @@ -709,25 +709,27 @@ message SetAppBackgroundStatusResp { } message ExtendMsgSet { - string ID = 1; -// repeated ExtendMsg extendMsgs = 2; - int32 latestUpdateTime = 3; + string sourceID = 1; + int32 sessionType = 2; + map extendMsgs = 3; + int64 MaxMsgUpdateTime = 4; + int32 extendMsgNum = 5; + int64 createTime = 6; +} + +message ExtendMsg { + map reactionExtensionList = 1; + string clientMsgID = 2; + int64 msgFirstModifyTime = 3; string attachedInfo = 4; string ex = 5; - int32 extendMsgNum = 6; - int32 createTime = 7; } -//message ExtendMsg { -// repeated ReactionExtendMsgSet content = 1; -// string clientMsgID = 2; -// int32 createTime = 3; -// int32 latestUpdateTime = 4; -//} - -message ReactionExtendMsgSet { - string userKey = 1; +message KeyValue { + string typeKey = 1; string value = 2; - int32 latestUpdateTime = 3; + int64 latestUpdateTime = 3; } + +