Merge remote-tracking branch 'origin/errcode' into errcode

This commit is contained in:
withchao 2023-05-05 12:03:44 +08:00
commit 66757099f6
48 changed files with 3027 additions and 2448 deletions

7
go.mod
View File

@ -41,12 +41,10 @@ require (
gorm.io/gorm v1.23.8 gorm.io/gorm v1.23.8
) )
require ( require github.com/google/uuid v1.3.0
github.com/google/uuid v1.3.0
github.com/minio/minio-go v6.0.14+incompatible
)
require ( require (
github.com/go-redis/redis v6.15.9+incompatible
github.com/go-sql-driver/mysql v1.6.0 github.com/go-sql-driver/mysql v1.6.0
k8s.io/apimachinery v0.27.1 k8s.io/apimachinery v0.27.1
k8s.io/client-go v0.27.1 k8s.io/client-go v0.27.1
@ -144,7 +142,6 @@ require (
) )
require ( require (
github.com/go-ini/ini v1.67.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/locales v0.14.1 // indirect
github.com/goccy/go-json v0.10.0 // indirect github.com/goccy/go-json v0.10.0 // indirect
github.com/jonboulle/clockwork v0.3.0 // indirect github.com/jonboulle/clockwork v0.3.0 // indirect

6
go.sum
View File

@ -460,8 +460,6 @@ github.com/gin-gonic/gin v1.8.2/go.mod h1:qw5AYuDrzRTnhvusDsrov+fDIxp9Dleuu12h8n
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A=
github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
@ -488,6 +486,8 @@ github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/j
github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA=
github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ=
github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU=
github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGKFlFgcHWWmHQjg=
github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI=
github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
@ -694,8 +694,6 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0j
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/minio/md5-simd v1.1.0 h1:QPfiOqlZH+Cj9teu0t9b1nTBfPbyTl16Of5MeuShdK4= github.com/minio/md5-simd v1.1.0 h1:QPfiOqlZH+Cj9teu0t9b1nTBfPbyTl16Of5MeuShdK4=
github.com/minio/md5-simd v1.1.0/go.mod h1:XpBqgZULrMYD3R+M28PcmP0CkI7PEMzB3U77ZrKZ0Gw= github.com/minio/md5-simd v1.1.0/go.mod h1:XpBqgZULrMYD3R+M28PcmP0CkI7PEMzB3U77ZrKZ0Gw=
github.com/minio/minio-go v6.0.14+incompatible h1:fnV+GD28LeqdN6vT2XdGKW8Qe/IfjJDswNVuni6km9o=
github.com/minio/minio-go v6.0.14+incompatible/go.mod h1:7guKYtitv8dktvNUGrhzmNlA5wrAABTQXCoesZdFQO8=
github.com/minio/minio-go/v7 v7.0.22 h1:iXhsiRyYh1ozm/+jN2qGgEIahYjEkvcpuu6NcdpSxcA= github.com/minio/minio-go/v7 v7.0.22 h1:iXhsiRyYh1ozm/+jN2qGgEIahYjEkvcpuu6NcdpSxcA=
github.com/minio/minio-go/v7 v7.0.22/go.mod h1:ei5JjmxwHaMrgsMrn4U/+Nmg+d8MKS1U2DAn1ou4+Do= github.com/minio/minio-go/v7 v7.0.22/go.mod h1:ei5JjmxwHaMrgsMrn4U/+Nmg+d8MKS1U2DAn1ou4+Do=
github.com/minio/sha256-simd v0.1.1 h1:5QHSlgo3nt5yKOJrC7W8w7X+NFl8cMPZm96iu8kKUJU= github.com/minio/sha256-simd v0.1.1 h1:5QHSlgo3nt5yKOJrC7W8w7X+NFl8cMPZm96iu8kKUJU=

View File

@ -110,7 +110,8 @@ func (ws *WsServer) Run() error {
} }
} }
}() }()
http.HandleFunc("/", ws.wsHandler) //Get request from client to handle by wsHandler http.HandleFunc("/", ws.wsHandler)
// http.HandleFunc("/metrics", func(w http.ResponseWriter, r *http.Request) {})
return http.ListenAndServe(":"+utils.IntToString(ws.port), nil) //Start listening return http.ListenAndServe(":"+utils.IntToString(ws.port), nil) //Start listening
} }

View File

@ -2,6 +2,7 @@ package msgtransfer
import ( import (
"fmt" "fmt"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
@ -59,7 +60,7 @@ func StartTransfer(prometheusPort int) error {
} }
func NewMsgTransfer(chatLogDatabase controller.ChatLogDatabase, func NewMsgTransfer(chatLogDatabase controller.ChatLogDatabase,
extendMsgDatabase controller.ExtendMsgDatabase, msgDatabase controller.MsgDatabase, notificationDatabase controller.MsgDatabase, extendMsgDatabase controller.ExtendMsgDatabase, msgDatabase controller.MsgDatabase, notificationDatabase controller.NotificationDatabase,
conversationRpcClient *rpcclient.ConversationClient) *MsgTransfer { conversationRpcClient *rpcclient.ConversationClient) *MsgTransfer {
return &MsgTransfer{persistentCH: NewPersistentConsumerHandler(chatLogDatabase), historyCH: NewOnlineHistoryRedisConsumerHandler(msgDatabase, conversationRpcClient), return &MsgTransfer{persistentCH: NewPersistentConsumerHandler(chatLogDatabase), historyCH: NewOnlineHistoryRedisConsumerHandler(msgDatabase, conversationRpcClient),
historyMongoCH: NewOnlineHistoryMongoConsumerHandler(msgDatabase, notificationDatabase), modifyCH: NewModifyMsgConsumerHandler(extendMsgDatabase)} historyMongoCH: NewOnlineHistoryMongoConsumerHandler(msgDatabase, notificationDatabase), modifyCH: NewModifyMsgConsumerHandler(extendMsgDatabase)}

View File

@ -62,15 +62,15 @@ func (mmc *ModifyMsgConsumerHandler) ModifyMsg(ctx context.Context, cMsg *sarama
return return
} }
log.Debug(msgFromMQ.TriggerID, "proto.Unmarshal MsgDataToMQ", msgFromMQ.String()) log.Debug(msgFromMQ.TriggerID, "proto.Unmarshal MsgDataToMQ", msgFromMQ.String())
for _, msgDataToMQ := range msgFromMQ.Messages { for _, msg := range msgFromMQ.Messages {
isReactionFromCache := utils.GetSwitchFromOptions(msgDataToMQ.MsgData.Options, constant.IsReactionFromCache) isReactionFromCache := utils.GetSwitchFromOptions(msg.Options, constant.IsReactionFromCache)
if !isReactionFromCache { if !isReactionFromCache {
continue continue
} }
ctx = mcontext.SetOperationID(ctx, operationID) ctx = mcontext.SetOperationID(ctx, operationID)
if msgDataToMQ.MsgData.ContentType == constant.ReactionMessageModifier { if msg.ContentType == constant.ReactionMessageModifier {
notification := &sdkws.ReactionMessageModifierNotification{} notification := &sdkws.ReactionMessageModifierNotification{}
if err := json.Unmarshal(msgDataToMQ.MsgData.Content, notification); err != nil { if err := json.Unmarshal(msg.Content, notification); err != nil {
continue continue
} }
if notification.IsExternalExtensions { if notification.IsExternalExtensions {
@ -93,21 +93,21 @@ func (mmc *ModifyMsgConsumerHandler) ModifyMsg(ctx context.Context, cMsg *sarama
} }
} }
if err := mmc.extendMsgDatabase.InsertExtendMsg(ctx, notification.SourceID, notification.SessionType, &extendMsg); err != nil { if err := mmc.extendMsgDatabase.InsertExtendMsg(ctx, notification.ConversationID, notification.SessionType, &extendMsg); err != nil {
log.NewError(operationID, "MsgFirstModify InsertExtendMsg failed", notification.SourceID, notification.SessionType, extendMsg, err.Error()) log.NewError(operationID, "MsgFirstModify InsertExtendMsg failed", notification.ConversationID, notification.SessionType, extendMsg, err.Error())
continue continue
} }
} else { } else {
if err := mmc.extendMsgDatabase.InsertOrUpdateReactionExtendMsgSet(ctx, notification.SourceID, notification.SessionType, notification.ClientMsgID, notification.MsgFirstModifyTime, mmc.extendSetMsgModel.Pb2Model(notification.SuccessReactionExtensions)); err != nil { if err := mmc.extendMsgDatabase.InsertOrUpdateReactionExtendMsgSet(ctx, notification.ConversationID, notification.SessionType, notification.ClientMsgID, notification.MsgFirstModifyTime, mmc.extendSetMsgModel.Pb2Model(notification.SuccessReactionExtensions)); err != nil {
log.NewError(operationID, "InsertOrUpdateReactionExtendMsgSet failed") log.NewError(operationID, "InsertOrUpdateReactionExtendMsgSet failed")
} }
} }
} else if msgDataToMQ.MsgData.ContentType == constant.ReactionMessageDeleter { } else if msg.ContentType == constant.ReactionMessageDeleter {
notification := &sdkws.ReactionMessageDeleteNotification{} notification := &sdkws.ReactionMessageDeleteNotification{}
if err := json.Unmarshal(msgDataToMQ.MsgData.Content, notification); err != nil { if err := json.Unmarshal(msg.Content, notification); err != nil {
continue continue
} }
if err := mmc.extendMsgDatabase.DeleteReactionExtendMsgSet(ctx, notification.SourceID, notification.SessionType, notification.ClientMsgID, notification.MsgFirstModifyTime, mmc.extendSetMsgModel.Pb2Model(notification.SuccessReactionExtensions)); err != nil { if err := mmc.extendMsgDatabase.DeleteReactionExtendMsgSet(ctx, notification.ConversationID, notification.SessionType, notification.ClientMsgID, notification.MsgFirstModifyTime, mmc.extendSetMsgModel.Pb2Model(notification.SuccessReactionExtensions)); err != nil {
log.NewError(operationID, "InsertOrUpdateReactionExtendMsgSet failed") log.NewError(operationID, "InsertOrUpdateReactionExtendMsgSet failed")
} }
} }

View File

@ -2,7 +2,6 @@ package msgtransfer
import ( import (
"context" "context"
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
"sync" "sync"
"time" "time"
@ -13,12 +12,11 @@ import (
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/log" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/log"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/mcontext" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/mcontext"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/prome" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/prome"
pbConversation "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/conversation"
pbMsg "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/msg"
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws" "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
"github.com/OpenIMSDK/Open-IM-Server/pkg/utils" "github.com/OpenIMSDK/Open-IM-Server/pkg/utils"
"github.com/Shopify/sarama" "github.com/Shopify/sarama"
"github.com/go-redis/redis"
"github.com/golang/protobuf/proto" "github.com/golang/protobuf/proto"
) )
@ -28,7 +26,7 @@ const MongoMessages = 5
const ChannelNum = 100 const ChannelNum = 100
type MsgChannelValue struct { type MsgChannelValue struct {
sourceID string //maybe userID or super groupID conversationID string //maybe userID or super groupID
ctx context.Context ctx context.Context
ctxMsgList []*ContextMsg ctxMsgList []*ContextMsg
} }
@ -88,12 +86,12 @@ func (och *OnlineHistoryRedisConsumerHandler) Run(channelID int) {
msgChannelValue := cmd.Value.(MsgChannelValue) msgChannelValue := cmd.Value.(MsgChannelValue)
ctxMsgList := msgChannelValue.ctxMsgList ctxMsgList := msgChannelValue.ctxMsgList
ctx := msgChannelValue.ctx ctx := msgChannelValue.ctx
log.ZDebug(ctx, "msg arrived channel", "channel id", channelID, "msgList length", len(ctxMsgList), "sourceID", msgChannelValue.sourceID) log.ZDebug(ctx, "msg arrived channel", "channel id", channelID, "msgList length", len(ctxMsgList), "conversationID", msgChannelValue.conversationID)
storageMsgList, notStorageMsgList, storageNotificationList, notStorageNotificationList, modifyMsgList := och.getPushStorageMsgList(msgChannelValue.sourceID, ctxMsgList) storageMsgList, notStorageMsgList, storageNotificationList, notStorageNotificationList, modifyMsgList := och.getPushStorageMsgList(msgChannelValue.conversationID, ctxMsgList)
och.handleMsg(ctx, msgChannelValue.sourceID, storageMsgList, notStorageMsgList) och.handleMsg(ctx, msgChannelValue.conversationID, storageMsgList, notStorageMsgList)
och.handleNotification(ctx, msgChannelValue.sourceID, storageNotificationList, notStorageNotificationList) och.handleNotification(ctx, msgChannelValue.conversationID, storageNotificationList, notStorageNotificationList)
if err := och.msgDatabase.MsgToModifyMQ(ctx, msgChannelValue.sourceID, modifyMsgList); err != nil { if err := och.msgDatabase.MsgToModifyMQ(ctx, msgChannelValue.conversationID, modifyMsgList); err != nil {
log.ZError(ctx, "msg to modify mq error", err, "sourceID", msgChannelValue.sourceID, "modifyMsgList", modifyMsgList) log.ZError(ctx, "msg to modify mq error", err, "conversationID", msgChannelValue.conversationID, "modifyMsgList", modifyMsgList)
} }
} }
} }
@ -101,26 +99,26 @@ func (och *OnlineHistoryRedisConsumerHandler) Run(channelID int) {
} }
// 获取消息/通知 存储的消息列表, 不存储并且推送的消息列表, // 获取消息/通知 存储的消息列表, 不存储并且推送的消息列表,
func (och *OnlineHistoryRedisConsumerHandler) getPushStorageMsgList(sourceID string, totalMsgs []*ContextMsg) (storageMsgList, notStorageMsgList, storageNotificatoinList, notStorageNotificationList, modifyMsgList []*pbMsg.MsgDataToMQ) { func (och *OnlineHistoryRedisConsumerHandler) getPushStorageMsgList(conversationID string, totalMsgs []*ContextMsg) (storageMsgList, notStorageMsgList, storageNotificatoinList, notStorageNotificationList, modifyMsgList []*sdkws.MsgData) {
isStorage := func(msg *sdkws.MsgData) bool { isStorage := func(msg *sdkws.MsgData) bool {
options2 := utils.Options(msg.Options) options2 := utils.Options(msg.Options)
if options2.IsHistory() { if options2.IsHistory() {
return true return true
} else { } else {
if !(!options2.IsSenderSync() && sourceID == msg.MsgData.SendID) { // if !(!options2.IsSenderSync() && conversationID == msg.MsgData.SendID) {
// return false
// }
return false return false
} }
} }
return false
}
for _, v := range totalMsgs { for _, v := range totalMsgs {
options := utils.Options(v.message.Options) options := utils.Options(v.message.Options)
if options.IsNotification() { if options.IsNotification() {
// 原通知 // 原通知
notificationMsg := proto.Clone(v.message).(*pbMsg.MsgDataToMQ) notificationMsg := proto.Clone(v.message).(*sdkws.MsgData)
if options.IsSendMsg() { if options.IsSendMsg() {
// 消息 // 消息
v.message.Options = utils.WithOptions(utils.Options(v.message.MsgData.Options), utils.WithNotification(false), utils.WithSendMsg(false)) v.message.Options = utils.WithOptions(utils.Options(v.message.Options), utils.WithNotification(false), utils.WithSendMsg(false))
storageMsgList = append(storageMsgList, v.message) storageMsgList = append(storageMsgList, v.message)
} }
if isStorage(notificationMsg) { if isStorage(notificationMsg) {
@ -142,59 +140,60 @@ func (och *OnlineHistoryRedisConsumerHandler) getPushStorageMsgList(sourceID str
return return
} }
func (och *OnlineHistoryRedisConsumerHandler) handleMsg(ctx context.Context, aggregationID string, storageList, notStorageList []*sdkws.MsgData) { func (och *OnlineHistoryRedisConsumerHandler) handleNotification(ctx context.Context, conversationID string, storageList, notStorageList []*sdkws.MsgData) {
och.handle(ctx, aggregationID, storageList, notStorageList, och.msgDatabase.BatchInsertChat2Cache) och.toPushTopic(ctx, conversationID, notStorageList)
}
func (och *OnlineHistoryRedisConsumerHandler) handleNotification(ctx context.Context, aggregationID string, storageList, notStorageList []*sdkws.MsgData) {
och.handle(ctx, aggregationID, storageList, notStorageList, och.msgDatabase.NotificationBatchInsertChat2Cache)
}
func (och *OnlineHistoryRedisConsumerHandler) handle(ctx context.Context, aggregationID string, storageList, notStorageList []*sdkws.MsgData, cacheAndIncr func(ctx context.Context, sourceID string, msgList []*sdkws.MsgData) (int64, error)) {
if len(storageList) > 0 { if len(storageList) > 0 {
lastSeq, err := och.msgDatabase.NotificationBatchInsertChat2Cache(ctx, sourceID, storageList) lastSeq, err := och.msgDatabase.NotificationBatchInsertChat2Cache(ctx, conversationID, storageList)
if err != nil { if err != nil {
log.ZError(ctx, "notification batch insert to redis error", err, "sourceID", sourceID, "storageList", storageList) log.ZError(ctx, "notification batch insert to redis error", err, "conversationID", conversationID, "storageList", storageList)
return return
} }
och.msgDatabase.MsgToMongoMQ(ctx, sourceID, storageList, lastSeq) log.ZDebug(ctx, "success to next topic")
och.toPushTopic(ctx, sourceID, storageList) och.msgDatabase.MsgToMongoMQ(ctx, conversationID, storageList, lastSeq)
och.toPushTopic(ctx, conversationID, storageList)
} }
} }
func (och *OnlineHistoryRedisConsumerHandler) toPushTopic(ctx context.Context, sourceID string, msgs []*pbMsg.MsgDataToMQ) { func (och *OnlineHistoryRedisConsumerHandler) toPushTopic(ctx context.Context, conversationID string, msgs []*sdkws.MsgData) {
for _, v := range msgs { for _, v := range msgs {
och.msgDatabase.MsgToPushMQ(ctx, sourceID, v) och.msgDatabase.MsgToPushMQ(ctx, conversationID, v)
} }
} }
func (och *OnlineHistoryRedisConsumerHandler) handleMsg(ctx context.Context, sourceID string, storageList, notStorageList []*pbMsg.MsgDataToMQ) { func (och *OnlineHistoryRedisConsumerHandler) handleMsg(ctx context.Context, conversationID string, storageList, notStorageList []*sdkws.MsgData) {
och.toPushTopic(ctx, sourceID, notStorageList) och.toPushTopic(ctx, conversationID, notStorageList)
if len(storageList) > 0 { if len(storageList) > 0 {
var currentMaxSeq int64 var currentMaxSeq int64
var err error var err error
if storageList[0].MsgData.SessionType == constant.SuperGroupChatType { if storageList[0].SessionType == constant.SuperGroupChatType {
currentMaxSeq, err = och.msgDatabase.GetGroupMaxSeq(ctx, sourceID) currentMaxSeq, err = och.msgDatabase.GetGroupMaxSeq(ctx, conversationID)
if err == redis.Nil { if err == redis.Nil {
if err := och.GroupChatFirstCreateConversation(ctx, storageList[0].MsgData); err != nil { log.ZInfo(ctx, "group chat first create conversation", "conversationID", conversationID)
log.ZError(ctx, "single chat first create conversation error", err, "sourceID", sourceID) userIDs, err := och.groupRpcClient.GetGroupMemberIDs(ctx, storageList[0].GroupID)
if err != nil {
log.ZError(ctx, "get group member ids error", err, "conversationID", conversationID)
} else {
if err := och.conversationRpcClient.GroupChatFirstCreateConversation(ctx, storageList[0].GroupID, userIDs); err != nil {
log.ZError(ctx, "single chat first create conversation error", err, "conversationID", conversationID)
}
} }
} }
} else { } else {
currentMaxSeq, err = och.msgDatabase.GetUserMaxSeq(ctx, sourceID) currentMaxSeq, err = och.msgDatabase.GetUserMaxSeq(ctx, conversationID)
if err == redis.Nil { if err == redis.Nil {
if err := och.SingleChatFirstCreateConversation(ctx, storageList[0].MsgData); err != nil { log.ZInfo(ctx, "single chat first create conversation", "conversationID", conversationID)
log.ZError(ctx, "single chat first create conversation error", err, "sourceID", sourceID) if err := och.conversationRpcClient.SingleChatFirstCreateConversation(ctx, storageList[0].RecvID, storageList[0].SendID); err != nil {
log.ZError(ctx, "single chat first create conversation error", err, "conversationID", conversationID)
} }
} }
} }
if err != nil && err != redis.Nil { if err != nil && err != redis.Nil {
prome.Inc(prome.SeqGetFailedCounter) prome.Inc(prome.SeqGetFailedCounter)
log.ZError(ctx, "get max seq err", err, "sourceID", sourceID) log.ZError(ctx, "get max seq err", err, "conversationID", conversationID)
return return
} }
prome.Inc(prome.SeqGetSuccessCounter) prome.Inc(prome.SeqGetSuccessCounter)
lastSeq, err := och.msgDatabase.BatchInsertChat2Cache(ctx, sourceID, storageList, currentMaxSeq) lastSeq, err := och.msgDatabase.BatchInsertChat2Cache(ctx, conversationID, storageList, currentMaxSeq)
if err != nil && err != redis.Nil { if err != nil && err != redis.Nil {
log.ZError(ctx, "batch data insert to redis err", err, "storageMsgList", storageList) log.ZError(ctx, "batch data insert to redis err", err, "storageMsgList", storageList)
och.singleMsgFailedCountMutex.Lock() och.singleMsgFailedCountMutex.Lock()
@ -202,42 +201,15 @@ func (och *OnlineHistoryRedisConsumerHandler) handleMsg(ctx context.Context, sou
och.singleMsgFailedCountMutex.Unlock() och.singleMsgFailedCountMutex.Unlock()
return return
} }
log.ZDebug(ctx, "success to next topic")
och.singleMsgSuccessCountMutex.Lock() och.singleMsgSuccessCountMutex.Lock()
och.singleMsgSuccessCount += uint64(len(storageList)) och.singleMsgSuccessCount += uint64(len(storageList))
och.singleMsgSuccessCountMutex.Unlock() och.singleMsgSuccessCountMutex.Unlock()
och.msgDatabase.MsgToMongoMQ(ctx, sourceID, storageList, lastSeq) och.msgDatabase.MsgToMongoMQ(ctx, conversationID, storageList, lastSeq)
och.toPushTopic(ctx, sourceID, storageList) och.toPushTopic(ctx, conversationID, storageList)
} }
} }
func (och *OnlineHistoryRedisConsumerHandler) SingleChatFirstCreateConversation(ctx context.Context, msg *sdkws.MsgData) error {
conversation := new(pbConversation.Conversation)
conversation.ConversationType = constant.SingleChatType
conversation2 := proto.Clone(conversation).(*pbConversation.Conversation)
conversation.OwnerUserID = msg.SendID
conversation.UserID = msg.RecvID
conversation.ConversationID = utils.GetConversationIDBySessionType(msg.RecvID, constant.SingleChatType)
conversation2.OwnerUserID = msg.RecvID
conversation2.UserID = msg.SendID
conversation2.ConversationID = utils.GetConversationIDBySessionType(msg.SendID, constant.SingleChatType)
log.ZDebug(ctx, "create single conversation", "conversation", conversation, "conversation2", conversation2)
return och.conversationRpcClient.CreateConversationsWithoutNotification(ctx, []*pbConversation.Conversation{conversation, conversation2})
}
func (och *OnlineHistoryRedisConsumerHandler) GroupChatFirstCreateConversation(ctx context.Context, msg *sdkws.MsgData) error {
userIDs, err := och.groupRpcClient.GetGroupMemberIDs(ctx, msg.GroupID)
if err != nil {
return err
}
var conversations []*pbConversation.Conversation
for _, v := range userIDs {
conversation := pbConversation.Conversation{ConversationType: constant.SuperGroupChatType, GroupID: msg.GroupID, OwnerUserID: v, ConversationID: utils.GetConversationIDBySessionType(v, constant.SuperGroupChatType)}
conversations = append(conversations, &conversation)
}
log.ZDebug(ctx, "create group conversation", "conversations", conversations)
return och.conversationRpcClient.CreateConversationsWithoutNotification(ctx, conversations)
}
func (och *OnlineHistoryRedisConsumerHandler) MessagesDistributionHandle() { func (och *OnlineHistoryRedisConsumerHandler) MessagesDistributionHandle() {
for { for {
aggregationMsgs := make(map[string][]*ContextMsg, ChannelNum) aggregationMsgs := make(map[string][]*ContextMsg, ChannelNum)
@ -272,12 +244,12 @@ func (och *OnlineHistoryRedisConsumerHandler) MessagesDistributionHandle() {
} }
} }
log.ZDebug(ctx, "generate map list users len", "length", len(aggregationMsgs)) log.ZDebug(ctx, "generate map list users len", "length", len(aggregationMsgs))
for sourceID, v := range aggregationMsgs { for conversationID, v := range aggregationMsgs {
if len(v) >= 0 { if len(v) >= 0 {
hashCode := utils.GetHashCode(sourceID) hashCode := utils.GetHashCode(conversationID)
channelID := hashCode % ChannelNum channelID := hashCode % ChannelNum
log.ZDebug(ctx, "generate channelID", "hashCode", hashCode, "channelID", channelID, "sourceID", sourceID) log.ZDebug(ctx, "generate channelID", "hashCode", hashCode, "channelID", channelID, "conversationID", conversationID)
och.chArrays[channelID] <- Cmd2Value{Cmd: AggregationMessages, Value: MsgChannelValue{sourceID: sourceID, ctxMsgList: v, ctx: ctx}} och.chArrays[channelID] <- Cmd2Value{Cmd: SourceMessages, Value: MsgChannelValue{conversationID: conversationID, ctxMsgList: v, ctx: ctx}}
} }
} }
} }

View File

@ -3,6 +3,7 @@ package msgtransfer
import ( import (
"context" "context"
"errors" "errors"
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws" "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
"github.com/OpenIMSDK/Open-IM-Server/pkg/utils" "github.com/OpenIMSDK/Open-IM-Server/pkg/utils"
@ -43,20 +44,20 @@ func (mc *OnlineHistoryMongoConsumerHandler) handleChatWs2Mongo(ctx context.Cont
log.Error("msg_transfer Unmarshal msg err", "", "msg", string(msg), "err", err.Error()) log.Error("msg_transfer Unmarshal msg err", "", "msg", string(msg), "err", err.Error())
return return
} }
log.Info(operationID, "BatchInsertChat2DB userID: ", msgFromMQ.AggregationID, "msgFromMQ.LastSeq: ", msgFromMQ.LastSeq) log.Info(operationID, "BatchInsertChat2DB userID: ", msgFromMQ.ConversationID, "msgFromMQ.LastSeq: ", msgFromMQ.LastSeq)
if len(msgFromMQ.MsgData) == 0 { if len(msgFromMQ.MsgData) == 0 {
log.ZError(ctx, "msgFromMQ.MsgData is empty", errors.New("msgFromMQ.MsgData is empty"), "cMsg", cMsg) log.ZError(ctx, "msgFromMQ.MsgData is empty", errors.New("msgFromMQ.MsgData is empty"), "cMsg", cMsg)
return return
} }
isNotification := msgFromMQ.MsgData[0].Options[constant.IsNotification] isNotification := msgFromMQ.MsgData[0].Options[constant.IsNotification]
if isNotification { if isNotification {
err = mc.notificationDatabase.BatchInsertChat2DB(ctx, msgFromMQ.AggregationID, msgFromMQ.MsgData, msgFromMQ.LastSeq) err = mc.notificationDatabase.BatchInsertChat2DB(ctx, msgFromMQ.ConversationID, msgFromMQ.MsgData, msgFromMQ.LastSeq)
if err != nil { if err != nil {
log.NewError(operationID, "single data insert to mongo err", err.Error(), msgFromMQ.MsgData, msgFromMQ.AggregationID, msgFromMQ.TriggerID) log.NewError(operationID, "single data insert to mongo err", err.Error(), msgFromMQ.MsgData, msgFromMQ.ConversationID, msgFromMQ.TriggerID)
} }
err = mc.notificationDatabase.DeleteMessageFromCache(ctx, msgFromMQ.AggregationID, msgFromMQ.MsgData) err = mc.notificationDatabase.DeleteMessageFromCache(ctx, msgFromMQ.ConversationID, msgFromMQ.MsgData)
if err != nil { if err != nil {
log.NewError(operationID, "remove cache msg from redis err", err.Error(), msgFromMQ.MsgData, msgFromMQ.AggregationID, msgFromMQ.TriggerID) log.NewError(operationID, "remove cache msg from redis err", err.Error(), msgFromMQ.MsgData, msgFromMQ.ConversationID, msgFromMQ.TriggerID)
} }
for _, v := range msgFromMQ.MsgData { for _, v := range msgFromMQ.MsgData {
if v.ContentType == constant.DeleteMessageNotification { if v.ContentType == constant.DeleteMessageNotification {
@ -72,13 +73,13 @@ func (mc *OnlineHistoryMongoConsumerHandler) handleChatWs2Mongo(ctx context.Cont
} }
} }
} else { } else {
err = mc.msgDatabase.BatchInsertChat2DB(ctx, msgFromMQ.AggregationID, msgFromMQ.MsgData, msgFromMQ.LastSeq) err = mc.msgDatabase.BatchInsertChat2DB(ctx, msgFromMQ.ConversationID, msgFromMQ.MsgData, msgFromMQ.LastSeq)
if err != nil { if err != nil {
log.NewError(operationID, "single data insert to mongo err", err.Error(), msgFromMQ.MsgData, msgFromMQ.AggregationID, msgFromMQ.TriggerID) log.NewError(operationID, "single data insert to mongo err", err.Error(), msgFromMQ.MsgData, msgFromMQ.ConversationID, msgFromMQ.TriggerID)
} }
err = mc.msgDatabase.DeleteMessageFromCache(ctx, msgFromMQ.AggregationID, msgFromMQ.MsgData) err = mc.msgDatabase.DeleteMessageFromCache(ctx, msgFromMQ.ConversationID, msgFromMQ.MsgData)
if err != nil { if err != nil {
log.NewError(operationID, "remove cache msg from redis err", err.Error(), msgFromMQ.MsgData, msgFromMQ.AggregationID, msgFromMQ.TriggerID) log.NewError(operationID, "remove cache msg from redis err", err.Error(), msgFromMQ.MsgData, msgFromMQ.ConversationID, msgFromMQ.TriggerID)
} }
for _, v := range msgFromMQ.MsgData { for _, v := range msgFromMQ.MsgData {
if v.ContentType == constant.DeleteMessageNotification { if v.ContentType == constant.DeleteMessageNotification {

View File

@ -36,7 +36,7 @@ func (c *ConsumerHandler) handleMs2PsChat(ctx context.Context, msg []byte) {
} }
pbData := &pbPush.PushMsgReq{ pbData := &pbPush.PushMsgReq{
MsgData: msgFromMQ.MsgData, MsgData: msgFromMQ.MsgData,
SourceID: msgFromMQ.SourceID, ConversationID: msgFromMQ.ConversationID,
} }
sec := msgFromMQ.MsgData.SendTime / 1000 sec := msgFromMQ.MsgData.SendTime / 1000
nowSec := utils.GetCurrentTimestampBySecond() nowSec := utils.GetCurrentTimestampBySecond()
@ -46,9 +46,9 @@ func (c *ConsumerHandler) handleMs2PsChat(ctx context.Context, msg []byte) {
var err error var err error
switch msgFromMQ.MsgData.SessionType { switch msgFromMQ.MsgData.SessionType {
case constant.SuperGroupChatType: case constant.SuperGroupChatType:
err = c.pusher.MsgToSuperGroupUser(ctx, pbData.SourceID, pbData.MsgData) err = c.pusher.MsgToSuperGroupUser(ctx, pbData.ConversationID, pbData.MsgData)
default: default:
err = c.pusher.MsgToUser(ctx, pbData.SourceID, pbData.MsgData) err = c.pusher.MsgToUser(ctx, pbData.ConversationID, pbData.MsgData)
} }
if err != nil { if err != nil {
log.ZError(ctx, "push failed", err, "msg", pbData.String()) log.ZError(ctx, "push failed", err, "msg", pbData.String())

View File

@ -2,6 +2,8 @@ package push
import ( import (
"context" "context"
"sync"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
@ -9,7 +11,6 @@ import (
"github.com/OpenIMSDK/Open-IM-Server/pkg/discoveryregistry" "github.com/OpenIMSDK/Open-IM-Server/pkg/discoveryregistry"
pbPush "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/push" pbPush "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/push"
"google.golang.org/grpc" "google.golang.org/grpc"
"sync"
) )
type pushServer struct { type pushServer struct {
@ -46,9 +47,9 @@ func Start(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) e
func (r *pushServer) PushMsg(ctx context.Context, pbData *pbPush.PushMsgReq) (resp *pbPush.PushMsgResp, err error) { func (r *pushServer) PushMsg(ctx context.Context, pbData *pbPush.PushMsgReq) (resp *pbPush.PushMsgResp, err error) {
switch pbData.MsgData.SessionType { switch pbData.MsgData.SessionType {
case constant.SuperGroupChatType: case constant.SuperGroupChatType:
err = r.pusher.MsgToSuperGroupUser(ctx, pbData.SourceID, pbData.MsgData) err = r.pusher.MsgToSuperGroupUser(ctx, pbData.ConversationID, pbData.MsgData)
default: default:
err = r.pusher.MsgToUser(ctx, pbData.SourceID, pbData.MsgData) err = r.pusher.MsgToUser(ctx, pbData.ConversationID, pbData.MsgData)
} }
if err != nil { if err != nil {
return nil, err return nil, err

View File

@ -196,8 +196,8 @@ func (p *Pusher) GetConnsAndOnlinePush(ctx context.Context, msg *sdkws.MsgData,
return wsResults, nil return wsResults, nil
} }
func (p *Pusher) offlinePushMsg(ctx context.Context, sourceID string, msg *sdkws.MsgData, offlinePushUserIDs []string) error { func (p *Pusher) offlinePushMsg(ctx context.Context, conversationID string, msg *sdkws.MsgData, offlinePushUserIDs []string) error {
title, content, opts, err := p.getOfflinePushInfos(sourceID, msg) title, content, opts, err := p.getOfflinePushInfos(conversationID, msg)
if err != nil { if err != nil {
return err return err
} }
@ -230,7 +230,7 @@ func (p *Pusher) GetOfflinePushOpts(msg *sdkws.MsgData) (opts *offlinepush.Opts,
return opts, nil return opts, nil
} }
func (p *Pusher) getOfflinePushInfos(sourceID string, msg *sdkws.MsgData) (title, content string, opts *offlinepush.Opts, err error) { func (p *Pusher) getOfflinePushInfos(conversationID string, msg *sdkws.MsgData) (title, content string, opts *offlinepush.Opts, err error) {
if p.offlinePusher == nil { if p.offlinePusher == nil {
err = errors.New("no offlinePusher is configured") err = errors.New("no offlinePusher is configured")
return return
@ -263,7 +263,7 @@ func (p *Pusher) getOfflinePushInfos(sourceID string, msg *sdkws.MsgData) (title
case constant.AtText: case constant.AtText:
a := AtContent{} a := AtContent{}
_ = utils.JsonStringToStruct(string(msg.Content), &a) _ = utils.JsonStringToStruct(string(msg.Content), &a)
if utils.IsContain(sourceID, a.AtUserList) { if utils.IsContain(conversationID, a.AtUserList) {
title = constant.ContentType2PushContent[constant.AtText] + constant.ContentType2PushContent[constant.Common] title = constant.ContentType2PushContent[constant.AtText] + constant.ContentType2PushContent[constant.Common]
} else { } else {
title = constant.ContentType2PushContent[constant.GroupMsg] title = constant.ContentType2PushContent[constant.GroupMsg]

View File

@ -183,11 +183,34 @@ func (c *conversationServer) GetRecvMsgNotNotifyUserIDs(ctx context.Context, req
} }
// create conversation without notification for msg redis transfer // create conversation without notification for msg redis transfer
func (c *conversationServer) CreateConversationsWithoutNotification(ctx context.Context, req *pbConversation.CreateConversationsWithoutNotificationReq) (*pbConversation.CreateConversationsWithoutNotificationResp, error) { func (c *conversationServer) CreateSingleChatConversations(ctx context.Context, req *pbConversation.CreateSingleChatConversationsReq) (*pbConversation.CreateSingleChatConversationsResp, error) {
conversations := convert.ConversationsPb2DB(req.Conversations) var conversation tableRelation.ConversationModel
err := c.conversationDatabase.CreateConversation(ctx, conversations) conversation.ConversationID = utils.GetConversationIDBySessionType(constant.SingleChatType, req.RecvID, req.SendID)
conversation.ConversationType = constant.SingleChatType
conversation2 := conversation
conversation2.OwnerUserID = req.RecvID
conversation2.UserID = req.SendID
conversation.OwnerUserID = req.SendID
conversation.UserID = req.RecvID
err := c.conversationDatabase.CreateConversation(ctx, []*tableRelation.ConversationModel{&conversation, &conversation2})
if err != nil { if err != nil {
return nil, err return nil, err
} }
return &pbConversation.CreateConversationsWithoutNotificationResp{}, nil return &pbConversation.CreateSingleChatConversationsResp{}, nil
}
func (c *conversationServer) CreateGroupChatConversations(ctx context.Context, req *pbConversation.CreateGroupChatConversationsReq) (*pbConversation.CreateGroupChatConversationsResp, error) {
err := c.conversationDatabase.CreateGroupChatConversation(ctx, req.GroupID, req.UserIDs)
if err != nil {
return nil, err
}
return &pbConversation.CreateGroupChatConversationsResp{}, nil
}
func (c *conversationServer) DelGroupChatConversations(ctx context.Context, req *pbConversation.DelGroupChatConversationsReq) (*pbConversation.DelGroupChatConversationsResp, error) {
if err := c.conversationDatabase.UpdateUsersConversationFiled(ctx, req.OwnerUserID,
utils.GetConversationIDBySessionType(constant.SuperGroupChatType, req.GroupID), map[string]interface{}{"max_seq": req.MaxSeq}); err != nil {
return nil, err
}
return &pbConversation.DelGroupChatConversationsResp{}, nil
} }

View File

@ -68,9 +68,9 @@ func Start(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) e
type groupServer struct { type groupServer struct {
GroupDatabase controller.GroupDatabase GroupDatabase controller.GroupDatabase
User *rpcclient.UserClient User *rpcclient.UserClient
//Notification *notification.Check
Notification *notification.GroupNotificationSender Notification *notification.GroupNotificationSender
conversationRpcClient *rpcclient.ConversationClient conversationRpcClient *rpcclient.ConversationClient
msgRpcClient *rpcclient.MsgClient
} }
func (s *groupServer) CheckGroupAdmin(ctx context.Context, groupID string) error { func (s *groupServer) CheckGroupAdmin(ctx context.Context, groupID string) error {
@ -308,10 +308,14 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite
} }
} }
} }
if group.GroupType == constant.SuperGroup { if group.GroupType == constant.SuperGroup {
if err := s.GroupDatabase.CreateSuperGroupMember(ctx, req.GroupID, req.InvitedUserIDs); err != nil { if err := s.GroupDatabase.CreateSuperGroupMember(ctx, req.GroupID, req.InvitedUserIDs); err != nil {
return nil, err return nil, err
} }
if err := s.conversationRpcClient.GroupChatFirstCreateConversation(ctx, req.GroupID, req.InvitedUserIDs); err != nil {
return nil, err
}
for _, userID := range req.InvitedUserIDs { for _, userID := range req.InvitedUserIDs {
s.Notification.SuperGroupNotification(ctx, userID, userID) s.Notification.SuperGroupNotification(ctx, userID, userID)
} }
@ -336,6 +340,9 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite
if err := s.GroupDatabase.CreateGroup(ctx, nil, groupMembers); err != nil { if err := s.GroupDatabase.CreateGroup(ctx, nil, groupMembers); err != nil {
return nil, err return nil, err
} }
if err := s.conversationRpcClient.GroupChatFirstCreateConversation(ctx, req.GroupID, req.InvitedUserIDs); err != nil {
return nil, err
}
s.Notification.MemberInvitedNotification(ctx, req.GroupID, req.Reason, req.InvitedUserIDs) s.Notification.MemberInvitedNotification(ctx, req.GroupID, req.Reason, req.InvitedUserIDs)
} }
return resp, nil return resp, nil
@ -456,6 +463,9 @@ func (s *groupServer) KickGroupMember(ctx context.Context, req *pbGroup.KickGrou
} }
s.Notification.MemberKickedNotification(ctx, req, req.KickedUserIDs) s.Notification.MemberKickedNotification(ctx, req, req.KickedUserIDs)
} }
if err := s.deleteMemberAndSetConversationSeq(ctx, req.GroupID, req.KickedUserIDs); err != nil {
return nil, err
}
return resp, nil return resp, nil
} }
@ -669,6 +679,9 @@ func (s *groupServer) JoinGroup(ctx context.Context, req *pbGroup.JoinGroupReq)
if err := s.GroupDatabase.CreateGroup(ctx, nil, []*relationTb.GroupMemberModel{groupMember}); err != nil { if err := s.GroupDatabase.CreateGroup(ctx, nil, []*relationTb.GroupMemberModel{groupMember}); err != nil {
return nil, err return nil, err
} }
if err := s.conversationRpcClient.GroupChatFirstCreateConversation(ctx, req.GroupID, []string{req.InviterUserID}); err != nil {
return nil, err
}
s.Notification.MemberEnterDirectlyNotification(ctx, req.GroupID, req.InviterUserID) s.Notification.MemberEnterDirectlyNotification(ctx, req.GroupID, req.InviterUserID)
return resp, nil return resp, nil
} }
@ -712,9 +725,28 @@ func (s *groupServer) QuitGroup(ctx context.Context, req *pbGroup.QuitGroupReq)
} }
s.Notification.MemberQuitNotification(ctx, req) s.Notification.MemberQuitNotification(ctx, req)
} }
if err := s.deleteMemberAndSetConversationSeq(ctx, req.GroupID, []string{mcontext.GetOpUserID(ctx)}); err != nil {
return nil, err
}
return resp, nil return resp, nil
} }
func (s *groupServer) deleteMemberAndSetConversationSeq(ctx context.Context, groupID string, userIDs []string) error {
conevrsationID := utils.GetConversationIDBySessionType(constant.SuperGroupChatType, groupID)
resp, err := s.msgRpcClient.GetMaxAndMinSeq(ctx, &sdkws.GetMaxAndMinSeqReq{
ConversationIDs: []string{},
UserID: mcontext.GetOpUserID(ctx),
})
if err != nil {
return err
}
seq, ok := resp.MaxAndMinSeqs[conevrsationID]
if !ok {
return errs.ErrInternalServer.Wrap("get max seq error")
}
return s.conversationRpcClient.DelGroupChatConversations(ctx, userIDs, groupID, seq.MaxSeq)
}
func (s *groupServer) SetGroupInfo(ctx context.Context, req *pbGroup.SetGroupInfoReq) (*pbGroup.SetGroupInfoResp, error) { func (s *groupServer) SetGroupInfo(ctx context.Context, req *pbGroup.SetGroupInfoReq) (*pbGroup.SetGroupInfoResp, error) {
if !tokenverify.IsAppManagerUid(ctx) { if !tokenverify.IsAppManagerUid(ctx) {
groupMember, err := s.GroupDatabase.TakeGroupMember(ctx, req.GroupInfoForSet.GroupID, mcontext.GetOpUserID(ctx)) groupMember, err := s.GroupDatabase.TakeGroupMember(ctx, req.GroupInfoForSet.GroupID, mcontext.GetOpUserID(ctx))
@ -758,7 +790,7 @@ func (s *groupServer) SetGroupInfo(ctx context.Context, req *pbGroup.SetGroupInf
args := &pbConversation.ModifyConversationFieldReq{ args := &pbConversation.ModifyConversationFieldReq{
Conversation: &pbConversation.Conversation{ Conversation: &pbConversation.Conversation{
OwnerUserID: mcontext.GetOpUserID(ctx), OwnerUserID: mcontext.GetOpUserID(ctx),
ConversationID: utils.GetConversationIDBySessionType(group.GroupID, constant.GroupChatType), ConversationID: utils.GetConversationIDBySessionType(constant.GroupChatType, group.GroupID),
ConversationType: constant.SuperGroupChatType, ConversationType: constant.SuperGroupChatType,
GroupID: group.GroupID, GroupID: group.GroupID,
}, },

View File

@ -2,6 +2,7 @@ package msg
import ( import (
"context" "context"
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/msg" "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/msg"
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws" "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
) )
@ -17,7 +18,7 @@ func (m *msgServer) SetMessageReactionExtensions(ctx context.Context, req *msg.S
////if ExternalExtension ////if ExternalExtension
//if req.IsExternalExtensions { //if req.IsExternalExtensions {
// resp.MsgFirstModifyTime = req.MsgFirstModifyTime // resp.MsgFirstModifyTime = req.MsgFirstModifyTime
// notification.ExtendMessageUpdatedNotification(req.OperationID, req.OpUserID, req.SourceID, req.SessionType, req, &resp, !req.IsReact, false) // notification.ExtendMessageUpdatedNotification(req.OperationID, req.OpUserID, req.conversationID, req.SessionType, req, &resp, !req.IsReact, false)
// return resp, nil // return resp, nil
//} //}
//isExists, err := m.MsgDatabase.JudgeMessageReactionExist(ctx, req.ClientMsgID, req.SessionType) //isExists, err := m.MsgDatabase.JudgeMessageReactionExist(ctx, req.ClientMsgID, req.SessionType)
@ -48,7 +49,7 @@ func (m *msgServer) SetMessageReactionExtensions(ctx context.Context, req *msg.S
// if err != nil { // if err != nil {
// return nil, err // return nil, err
// } // }
// mongoValue, err := m.MsgDatabase.GetExtendMsg(ctx, req.SourceID, req.SessionType, req.ClientMsgID, req.MsgFirstModifyTime) // mongoValue, err := m.MsgDatabase.GetExtendMsg(ctx, req.conversationID, req.SessionType, req.ClientMsgID, req.MsgFirstModifyTime)
// if err != nil { // if err != nil {
// return nil, err // return nil, err
// } // }
@ -68,7 +69,7 @@ func (m *msgServer) SetMessageReactionExtensions(ctx context.Context, req *msg.S
// temp.LatestUpdateTime = utils.GetCurrentTimestampByMill() // temp.LatestUpdateTime = utils.GetCurrentTimestampByMill()
// setValue[k] = temp // setValue[k] = temp
// } // }
// err = db.DB.InsertOrUpdateReactionExtendMsgSet(req.SourceID, req.SessionType, req.ClientMsgID, req.MsgFirstModifyTime, setValue) // err = db.DB.InsertOrUpdateReactionExtendMsgSet(req.conversationID, req.SessionType, req.ClientMsgID, req.MsgFirstModifyTime, setValue)
// if err != nil { // if err != nil {
// for _, value := range setValue { // for _, value := range setValue {
// temp := new(msg.KeyValueResp) // temp := new(msg.KeyValueResp)
@ -123,12 +124,12 @@ func (m *msgServer) SetMessageReactionExtensions(ctx context.Context, req *msg.S
//} //}
//if !isExists { //if !isExists {
// if !req.IsReact { // if !req.IsReact {
// notification.ExtendMessageUpdatedNotification(req.OperationID, req.OpUserID, req.SourceID, req.SessionType, req, &resp, true, true) // notification.ExtendMessageUpdatedNotification(req.OperationID, req.OpUserID, req.conversationID, req.SessionType, req, &resp, true, true)
// } else { // } else {
// notification.ExtendMessageUpdatedNotification(req.OperationID, req.OpUserID, req.SourceID, req.SessionType, req, &resp, false, false) // notification.ExtendMessageUpdatedNotification(req.OperationID, req.OpUserID, req.conversationID, req.SessionType, req, &resp, false, false)
// } // }
//} else { //} else {
// notification.ExtendMessageUpdatedNotification(req.OperationID, req.OpUserID, req.SourceID, req.SessionType, req, &resp, false, true) // notification.ExtendMessageUpdatedNotification(req.OperationID, req.OpUserID, req.conversationID, req.SessionType, req, &resp, false, true)
//} //}
//log.Debug(req.OperationID, utils.GetSelfFuncName(), "m return is:", resp.String()) //log.Debug(req.OperationID, utils.GetSelfFuncName(), "m return is:", resp.String())
return resp, nil return resp, nil
@ -182,7 +183,7 @@ func (m *msgServer) GetMessagesReactionExtensions(ctx context.Context, req *msg.
// oneMessage.Pb2Model = keyMap // oneMessage.Pb2Model = keyMap
// //
// } else { // } else {
// mongoValue, err := db.DB.GetExtendMsg(req.SourceID, req.SessionType, messageValue.ClientMsgID, messageValue.MsgFirstModifyTime) // mongoValue, err := db.DB.GetExtendMsg(req.conversationID, req.SessionType, messageValue.ClientMsgID, messageValue.MsgFirstModifyTime)
// if err != nil { // if err != nil {
// oneMessage.ErrCode = 100 // oneMessage.ErrCode = 100
// oneMessage.ErrMsg = err.Error() // oneMessage.ErrMsg = err.Error()
@ -230,7 +231,7 @@ func (m *msgServer) DeleteMessageReactionExtensions(ctx context.Context, req *ms
////if ExternalExtension ////if ExternalExtension
//if req.IsExternalExtensions { //if req.IsExternalExtensions {
// rResp.Result = callbackResp.ResultReactionExtensionList // rResp.Result = callbackResp.ResultReactionExtensionList
// notification.ExtendMessageDeleteNotification(req.OperationID, req.OpUserID, req.SourceID, req.SessionType, req, &rResp, false, false) // notification.ExtendMessageDeleteNotification(req.OperationID, req.OpUserID, req.conversationID, req.SessionType, req, &rResp, false, false)
// return &rResp, nil // return &rResp, nil
// //
//} //}
@ -302,7 +303,7 @@ func (m *msgServer) DeleteMessageReactionExtensions(ctx context.Context, req *ms
// } // }
// return &rResp, nil // return &rResp, nil
// } // }
// mongoValue, err := db.DB.GetExtendMsg(req.SourceID, req.SessionType, req.ClientMsgID, req.MsgFirstModifyTime) // mongoValue, err := db.DB.GetExtendMsg(req.conversationID, req.SessionType, req.ClientMsgID, req.MsgFirstModifyTime)
// if err != nil { // if err != nil {
// rResp.ErrCode = 200 // rResp.ErrCode = 200
// rResp.ErrMsg = err.Error() // rResp.ErrMsg = err.Error()
@ -332,7 +333,7 @@ func (m *msgServer) DeleteMessageReactionExtensions(ctx context.Context, req *ms
// temp.TypeKey = v.TypeKey // temp.TypeKey = v.TypeKey
// setValue[v.TypeKey] = temp // setValue[v.TypeKey] = temp
// } // }
// err = db.DB.DeleteReactionExtendMsgSet(req.SourceID, req.SessionType, req.ClientMsgID, req.MsgFirstModifyTime, setValue) // err = db.DB.DeleteReactionExtendMsgSet(req.conversationID, req.SessionType, req.ClientMsgID, req.MsgFirstModifyTime, setValue)
// if err != nil { // if err != nil {
// for _, value := range setValue { // for _, value := range setValue {
// temp := new(msg.KeyValueResp) // temp := new(msg.KeyValueResp)
@ -354,7 +355,7 @@ func (m *msgServer) DeleteMessageReactionExtensions(ctx context.Context, req *ms
// } // }
// //
//} //}
//notification.ExtendMessageDeleteNotification(req.OperationID, req.OpUserID, req.SourceID, req.SessionType, req, &rResp, false, isExists) //notification.ExtendMessageDeleteNotification(req.OperationID, req.OpUserID, req.conversationID, req.SessionType, req, &rResp, false, isExists)
//log.Debug(req.OperationID, utils.GetSelfFuncName(), "m return is:", rResp.String()) //log.Debug(req.OperationID, utils.GetSelfFuncName(), "m return is:", rResp.String())
return resp, nil return resp, nil
} }

View File

@ -2,6 +2,7 @@ package msg
import ( import (
"context" "context"
cbapi "github.com/OpenIMSDK/Open-IM-Server/pkg/callbackstruct" cbapi "github.com/OpenIMSDK/Open-IM-Server/pkg/callbackstruct"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant"
@ -17,7 +18,7 @@ func CallbackSetMessageReactionExtensions(ctx context.Context, setReq *msg.SetMe
req := &cbapi.CallbackBeforeSetMessageReactionExtReq{ req := &cbapi.CallbackBeforeSetMessageReactionExtReq{
OperationID: mcontext.GetOperationID(ctx), OperationID: mcontext.GetOperationID(ctx),
CallbackCommand: constant.CallbackBeforeSetMessageReactionExtensionCommand, CallbackCommand: constant.CallbackBeforeSetMessageReactionExtensionCommand,
SourceID: setReq.SourceID, ConversationID: setReq.ConversationID,
OpUserID: mcontext.GetOpUserID(ctx), OpUserID: mcontext.GetOpUserID(ctx),
SessionType: setReq.SessionType, SessionType: setReq.SessionType,
ReactionExtensionList: setReq.ReactionExtensions, ReactionExtensionList: setReq.ReactionExtensions,
@ -41,7 +42,7 @@ func CallbackDeleteMessageReactionExtensions(setReq *msg.DeleteMessagesReactionE
req := &cbapi.CallbackDeleteMessageReactionExtReq{ req := &cbapi.CallbackDeleteMessageReactionExtReq{
OperationID: setReq.OperationID, OperationID: setReq.OperationID,
CallbackCommand: constant.CallbackBeforeDeleteMessageReactionExtensionsCommand, CallbackCommand: constant.CallbackBeforeDeleteMessageReactionExtensionsCommand,
SourceID: setReq.SourceID, ConversationID: setReq.ConversationID,
OpUserID: setReq.OpUserID, OpUserID: setReq.OpUserID,
SessionType: setReq.SessionType, SessionType: setReq.SessionType,
ReactionExtensionList: setReq.ReactionExtensions, ReactionExtensionList: setReq.ReactionExtensions,
@ -60,7 +61,7 @@ func CallbackGetMessageListReactionExtensions(ctx context.Context, getReq *msg.G
req := &cbapi.CallbackGetMessageListReactionExtReq{ req := &cbapi.CallbackGetMessageListReactionExtReq{
OperationID: mcontext.GetOperationID(ctx), OperationID: mcontext.GetOperationID(ctx),
CallbackCommand: constant.CallbackGetMessageListReactionExtensionsCommand, CallbackCommand: constant.CallbackGetMessageListReactionExtensionsCommand,
SourceID: getReq.SourceID, ConversationID: getReq.ConversationID,
OpUserID: mcontext.GetOperationID(ctx), OpUserID: mcontext.GetOperationID(ctx),
SessionType: getReq.SessionType, SessionType: getReq.SessionType,
TypeKeyList: getReq.TypeKeys, TypeKeyList: getReq.TypeKeys,
@ -73,7 +74,7 @@ func CallbackAddMessageReactionExtensions(ctx context.Context, setReq *msg.Modif
req := &cbapi.CallbackAddMessageReactionExtReq{ req := &cbapi.CallbackAddMessageReactionExtReq{
OperationID: mcontext.GetOperationID(ctx), OperationID: mcontext.GetOperationID(ctx),
CallbackCommand: constant.CallbackAddMessageListReactionExtensionsCommand, CallbackCommand: constant.CallbackAddMessageListReactionExtensionsCommand,
SourceID: setReq.SourceID, ConversationID: setReq.ConversationID,
OpUserID: mcontext.GetOperationID(ctx), OpUserID: mcontext.GetOperationID(ctx),
SessionType: setReq.SessionType, SessionType: setReq.SessionType,
ReactionExtensionList: setReq.ReactionExtensions, ReactionExtensionList: setReq.ReactionExtensions,

View File

@ -2,16 +2,17 @@ package msg
import ( import (
"context" "context"
"math/rand"
"strconv"
"sync"
"time"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant"
"github.com/OpenIMSDK/Open-IM-Server/pkg/errs" "github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/msg" "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/msg"
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws" "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
"github.com/OpenIMSDK/Open-IM-Server/pkg/utils" "github.com/OpenIMSDK/Open-IM-Server/pkg/utils"
"math/rand"
"strconv"
"sync"
"time"
) )
var ( var (
@ -252,7 +253,7 @@ func GetMsgID(sendID string) string {
return utils.Md5(t + "-" + sendID + "-" + strconv.Itoa(rand.Int())) return utils.Md5(t + "-" + sendID + "-" + strconv.Itoa(rand.Int()))
} }
func (m *msgServer) modifyMessageByUserMessageReceiveOpt(ctx context.Context, userID, sourceID string, sessionType int, pb *msg.SendMsgReq) (bool, error) { func (m *msgServer) modifyMessageByUserMessageReceiveOpt(ctx context.Context, userID, conversationID string, sessionType int, pb *msg.SendMsgReq) (bool, error) {
opt, err := m.User.GetUserGlobalMsgRecvOpt(ctx, userID) opt, err := m.User.GetUserGlobalMsgRecvOpt(ctx, userID)
if err != nil { if err != nil {
return false, err return false, err
@ -268,12 +269,11 @@ func (m *msgServer) modifyMessageByUserMessageReceiveOpt(ctx context.Context, us
utils.SetSwitchFromOptions(pb.MsgData.Options, constant.IsOfflinePush, false) utils.SetSwitchFromOptions(pb.MsgData.Options, constant.IsOfflinePush, false)
return true, nil return true, nil
} }
conversationID := utils.GetConversationIDBySessionType(sourceID, sessionType) // conversationID := utils.GetConversationIDBySessionType(conversationID, sessionType)
singleOpt, err := m.Conversation.GetSingleConversationRecvMsgOpt(ctx, userID, conversationID) singleOpt, err := m.Conversation.GetSingleConversationRecvMsgOpt(ctx, userID, conversationID)
//if err != nil { if err != nil {
// return false, err return false, err
//} }
return true, nil
switch singleOpt { switch singleOpt {
case constant.ReceiveMessage: case constant.ReceiveMessage:
return true, nil return true, nil
@ -310,29 +310,29 @@ func valueCopy(pb *msg.SendMsgReq) *msg.SendMsgReq {
return &msg.SendMsgReq{MsgData: &msgData} return &msg.SendMsgReq{MsgData: &msgData}
} }
func (m *msgServer) sendMsgToGroupOptimization(ctx context.Context, list []string, groupPB *msg.SendMsgReq, wg *sync.WaitGroup) error { func (m *msgServer) sendMsgToGroupOptimization(ctx context.Context, list []string, req *msg.SendMsgReq, wg *sync.WaitGroup) error {
msgToMQGroup := msg.MsgDataToMQ{MsgData: groupPB.MsgData}
tempOptions := make(map[string]bool, 1) tempOptions := make(map[string]bool, 1)
for k, v := range groupPB.MsgData.Options { for k, v := range req.MsgData.Options {
tempOptions[k] = v tempOptions[k] = v
} }
for _, v := range list { for _, v := range list {
groupPB.MsgData.RecvID = v req.MsgData.RecvID = v
options := make(map[string]bool, 1) options := make(map[string]bool, 1)
for k, v := range tempOptions { for k, v := range tempOptions {
options[k] = v options[k] = v
} }
groupPB.MsgData.Options = options req.MsgData.Options = options
isSend, err := m.modifyMessageByUserMessageReceiveOpt(ctx, v, groupPB.MsgData.GroupID, constant.GroupChatType, groupPB) conversationID := utils.GetConversationIDBySessionType(constant.GroupChatType, req.MsgData.GroupID)
isSend, err := m.modifyMessageByUserMessageReceiveOpt(ctx, v, conversationID, constant.GroupChatType, req)
if err != nil { if err != nil {
wg.Done() wg.Done()
return err return err
} }
if isSend { if isSend {
if v == "" || groupPB.MsgData.SendID == "" { if v == "" || req.MsgData.SendID == "" {
return errs.ErrArgs.Wrap("userID or groupPB.MsgData.SendID is empty") return errs.ErrArgs.Wrap("userID or groupPB.MsgData.SendID is empty")
} }
err := m.MsgDatabase.MsgToMQ(ctx, v, &msgToMQGroup) err := m.MsgDatabase.MsgToMQ(ctx, v, req.MsgData)
if err != nil { if err != nil {
wg.Done() wg.Done()
return err return err

View File

@ -21,8 +21,7 @@ func (m *msgServer) sendMsgSuperGroupChat(ctx context.Context, req *msg.SendMsgR
promePkg.Inc(promePkg.WorkSuperGroupChatMsgProcessFailedCounter) promePkg.Inc(promePkg.WorkSuperGroupChatMsgProcessFailedCounter)
return nil, err return nil, err
} }
msgToMQSingle := msg.MsgDataToMQ{MsgData: req.MsgData} err = m.MsgDatabase.MsgToMQ(ctx, req.MsgData.GroupID, req.MsgData)
err = m.MsgDatabase.MsgToMQ(ctx, msgToMQSingle.MsgData.GroupID, &msgToMQSingle)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -32,27 +31,26 @@ func (m *msgServer) sendMsgSuperGroupChat(ctx context.Context, req *msg.SendMsgR
} }
promePkg.Inc(promePkg.WorkSuperGroupChatMsgProcessSuccessCounter) promePkg.Inc(promePkg.WorkSuperGroupChatMsgProcessSuccessCounter)
resp.SendTime = msgToMQSingle.MsgData.SendTime resp.SendTime = req.MsgData.SendTime
resp.ServerMsgID = msgToMQSingle.MsgData.ServerMsgID resp.ServerMsgID = req.MsgData.ServerMsgID
resp.ClientMsgID = msgToMQSingle.MsgData.ClientMsgID resp.ClientMsgID = req.MsgData.ClientMsgID
return resp, nil return resp, nil
} }
func (m *msgServer) sendMsgNotification(ctx context.Context, req *msg.SendMsgReq) (resp *msg.SendMsgResp, err error) { func (m *msgServer) sendMsgNotification(ctx context.Context, req *msg.SendMsgReq) (resp *msg.SendMsgResp, err error) {
msgToMQSingle := msg.MsgDataToMQ{MsgData: req.MsgData} err = m.MsgDatabase.MsgToMQ(ctx, req.MsgData.RecvID, req.MsgData)
err = m.MsgDatabase.MsgToMQ(ctx, msgToMQSingle.MsgData.RecvID, &msgToMQSingle)
if err != nil { if err != nil {
return nil, err return nil, err
} }
if msgToMQSingle.MsgData.SendID != msgToMQSingle.MsgData.RecvID { //Filter messages sent to yourself if req.MsgData.SendID != req.MsgData.RecvID { //Filter messages sent to yourself
err = m.MsgDatabase.MsgToMQ(ctx, msgToMQSingle.MsgData.SendID, &msgToMQSingle) err = m.MsgDatabase.MsgToMQ(ctx, req.MsgData.SendID, req.MsgData)
if err != nil { if err != nil {
return nil, err return nil, err
} }
} }
resp = &msg.SendMsgResp{ resp = &msg.SendMsgResp{
ServerMsgID: msgToMQSingle.MsgData.ServerMsgID, ServerMsgID: req.MsgData.ServerMsgID,
ClientMsgID: msgToMQSingle.MsgData.ClientMsgID, ClientMsgID: req.MsgData.ClientMsgID,
SendTime: msgToMQSingle.MsgData.SendTime, SendTime: req.MsgData.SendTime,
} }
return resp, nil return resp, nil
} }
@ -67,15 +65,14 @@ func (m *msgServer) sendMsgSingleChat(ctx context.Context, req *msg.SendMsgReq)
if err != nil { if err != nil {
return nil, err return nil, err
} }
msgToMQSingle := msg.MsgDataToMQ{MsgData: req.MsgData}
if isSend { if isSend {
err = m.MsgDatabase.MsgToMQ(ctx, req.MsgData.RecvID, &msgToMQSingle) err = m.MsgDatabase.MsgToMQ(ctx, req.MsgData.RecvID, req.MsgData)
if err != nil { if err != nil {
return nil, errs.ErrInternalServer.Wrap("insert to mq") return nil, errs.ErrInternalServer.Wrap("insert to mq")
} }
} }
if msgToMQSingle.MsgData.SendID != msgToMQSingle.MsgData.RecvID { //Filter messages sent to yourself if req.MsgData.SendID != req.MsgData.RecvID { //Filter messages sent to yourself
err = m.MsgDatabase.MsgToMQ(ctx, req.MsgData.SendID, &msgToMQSingle) err = m.MsgDatabase.MsgToMQ(ctx, req.MsgData.SendID, req.MsgData)
if err != nil { if err != nil {
return nil, errs.ErrInternalServer.Wrap("insert to mq") return nil, errs.ErrInternalServer.Wrap("insert to mq")
} }
@ -86,9 +83,9 @@ func (m *msgServer) sendMsgSingleChat(ctx context.Context, req *msg.SendMsgReq)
} }
promePkg.Inc(promePkg.SingleChatMsgProcessSuccessCounter) promePkg.Inc(promePkg.SingleChatMsgProcessSuccessCounter)
resp = &msg.SendMsgResp{ resp = &msg.SendMsgResp{
ServerMsgID: msgToMQSingle.MsgData.ServerMsgID, ServerMsgID: req.MsgData.ServerMsgID,
ClientMsgID: msgToMQSingle.MsgData.ClientMsgID, ClientMsgID: req.MsgData.ClientMsgID,
SendTime: msgToMQSingle.MsgData.SendTime, SendTime: req.MsgData.SendTime,
} }
return resp, nil return resp, nil
} }
@ -175,7 +172,7 @@ func (m *msgServer) sendMsgGroupChat(ctx context.Context, req *msg.SendMsgReq) (
var atUserID []string var atUserID []string
conversation := pbConversation.Conversation{ conversation := pbConversation.Conversation{
OwnerUserID: req.MsgData.SendID, OwnerUserID: req.MsgData.SendID,
ConversationID: utils.GetConversationIDBySessionType(req.MsgData.GroupID, constant.GroupChatType), ConversationID: utils.GetConversationIDBySessionType(constant.GroupChatType, req.MsgData.GroupID),
ConversationType: constant.GroupChatType, ConversationType: constant.GroupChatType,
GroupID: req.MsgData.GroupID, GroupID: req.MsgData.GroupID,
} }

View File

@ -24,6 +24,7 @@ type MessageInterceptorChain []MessageInterceptorFunc
type msgServer struct { type msgServer struct {
RegisterCenter discoveryregistry.SvcDiscoveryRegistry RegisterCenter discoveryregistry.SvcDiscoveryRegistry
MsgDatabase controller.MsgDatabase MsgDatabase controller.MsgDatabase
notificationDatabase controller.NotificationDatabase
ExtendMsgDatabase controller.ExtendMsgDatabase ExtendMsgDatabase controller.ExtendMsgDatabase
Group *rpcclient.GroupClient Group *rpcclient.GroupClient
User *rpcclient.UserClient User *rpcclient.UserClient
@ -97,6 +98,7 @@ func (m *msgServer) initPrometheus() {
prome.NewWorkSuperGroupChatMsgProcessSuccessCounter() prome.NewWorkSuperGroupChatMsgProcessSuccessCounter()
prome.NewWorkSuperGroupChatMsgProcessFailedCounter() prome.NewWorkSuperGroupChatMsgProcessFailedCounter()
} }
func (m *msgServer) SendMsg(ctx context.Context, req *msg.SendMsgReq) (resp *msg.SendMsgResp, error error) { func (m *msgServer) SendMsg(ctx context.Context, req *msg.SendMsgReq) (resp *msg.SendMsgResp, error error) {
resp = &msg.SendMsgResp{} resp = &msg.SendMsgResp{}
flag := isMessageHasReadEnabled(req.MsgData) flag := isMessageHasReadEnabled(req.MsgData)
@ -127,52 +129,53 @@ func (m *msgServer) GetMaxAndMinSeq(ctx context.Context, req *sdkws.GetMaxAndMin
} }
m2 := make(map[string]*sdkws.MaxAndMinSeq) m2 := make(map[string]*sdkws.MaxAndMinSeq)
maxSeq, err := m.MsgDatabase.GetUserMaxSeq(ctx, req.UserID)
if err != nil && errs.Unwrap(err) != redis.Nil {
return nil, err
}
minSeq, err := m.MsgDatabase.GetUserMinSeq(ctx, req.UserID)
if err != nil && errs.Unwrap(err) != redis.Nil {
return nil, err
}
resp := new(sdkws.GetMaxAndMinSeqResp) resp := new(sdkws.GetMaxAndMinSeqResp)
resp.MaxSeq = maxSeq for _, conversationID := range req.ConversationIDs {
resp.MinSeq = minSeq maxSeq, err := m.MsgDatabase.GetGroupMaxSeq(ctx, conversationID)
for _, groupID := range req.GroupIDs {
maxSeq, err := m.MsgDatabase.GetGroupMaxSeq(ctx, groupID)
if err != nil && errs.Unwrap(err) != redis.Nil { if err != nil && errs.Unwrap(err) != redis.Nil {
return nil, err return nil, err
} }
minSeq, err := m.MsgDatabase.GetGroupMinSeq(ctx, groupID) minSeq, err := m.MsgDatabase.GetGroupMinSeq(ctx, conversationID)
if err != nil && errs.Unwrap(err) != redis.Nil { if err != nil && errs.Unwrap(err) != redis.Nil {
return nil, err return nil, err
} }
m2[groupID] = &sdkws.MaxAndMinSeq{ m2[conversationID] = &sdkws.MaxAndMinSeq{
MaxSeq: maxSeq, MaxSeq: maxSeq,
MinSeq: minSeq, MinSeq: minSeq,
} }
} }
resp.MaxAndMinSeqs = m2
resp.GroupMaxAndMinSeq = m2
return resp, nil return resp, nil
} }
func (m *msgServer) PullMessageBySeqs(ctx context.Context, req *sdkws.PullMessageBySeqsReq) (*sdkws.PullMessageBySeqsResp, error) { func (m *msgServer) PullMessageBySeqs(ctx context.Context, req *sdkws.PullMessageBySeqsReq) (*sdkws.PullMessageBySeqsResp, error) {
resp := &sdkws.PullMessageBySeqsResp{GroupMsgDataList: make(map[string]*sdkws.MsgDataList)} resp := &sdkws.PullMessageBySeqsResp{}
msgs, err := m.MsgDatabase.GetMsgBySeqs(ctx, req.UserID, req.Seqs) for _, seq := range req.SeqRanges {
if !seq.IsNotification {
msgs, err := m.MsgDatabase.GetMsgBySeqsRange(ctx, seq.ConversationID, seq.Begin, seq.End, seq.Num)
if err != nil { if err != nil {
return nil, err return nil, err
} }
resp.List = msgs resp.Msgs = append(resp.Msgs, &sdkws.PullMsgs{
for groupID, list := range req.GroupSeqs { ConversationID: seq.ConversationID,
msgs, err := m.MsgDatabase.GetSuperGroupMsgBySeqs(ctx, groupID, list.Seqs) Msgs: msgs,
})
} else {
var seqs []int64
for i := seq.Begin; i <= seq.End; i++ {
seqs = append(seqs, i)
}
msgs, err := m.notificationDatabase.GetMsgBySeqs(ctx, seq.ConversationID, seqs)
if err != nil { if err != nil {
return nil, err return nil, err
} }
resp.GroupMsgDataList[groupID] = &sdkws.MsgDataList{ resp.Msgs = append(resp.Msgs, &sdkws.PullMsgs{
MsgDataList: msgs, ConversationID: seq.ConversationID,
Msgs: msgs,
IsNotification: true,
})
} }
} }
return resp, nil return resp, nil
} }

View File

@ -167,7 +167,7 @@ func (c *MsgTool) GetAndFixGroupUserSeq(ctx context.Context, userID string, grou
return minSeqCache, nil return minSeqCache, nil
} }
func (c *MsgTool) CheckMaxSeqWithMongo(ctx context.Context, sourceID string, maxSeqCache, maxSeqMongo int64, diffusionType int) error { func (c *MsgTool) CheckMaxSeqWithMongo(ctx context.Context, conversationID string, maxSeqCache, maxSeqMongo int64, diffusionType int) error {
if math.Abs(float64(maxSeqMongo-maxSeqCache)) > 10 { if math.Abs(float64(maxSeqMongo-maxSeqCache)) > 10 {
return errSeq return errSeq
} }

View File

@ -51,7 +51,7 @@ type SetMsgMinSeqResp struct {
type ModifyMessageReactionExtensionsReq struct { type ModifyMessageReactionExtensionsReq struct {
OperationID string `json:"operationID" binding:"required"` OperationID string `json:"operationID" binding:"required"`
SourceID string `json:"sourceID" binding:"required"` conversationID string `json:"conversationID" binding:"required"`
SessionType int32 `json:"sessionType" binding:"required"` SessionType int32 `json:"sessionType" binding:"required"`
ReactionExtensionList map[string]*sdkws.KeyValue `json:"reactionExtensionList,omitempty" binding:"required"` ReactionExtensionList map[string]*sdkws.KeyValue `json:"reactionExtensionList,omitempty" binding:"required"`
ClientMsgID string `json:"clientMsgID" binding:"required"` ClientMsgID string `json:"clientMsgID" binding:"required"`
@ -72,7 +72,7 @@ type ModifyMessageReactionExtensionsResp struct {
//type OperateMessageListReactionExtensionsReq struct { //type OperateMessageListReactionExtensionsReq struct {
// OperationID string `json:"operationID" binding:"required"` // OperationID string `json:"operationID" binding:"required"`
// SourceID string `json:"sourceID" binding:"required"` // conversationID string `json:"conversationID" binding:"required"`
// SessionType string `json:"sessionType" binding:"required"` // SessionType string `json:"sessionType" binding:"required"`
// MessageReactionKeyList []*msg.GetMessageListReactionExtensionsReq_MessageReactionKey `json:"messageReactionKeyList" binding:"required"` // MessageReactionKeyList []*msg.GetMessageListReactionExtensionsReq_MessageReactionKey `json:"messageReactionKeyList" binding:"required"`
//} //}
@ -100,7 +100,7 @@ type AddMessageReactionExtensionsResp ModifyMessageReactionExtensionsResp
type DeleteMessageReactionExtensionsReq struct { type DeleteMessageReactionExtensionsReq struct {
OperationID string `json:"operationID" binding:"required"` OperationID string `json:"operationID" binding:"required"`
SourceID string `json:"sourceID" binding:"required"` conversationID string `json:"conversationID" binding:"required"`
SessionType int32 `json:"sessionType" binding:"required"` SessionType int32 `json:"sessionType" binding:"required"`
ClientMsgID string `json:"clientMsgID" binding:"required"` ClientMsgID string `json:"clientMsgID" binding:"required"`
IsExternalExtensions bool `json:"isExternalExtensions"` IsExternalExtensions bool `json:"isExternalExtensions"`

View File

@ -69,7 +69,7 @@ type CallbackMsgModifyCommandResp struct {
type CallbackBeforeSetMessageReactionExtReq struct { type CallbackBeforeSetMessageReactionExtReq struct {
OperationID string `json:"operationID"` OperationID string `json:"operationID"`
CallbackCommand `json:"callbackCommand"` CallbackCommand `json:"callbackCommand"`
SourceID string `json:"sourceID"` ConversationID string `json:"conversationID"`
OpUserID string `json:"opUserID"` OpUserID string `json:"opUserID"`
SessionType int32 `json:"sessionType"` SessionType int32 `json:"sessionType"`
ReactionExtensionList map[string]*sdkws.KeyValue `json:"reactionExtensionList"` ReactionExtensionList map[string]*sdkws.KeyValue `json:"reactionExtensionList"`
@ -86,7 +86,7 @@ type CallbackBeforeSetMessageReactionExtResp struct {
type CallbackDeleteMessageReactionExtReq struct { type CallbackDeleteMessageReactionExtReq struct {
CallbackCommand `json:"callbackCommand"` CallbackCommand `json:"callbackCommand"`
OperationID string `json:"operationID"` OperationID string `json:"operationID"`
SourceID string `json:"sourceID"` ConversationID string `json:"conversationID"`
OpUserID string `json:"opUserID"` OpUserID string `json:"opUserID"`
SessionType int32 `json:"sessionType"` SessionType int32 `json:"sessionType"`
ReactionExtensionList []*sdkws.KeyValue `json:"reactionExtensionList"` ReactionExtensionList []*sdkws.KeyValue `json:"reactionExtensionList"`
@ -103,7 +103,7 @@ type CallbackDeleteMessageReactionExtResp struct {
type CallbackGetMessageListReactionExtReq struct { type CallbackGetMessageListReactionExtReq struct {
OperationID string `json:"operationID"` OperationID string `json:"operationID"`
CallbackCommand `json:"callbackCommand"` CallbackCommand `json:"callbackCommand"`
SourceID string `json:"sourceID"` ConversationID string `json:"conversationID"`
OpUserID string `json:"opUserID"` OpUserID string `json:"opUserID"`
SessionType int32 `json:"sessionType"` SessionType int32 `json:"sessionType"`
TypeKeyList []string `json:"typeKeyList"` TypeKeyList []string `json:"typeKeyList"`
@ -118,7 +118,7 @@ type CallbackGetMessageListReactionExtResp struct {
type CallbackAddMessageReactionExtReq struct { type CallbackAddMessageReactionExtReq struct {
OperationID string `json:"operationID"` OperationID string `json:"operationID"`
CallbackCommand `json:"callbackCommand"` CallbackCommand `json:"callbackCommand"`
SourceID string `json:"sourceID"` ConversationID string `json:"conversationID"`
OpUserID string `json:"opUserID"` OpUserID string `json:"opUserID"`
SessionType int32 `json:"sessionType"` SessionType int32 `json:"sessionType"`
ReactionExtensionList map[string]*sdkws.KeyValue `json:"reactionExtensionList"` ReactionExtensionList map[string]*sdkws.KeyValue `json:"reactionExtensionList"`

View File

@ -17,7 +17,7 @@ const (
type ExtendMsgSetCache interface { type ExtendMsgSetCache interface {
metaCache metaCache
NewCache() ExtendMsgSetCache NewCache() ExtendMsgSetCache
GetExtendMsg(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, firstModifyTime int64) (extendMsg *unrelation.ExtendMsgModel, err error) GetExtendMsg(ctx context.Context, conversationID string, sessionType int32, clientMsgID string, firstModifyTime int64) (extendMsg *unrelation.ExtendMsgModel, err error)
DelExtendMsg(clientMsgID string) ExtendMsgSetCache DelExtendMsg(clientMsgID string) ExtendMsgSetCache
} }
@ -51,9 +51,9 @@ func (e *ExtendMsgSetCacheRedis) getKey(clientMsgID string) string {
return extendMsgCache + clientMsgID return extendMsgCache + clientMsgID
} }
func (e *ExtendMsgSetCacheRedis) GetExtendMsg(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, firstModifyTime int64) (extendMsg *unrelation.ExtendMsgModel, err error) { func (e *ExtendMsgSetCacheRedis) GetExtendMsg(ctx context.Context, conversationID string, sessionType int32, clientMsgID string, firstModifyTime int64) (extendMsg *unrelation.ExtendMsgModel, err error) {
return getCache(ctx, e.rcClient, e.getKey(clientMsgID), e.expireTime, func(ctx context.Context) (*unrelation.ExtendMsgModel, error) { return getCache(ctx, e.rcClient, e.getKey(clientMsgID), e.expireTime, func(ctx context.Context) (*unrelation.ExtendMsgModel, error) {
return e.extendMsgSetDB.TakeExtendMsg(ctx, sourceID, sessionType, clientMsgID, firstModifyTime) return e.extendMsgSetDB.TakeExtendMsg(ctx, conversationID, sessionType, clientMsgID, firstModifyTime)
}) })
} }

View File

@ -4,10 +4,11 @@ import (
"context" "context"
"errors" "errors"
"fmt" "fmt"
"github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
"strconv" "strconv"
"time" "time"
"github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/log" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/log"
@ -20,23 +21,28 @@ import (
"github.com/go-redis/redis/v8" "github.com/go-redis/redis/v8"
) )
//const ( const (
// userIncrSeq = "REDIS_USER_INCR_SEQ:" // user incr seq userIncrSeq = "REDIS_USER_INCR_SEQ:" // user incr seq
// userMinSeq = "REDIS_USER_MIN_SEQ:" appleDeviceToken = "DEVICE_TOKEN"
// getuiToken = "GETUI_TOKEN" userMinSeq = "REDIS_USER_MIN_SEQ:"
// getuiTaskID = "GETUI_TASK_ID" getuiToken = "GETUI_TOKEN"
// messageCache = "MESSAGE_CACHE:" getuiTaskID = "GETUI_TASK_ID"
// signalCache = "SIGNAL_CACHE:" messageCache = "MESSAGE_CACHE:"
// signalListCache = "SIGNAL_LIST_CACHE:" signalCache = "SIGNAL_CACHE:"
// FcmToken = "FCM_TOKEN:" signalListCache = "SIGNAL_LIST_CACHE:"
// groupUserMinSeq = "GROUP_USER_MIN_SEQ:" fcmToken = "FCM_TOKEN:"
// groupMaxSeq = "GROUP_MAX_SEQ:" groupUserMinSeq = "GROUP_USER_MIN_SEQ:"
// groupMinSeq = "GROUP_MIN_SEQ:" groupMaxSeq = "GROUP_MAX_SEQ:"
// sendMsgFailedFlag = "SEND_MSG_FAILED_FLAG:" groupMinSeq = "GROUP_MIN_SEQ:"
// userBadgeUnreadCountSum = "USER_BADGE_UNREAD_COUNT_SUM:" sendMsgFailedFlag = "SEND_MSG_FAILED_FLAG:"
// exTypeKeyLocker = "EX_LOCK:" userBadgeUnreadCountSum = "USER_BADGE_UNREAD_COUNT_SUM:"
// uidPidToken = "UID_PID_TOKEN_STATUS:" exTypeKeyLocker = "EX_LOCK:"
//) uidPidToken = "UID_PID_TOKEN_STATUS:"
userNotificationSeq = "USER_NOTIFICATION_SEQ:"
userMinNotificationSeq = "USER_MIN_NOTIFICATION_SEQ:"
groupNotificationSeq = "GROUP_NOTIFICATION_SEQ:"
groupMinNotificationSeq = "GROUP_MIN_NOTIFICATION_SEQ:"
)
type MsgModel interface { type MsgModel interface {
IncrUserSeq(ctx context.Context, userID string) (int64, error) IncrUserSeq(ctx context.Context, userID string) (int64, error)
@ -84,6 +90,20 @@ type MsgModel interface {
SetMessageTypeKeyValue(ctx context.Context, clientMsgID string, sessionType int32, typeKey, value string) error SetMessageTypeKeyValue(ctx context.Context, clientMsgID string, sessionType int32, typeKey, value string) error
LockMessageTypeKey(ctx context.Context, clientMsgID string, TypeKey string) error LockMessageTypeKey(ctx context.Context, clientMsgID string, TypeKey string) error
UnLockMessageTypeKey(ctx context.Context, clientMsgID string, TypeKey string) error UnLockMessageTypeKey(ctx context.Context, clientMsgID string, TypeKey string) error
// notificatio
// IncrUserNotificationSeq(ctx context.Context, userID string) (int64, error)
// GetUserNotificationMaxSeq(ctx context.Context, userID string) (int64, error)
// SetUserNotificationMaxSeq(ctx context.Context, userID string, maxSeq int64) error
// SetUserNotificationMinSeq(ctx context.Context, userID string, minSeq int64) (err error)
// GetUserNotificationMinSeq(ctx context.Context, userID string) (int64, error)
// SetGroupNotificationUserMinSeq(ctx context.Context, groupID, userID string, minSeq int64) (err error)
// GetGroupNotificationUserMinSeq(ctx context.Context, groupID, userID string) (int64, error)
// GetGroupNotificationMaxSeq(ctx context.Context, groupID string) (int64, error)
// GetGroupNotificationMinSeq(ctx context.Context, groupID string) (int64, error)
// IncrGroupNotificationMaxSeq(ctx context.Context, groupID string) (int64, error)
// SetGroupNotificationMaxSeq(ctx context.Context, groupID string, maxSeq int64) error
// SetGroupNotificationMinSeq(ctx context.Context, groupID string, minSeq int64) error
} }
func NewMsgCacheModel(client redis.UniversalClient) MsgModel { func NewMsgCacheModel(client redis.UniversalClient) MsgModel {
@ -212,12 +232,12 @@ func (c *msgCache) DeleteTokenByUidPid(ctx context.Context, userID string, platf
return errs.Wrap(c.rdb.HDel(ctx, key, fields...).Err()) return errs.Wrap(c.rdb.HDel(ctx, key, fields...).Err())
} }
func (c *msgCache) getMessageCacheKey(sourceID string, seq int64) string { func (c *msgCache) getMessageCacheKey(conversationID string, seq int64) string {
return messageCache + sourceID + "_" + strconv.Itoa(int(seq)) return messageCache + conversationID + "_" + strconv.Itoa(int(seq))
} }
func (c *msgCache) allMessageCacheKey(sourceID string) string { func (c *msgCache) allMessageCacheKey(conversationID string) string {
return messageCache + sourceID + "_*" return messageCache + conversationID + "_*"
} }
func (c *msgCache) GetMessagesBySeq(ctx context.Context, userID string, seqs []int64) (seqMsgs []*sdkws.MsgData, failedSeqs []int64, err error) { func (c *msgCache) GetMessagesBySeq(ctx context.Context, userID string, seqs []int64) (seqMsgs []*sdkws.MsgData, failedSeqs []int64, err error) {
@ -437,15 +457,15 @@ func (c *msgCache) GetSendMsgStatus(ctx context.Context, id string) (int32, erro
} }
func (c *msgCache) SetFcmToken(ctx context.Context, account string, platformID int, fcmToken string, expireTime int64) (err error) { func (c *msgCache) SetFcmToken(ctx context.Context, account string, platformID int, fcmToken string, expireTime int64) (err error) {
return errs.Wrap(c.rdb.Set(ctx, FcmToken+account+":"+strconv.Itoa(platformID), fcmToken, time.Duration(expireTime)*time.Second).Err()) return errs.Wrap(c.rdb.Set(ctx, fcmToken+account+":"+strconv.Itoa(platformID), fcmToken, time.Duration(expireTime)*time.Second).Err())
} }
func (c *msgCache) GetFcmToken(ctx context.Context, account string, platformID int) (string, error) { func (c *msgCache) GetFcmToken(ctx context.Context, account string, platformID int) (string, error) {
return utils.Wrap2(c.rdb.Get(ctx, FcmToken+account+":"+strconv.Itoa(platformID)).Result()) return utils.Wrap2(c.rdb.Get(ctx, fcmToken+account+":"+strconv.Itoa(platformID)).Result())
} }
func (c *msgCache) DelFcmToken(ctx context.Context, account string, platformID int) error { func (c *msgCache) DelFcmToken(ctx context.Context, account string, platformID int) error {
return errs.Wrap(c.rdb.Del(ctx, FcmToken+account+":"+strconv.Itoa(platformID)).Err()) return errs.Wrap(c.rdb.Del(ctx, fcmToken+account+":"+strconv.Itoa(platformID)).Err())
} }
func (c *msgCache) IncrUserBadgeUnreadCountSum(ctx context.Context, userID string) (int, error) { func (c *msgCache) IncrUserBadgeUnreadCountSum(ctx context.Context, userID string) (int, error) {

View File

@ -4,10 +4,11 @@ import (
"context" "context"
"errors" "errors"
"fmt" "fmt"
"github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
"strconv" "strconv"
"time" "time"
"github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/log" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/log"
@ -212,12 +213,12 @@ func (c *notificationCache) DeleteTokenByUidPid(ctx context.Context, userID stri
return errs.Wrap(c.rdb.HDel(ctx, key, fields...).Err()) return errs.Wrap(c.rdb.HDel(ctx, key, fields...).Err())
} }
func (c *notificationCache) getMessageCacheKey(sourceID string, seq int64) string { func (c *notificationCache) getMessageCacheKey(conversationID string, seq int64) string {
return NotificationMessageCache + sourceID + "_" + strconv.Itoa(int(seq)) return NotificationMessageCache + conversationID + "_" + strconv.Itoa(int(seq))
} }
func (c *notificationCache) allMessageCacheKey(sourceID string) string { func (c *notificationCache) allMessageCacheKey(conversationID string) string {
return NotificationMessageCache + sourceID + "_*" return NotificationMessageCache + conversationID + "_*"
} }
func (c *notificationCache) GetMessagesBySeq(ctx context.Context, userID string, seqs []int64) (seqMsgs []*sdkws.MsgData, failedSeqs []int64, err error) { func (c *notificationCache) GetMessagesBySeq(ctx context.Context, userID string, seqs []int64) (seqMsgs []*sdkws.MsgData, failedSeqs []int64, err error) {

View File

@ -0,0 +1,31 @@
package controller
import (
"context"
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
)
// sourceID 可以是通知也可以是conversation
type commonMsgDatabase interface {
BatchInsertChat2DB(ctx context.Context, sourceID string, msgs []*sdkws.MsgData, currentMaxSeq int64) error
DeleteMessageFromCache(ctx context.Context, sourceID string, msgs []*sdkws.MsgData) error
GetMsgBySeqs(ctx context.Context, sourceID string, seqs []int64) (seqMsg []*sdkws.MsgData, err error)
GetMsgBySeqsRange(ctx context.Context, sourceID string, begin, end, num int64) (seqMsg []*sdkws.MsgData, err error)
CleanUpUserMsg(ctx context.Context, sourceID string) error
DelMsgsBySeqs(ctx context.Context, sourceID string, seqs []int64) (totalUnExistSeqs []int64, err error)
DelMsgsAndResetMinSeq(ctx context.Context, sourceID string, userIDs []string, remainTime int64) error
GetMinMaxSeqInMongoAndCache(ctx context.Context, sourceID string) (minSeqMongo, maxSeqMongo, minSeqCache, maxSeqCache int64, err error)
GetMaxSeq(ctx context.Context, sourceID string) (int64, error)
GetMinSeq(ctx context.Context, sourceID string) (int64, error)
SetMaxSeq(ctx context.Context, sourceID string, seq int64) error
SetMinSeq(ctx context.Context, sourceID string, seq int64) error
MsgToMQ(ctx context.Context, sourceID string, msg2mq *sdkws.MsgData) error
MsgToModifyMQ(ctx context.Context, sourceID string, messages []*sdkws.MsgData) error
MsgToPushMQ(ctx context.Context, sourceID string, msg2mq *sdkws.MsgData) (int32, int64, error)
MsgToMongoMQ(ctx context.Context, sourceID string, messages []*sdkws.MsgData, lastSeq int64) error
}

View File

@ -28,6 +28,7 @@ type ConversationDatabase interface {
SetUserConversations(ctx context.Context, ownerUserID string, conversations []*relationTb.ConversationModel) error SetUserConversations(ctx context.Context, ownerUserID string, conversations []*relationTb.ConversationModel) error
//SetUsersConversationFiledTx 设置多个用户会话关于某个字段的更新操作,如果会话不存在则创建,否则更新,内部保证事务操作 //SetUsersConversationFiledTx 设置多个用户会话关于某个字段的更新操作,如果会话不存在则创建,否则更新,内部保证事务操作
SetUsersConversationFiledTx(ctx context.Context, userIDs []string, conversation *relationTb.ConversationModel, filedMap map[string]interface{}) error SetUsersConversationFiledTx(ctx context.Context, userIDs []string, conversation *relationTb.ConversationModel, filedMap map[string]interface{}) error
CreateGroupChatConversation(ctx context.Context, groupID string, userIDs []string) error
} }
func NewConversationDatabase(conversation relationTb.ConversationModelInterface, cache cache.ConversationCache, tx tx.Tx) ConversationDatabase { func NewConversationDatabase(conversation relationTb.ConversationModelInterface, cache cache.ConversationCache, tx tx.Tx) ConversationDatabase {
@ -105,22 +106,22 @@ func (c *ConversationDataBase) SyncPeerUserPrivateConversationTx(ctx context.Con
return c.tx.Transaction(func(tx any) error { return c.tx.Transaction(func(tx any) error {
conversationTx := c.conversationDB.NewTx(tx) conversationTx := c.conversationDB.NewTx(tx)
cache := c.cache.NewCache() cache := c.cache.NewCache()
for _, v := range [][3]string{{conversation.OwnerUserID, conversation.ConversationID, conversation.UserID}, {conversation.UserID, utils.GetConversationIDBySessionType(conversation.OwnerUserID, constant.SingleChatType), conversation.OwnerUserID}} { for _, v := range [][2]string{{conversation.OwnerUserID, conversation.UserID}, {conversation.UserID, conversation.OwnerUserID}} {
haveUserIDs, err := conversationTx.FindUserID(ctx, []string{v[0]}, []string{v[1]}) haveUserIDs, err := conversationTx.FindUserID(ctx, []string{v[0]}, []string{conversation.ConversationID})
if err != nil { if err != nil {
return err return err
} }
if len(haveUserIDs) > 0 { if len(haveUserIDs) > 0 {
_, err := conversationTx.UpdateByMap(ctx, []string{v[0]}, v[1], map[string]interface{}{"is_private_chat": conversation.IsPrivateChat}) _, err := conversationTx.UpdateByMap(ctx, []string{v[0]}, conversation.ConversationID, map[string]interface{}{"is_private_chat": conversation.IsPrivateChat})
if err != nil { if err != nil {
return err return err
} }
cache = cache.DelUsersConversation(v[1], v[0]) cache = cache.DelUsersConversation(conversation.ConversationID, v[0])
} else { } else {
newConversation := *conversation newConversation := *conversation
newConversation.OwnerUserID = v[0] newConversation.OwnerUserID = v[0]
newConversation.UserID = v[2] newConversation.UserID = v[1]
newConversation.ConversationID = v[1] newConversation.ConversationID = conversation.ConversationID
newConversation.IsPrivateChat = conversation.IsPrivateChat newConversation.IsPrivateChat = conversation.IsPrivateChat
if err := conversationTx.Create(ctx, []*relationTb.ConversationModel{&newConversation}); err != nil { if err := conversationTx.Create(ctx, []*relationTb.ConversationModel{&newConversation}); err != nil {
return err return err
@ -191,3 +192,27 @@ func (c *ConversationDataBase) SetUserConversations(ctx context.Context, ownerUs
func (c *ConversationDataBase) FindRecvMsgNotNotifyUserIDs(ctx context.Context, groupID string) ([]string, error) { func (c *ConversationDataBase) FindRecvMsgNotNotifyUserIDs(ctx context.Context, groupID string) ([]string, error) {
return c.cache.GetSuperGroupRecvMsgNotNotifyUserIDs(ctx, groupID) return c.cache.GetSuperGroupRecvMsgNotNotifyUserIDs(ctx, groupID)
} }
func (c *ConversationDataBase) CreateGroupChatConversation(ctx context.Context, groupID string, userIDs []string) error {
conversationID := utils.GetConversationIDBySessionType(constant.SuperGroupChatType, groupID)
return c.tx.Transaction(func(tx any) error {
existConversationUserIDs, err := c.conversationDB.FindUserID(ctx, userIDs, []string{groupID})
if err != nil {
return err
}
notExistUserIDs := utils.DifferenceString(userIDs, existConversationUserIDs)
var conversations []*relationTb.ConversationModel
for _, v := range notExistUserIDs {
conversation := relationTb.ConversationModel{ConversationType: constant.SuperGroupChatType, GroupID: groupID, OwnerUserID: v, ConversationID: conversationID}
conversations = append(conversations, &conversation)
}
err = c.conversationDB.Create(ctx, conversations)
if err != nil {
return err
}
_, err = c.conversationDB.UpdateByMap(ctx, userIDs, conversationID, map[string]interface{}{"max_seq": 0})
return err
})
}

View File

@ -12,11 +12,11 @@ import (
type ExtendMsgDatabase interface { type ExtendMsgDatabase interface {
CreateExtendMsgSet(ctx context.Context, set *unRelationTb.ExtendMsgSetModel) error CreateExtendMsgSet(ctx context.Context, set *unRelationTb.ExtendMsgSetModel) error
GetAllExtendMsgSet(ctx context.Context, ID string, opts *unRelationTb.GetAllExtendMsgSetOpts) (sets []*unRelationTb.ExtendMsgSetModel, err error) GetAllExtendMsgSet(ctx context.Context, ID string, opts *unRelationTb.GetAllExtendMsgSetOpts) (sets []*unRelationTb.ExtendMsgSetModel, err error)
GetExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, maxMsgUpdateTime int64) (*unRelationTb.ExtendMsgSetModel, error) GetExtendMsgSet(ctx context.Context, conversationID string, sessionType int32, maxMsgUpdateTime int64) (*unRelationTb.ExtendMsgSetModel, error)
InsertExtendMsg(ctx context.Context, sourceID string, sessionType int32, msg *unRelationTb.ExtendMsgModel) error InsertExtendMsg(ctx context.Context, conversationID string, sessionType int32, msg *unRelationTb.ExtendMsgModel) error
InsertOrUpdateReactionExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*unRelationTb.KeyValueModel) error InsertOrUpdateReactionExtendMsgSet(ctx context.Context, conversationID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*unRelationTb.KeyValueModel) error
DeleteReactionExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*unRelationTb.KeyValueModel) error DeleteReactionExtendMsgSet(ctx context.Context, conversationID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*unRelationTb.KeyValueModel) error
GetExtendMsg(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, maxMsgUpdateTime int64) (extendMsg *unRelationTb.ExtendMsgModel, err error) GetExtendMsg(ctx context.Context, conversationID string, sessionType int32, clientMsgID string, maxMsgUpdateTime int64) (extendMsg *unRelationTb.ExtendMsgModel, err error)
} }
type extendMsgDatabase struct { type extendMsgDatabase struct {
@ -33,27 +33,27 @@ func (e *extendMsgDatabase) CreateExtendMsgSet(ctx context.Context, set *unRelat
return e.database.CreateExtendMsgSet(ctx, set) return e.database.CreateExtendMsgSet(ctx, set)
} }
func (e *extendMsgDatabase) GetAllExtendMsgSet(ctx context.Context, sourceID string, opts *unRelationTb.GetAllExtendMsgSetOpts) (sets []*unRelationTb.ExtendMsgSetModel, err error) { func (e *extendMsgDatabase) GetAllExtendMsgSet(ctx context.Context, conversationID string, opts *unRelationTb.GetAllExtendMsgSetOpts) (sets []*unRelationTb.ExtendMsgSetModel, err error) {
return e.database.GetAllExtendMsgSet(ctx, sourceID, opts) return e.database.GetAllExtendMsgSet(ctx, conversationID, opts)
} }
func (e *extendMsgDatabase) GetExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, maxMsgUpdateTime int64) (*unRelationTb.ExtendMsgSetModel, error) { func (e *extendMsgDatabase) GetExtendMsgSet(ctx context.Context, conversationID string, sessionType int32, maxMsgUpdateTime int64) (*unRelationTb.ExtendMsgSetModel, error) {
return e.database.GetExtendMsgSet(ctx, sourceID, sessionType, maxMsgUpdateTime) return e.database.GetExtendMsgSet(ctx, conversationID, sessionType, maxMsgUpdateTime)
} }
func (e *extendMsgDatabase) InsertExtendMsg(ctx context.Context, sourceID string, sessionType int32, msg *unRelationTb.ExtendMsgModel) error { func (e *extendMsgDatabase) InsertExtendMsg(ctx context.Context, conversationID string, sessionType int32, msg *unRelationTb.ExtendMsgModel) error {
return e.database.InsertExtendMsg(ctx, sourceID, sessionType, msg) return e.database.InsertExtendMsg(ctx, conversationID, sessionType, msg)
} }
func (e *extendMsgDatabase) InsertOrUpdateReactionExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*unRelationTb.KeyValueModel) error { func (e *extendMsgDatabase) InsertOrUpdateReactionExtendMsgSet(ctx context.Context, conversationID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*unRelationTb.KeyValueModel) error {
e.cache.DelExtendMsg(clientMsgID).ExecDel(ctx) e.cache.DelExtendMsg(clientMsgID).ExecDel(ctx)
return e.database.InsertOrUpdateReactionExtendMsgSet(ctx, sourceID, sessionType, clientMsgID, msgFirstModifyTime, reactionExtensionList) return e.database.InsertOrUpdateReactionExtendMsgSet(ctx, conversationID, sessionType, clientMsgID, msgFirstModifyTime, reactionExtensionList)
} }
func (e *extendMsgDatabase) DeleteReactionExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*unRelationTb.KeyValueModel) error { func (e *extendMsgDatabase) DeleteReactionExtendMsgSet(ctx context.Context, conversationID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*unRelationTb.KeyValueModel) error {
return e.database.DeleteReactionExtendMsgSet(ctx, sourceID, sessionType, clientMsgID, msgFirstModifyTime, reactionExtensionList) return e.database.DeleteReactionExtendMsgSet(ctx, conversationID, sessionType, clientMsgID, msgFirstModifyTime, reactionExtensionList)
} }
func (e *extendMsgDatabase) GetExtendMsg(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, maxMsgUpdateTime int64) (extendMsg *unRelationTb.ExtendMsgModel, err error) { func (e *extendMsgDatabase) GetExtendMsg(ctx context.Context, conversationID string, sessionType int32, clientMsgID string, maxMsgUpdateTime int64) (extendMsg *unRelationTb.ExtendMsgModel, err error) {
return e.cache.GetExtendMsg(ctx, sourceID, sessionType, clientMsgID, maxMsgUpdateTime) return e.cache.GetExtendMsg(ctx, conversationID, sessionType, clientMsgID, maxMsgUpdateTime)
} }

View File

@ -30,18 +30,19 @@ import (
type MsgDatabase interface { type MsgDatabase interface {
// 批量插入消息 // 批量插入消息
BatchInsertChat2DB(ctx context.Context, sourceID string, msgList []*sdkws.MsgData, currentMaxSeq int64) error BatchInsertChat2DB(ctx context.Context, conversationID string, msgList []*sdkws.MsgData, currentMaxSeq int64) error
// 刪除redis中消息缓存 // 刪除redis中消息缓存
DeleteMessageFromCache(ctx context.Context, sourceID string, msgList []*sdkws.MsgData) error DeleteMessageFromCache(ctx context.Context, conversationID string, msgList []*sdkws.MsgData) error
// incrSeq然后批量插入缓存 // incrSeq然后批量插入缓存
BatchInsertChat2Cache(ctx context.Context, sourceID string, msgList []*sdkws.MsgData) (int64, error) BatchInsertChat2Cache(ctx context.Context, conversationID string, msgList []*sdkws.MsgData, currentMaxSeq int64) (int64, error)
// incrSeq通知seq然后批量插入缓存 // incrSeq通知seq然后批量插入缓存
NotificationBatchInsertChat2Cache(ctx context.Context, sourceID string, msgs []*sdkws.MsgData) (int64, error) NotificationBatchInsertChat2Cache(ctx context.Context, conversationID string, msgs []*sdkws.MsgData) (int64, error)
// 删除消息 返回不存在的seqList // 删除消息 返回不存在的seqList
DelMsgBySeqs(ctx context.Context, userID string, seqs []int64) (totalUnExistSeqs []int64, err error) DelMsgBySeqs(ctx context.Context, userID string, seqs []int64) (totalUnExistSeqs []int64, err error)
// 获取群ID或者UserID最新一条在mongo里面的消息 // 获取群ID或者UserID最新一条在mongo里面的消息
// 通过seqList获取mongo中写扩散消息 // 通过seqList获取mongo中写扩散消息
GetMsgBySeqs(ctx context.Context, userID string, seqs []int64) (seqMsg []*sdkws.MsgData, err error) GetMsgBySeqs(ctx context.Context, userID string, seqs []int64) (seqMsg []*sdkws.MsgData, err error)
GetMsgBySeqsRange(ctx context.Context, conversationID string, begin, end, num int64) (seqMsg []*sdkws.MsgData, err error)
// 通过seqList获取大群在 mongo里面的消息 // 通过seqList获取大群在 mongo里面的消息
GetSuperGroupMsgBySeqs(ctx context.Context, groupID string, seqs []int64) (seqMsg []*sdkws.MsgData, err error) GetSuperGroupMsgBySeqs(ctx context.Context, groupID string, seqs []int64) (seqMsg []*sdkws.MsgData, err error)
// 删除用户所有消息/redis/mongo然后重置seq // 删除用户所有消息/redis/mongo然后重置seq
@ -66,12 +67,12 @@ type MsgDatabase interface {
SetMessageTypeKeyValue(ctx context.Context, clientMsgID string, sessionType int32, typeKey, value string) error SetMessageTypeKeyValue(ctx context.Context, clientMsgID string, sessionType int32, typeKey, value string) error
SetMessageReactionExpire(ctx context.Context, clientMsgID string, sessionType int32, expiration time.Duration) (bool, error) SetMessageReactionExpire(ctx context.Context, clientMsgID string, sessionType int32, expiration time.Duration) (bool, error)
GetExtendMsg(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, maxMsgUpdateTime int64) (*pbMsg.ExtendMsg, error) GetExtendMsg(ctx context.Context, conversationID string, sessionType int32, clientMsgID string, maxMsgUpdateTime int64) (*pbMsg.ExtendMsg, error)
InsertOrUpdateReactionExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*sdkws.KeyValue) error InsertOrUpdateReactionExtendMsgSet(ctx context.Context, conversationID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*sdkws.KeyValue) error
GetMessageTypeKeyValue(ctx context.Context, clientMsgID string, sessionType int32, typeKey string) (string, error) GetMessageTypeKeyValue(ctx context.Context, clientMsgID string, sessionType int32, typeKey string) (string, error)
GetOneMessageAllReactionList(ctx context.Context, clientMsgID string, sessionType int32) (map[string]string, error) GetOneMessageAllReactionList(ctx context.Context, clientMsgID string, sessionType int32) (map[string]string, error)
DeleteOneMessageKey(ctx context.Context, clientMsgID string, sessionType int32, subKey string) error DeleteOneMessageKey(ctx context.Context, clientMsgID string, sessionType int32, subKey string) error
DeleteReactionExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*sdkws.KeyValue) error DeleteReactionExtendMsgSet(ctx context.Context, conversationID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*sdkws.KeyValue) error
SetSendMsgStatus(ctx context.Context, id string, status int32) error SetSendMsgStatus(ctx context.Context, id string, status int32) error
GetSendMsgStatus(ctx context.Context, id string) (int32, error) GetSendMsgStatus(ctx context.Context, id string) (int32, error)
GetUserMaxSeq(ctx context.Context, userID string) (int64, error) GetUserMaxSeq(ctx context.Context, userID string) (int64, error)
@ -80,9 +81,9 @@ type MsgDatabase interface {
GetGroupMinSeq(ctx context.Context, groupID string) (int64, error) GetGroupMinSeq(ctx context.Context, groupID string) (int64, error)
MsgToMQ(ctx context.Context, key string, msg2mq *sdkws.MsgData) error MsgToMQ(ctx context.Context, key string, msg2mq *sdkws.MsgData) error
MsgToModifyMQ(ctx context.Context, aggregationID string, messages []*sdkws.MsgData) error MsgToModifyMQ(ctx context.Context, conversationID string, messages []*sdkws.MsgData) error
MsgToPushMQ(ctx context.Context, sourceID string, msg2mq *sdkws.MsgData) (int32, int64, error) MsgToPushMQ(ctx context.Context, conversationID string, msg2mq *sdkws.MsgData) (int32, int64, error)
MsgToMongoMQ(ctx context.Context, aggregationID string, messages []*sdkws.MsgData, lastSeq int64) error MsgToMongoMQ(ctx context.Context, conversationID string, messages []*sdkws.MsgData, lastSeq int64) error
} }
func NewMsgDatabase(msgDocModel unRelationTb.MsgDocModelInterface, cacheModel cache.MsgModel) MsgDatabase { func NewMsgDatabase(msgDocModel unRelationTb.MsgDocModelInterface, cacheModel cache.MsgModel) MsgDatabase {
@ -140,12 +141,12 @@ func (db *msgDatabase) DeleteOneMessageKey(ctx context.Context, clientMsgID stri
return db.cache.DeleteOneMessageKey(ctx, clientMsgID, sessionType, subKey) return db.cache.DeleteOneMessageKey(ctx, clientMsgID, sessionType, subKey)
} }
func (db *msgDatabase) InsertOrUpdateReactionExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensions map[string]*sdkws.KeyValue) error { func (db *msgDatabase) InsertOrUpdateReactionExtendMsgSet(ctx context.Context, conversationID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensions map[string]*sdkws.KeyValue) error {
return db.extendMsgDatabase.InsertOrUpdateReactionExtendMsgSet(ctx, sourceID, sessionType, clientMsgID, msgFirstModifyTime, db.extendMsgSetModel.Pb2Model(reactionExtensions)) return db.extendMsgDatabase.InsertOrUpdateReactionExtendMsgSet(ctx, conversationID, sessionType, clientMsgID, msgFirstModifyTime, db.extendMsgSetModel.Pb2Model(reactionExtensions))
} }
func (db *msgDatabase) GetExtendMsg(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, maxMsgUpdateTime int64) (*pbMsg.ExtendMsg, error) { func (db *msgDatabase) GetExtendMsg(ctx context.Context, conversationID string, sessionType int32, clientMsgID string, maxMsgUpdateTime int64) (*pbMsg.ExtendMsg, error) {
extendMsgSet, err := db.extendMsgDatabase.GetExtendMsgSet(ctx, sourceID, sessionType, maxMsgUpdateTime) extendMsgSet, err := db.extendMsgDatabase.GetExtendMsgSet(ctx, conversationID, sessionType, maxMsgUpdateTime)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -172,8 +173,8 @@ func (db *msgDatabase) GetExtendMsg(ctx context.Context, sourceID string, sessio
}, nil }, nil
} }
func (db *msgDatabase) DeleteReactionExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensions map[string]*sdkws.KeyValue) error { func (db *msgDatabase) DeleteReactionExtendMsgSet(ctx context.Context, conversationID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensions map[string]*sdkws.KeyValue) error {
return db.extendMsgDatabase.DeleteReactionExtendMsgSet(ctx, sourceID, sessionType, clientMsgID, msgFirstModifyTime, db.extendMsgSetModel.Pb2Model(reactionExtensions)) return db.extendMsgDatabase.DeleteReactionExtendMsgSet(ctx, conversationID, sessionType, clientMsgID, msgFirstModifyTime, db.extendMsgSetModel.Pb2Model(reactionExtensions))
} }
func (db *msgDatabase) SetSendMsgStatus(ctx context.Context, id string, status int32) error { func (db *msgDatabase) SetSendMsgStatus(ctx context.Context, id string, status int32) error {
@ -189,26 +190,26 @@ func (db *msgDatabase) MsgToMQ(ctx context.Context, key string, msg2mq *sdkws.Ms
return err return err
} }
func (db *msgDatabase) MsgToModifyMQ(ctx context.Context, aggregationID string, messages []*sdkws.MsgData) error { func (db *msgDatabase) MsgToModifyMQ(ctx context.Context, conversationID string, messages []*sdkws.MsgData) error {
if len(messages) > 0 { if len(messages) > 0 {
_, _, err := db.producerToModify.SendMessage(ctx, aggregationID, &pbMsg.MsgDataToModifyByMQ{AggregationID: aggregationID, Messages: messages}) _, _, err := db.producerToModify.SendMessage(ctx, conversationID, &pbMsg.MsgDataToModifyByMQ{ConversationID: conversationID, Messages: messages})
return err return err
} }
return nil return nil
} }
func (db *msgDatabase) MsgToPushMQ(ctx context.Context, key string, msg2mq *sdkws.MsgData) (int32, int64, error) { func (db *msgDatabase) MsgToPushMQ(ctx context.Context, conversationID string, msg2mq *sdkws.MsgData) (int32, int64, error) {
mqPushMsg := pbMsg.PushMsgDataToMQ{MsgData: msg2mq, SourceID: key} mqPushMsg := pbMsg.PushMsgDataToMQ{MsgData: msg2mq, ConversationID: conversationID}
partition, offset, err := db.producerToPush.SendMessage(ctx, key, &mqPushMsg) partition, offset, err := db.producerToPush.SendMessage(ctx, conversationID, &mqPushMsg)
if err != nil { if err != nil {
log.ZError(ctx, "MsgToPushMQ", err, "key", key, "msg2mq", msg2mq) log.ZError(ctx, "MsgToPushMQ", err, "key", conversationID, "msg2mq", msg2mq)
} }
return partition, offset, err return partition, offset, err
} }
func (db *msgDatabase) MsgToMongoMQ(ctx context.Context, aggregationID string, messages []*sdkws.MsgData, lastSeq int64) error { func (db *msgDatabase) MsgToMongoMQ(ctx context.Context, conversationID string, messages []*sdkws.MsgData, lastSeq int64) error {
if len(messages) > 0 { if len(messages) > 0 {
_, _, err := db.producerToModify.SendMessage(ctx, aggregationID, &pbMsg.MsgDataToMongoByMQ{LastSeq: lastSeq, AggregationID: aggregationID, MsgData: messages}) _, _, err := db.producerToModify.SendMessage(ctx, conversationID, &pbMsg.MsgDataToMongoByMQ{LastSeq: lastSeq, ConversationID: conversationID, MsgData: messages})
return err return err
} }
return nil return nil
@ -229,7 +230,7 @@ func (db *msgDatabase) GetGroupMinSeq(ctx context.Context, groupID string) (int6
return db.cache.GetGroupMinSeq(ctx, groupID) return db.cache.GetGroupMinSeq(ctx, groupID)
} }
func (db *msgDatabase) BatchInsertChat2DB(ctx context.Context, sourceID string, msgList []*sdkws.MsgData, currentMaxSeq int64) error { func (db *msgDatabase) BatchInsertChat2DB(ctx context.Context, conversationID string, msgList []*sdkws.MsgData, currentMaxSeq int64) error {
//newTime := utils.GetCurrentTimestampByMill() //newTime := utils.GetCurrentTimestampByMill()
if int64(len(msgList)) > db.msg.GetSingleGocMsgNum() { if int64(len(msgList)) > db.msg.GetSingleGocMsgNum() {
return errors.New("too large") return errors.New("too large")
@ -263,11 +264,11 @@ func (db *msgDatabase) BatchInsertChat2DB(ctx context.Context, sourceID string,
if insertCounter < remain { if insertCounter < remain {
msgsToMongo = append(msgsToMongo, sMsg) msgsToMongo = append(msgsToMongo, sMsg)
insertCounter++ insertCounter++
docID = db.msg.GetDocID(sourceID, currentMaxSeq) docID = db.msg.GetDocID(conversationID, currentMaxSeq)
//log.Debug(operationID, "msgListToMongo ", seqUid, m.MsgData.Seq, m.MsgData.ClientMsgID, insertCounter, remain, "userID: ", userID) //log.Debug(operationID, "msgListToMongo ", seqUid, m.MsgData.Seq, m.MsgData.ClientMsgID, insertCounter, remain, "userID: ", userID)
} else { } else {
msgsToMongoNext = append(msgsToMongoNext, sMsg) msgsToMongoNext = append(msgsToMongoNext, sMsg)
docIDNext = db.msg.GetDocID(sourceID, currentMaxSeq) docIDNext = db.msg.GetDocID(conversationID, currentMaxSeq)
//log.Debug(operationID, "msgListToMongoNext ", seqUidNext, m.MsgData.Seq, m.MsgData.ClientMsgID, insertCounter, remain, "userID: ", userID) //log.Debug(operationID, "msgListToMongoNext ", seqUidNext, m.MsgData.Seq, m.MsgData.ClientMsgID, insertCounter, remain, "userID: ", userID)
} }
} }
@ -317,11 +318,11 @@ func (db *msgDatabase) DeleteMessageFromCache(ctx context.Context, userID string
return db.cache.DeleteMessageFromCache(ctx, userID, msgs) return db.cache.DeleteMessageFromCache(ctx, userID, msgs)
} }
func (db *msgDatabase) NotificationBatchInsertChat2Cache(ctx context.Context, sourceID string, msgs []*sdkws.MsgData) (int64, error) { func (db *msgDatabase) NotificationBatchInsertChat2Cache(ctx context.Context, conversationID string, msgs []*sdkws.MsgData) (int64, error) {
return 0, nil return 0, nil
} }
func (db *msgDatabase) BatchInsertChat2Cache(ctx context.Context, sourceID string, msgList []*sdkws.MsgData) (int64, error) { func (db *msgDatabase) BatchInsertChat2Cache(ctx context.Context, conversationID string, msgList []*sdkws.MsgData, currentMaxSeq int64) (int64, error) {
//newTime := utils.GetCurrentTimestampByMill() //newTime := utils.GetCurrentTimestampByMill()
lenList := len(msgList) lenList := len(msgList)
if int64(lenList) > db.msg.GetSingleGocMsgNum() { if int64(lenList) > db.msg.GetSingleGocMsgNum() {
@ -331,39 +332,25 @@ func (db *msgDatabase) BatchInsertChat2Cache(ctx context.Context, sourceID strin
return 0, errors.New("too short as 0") return 0, errors.New("too short as 0")
} }
// judge sessionType to get seq // judge sessionType to get seq
var currentMaxSeq int64
var err error
if msgList[0].SessionType == constant.SuperGroupChatType {
currentMaxSeq, err = db.cache.GetGroupMaxSeq(ctx, sourceID)
//log.Debug(operationID, "constant.SuperGroupChatType lastMaxSeq before add ", currentMaxSeq, "userID ", sourceID, err)
} else {
currentMaxSeq, err = db.cache.GetUserMaxSeq(ctx, sourceID)
//log.Debug(operationID, "constant.SingleChatType lastMaxSeq before add ", currentMaxSeq, "userID ", sourceID, err)
}
if err != nil && err != redis.Nil {
prome.Inc(prome.SeqGetFailedCounter)
return 0, utils.Wrap(err, "")
}
prome.Inc(prome.SeqGetSuccessCounter)
lastMaxSeq := currentMaxSeq lastMaxSeq := currentMaxSeq
for _, m := range msgList { for _, m := range msgList {
currentMaxSeq++ currentMaxSeq++
m.Seq = currentMaxSeq m.Seq = currentMaxSeq
//log.Debug(operationID, "cache msg node ", m.String(), m.MsgData.ClientMsgID, "userID: ", sourceID, "seq: ", currentMaxSeq) //log.Debug(operationID, "cache msg node ", m.String(), m.MsgData.ClientMsgID, "userID: ", conversationID, "seq: ", currentMaxSeq)
} }
//log.Debug(operationID, "SetMessageToCache ", sourceID, len(msgList)) //log.Debug(operationID, "SetMessageToCache ", conversationID, len(msgList))
failedNum, err := db.cache.SetMessageToCache(ctx, sourceID, msgList) failedNum, err := db.cache.SetMessageToCache(ctx, conversationID, msgList)
if err != nil { if err != nil {
prome.Add(prome.MsgInsertRedisFailedCounter, failedNum) prome.Add(prome.MsgInsertRedisFailedCounter, failedNum)
//log.Error(operationID, "setMessageToCache failed, continue ", err.Error(), len(msgList), sourceID) //log.Error(operationID, "setMessageToCache failed, continue ", err.Error(), len(msgList), conversationID)
} else { } else {
prome.Inc(prome.MsgInsertRedisSuccessCounter) prome.Inc(prome.MsgInsertRedisSuccessCounter)
} }
//log.Debug(operationID, "batch to redis cost time ", mongo2.getCurrentTimestampByMill()-newTime, sourceID, len(msgList)) //log.Debug(operationID, "batch to redis cost time ", mongo2.getCurrentTimestampByMill()-newTime, conversationID, len(msgList))
if msgList[0].SessionType == constant.SuperGroupChatType { if msgList[0].SessionType == constant.SuperGroupChatType {
err = db.cache.SetGroupMaxSeq(ctx, sourceID, currentMaxSeq) err = db.cache.SetGroupMaxSeq(ctx, conversationID, currentMaxSeq)
} else { } else {
err = db.cache.SetUserMaxSeq(ctx, sourceID, currentMaxSeq) err = db.cache.SetUserMaxSeq(ctx, conversationID, currentMaxSeq)
} }
if err != nil { if err != nil {
prome.Inc(prome.SeqSetFailedCounter) prome.Inc(prome.SeqSetFailedCounter)
@ -438,16 +425,16 @@ func (db *msgDatabase) GetMsgAndIndexBySeqsInOneDoc(ctx context.Context, docID s
return seqMsgs, indexes, unExistSeqs, nil return seqMsgs, indexes, unExistSeqs, nil
} }
func (db *msgDatabase) GetNewestMsg(ctx context.Context, sourceID string) (msgPb *sdkws.MsgData, err error) { func (db *msgDatabase) GetNewestMsg(ctx context.Context, conversationID string) (msgPb *sdkws.MsgData, err error) {
msgInfo, err := db.msgDocDatabase.GetNewestMsg(ctx, sourceID) msgInfo, err := db.msgDocDatabase.GetNewestMsg(ctx, conversationID)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return db.unmarshalMsg(msgInfo) return db.unmarshalMsg(msgInfo)
} }
func (db *msgDatabase) GetOldestMsg(ctx context.Context, sourceID string) (msgPb *sdkws.MsgData, err error) { func (db *msgDatabase) GetOldestMsg(ctx context.Context, conversationID string) (msgPb *sdkws.MsgData, err error) {
msgInfo, err := db.msgDocDatabase.GetOldestMsg(ctx, sourceID) msgInfo, err := db.msgDocDatabase.GetOldestMsg(ctx, conversationID)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -463,10 +450,10 @@ func (db *msgDatabase) unmarshalMsg(msgInfo *unRelationTb.MsgInfoModel) (msgPb *
return msgPb, nil return msgPb, nil
} }
func (db *msgDatabase) getMsgBySeqs(ctx context.Context, sourceID string, seqs []int64, diffusionType int) (seqMsgs []*sdkws.MsgData, err error) { func (db *msgDatabase) getMsgBySeqs(ctx context.Context, conversationID string, seqs []int64, diffusionType int) (seqMsgs []*sdkws.MsgData, err error) {
var hasSeqs []int64 var hasSeqs []int64
singleCount := 0 singleCount := 0
m := db.msg.GetDocIDSeqsMap(sourceID, seqs) m := db.msg.GetDocIDSeqsMap(conversationID, seqs)
for docID, value := range m { for docID, value := range m {
doc, err := db.msgDocDatabase.FindOneByDocID(ctx, docID) doc, err := db.msgDocDatabase.FindOneByDocID(ctx, docID)
if err != nil { if err != nil {
@ -497,7 +484,7 @@ func (db *msgDatabase) getMsgBySeqs(ctx context.Context, sourceID string, seqs [
if diffusionType == constant.WriteDiffusion { if diffusionType == constant.WriteDiffusion {
exceptionMsg = db.msg.GenExceptionMessageBySeqs(diff) exceptionMsg = db.msg.GenExceptionMessageBySeqs(diff)
} else if diffusionType == constant.ReadDiffusion { } else if diffusionType == constant.ReadDiffusion {
exceptionMsg = db.msg.GenExceptionSuperGroupMessageBySeqs(diff, sourceID) exceptionMsg = db.msg.GenExceptionSuperGroupMessageBySeqs(diff, conversationID)
} }
seqMsgs = append(seqMsgs, exceptionMsg...) seqMsgs = append(seqMsgs, exceptionMsg...)
} }
@ -525,6 +512,31 @@ func (db *msgDatabase) GetMsgBySeqs(ctx context.Context, userID string, seqs []i
return successMsgs, nil return successMsgs, nil
} }
func (db *msgDatabase) GetMsgBySeqsRange(ctx context.Context, conversationID string, begin, end, num int64) (seqMsg []*sdkws.MsgData, err error) {
var seqs []int64
for i := begin; i <= end; i++ {
seqs = append(seqs, i)
}
successMsgs, failedSeqs, err := db.cache.GetMessagesBySeq(ctx, conversationID, seqs)
if err != nil {
if err != redis.Nil {
prome.Add(prome.MsgPullFromRedisFailedCounter, len(failedSeqs))
log.Error(mcontext.GetOperationID(ctx), "get message from redis exception", err.Error(), failedSeqs)
}
}
prome.Add(prome.MsgPullFromRedisSuccessCounter, len(successMsgs))
if len(failedSeqs) > 0 {
mongoMsgs, err := db.getMsgBySeqs(ctx, conversationID, seqs, constant.ReadDiffusion)
if err != nil {
prome.Add(prome.MsgPullFromMongoFailedCounter, len(failedSeqs))
return nil, err
}
prome.Add(prome.MsgPullFromMongoSuccessCounter, len(mongoMsgs))
successMsgs = append(successMsgs, mongoMsgs...)
}
return successMsgs, nil
}
func (db *msgDatabase) GetSuperGroupMsgBySeqs(ctx context.Context, groupID string, seqs []int64) (successMsgs []*sdkws.MsgData, err error) { func (db *msgDatabase) GetSuperGroupMsgBySeqs(ctx context.Context, groupID string, seqs []int64) (successMsgs []*sdkws.MsgData, err error) {
successMsgs, failedSeqs, err := db.cache.GetMessagesBySeq(ctx, groupID, seqs) successMsgs, failedSeqs, err := db.cache.GetMessagesBySeq(ctx, groupID, seqs)
if err != nil { if err != nil {
@ -609,13 +621,13 @@ func (d *delMsgRecursionStruct) getSetMinSeq() int64 {
// seq 70 // seq 70
// set minSeq 21 // set minSeq 21
// recursion 删除list并且返回设置的最小seq // recursion 删除list并且返回设置的最小seq
func (db *msgDatabase) deleteMsgRecursion(ctx context.Context, sourceID string, index int64, delStruct *delMsgRecursionStruct, remainTime int64) (int64, error) { func (db *msgDatabase) deleteMsgRecursion(ctx context.Context, conversationID string, index int64, delStruct *delMsgRecursionStruct, remainTime int64) (int64, error) {
// find from oldest list // find from oldest list
msgs, err := db.msgDocDatabase.GetMsgsByIndex(ctx, sourceID, index) msgs, err := db.msgDocDatabase.GetMsgsByIndex(ctx, conversationID, index)
if err != nil || msgs.DocID == "" { if err != nil || msgs.DocID == "" {
if err != nil { if err != nil {
if err == unrelation.ErrMsgListNotExist { if err == unrelation.ErrMsgListNotExist {
log.NewDebug(mcontext.GetOperationID(ctx), utils.GetSelfFuncName(), "ID:", sourceID, "index:", index, err.Error()) log.NewDebug(mcontext.GetOperationID(ctx), utils.GetSelfFuncName(), "ID:", conversationID, "index:", index, err.Error())
} else { } else {
//log.NewError(operationID, utils.GetSelfFuncName(), "GetUserMsgListByIndex failed", err.Error(), index, ID) //log.NewError(operationID, utils.GetSelfFuncName(), "GetUserMsgListByIndex failed", err.Error(), index, ID)
} }
@ -627,7 +639,7 @@ func (db *msgDatabase) deleteMsgRecursion(ctx context.Context, sourceID string,
} }
return delStruct.getSetMinSeq() + 1, nil return delStruct.getSetMinSeq() + 1, nil
} }
//log.NewDebug(operationID, "ID:", sourceID, "index:", index, "uid:", msgs.UID, "len:", len(msgs.Msg)) //log.NewDebug(operationID, "ID:", conversationID, "index:", index, "uid:", msgs.UID, "len:", len(msgs.Msg))
if int64(len(msgs.Msg)) > db.msg.GetSingleGocMsgNum() { if int64(len(msgs.Msg)) > db.msg.GetSingleGocMsgNum() {
log.ZWarn(ctx, "msgs too large", nil, "lenth", len(msgs.Msg), "docID:", msgs.DocID) log.ZWarn(ctx, "msgs too large", nil, "lenth", len(msgs.Msg), "docID:", msgs.DocID)
} }
@ -670,7 +682,7 @@ func (db *msgDatabase) deleteMsgRecursion(ctx context.Context, sourceID string,
} }
} }
// 继续递归 index+1 // 继续递归 index+1
seq, err := db.deleteMsgRecursion(ctx, sourceID, index+1, delStruct, remainTime) seq, err := db.deleteMsgRecursion(ctx, conversationID, index+1, delStruct, remainTime)
return seq, utils.Wrap(err, "deleteMsg failed") return seq, utils.Wrap(err, "deleteMsg failed")
} }
@ -703,8 +715,8 @@ func (db *msgDatabase) GetSuperGroupMinMaxSeqInMongoAndCache(ctx context.Context
return return
} }
func (db *msgDatabase) GetMinMaxSeqMongo(ctx context.Context, sourceID string) (minSeqMongo, maxSeqMongo int64, err error) { func (db *msgDatabase) GetMinMaxSeqMongo(ctx context.Context, conversationID string) (minSeqMongo, maxSeqMongo int64, err error) {
oldestMsgMongo, err := db.msgDocDatabase.GetOldestMsg(ctx, sourceID) oldestMsgMongo, err := db.msgDocDatabase.GetOldestMsg(ctx, conversationID)
if err != nil { if err != nil {
return 0, 0, err return 0, 0, err
} }
@ -713,7 +725,7 @@ func (db *msgDatabase) GetMinMaxSeqMongo(ctx context.Context, sourceID string) (
return 0, 0, err return 0, 0, err
} }
minSeqMongo = msgPb.Seq minSeqMongo = msgPb.Seq
newestMsgMongo, err := db.msgDocDatabase.GetNewestMsg(ctx, sourceID) newestMsgMongo, err := db.msgDocDatabase.GetNewestMsg(ctx, conversationID)
if err != nil { if err != nil {
return 0, 0, err return 0, 0, err
} }

View File

@ -30,13 +30,13 @@ import (
type NotificationDatabase interface { type NotificationDatabase interface {
// 批量插入消息 // 批量插入消息
BatchInsertChat2DB(ctx context.Context, sourceID string, msgList []*sdkws.MsgData, currentMaxSeq int64) error BatchInsertChat2DB(ctx context.Context, conversationID string, msgList []*sdkws.MsgData, currentMaxSeq int64) error
// 刪除redis中消息缓存 // 刪除redis中消息缓存
DeleteMessageFromCache(ctx context.Context, sourceID string, msgList []*sdkws.MsgData) error DeleteMessageFromCache(ctx context.Context, conversationID string, msgList []*sdkws.MsgData) error
// incrSeq然后批量插入缓存 // incrSeq然后批量插入缓存
BatchInsertChat2Cache(ctx context.Context, sourceID string, msgList []*sdkws.MsgData) (int64, error) BatchInsertChat2Cache(ctx context.Context, conversationID string, msgList []*sdkws.MsgData) (int64, error)
// incrSeq通知seq然后批量插入缓存 // incrSeq通知seq然后批量插入缓存
NotificationBatchInsertChat2Cache(ctx context.Context, sourceID string, msgs []*sdkws.MsgData) (int64, error) NotificationBatchInsertChat2Cache(ctx context.Context, conversationID string, msgs []*sdkws.MsgData) (int64, error)
// 删除消息 返回不存在的seqList // 删除消息 返回不存在的seqList
DelMsgBySeqs(ctx context.Context, userID string, seqs []int64) (totalUnExistSeqs []int64, err error) DelMsgBySeqs(ctx context.Context, userID string, seqs []int64) (totalUnExistSeqs []int64, err error)
// 获取群ID或者UserID最新一条在mongo里面的消息 // 获取群ID或者UserID最新一条在mongo里面的消息
@ -66,12 +66,12 @@ type NotificationDatabase interface {
SetMessageTypeKeyValue(ctx context.Context, clientMsgID string, sessionType int32, typeKey, value string) error SetMessageTypeKeyValue(ctx context.Context, clientMsgID string, sessionType int32, typeKey, value string) error
SetMessageReactionExpire(ctx context.Context, clientMsgID string, sessionType int32, expiration time.Duration) (bool, error) SetMessageReactionExpire(ctx context.Context, clientMsgID string, sessionType int32, expiration time.Duration) (bool, error)
GetExtendMsg(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, maxMsgUpdateTime int64) (*pbMsg.ExtendMsg, error) GetExtendMsg(ctx context.Context, conversationID string, sessionType int32, clientMsgID string, maxMsgUpdateTime int64) (*pbMsg.ExtendMsg, error)
InsertOrUpdateReactionExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*sdkws.KeyValue) error InsertOrUpdateReactionExtendMsgSet(ctx context.Context, conversationID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*sdkws.KeyValue) error
GetMessageTypeKeyValue(ctx context.Context, clientMsgID string, sessionType int32, typeKey string) (string, error) GetMessageTypeKeyValue(ctx context.Context, clientMsgID string, sessionType int32, typeKey string) (string, error)
GetOneMessageAllReactionList(ctx context.Context, clientMsgID string, sessionType int32) (map[string]string, error) GetOneMessageAllReactionList(ctx context.Context, clientMsgID string, sessionType int32) (map[string]string, error)
DeleteOneMessageKey(ctx context.Context, clientMsgID string, sessionType int32, subKey string) error DeleteOneMessageKey(ctx context.Context, clientMsgID string, sessionType int32, subKey string) error
DeleteReactionExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*sdkws.KeyValue) error DeleteReactionExtendMsgSet(ctx context.Context, conversationID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*sdkws.KeyValue) error
SetSendMsgStatus(ctx context.Context, id string, status int32) error SetSendMsgStatus(ctx context.Context, id string, status int32) error
GetSendMsgStatus(ctx context.Context, id string) (int32, error) GetSendMsgStatus(ctx context.Context, id string) (int32, error)
GetUserMaxSeq(ctx context.Context, userID string) (int64, error) GetUserMaxSeq(ctx context.Context, userID string) (int64, error)
@ -80,9 +80,9 @@ type NotificationDatabase interface {
GetGroupMinSeq(ctx context.Context, groupID string) (int64, error) GetGroupMinSeq(ctx context.Context, groupID string) (int64, error)
MsgToMQ(ctx context.Context, key string, msg2mq *sdkws.MsgData) error MsgToMQ(ctx context.Context, key string, msg2mq *sdkws.MsgData) error
MsgToModifyMQ(ctx context.Context, aggregationID string, messages []*sdkws.MsgData) error MsgToModifyMQ(ctx context.Context, conversationID string, messages []*sdkws.MsgData) error
MsgToPushMQ(ctx context.Context, sourceID string, msg2mq *sdkws.MsgData) (int32, int64, error) MsgToPushMQ(ctx context.Context, conversationID string, msg2mq *sdkws.MsgData) (int32, int64, error)
MsgToMongoMQ(ctx context.Context, aggregationID string, messages []*sdkws.MsgData, lastSeq int64) error MsgToMongoMQ(ctx context.Context, conversationID string, messages []*sdkws.MsgData, lastSeq int64) error
} }
func NewNotificationDatabase(msgDocModel unRelationTb.NotificationDocModelInterface, cacheModel cache.NotificationModel) NotificationDatabase { func NewNotificationDatabase(msgDocModel unRelationTb.NotificationDocModelInterface, cacheModel cache.NotificationModel) NotificationDatabase {
@ -141,12 +141,12 @@ func (db *notificationDatabase) DeleteOneMessageKey(ctx context.Context, clientM
return db.cache.DeleteOneMessageKey(ctx, clientMsgID, sessionType, subKey) return db.cache.DeleteOneMessageKey(ctx, clientMsgID, sessionType, subKey)
} }
func (db *notificationDatabase) InsertOrUpdateReactionExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensions map[string]*sdkws.KeyValue) error { func (db *notificationDatabase) InsertOrUpdateReactionExtendMsgSet(ctx context.Context, conversationID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensions map[string]*sdkws.KeyValue) error {
return db.extendMsgDatabase.InsertOrUpdateReactionExtendMsgSet(ctx, sourceID, sessionType, clientMsgID, msgFirstModifyTime, db.extendMsgSetModel.Pb2Model(reactionExtensions)) return db.extendMsgDatabase.InsertOrUpdateReactionExtendMsgSet(ctx, conversationID, sessionType, clientMsgID, msgFirstModifyTime, db.extendMsgSetModel.Pb2Model(reactionExtensions))
} }
func (db *notificationDatabase) GetExtendMsg(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, maxMsgUpdateTime int64) (*pbMsg.ExtendMsg, error) { func (db *notificationDatabase) GetExtendMsg(ctx context.Context, conversationID string, sessionType int32, clientMsgID string, maxMsgUpdateTime int64) (*pbMsg.ExtendMsg, error) {
extendMsgSet, err := db.extendMsgDatabase.GetExtendMsgSet(ctx, sourceID, sessionType, maxMsgUpdateTime) extendMsgSet, err := db.extendMsgDatabase.GetExtendMsgSet(ctx, conversationID, sessionType, maxMsgUpdateTime)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -173,8 +173,8 @@ func (db *notificationDatabase) GetExtendMsg(ctx context.Context, sourceID strin
}, nil }, nil
} }
func (db *notificationDatabase) DeleteReactionExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensions map[string]*sdkws.KeyValue) error { func (db *notificationDatabase) DeleteReactionExtendMsgSet(ctx context.Context, conversationID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensions map[string]*sdkws.KeyValue) error {
return db.extendMsgDatabase.DeleteReactionExtendMsgSet(ctx, sourceID, sessionType, clientMsgID, msgFirstModifyTime, db.extendMsgSetModel.Pb2Model(reactionExtensions)) return db.extendMsgDatabase.DeleteReactionExtendMsgSet(ctx, conversationID, sessionType, clientMsgID, msgFirstModifyTime, db.extendMsgSetModel.Pb2Model(reactionExtensions))
} }
func (db *notificationDatabase) SetSendMsgStatus(ctx context.Context, id string, status int32) error { func (db *notificationDatabase) SetSendMsgStatus(ctx context.Context, id string, status int32) error {
@ -190,26 +190,26 @@ func (db *notificationDatabase) MsgToMQ(ctx context.Context, key string, msg2mq
return err return err
} }
func (db *notificationDatabase) MsgToModifyMQ(ctx context.Context, aggregationID string, messages []*sdkws.MsgData) error { func (db *notificationDatabase) MsgToModifyMQ(ctx context.Context, conversationID string, messages []*sdkws.MsgData) error {
if len(messages) > 0 { if len(messages) > 0 {
_, _, err := db.producerToModify.SendMessage(ctx, aggregationID, &pbMsg.MsgDataToModifyByMQ{AggregationID: aggregationID, Messages: messages}) _, _, err := db.producerToModify.SendMessage(ctx, conversationID, &pbMsg.MsgDataToModifyByMQ{ConversationID: conversationID, Messages: messages})
return err return err
} }
return nil return nil
} }
func (db *notificationDatabase) MsgToPushMQ(ctx context.Context, key string, msg2mq *sdkws.MsgData) (int32, int64, error) { func (db *notificationDatabase) MsgToPushMQ(ctx context.Context, conversationID string, msg2mq *sdkws.MsgData) (int32, int64, error) {
mqPushMsg := pbMsg.PushMsgDataToMQ{MsgData: msg2mq, SourceID: key} mqPushMsg := pbMsg.PushMsgDataToMQ{MsgData: msg2mq, ConversationID: conversationID}
partition, offset, err := db.producerToPush.SendMessage(ctx, key, &mqPushMsg) partition, offset, err := db.producerToPush.SendMessage(ctx, conversationID, &mqPushMsg)
if err != nil { if err != nil {
log.ZError(ctx, "MsgToPushMQ", err, "key", key, "msg2mq", msg2mq) log.ZError(ctx, "MsgToPushMQ", err, "conversationID", conversationID, "msg2mq", msg2mq)
} }
return partition, offset, err return partition, offset, err
} }
func (db *notificationDatabase) MsgToMongoMQ(ctx context.Context, aggregationID string, messages []*sdkws.MsgData, lastSeq int64) error { func (db *notificationDatabase) MsgToMongoMQ(ctx context.Context, conversationID string, messages []*sdkws.MsgData, lastSeq int64) error {
if len(messages) > 0 { if len(messages) > 0 {
_, _, err := db.producerToModify.SendMessage(ctx, aggregationID, &pbMsg.MsgDataToMongoByMQ{LastSeq: lastSeq, AggregationID: aggregationID, MsgData: messages}) _, _, err := db.producerToModify.SendMessage(ctx, conversationID, &pbMsg.MsgDataToMongoByMQ{LastSeq: lastSeq, ConversationID: conversationID, MsgData: messages})
return err return err
} }
return nil return nil
@ -230,7 +230,7 @@ func (db *notificationDatabase) GetGroupMinSeq(ctx context.Context, groupID stri
return db.cache.GetGroupMinSeq(ctx, groupID) return db.cache.GetGroupMinSeq(ctx, groupID)
} }
func (db *notificationDatabase) BatchInsertChat2DB(ctx context.Context, sourceID string, msgList []*sdkws.MsgData, currentMaxSeq int64) error { func (db *notificationDatabase) BatchInsertChat2DB(ctx context.Context, conversationID string, msgList []*sdkws.MsgData, currentMaxSeq int64) error {
//newTime := utils.GetCurrentTimestampByMill() //newTime := utils.GetCurrentTimestampByMill()
if int64(len(msgList)) > db.msg.GetsingleGocNotificationNum() { if int64(len(msgList)) > db.msg.GetsingleGocNotificationNum() {
return errors.New("too large") return errors.New("too large")
@ -264,11 +264,11 @@ func (db *notificationDatabase) BatchInsertChat2DB(ctx context.Context, sourceID
if insertCounter < remain { if insertCounter < remain {
msgsToMongo = append(msgsToMongo, sMsg) msgsToMongo = append(msgsToMongo, sMsg)
insertCounter++ insertCounter++
docID = db.msg.GetDocID(sourceID, currentMaxSeq) docID = db.msg.GetDocID(conversationID, currentMaxSeq)
//log.Debug(operationID, "msgListToMongo ", seqUid, m.MsgData.Seq, m.MsgData.ClientMsgID, insertCounter, remain, "userID: ", userID) //log.Debug(operationID, "msgListToMongo ", seqUid, m.MsgData.Seq, m.MsgData.ClientMsgID, insertCounter, remain, "userID: ", userID)
} else { } else {
msgsToMongoNext = append(msgsToMongoNext, sMsg) msgsToMongoNext = append(msgsToMongoNext, sMsg)
docIDNext = db.msg.GetDocID(sourceID, currentMaxSeq) docIDNext = db.msg.GetDocID(conversationID, currentMaxSeq)
//log.Debug(operationID, "msgListToMongoNext ", seqUidNext, m.MsgData.Seq, m.MsgData.ClientMsgID, insertCounter, remain, "userID: ", userID) //log.Debug(operationID, "msgListToMongoNext ", seqUidNext, m.MsgData.Seq, m.MsgData.ClientMsgID, insertCounter, remain, "userID: ", userID)
} }
} }
@ -318,11 +318,11 @@ func (db *notificationDatabase) DeleteMessageFromCache(ctx context.Context, user
return db.cache.DeleteMessageFromCache(ctx, userID, msgs) return db.cache.DeleteMessageFromCache(ctx, userID, msgs)
} }
func (db *notificationDatabase) NotificationBatchInsertChat2Cache(ctx context.Context, sourceID string, msgs []*sdkws.MsgData) (int64, error) { func (db *notificationDatabase) NotificationBatchInsertChat2Cache(ctx context.Context, conversationID string, msgs []*sdkws.MsgData) (int64, error) {
return 0, nil return 0, nil
} }
func (db *notificationDatabase) BatchInsertChat2Cache(ctx context.Context, sourceID string, msgList []*sdkws.MsgData) (int64, error) { func (db *notificationDatabase) BatchInsertChat2Cache(ctx context.Context, conversationID string, msgList []*sdkws.MsgData) (int64, error) {
//newTime := utils.GetCurrentTimestampByMill() //newTime := utils.GetCurrentTimestampByMill()
lenList := len(msgList) lenList := len(msgList)
if int64(lenList) > db.msg.GetsingleGocNotificationNum() { if int64(lenList) > db.msg.GetsingleGocNotificationNum() {
@ -335,11 +335,11 @@ func (db *notificationDatabase) BatchInsertChat2Cache(ctx context.Context, sourc
var currentMaxSeq int64 var currentMaxSeq int64
var err error var err error
if msgList[0].SessionType == constant.SuperGroupChatType { if msgList[0].SessionType == constant.SuperGroupChatType {
currentMaxSeq, err = db.cache.GetGroupMaxSeq(ctx, sourceID) currentMaxSeq, err = db.cache.GetGroupMaxSeq(ctx, conversationID)
//log.Debug(operationID, "constant.SuperGroupChatType lastMaxSeq before add ", currentMaxSeq, "userID ", sourceID, err) //log.Debug(operationID, "constant.SuperGroupChatType lastMaxSeq before add ", currentMaxSeq, "userID ", conversationID, err)
} else { } else {
currentMaxSeq, err = db.cache.GetUserMaxSeq(ctx, sourceID) currentMaxSeq, err = db.cache.GetUserMaxSeq(ctx, conversationID)
//log.Debug(operationID, "constant.SingleChatType lastMaxSeq before add ", currentMaxSeq, "userID ", sourceID, err) //log.Debug(operationID, "constant.SingleChatType lastMaxSeq before add ", currentMaxSeq, "userID ", conversationID, err)
} }
if err != nil && err != redis.Nil { if err != nil && err != redis.Nil {
prome.Inc(prome.SeqGetFailedCounter) prome.Inc(prome.SeqGetFailedCounter)
@ -350,21 +350,21 @@ func (db *notificationDatabase) BatchInsertChat2Cache(ctx context.Context, sourc
for _, m := range msgList { for _, m := range msgList {
currentMaxSeq++ currentMaxSeq++
m.Seq = currentMaxSeq m.Seq = currentMaxSeq
//log.Debug(operationID, "cache msg node ", m.String(), m.MsgData.ClientMsgID, "userID: ", sourceID, "seq: ", currentMaxSeq) //log.Debug(operationID, "cache msg node ", m.String(), m.MsgData.ClientMsgID, "userID: ", conversationID, "seq: ", currentMaxSeq)
} }
//log.Debug(operationID, "SetMessageToCache ", sourceID, len(msgList)) //log.Debug(operationID, "SetMessageToCache ", conversationID, len(msgList))
failedNum, err := db.cache.SetMessageToCache(ctx, sourceID, msgList) failedNum, err := db.cache.SetMessageToCache(ctx, conversationID, msgList)
if err != nil { if err != nil {
prome.Add(prome.MsgInsertRedisFailedCounter, failedNum) prome.Add(prome.MsgInsertRedisFailedCounter, failedNum)
//log.Error(operationID, "setMessageToCache failed, continue ", err.Error(), len(msgList), sourceID) //log.Error(operationID, "setMessageToCache failed, continue ", err.Error(), len(msgList), conversationID)
} else { } else {
prome.Inc(prome.MsgInsertRedisSuccessCounter) prome.Inc(prome.MsgInsertRedisSuccessCounter)
} }
//log.Debug(operationID, "batch to redis cost time ", mongo2.getCurrentTimestampByMill()-newTime, sourceID, len(msgList)) //log.Debug(operationID, "batch to redis cost time ", mongo2.getCurrentTimestampByMill()-newTime, conversationID, len(msgList))
if msgList[0].SessionType == constant.SuperGroupChatType { if msgList[0].SessionType == constant.SuperGroupChatType {
err = db.cache.SetGroupMaxSeq(ctx, sourceID, currentMaxSeq) err = db.cache.SetGroupMaxSeq(ctx, conversationID, currentMaxSeq)
} else { } else {
err = db.cache.SetUserMaxSeq(ctx, sourceID, currentMaxSeq) err = db.cache.SetUserMaxSeq(ctx, conversationID, currentMaxSeq)
} }
if err != nil { if err != nil {
prome.Inc(prome.SeqSetFailedCounter) prome.Inc(prome.SeqSetFailedCounter)
@ -439,16 +439,16 @@ func (db *notificationDatabase) GetMsgAndIndexBySeqsInOneDoc(ctx context.Context
return seqMsgs, indexes, unExistSeqs, nil return seqMsgs, indexes, unExistSeqs, nil
} }
func (db *notificationDatabase) GetNewestMsg(ctx context.Context, sourceID string) (msgPb *sdkws.MsgData, err error) { func (db *notificationDatabase) GetNewestMsg(ctx context.Context, conversationID string) (msgPb *sdkws.MsgData, err error) {
msgInfo, err := db.msgDocDatabase.GetNewestMsg(ctx, sourceID) msgInfo, err := db.msgDocDatabase.GetNewestMsg(ctx, conversationID)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return db.unmarshalMsg(msgInfo) return db.unmarshalMsg(msgInfo)
} }
func (db *notificationDatabase) GetOldestMsg(ctx context.Context, sourceID string) (msgPb *sdkws.MsgData, err error) { func (db *notificationDatabase) GetOldestMsg(ctx context.Context, conversationID string) (msgPb *sdkws.MsgData, err error) {
msgInfo, err := db.msgDocDatabase.GetOldestMsg(ctx, sourceID) msgInfo, err := db.msgDocDatabase.GetOldestMsg(ctx, conversationID)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -464,10 +464,10 @@ func (db *notificationDatabase) unmarshalMsg(msgInfo *unRelationTb.NotificationI
return msgPb, nil return msgPb, nil
} }
func (db *notificationDatabase) getMsgBySeqs(ctx context.Context, sourceID string, seqs []int64, diffusionType int) (seqMsgs []*sdkws.MsgData, err error) { func (db *notificationDatabase) getMsgBySeqs(ctx context.Context, conversationID string, seqs []int64, diffusionType int) (seqMsgs []*sdkws.MsgData, err error) {
var hasSeqs []int64 var hasSeqs []int64
singleCount := 0 singleCount := 0
m := db.msg.GetDocIDSeqsMap(sourceID, seqs) m := db.msg.GetDocIDSeqsMap(conversationID, seqs)
for docID, value := range m { for docID, value := range m {
doc, err := db.msgDocDatabase.FindOneByDocID(ctx, docID) doc, err := db.msgDocDatabase.FindOneByDocID(ctx, docID)
if err != nil { if err != nil {
@ -498,7 +498,7 @@ func (db *notificationDatabase) getMsgBySeqs(ctx context.Context, sourceID strin
if diffusionType == constant.WriteDiffusion { if diffusionType == constant.WriteDiffusion {
exceptionMsg = db.msg.GenExceptionMessageBySeqs(diff) exceptionMsg = db.msg.GenExceptionMessageBySeqs(diff)
} else if diffusionType == constant.ReadDiffusion { } else if diffusionType == constant.ReadDiffusion {
exceptionMsg = db.msg.GenExceptionSuperGroupMessageBySeqs(diff, sourceID) exceptionMsg = db.msg.GenExceptionSuperGroupMessageBySeqs(diff, conversationID)
} }
seqMsgs = append(seqMsgs, exceptionMsg...) seqMsgs = append(seqMsgs, exceptionMsg...)
} }
@ -610,13 +610,13 @@ func (d *delNotificationRecursionStruct) getSetMinSeq() int64 {
// seq 70 // seq 70
// set minSeq 21 // set minSeq 21
// recursion 删除list并且返回设置的最小seq // recursion 删除list并且返回设置的最小seq
func (db *notificationDatabase) deleteMsgRecursion(ctx context.Context, sourceID string, index int64, delStruct *delNotificationRecursionStruct, remainTime int64) (int64, error) { func (db *notificationDatabase) deleteMsgRecursion(ctx context.Context, conversationID string, index int64, delStruct *delNotificationRecursionStruct, remainTime int64) (int64, error) {
// find from oldest list // find from oldest list
msgs, err := db.msgDocDatabase.GetMsgsByIndex(ctx, sourceID, index) msgs, err := db.msgDocDatabase.GetMsgsByIndex(ctx, conversationID, index)
if err != nil || msgs.DocID == "" { if err != nil || msgs.DocID == "" {
if err != nil { if err != nil {
if err == unrelation.ErrMsgListNotExist { if err == unrelation.ErrMsgListNotExist {
log.NewDebug(mcontext.GetOperationID(ctx), utils.GetSelfFuncName(), "ID:", sourceID, "index:", index, err.Error()) log.NewDebug(mcontext.GetOperationID(ctx), utils.GetSelfFuncName(), "ID:", conversationID, "index:", index, err.Error())
} else { } else {
//log.NewError(operationID, utils.GetSelfFuncName(), "GetUserMsgListByIndex failed", err.Error(), index, ID) //log.NewError(operationID, utils.GetSelfFuncName(), "GetUserMsgListByIndex failed", err.Error(), index, ID)
} }
@ -628,7 +628,7 @@ func (db *notificationDatabase) deleteMsgRecursion(ctx context.Context, sourceID
} }
return delStruct.getSetMinSeq() + 1, nil return delStruct.getSetMinSeq() + 1, nil
} }
//log.NewDebug(operationID, "ID:", sourceID, "index:", index, "uid:", msgs.UID, "len:", len(msgs.Msg)) //log.NewDebug(operationID, "ID:", conversationID, "index:", index, "uid:", msgs.UID, "len:", len(msgs.Msg))
if int64(len(msgs.Msg)) > db.msg.GetsingleGocNotificationNum() { if int64(len(msgs.Msg)) > db.msg.GetsingleGocNotificationNum() {
log.ZWarn(ctx, "msgs too large", nil, "lenth", len(msgs.Msg), "docID:", msgs.DocID) log.ZWarn(ctx, "msgs too large", nil, "lenth", len(msgs.Msg), "docID:", msgs.DocID)
} }
@ -671,7 +671,7 @@ func (db *notificationDatabase) deleteMsgRecursion(ctx context.Context, sourceID
} }
} }
// 继续递归 index+1 // 继续递归 index+1
seq, err := db.deleteMsgRecursion(ctx, sourceID, index+1, delStruct, remainTime) seq, err := db.deleteMsgRecursion(ctx, conversationID, index+1, delStruct, remainTime)
return seq, utils.Wrap(err, "deleteMsg failed") return seq, utils.Wrap(err, "deleteMsg failed")
} }
@ -704,8 +704,8 @@ func (db *notificationDatabase) GetSuperGroupMinMaxSeqInMongoAndCache(ctx contex
return return
} }
func (db *notificationDatabase) GetMinMaxSeqMongo(ctx context.Context, sourceID string) (minSeqMongo, maxSeqMongo int64, err error) { func (db *notificationDatabase) GetMinMaxSeqMongo(ctx context.Context, conversationID string) (minSeqMongo, maxSeqMongo int64, err error) {
oldestMsgMongo, err := db.msgDocDatabase.GetOldestMsg(ctx, sourceID) oldestMsgMongo, err := db.msgDocDatabase.GetOldestMsg(ctx, conversationID)
if err != nil { if err != nil {
return 0, 0, err return 0, 0, err
} }
@ -714,7 +714,7 @@ func (db *notificationDatabase) GetMinMaxSeqMongo(ctx context.Context, sourceID
return 0, 0, err return 0, 0, err
} }
minSeqMongo = msgPb.Seq minSeqMongo = msgPb.Seq
newestMsgMongo, err := db.msgDocDatabase.GetNewestMsg(ctx, sourceID) newestMsgMongo, err := db.msgDocDatabase.GetNewestMsg(ctx, conversationID)
if err != nil { if err != nil {
return 0, 0, err return 0, 0, err
} }

View File

@ -23,6 +23,8 @@ type ConversationModel struct {
UpdateUnreadCountTime int64 `gorm:"column:update_unread_count_time" json:"updateUnreadCountTime"` UpdateUnreadCountTime int64 `gorm:"column:update_unread_count_time" json:"updateUnreadCountTime"`
AttachedInfo string `gorm:"column:attached_info;type:varchar(1024)" json:"attachedInfo"` AttachedInfo string `gorm:"column:attached_info;type:varchar(1024)" json:"attachedInfo"`
Ex string `gorm:"column:ex;type:varchar(1024)" json:"ex"` Ex string `gorm:"column:ex;type:varchar(1024)" json:"ex"`
MaxSeq int64 `gorm:"column:max_seq" json:"maxSeq"`
MinSeq int64 `gorm:"column:min_seq" json:"minSeq"`
} }
func (ConversationModel) TableName() string { func (ConversationModel) TableName() string {

View File

@ -2,9 +2,10 @@ package unrelation
import ( import (
"context" "context"
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
"strconv" "strconv"
"strings" "strings"
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
) )
const ( const (
@ -14,7 +15,7 @@ const (
) )
type ExtendMsgSetModel struct { type ExtendMsgSetModel struct {
SourceID string `bson:"source_id" json:"sourceID"` ConversationID string `bson:"source_id" json:"conversationID"`
SessionType int32 `bson:"session_type" json:"sessionType"` SessionType int32 `bson:"session_type" json:"sessionType"`
ExtendMsgs map[string]ExtendMsgModel `bson:"extend_msgs" json:"extendMsgs"` ExtendMsgs map[string]ExtendMsgModel `bson:"extend_msgs" json:"extendMsgs"`
ExtendMsgNum int32 `bson:"extend_msg_num" json:"extendMsgNum"` ExtendMsgNum int32 `bson:"extend_msg_num" json:"extendMsgNum"`
@ -38,12 +39,12 @@ type ExtendMsgModel struct {
type ExtendMsgSetModelInterface interface { type ExtendMsgSetModelInterface interface {
CreateExtendMsgSet(ctx context.Context, set *ExtendMsgSetModel) error CreateExtendMsgSet(ctx context.Context, set *ExtendMsgSetModel) error
GetAllExtendMsgSet(ctx context.Context, sourceID string, opts *GetAllExtendMsgSetOpts) (sets []*ExtendMsgSetModel, err error) GetAllExtendMsgSet(ctx context.Context, conversationID string, opts *GetAllExtendMsgSetOpts) (sets []*ExtendMsgSetModel, err error)
GetExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, maxMsgUpdateTime int64) (*ExtendMsgSetModel, error) GetExtendMsgSet(ctx context.Context, conversationID string, sessionType int32, maxMsgUpdateTime int64) (*ExtendMsgSetModel, error)
InsertExtendMsg(ctx context.Context, sourceID string, sessionType int32, msg *ExtendMsgModel) error InsertExtendMsg(ctx context.Context, conversationID string, sessionType int32, msg *ExtendMsgModel) error
InsertOrUpdateReactionExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*KeyValueModel) error InsertOrUpdateReactionExtendMsgSet(ctx context.Context, conversationID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*KeyValueModel) error
DeleteReactionExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*KeyValueModel) error DeleteReactionExtendMsgSet(ctx context.Context, conversationID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*KeyValueModel) error
TakeExtendMsg(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, maxMsgUpdateTime int64) (extendMsg *ExtendMsgModel, err error) TakeExtendMsg(ctx context.Context, conversationID string, sessionType int32, clientMsgID string, maxMsgUpdateTime int64) (extendMsg *ExtendMsgModel, err error)
} }
func (ExtendMsgSetModel) TableName() string { func (ExtendMsgSetModel) TableName() string {
@ -54,12 +55,12 @@ func (ExtendMsgSetModel) GetExtendMsgMaxNum() int32 {
return ExtendMsgMaxNum return ExtendMsgMaxNum
} }
func (ExtendMsgSetModel) GetSourceID(ID string, index int32) string { func (ExtendMsgSetModel) GetConversationID(ID string, index int32) string {
return ID + ":" + strconv.Itoa(int(index)) return ID + ":" + strconv.Itoa(int(index))
} }
func (e *ExtendMsgSetModel) SplitSourceIDAndGetIndex() int32 { func (e *ExtendMsgSetModel) SplitConversationIDAndGetIndex() int32 {
l := strings.Split(e.SourceID, ":") l := strings.Split(e.ConversationID, ":")
index, _ := strconv.Atoi(l[len(l)-1]) index, _ := strconv.Atoi(l[len(l)-1])
return int32(index) return int32(index)
} }

View File

@ -2,10 +2,11 @@ package unrelation
import ( import (
"context" "context"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant"
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
"strconv" "strconv"
"strings" "strings"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant"
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
) )
const ( const (
@ -30,10 +31,10 @@ type MsgDocModelInterface interface {
Create(ctx context.Context, model *MsgDocModel) error Create(ctx context.Context, model *MsgDocModel) error
UpdateMsgStatusByIndexInOneDoc(ctx context.Context, docID string, msg *sdkws.MsgData, seqIndex int, status int32) error UpdateMsgStatusByIndexInOneDoc(ctx context.Context, docID string, msg *sdkws.MsgData, seqIndex int, status int32) error
FindOneByDocID(ctx context.Context, docID string) (*MsgDocModel, error) FindOneByDocID(ctx context.Context, docID string) (*MsgDocModel, error)
GetNewestMsg(ctx context.Context, sourceID string) (*MsgInfoModel, error) GetNewestMsg(ctx context.Context, conversationID string) (*MsgInfoModel, error)
GetOldestMsg(ctx context.Context, sourceID string) (*MsgInfoModel, error) GetOldestMsg(ctx context.Context, conversationID string) (*MsgInfoModel, error)
Delete(ctx context.Context, docIDs []string) error Delete(ctx context.Context, docIDs []string) error
GetMsgsByIndex(ctx context.Context, sourceID string, index int64) (*MsgDocModel, error) GetMsgsByIndex(ctx context.Context, conversationID string, index int64) (*MsgDocModel, error)
UpdateOneDoc(ctx context.Context, msg *MsgDocModel) error UpdateOneDoc(ctx context.Context, msg *MsgDocModel) error
} }
@ -59,9 +60,9 @@ func (m *MsgDocModel) IsFull() bool {
return false return false
} }
func (m MsgDocModel) GetDocID(sourceID string, seq int64) string { func (m MsgDocModel) GetDocID(conversationID string, seq int64) string {
seqSuffix := seq / singleGocMsgNum seqSuffix := seq / singleGocMsgNum
return m.indexGen(sourceID, seqSuffix) return m.indexGen(conversationID, seqSuffix)
} }
func (m MsgDocModel) GetSeqDocIDList(userID string, maxSeq int64) []string { func (m MsgDocModel) GetSeqDocIDList(userID string, maxSeq int64) []string {
@ -83,10 +84,10 @@ func (m MsgDocModel) superGroupIndexGen(groupID string, seqSuffix int64) string
return "super_group_" + groupID + ":" + strconv.FormatInt(int64(seqSuffix), 10) return "super_group_" + groupID + ":" + strconv.FormatInt(int64(seqSuffix), 10)
} }
func (m MsgDocModel) GetDocIDSeqsMap(sourceID string, seqs []int64) map[string][]int64 { func (m MsgDocModel) GetDocIDSeqsMap(conversationID string, seqs []int64) map[string][]int64 {
t := make(map[string][]int64) t := make(map[string][]int64)
for i := 0; i < len(seqs); i++ { for i := 0; i < len(seqs); i++ {
docID := m.GetDocID(sourceID, seqs[i]) docID := m.GetDocID(conversationID, seqs[i])
if value, ok := t[docID]; !ok { if value, ok := t[docID]; !ok {
var temp []int64 var temp []int64
t[docID] = append(temp, seqs[i]) t[docID] = append(temp, seqs[i])
@ -108,8 +109,8 @@ func (m MsgDocModel) getMsgIndex(seq uint32) int {
return int(index) return int(index)
} }
func (m MsgDocModel) indexGen(sourceID string, seqSuffix int64) string { func (m MsgDocModel) indexGen(conversationID string, seqSuffix int64) string {
return sourceID + ":" + strconv.FormatInt(seqSuffix, 10) return conversationID + ":" + strconv.FormatInt(seqSuffix, 10)
} }
func (MsgDocModel) GenExceptionMessageBySeqs(seqs []int64) (exceptionMsg []*sdkws.MsgData) { func (MsgDocModel) GenExceptionMessageBySeqs(seqs []int64) (exceptionMsg []*sdkws.MsgData) {

View File

@ -2,10 +2,11 @@ package unrelation
import ( import (
"context" "context"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant"
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
"strconv" "strconv"
"strings" "strings"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant"
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
) )
const ( const (
@ -30,10 +31,10 @@ type NotificationDocModelInterface interface {
Create(ctx context.Context, model *NotificationDocModel) error Create(ctx context.Context, model *NotificationDocModel) error
UpdateMsgStatusByIndexInOneDoc(ctx context.Context, docID string, msg *sdkws.MsgData, seqIndex int, status int32) error UpdateMsgStatusByIndexInOneDoc(ctx context.Context, docID string, msg *sdkws.MsgData, seqIndex int, status int32) error
FindOneByDocID(ctx context.Context, docID string) (*NotificationDocModel, error) FindOneByDocID(ctx context.Context, docID string) (*NotificationDocModel, error)
GetNewestMsg(ctx context.Context, sourceID string) (*NotificationInfoModel, error) GetNewestMsg(ctx context.Context, conversationID string) (*NotificationInfoModel, error)
GetOldestMsg(ctx context.Context, sourceID string) (*NotificationInfoModel, error) GetOldestMsg(ctx context.Context, conversationID string) (*NotificationInfoModel, error)
Delete(ctx context.Context, docIDs []string) error Delete(ctx context.Context, docIDs []string) error
GetMsgsByIndex(ctx context.Context, sourceID string, index int64) (*NotificationDocModel, error) GetMsgsByIndex(ctx context.Context, conversationID string, index int64) (*NotificationDocModel, error)
UpdateOneDoc(ctx context.Context, msg *NotificationDocModel) error UpdateOneDoc(ctx context.Context, msg *NotificationDocModel) error
} }
@ -59,9 +60,9 @@ func (m *NotificationDocModel) IsFull() bool {
return false return false
} }
func (m NotificationDocModel) GetDocID(sourceID string, seq int64) string { func (m NotificationDocModel) GetDocID(conversationID string, seq int64) string {
seqSuffix := seq / singleGocNotificationNum seqSuffix := seq / singleGocNotificationNum
return m.indexGen(sourceID, seqSuffix) return m.indexGen(conversationID, seqSuffix)
} }
func (m NotificationDocModel) GetSeqDocIDList(userID string, maxSeq int64) []string { func (m NotificationDocModel) GetSeqDocIDList(userID string, maxSeq int64) []string {
@ -83,10 +84,10 @@ func (m NotificationDocModel) superGroupIndexGen(groupID string, seqSuffix int64
return "super_group_" + groupID + ":" + strconv.FormatInt(int64(seqSuffix), 10) return "super_group_" + groupID + ":" + strconv.FormatInt(int64(seqSuffix), 10)
} }
func (m NotificationDocModel) GetDocIDSeqsMap(sourceID string, seqs []int64) map[string][]int64 { func (m NotificationDocModel) GetDocIDSeqsMap(conversationID string, seqs []int64) map[string][]int64 {
t := make(map[string][]int64) t := make(map[string][]int64)
for i := 0; i < len(seqs); i++ { for i := 0; i < len(seqs); i++ {
docID := m.GetDocID(sourceID, seqs[i]) docID := m.GetDocID(conversationID, seqs[i])
if value, ok := t[docID]; !ok { if value, ok := t[docID]; !ok {
var temp []int64 var temp []int64
t[docID] = append(temp, seqs[i]) t[docID] = append(temp, seqs[i])
@ -108,8 +109,8 @@ func (m NotificationDocModel) getMsgIndex(seq uint32) int {
return int(index) return int(index)
} }
func (m NotificationDocModel) indexGen(sourceID string, seqSuffix int64) string { func (m NotificationDocModel) indexGen(conversationID string, seqSuffix int64) string {
return sourceID + ":" + strconv.FormatInt(seqSuffix, 10) return conversationID + ":" + strconv.FormatInt(seqSuffix, 10)
} }
func (NotificationDocModel) GenExceptionMessageBySeqs(seqs []int64) (exceptionMsg []*sdkws.MsgData) { func (NotificationDocModel) GenExceptionMessageBySeqs(seqs []int64) (exceptionMsg []*sdkws.MsgData) {

View File

@ -4,6 +4,7 @@ import (
"context" "context"
"errors" "errors"
"fmt" "fmt"
unRelationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation" unRelationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation"
"github.com/OpenIMSDK/Open-IM-Server/pkg/utils" "github.com/OpenIMSDK/Open-IM-Server/pkg/utils"
"go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/bson"
@ -46,11 +47,11 @@ func (e *ExtendMsgSetMongoDriver) GetAllExtendMsgSet(ctx context.Context, ID str
return sets, nil return sets, nil
} }
func (e *ExtendMsgSetMongoDriver) GetExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, maxMsgUpdateTime int64) (*unRelationTb.ExtendMsgSetModel, error) { func (e *ExtendMsgSetMongoDriver) GetExtendMsgSet(ctx context.Context, conversationID string, sessionType int32, maxMsgUpdateTime int64) (*unRelationTb.ExtendMsgSetModel, error) {
var err error var err error
findOpts := options.Find().SetLimit(1).SetSkip(0).SetSort(bson.M{"source_id": -1}).SetProjection(bson.M{"extend_msgs": 0}) findOpts := options.Find().SetLimit(1).SetSkip(0).SetSort(bson.M{"source_id": -1}).SetProjection(bson.M{"extend_msgs": 0})
// update newest // update newest
find := bson.M{"source_id": primitive.Regex{Pattern: fmt.Sprintf("^%s", sourceID)}, "session_type": sessionType} find := bson.M{"source_id": primitive.Regex{Pattern: fmt.Sprintf("^%s", conversationID)}, "session_type": sessionType}
if maxMsgUpdateTime > 0 { if maxMsgUpdateTime > 0 {
find["max_msg_update_time"] = maxMsgUpdateTime find["max_msg_update_time"] = maxMsgUpdateTime
} }
@ -69,18 +70,18 @@ func (e *ExtendMsgSetMongoDriver) GetExtendMsgSet(ctx context.Context, sourceID
} }
// first modify msg // first modify msg
func (e *ExtendMsgSetMongoDriver) InsertExtendMsg(ctx context.Context, sourceID string, sessionType int32, msg *unRelationTb.ExtendMsgModel) error { func (e *ExtendMsgSetMongoDriver) InsertExtendMsg(ctx context.Context, conversationID string, sessionType int32, msg *unRelationTb.ExtendMsgModel) error {
set, err := e.GetExtendMsgSet(ctx, sourceID, sessionType, 0) set, err := e.GetExtendMsgSet(ctx, conversationID, sessionType, 0)
if err != nil { if err != nil {
return utils.Wrap(err, "") return utils.Wrap(err, "")
} }
if set == nil || set.ExtendMsgNum >= set.GetExtendMsgMaxNum() { if set == nil || set.ExtendMsgNum >= set.GetExtendMsgMaxNum() {
var index int32 var index int32
if set != nil { if set != nil {
index = set.SplitSourceIDAndGetIndex() index = set.SplitConversationIDAndGetIndex()
} }
err = e.CreateExtendMsgSet(ctx, &unRelationTb.ExtendMsgSetModel{ err = e.CreateExtendMsgSet(ctx, &unRelationTb.ExtendMsgSetModel{
SourceID: set.GetSourceID(sourceID, index), ConversationID: set.GetConversationID(conversationID, index),
SessionType: sessionType, SessionType: sessionType,
ExtendMsgs: map[string]unRelationTb.ExtendMsgModel{msg.ClientMsgID: *msg}, ExtendMsgs: map[string]unRelationTb.ExtendMsgModel{msg.ClientMsgID: *msg},
ExtendMsgNum: 1, ExtendMsgNum: 1,
@ -88,13 +89,13 @@ func (e *ExtendMsgSetMongoDriver) InsertExtendMsg(ctx context.Context, sourceID
MaxMsgUpdateTime: msg.MsgFirstModifyTime, MaxMsgUpdateTime: msg.MsgFirstModifyTime,
}) })
} else { } else {
_, err = e.ExtendMsgSetCollection.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}}) _, err = e.ExtendMsgSetCollection.UpdateOne(ctx, bson.M{"conversation_id": set.ConversationID, "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, "") return utils.Wrap(err, "")
} }
// insert or update // insert or update
func (e *ExtendMsgSetMongoDriver) InsertOrUpdateReactionExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*unRelationTb.KeyValueModel) error { func (e *ExtendMsgSetMongoDriver) InsertOrUpdateReactionExtendMsgSet(ctx context.Context, conversationID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*unRelationTb.KeyValueModel) error {
var updateBson = bson.M{} var updateBson = bson.M{}
for _, v := range reactionExtensionList { for _, v := range reactionExtensionList {
updateBson[fmt.Sprintf("extend_msgs.%s.%s", clientMsgID, v.TypeKey)] = v updateBson[fmt.Sprintf("extend_msgs.%s.%s", clientMsgID, v.TypeKey)] = v
@ -103,37 +104,37 @@ func (e *ExtendMsgSetMongoDriver) InsertOrUpdateReactionExtendMsgSet(ctx context
opt := &options.UpdateOptions{ opt := &options.UpdateOptions{
Upsert: &upsert, Upsert: &upsert,
} }
set, err := e.GetExtendMsgSet(ctx, sourceID, sessionType, msgFirstModifyTime) set, err := e.GetExtendMsgSet(ctx, conversationID, sessionType, msgFirstModifyTime)
if err != nil { if err != nil {
return utils.Wrap(err, "") return utils.Wrap(err, "")
} }
if set == nil { if set == nil {
return errors.New(fmt.Sprintf("sourceID %s has no set", sourceID)) return errors.New(fmt.Sprintf("conversationID %s has no set", conversationID))
} }
_, err = e.ExtendMsgSetCollection.UpdateOne(ctx, bson.M{"source_id": set.SourceID, "session_type": sessionType}, bson.M{"$set": updateBson}, opt) _, err = e.ExtendMsgSetCollection.UpdateOne(ctx, bson.M{"source_id": set.ConversationID, "session_type": sessionType}, bson.M{"$set": updateBson}, opt)
return utils.Wrap(err, "") return utils.Wrap(err, "")
} }
// delete TypeKey // delete TypeKey
func (e *ExtendMsgSetMongoDriver) DeleteReactionExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*unRelationTb.KeyValueModel) error { func (e *ExtendMsgSetMongoDriver) DeleteReactionExtendMsgSet(ctx context.Context, conversationID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*unRelationTb.KeyValueModel) error {
var updateBson = bson.M{} var updateBson = bson.M{}
for _, v := range reactionExtensionList { for _, v := range reactionExtensionList {
updateBson[fmt.Sprintf("extend_msgs.%s.%s", clientMsgID, v.TypeKey)] = "" updateBson[fmt.Sprintf("extend_msgs.%s.%s", clientMsgID, v.TypeKey)] = ""
} }
set, err := e.GetExtendMsgSet(ctx, sourceID, sessionType, msgFirstModifyTime) set, err := e.GetExtendMsgSet(ctx, conversationID, sessionType, msgFirstModifyTime)
if err != nil { if err != nil {
return utils.Wrap(err, "") return utils.Wrap(err, "")
} }
if set == nil { if set == nil {
return errors.New(fmt.Sprintf("sourceID %s has no set", sourceID)) return errors.New(fmt.Sprintf("conversationID %s has no set", conversationID))
} }
_, err = e.ExtendMsgSetCollection.UpdateOne(ctx, bson.M{"source_id": set.SourceID, "session_type": sessionType}, bson.M{"$unset": updateBson}) _, err = e.ExtendMsgSetCollection.UpdateOne(ctx, bson.M{"source_id": set.ConversationID, "session_type": sessionType}, bson.M{"$unset": updateBson})
return err return err
} }
func (e *ExtendMsgSetMongoDriver) TakeExtendMsg(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, maxMsgUpdateTime int64) (extendMsg *unRelationTb.ExtendMsgModel, err error) { func (e *ExtendMsgSetMongoDriver) TakeExtendMsg(ctx context.Context, conversationID string, sessionType int32, clientMsgID string, maxMsgUpdateTime int64) (extendMsg *unRelationTb.ExtendMsgModel, err error) {
findOpts := options.Find().SetLimit(1).SetSkip(0).SetSort(bson.M{"source_id": -1}).SetProjection(bson.M{fmt.Sprintf("extend_msgs.%s", clientMsgID): 1}) 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) regex := fmt.Sprintf("^%s", conversationID)
result, err := e.ExtendMsgSetCollection.Find(ctx, bson.M{"source_id": primitive.Regex{Pattern: regex}, "session_type": sessionType, "max_msg_update_time": bson.M{"$lte": maxMsgUpdateTime}}, findOpts) result, err := e.ExtendMsgSetCollection.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 { if err != nil {
return nil, utils.Wrap(err, "") return nil, utils.Wrap(err, "")

View File

@ -56,9 +56,9 @@ func (m *MsgMongoDriver) FindOneByDocID(ctx context.Context, docID string) (*tab
return doc, err return doc, err
} }
func (m *MsgMongoDriver) GetMsgsByIndex(ctx context.Context, sourceID string, index int64) (*table.MsgDocModel, error) { func (m *MsgMongoDriver) GetMsgsByIndex(ctx context.Context, conversationID string, index int64) (*table.MsgDocModel, error) {
findOpts := options.Find().SetLimit(1).SetSkip(index).SetSort(bson.M{"uid": 1}) findOpts := options.Find().SetLimit(1).SetSkip(index).SetSort(bson.M{"uid": 1})
cursor, err := m.MsgCollection.Find(ctx, bson.M{"uid": primitive.Regex{Pattern: fmt.Sprintf("^%s:", sourceID)}}, findOpts) cursor, err := m.MsgCollection.Find(ctx, bson.M{"uid": primitive.Regex{Pattern: fmt.Sprintf("^%s:", conversationID)}}, findOpts)
if err != nil { if err != nil {
return nil, utils.Wrap(err, "") return nil, utils.Wrap(err, "")
} }
@ -73,9 +73,9 @@ func (m *MsgMongoDriver) GetMsgsByIndex(ctx context.Context, sourceID string, in
return nil, ErrMsgListNotExist return nil, ErrMsgListNotExist
} }
func (m *MsgMongoDriver) GetNewestMsg(ctx context.Context, sourceID string) (*table.MsgInfoModel, error) { func (m *MsgMongoDriver) GetNewestMsg(ctx context.Context, conversationID string) (*table.MsgInfoModel, error) {
var msgDocs []table.MsgDocModel var msgDocs []table.MsgDocModel
cursor, err := m.MsgCollection.Find(ctx, bson.M{"uid": bson.M{"$regex": fmt.Sprintf("^%s:", sourceID)}}, options.Find().SetLimit(1).SetSort(bson.M{"uid": -1})) cursor, err := m.MsgCollection.Find(ctx, bson.M{"uid": bson.M{"$regex": fmt.Sprintf("^%s:", conversationID)}}, options.Find().SetLimit(1).SetSort(bson.M{"uid": -1}))
if err != nil { if err != nil {
return nil, utils.Wrap(err, "") return nil, utils.Wrap(err, "")
} }
@ -92,9 +92,9 @@ func (m *MsgMongoDriver) GetNewestMsg(ctx context.Context, sourceID string) (*ta
return nil, ErrMsgNotFound return nil, ErrMsgNotFound
} }
func (m *MsgMongoDriver) GetOldestMsg(ctx context.Context, sourceID string) (*table.MsgInfoModel, error) { func (m *MsgMongoDriver) GetOldestMsg(ctx context.Context, conversationID string) (*table.MsgInfoModel, error) {
var msgDocs []table.MsgDocModel var msgDocs []table.MsgDocModel
cursor, err := m.MsgCollection.Find(ctx, bson.M{"uid": bson.M{"$regex": fmt.Sprintf("^%s:", sourceID)}}, options.Find().SetLimit(1).SetSort(bson.M{"uid": 1})) cursor, err := m.MsgCollection.Find(ctx, bson.M{"uid": bson.M{"$regex": fmt.Sprintf("^%s:", conversationID)}}, options.Find().SetLimit(1).SetSort(bson.M{"uid": 1}))
if err != nil { if err != nil {
return nil, err return nil, err
} }

View File

@ -56,9 +56,9 @@ func (m *NotificationMongoDriver) FindOneByDocID(ctx context.Context, docID stri
return doc, err return doc, err
} }
func (m *NotificationMongoDriver) GetMsgsByIndex(ctx context.Context, sourceID string, index int64) (*table.NotificationDocModel, error) { func (m *NotificationMongoDriver) GetMsgsByIndex(ctx context.Context, conversationID string, index int64) (*table.NotificationDocModel, error) {
findOpts := options.Find().SetLimit(1).SetSkip(index).SetSort(bson.M{"uid": 1}) findOpts := options.Find().SetLimit(1).SetSkip(index).SetSort(bson.M{"uid": 1})
cursor, err := m.MsgCollection.Find(ctx, bson.M{"uid": primitive.Regex{Pattern: fmt.Sprintf("^%s:", sourceID)}}, findOpts) cursor, err := m.MsgCollection.Find(ctx, bson.M{"uid": primitive.Regex{Pattern: fmt.Sprintf("^%s:", conversationID)}}, findOpts)
if err != nil { if err != nil {
return nil, utils.Wrap(err, "") return nil, utils.Wrap(err, "")
} }
@ -73,9 +73,9 @@ func (m *NotificationMongoDriver) GetMsgsByIndex(ctx context.Context, sourceID s
return nil, ErrMsgListNotExist return nil, ErrMsgListNotExist
} }
func (m *NotificationMongoDriver) GetNewestMsg(ctx context.Context, sourceID string) (*table.NotificationInfoModel, error) { func (m *NotificationMongoDriver) GetNewestMsg(ctx context.Context, conversationID string) (*table.NotificationInfoModel, error) {
var msgDocs []table.NotificationDocModel var msgDocs []table.NotificationDocModel
cursor, err := m.MsgCollection.Find(ctx, bson.M{"uid": bson.M{"$regex": fmt.Sprintf("^%s:", sourceID)}}, options.Find().SetLimit(1).SetSort(bson.M{"uid": -1})) cursor, err := m.MsgCollection.Find(ctx, bson.M{"uid": bson.M{"$regex": fmt.Sprintf("^%s:", conversationID)}}, options.Find().SetLimit(1).SetSort(bson.M{"uid": -1}))
if err != nil { if err != nil {
return nil, utils.Wrap(err, "") return nil, utils.Wrap(err, "")
} }
@ -92,9 +92,9 @@ func (m *NotificationMongoDriver) GetNewestMsg(ctx context.Context, sourceID str
return nil, ErrMsgNotFound return nil, ErrMsgNotFound
} }
func (m *NotificationMongoDriver) GetOldestMsg(ctx context.Context, sourceID string) (*table.NotificationInfoModel, error) { func (m *NotificationMongoDriver) GetOldestMsg(ctx context.Context, conversationID string) (*table.NotificationInfoModel, error) {
var msgDocs []table.NotificationDocModel var msgDocs []table.NotificationDocModel
cursor, err := m.MsgCollection.Find(ctx, bson.M{"uid": bson.M{"$regex": fmt.Sprintf("^%s:", sourceID)}}, options.Find().SetLimit(1).SetSort(bson.M{"uid": 1})) cursor, err := m.MsgCollection.Find(ctx, bson.M{"uid": bson.M{"$regex": fmt.Sprintf("^%s:", conversationID)}}, options.Find().SetLimit(1).SetSort(bson.M{"uid": 1}))
if err != nil { if err != nil {
return nil, err return nil, err
} }

View File

@ -15,14 +15,23 @@ import (
type DnsDiscoveryRegistry struct { type DnsDiscoveryRegistry struct {
opts []grpc.DialOption opts []grpc.DialOption
namespace string namespace string
config *rest.Config
} }
func (d DnsDiscoveryRegistry) GetConns(serviceName string, opts ...grpc.DialOption) ([]*grpc.ClientConn, error) { func NewDnsDiscoveryRegistry(namespace string, opts []grpc.DialOption) (*DnsDiscoveryRegistry, error) {
config, err := rest.InClusterConfig() config, err := rest.InClusterConfig()
if err != nil { if err != nil {
return nil, err return nil, err
} }
clientset, err := kubernetes.NewForConfig(config) return &DnsDiscoveryRegistry{
config: config,
namespace: namespace,
opts: opts,
}, nil
}
func (d DnsDiscoveryRegistry) GetConns(serviceName string, opts ...grpc.DialOption) ([]*grpc.ClientConn, error) {
clientset, err := kubernetes.NewForConfig(d.config)
if err != nil { if err != nil {
return nil, err return nil, err
} }

View File

@ -980,16 +980,17 @@ func (x *GetRecvMsgNotNotifyUserIDsResp) GetUserIDs() []string {
return nil return nil
} }
type CreateConversationsWithoutNotificationReq struct { type CreateSingleChatConversationsReq struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Conversations []*Conversation `protobuf:"bytes,1,rep,name=conversations,proto3" json:"conversations"` RecvID string `protobuf:"bytes,1,opt,name=recvID,proto3" json:"recvID"`
SendID string `protobuf:"bytes,2,opt,name=sendID,proto3" json:"sendID"`
} }
func (x *CreateConversationsWithoutNotificationReq) Reset() { func (x *CreateSingleChatConversationsReq) Reset() {
*x = CreateConversationsWithoutNotificationReq{} *x = CreateSingleChatConversationsReq{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_conversation_conversation_proto_msgTypes[17] mi := &file_conversation_conversation_proto_msgTypes[17]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -997,13 +998,13 @@ func (x *CreateConversationsWithoutNotificationReq) Reset() {
} }
} }
func (x *CreateConversationsWithoutNotificationReq) String() string { func (x *CreateSingleChatConversationsReq) String() string {
return protoimpl.X.MessageStringOf(x) return protoimpl.X.MessageStringOf(x)
} }
func (*CreateConversationsWithoutNotificationReq) ProtoMessage() {} func (*CreateSingleChatConversationsReq) ProtoMessage() {}
func (x *CreateConversationsWithoutNotificationReq) ProtoReflect() protoreflect.Message { func (x *CreateSingleChatConversationsReq) ProtoReflect() protoreflect.Message {
mi := &file_conversation_conversation_proto_msgTypes[17] mi := &file_conversation_conversation_proto_msgTypes[17]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -1015,41 +1016,141 @@ func (x *CreateConversationsWithoutNotificationReq) ProtoReflect() protoreflect.
return mi.MessageOf(x) return mi.MessageOf(x)
} }
// Deprecated: Use CreateConversationsWithoutNotificationReq.ProtoReflect.Descriptor instead. // Deprecated: Use CreateSingleChatConversationsReq.ProtoReflect.Descriptor instead.
func (*CreateConversationsWithoutNotificationReq) Descriptor() ([]byte, []int) { func (*CreateSingleChatConversationsReq) Descriptor() ([]byte, []int) {
return file_conversation_conversation_proto_rawDescGZIP(), []int{17} return file_conversation_conversation_proto_rawDescGZIP(), []int{17}
} }
func (x *CreateConversationsWithoutNotificationReq) GetConversations() []*Conversation { func (x *CreateSingleChatConversationsReq) GetRecvID() string {
if x != nil { if x != nil {
return x.Conversations return x.RecvID
}
return ""
}
func (x *CreateSingleChatConversationsReq) GetSendID() string {
if x != nil {
return x.SendID
}
return ""
}
type CreateSingleChatConversationsResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *CreateSingleChatConversationsResp) Reset() {
*x = CreateSingleChatConversationsResp{}
if protoimpl.UnsafeEnabled {
mi := &file_conversation_conversation_proto_msgTypes[18]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CreateSingleChatConversationsResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateSingleChatConversationsResp) ProtoMessage() {}
func (x *CreateSingleChatConversationsResp) ProtoReflect() protoreflect.Message {
mi := &file_conversation_conversation_proto_msgTypes[18]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CreateSingleChatConversationsResp.ProtoReflect.Descriptor instead.
func (*CreateSingleChatConversationsResp) Descriptor() ([]byte, []int) {
return file_conversation_conversation_proto_rawDescGZIP(), []int{18}
}
type CreateGroupChatConversationsReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
UserIDs []string `protobuf:"bytes,1,rep,name=userIDs,proto3" json:"userIDs"`
GroupID string `protobuf:"bytes,2,opt,name=groupID,proto3" json:"groupID"`
}
func (x *CreateGroupChatConversationsReq) Reset() {
*x = CreateGroupChatConversationsReq{}
if protoimpl.UnsafeEnabled {
mi := &file_conversation_conversation_proto_msgTypes[19]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CreateGroupChatConversationsReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateGroupChatConversationsReq) ProtoMessage() {}
func (x *CreateGroupChatConversationsReq) ProtoReflect() protoreflect.Message {
mi := &file_conversation_conversation_proto_msgTypes[19]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CreateGroupChatConversationsReq.ProtoReflect.Descriptor instead.
func (*CreateGroupChatConversationsReq) Descriptor() ([]byte, []int) {
return file_conversation_conversation_proto_rawDescGZIP(), []int{19}
}
func (x *CreateGroupChatConversationsReq) GetUserIDs() []string {
if x != nil {
return x.UserIDs
} }
return nil return nil
} }
type CreateConversationsWithoutNotificationResp struct { func (x *CreateGroupChatConversationsReq) GetGroupID() string {
if x != nil {
return x.GroupID
}
return ""
}
type CreateGroupChatConversationsResp struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
} }
func (x *CreateConversationsWithoutNotificationResp) Reset() { func (x *CreateGroupChatConversationsResp) Reset() {
*x = CreateConversationsWithoutNotificationResp{} *x = CreateGroupChatConversationsResp{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_conversation_conversation_proto_msgTypes[18] mi := &file_conversation_conversation_proto_msgTypes[20]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
} }
func (x *CreateConversationsWithoutNotificationResp) String() string { func (x *CreateGroupChatConversationsResp) String() string {
return protoimpl.X.MessageStringOf(x) return protoimpl.X.MessageStringOf(x)
} }
func (*CreateConversationsWithoutNotificationResp) ProtoMessage() {} func (*CreateGroupChatConversationsResp) ProtoMessage() {}
func (x *CreateConversationsWithoutNotificationResp) ProtoReflect() protoreflect.Message { func (x *CreateGroupChatConversationsResp) ProtoReflect() protoreflect.Message {
mi := &file_conversation_conversation_proto_msgTypes[18] mi := &file_conversation_conversation_proto_msgTypes[20]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -1060,9 +1161,110 @@ func (x *CreateConversationsWithoutNotificationResp) ProtoReflect() protoreflect
return mi.MessageOf(x) return mi.MessageOf(x)
} }
// Deprecated: Use CreateConversationsWithoutNotificationResp.ProtoReflect.Descriptor instead. // Deprecated: Use CreateGroupChatConversationsResp.ProtoReflect.Descriptor instead.
func (*CreateConversationsWithoutNotificationResp) Descriptor() ([]byte, []int) { func (*CreateGroupChatConversationsResp) Descriptor() ([]byte, []int) {
return file_conversation_conversation_proto_rawDescGZIP(), []int{18} return file_conversation_conversation_proto_rawDescGZIP(), []int{20}
}
type DelGroupChatConversationsReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID"`
OwnerUserID []string `protobuf:"bytes,2,rep,name=ownerUserID,proto3" json:"ownerUserID"`
MaxSeq int64 `protobuf:"varint,3,opt,name=maxSeq,proto3" json:"maxSeq"`
}
func (x *DelGroupChatConversationsReq) Reset() {
*x = DelGroupChatConversationsReq{}
if protoimpl.UnsafeEnabled {
mi := &file_conversation_conversation_proto_msgTypes[21]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DelGroupChatConversationsReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DelGroupChatConversationsReq) ProtoMessage() {}
func (x *DelGroupChatConversationsReq) ProtoReflect() protoreflect.Message {
mi := &file_conversation_conversation_proto_msgTypes[21]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DelGroupChatConversationsReq.ProtoReflect.Descriptor instead.
func (*DelGroupChatConversationsReq) Descriptor() ([]byte, []int) {
return file_conversation_conversation_proto_rawDescGZIP(), []int{21}
}
func (x *DelGroupChatConversationsReq) GetGroupID() string {
if x != nil {
return x.GroupID
}
return ""
}
func (x *DelGroupChatConversationsReq) GetOwnerUserID() []string {
if x != nil {
return x.OwnerUserID
}
return nil
}
func (x *DelGroupChatConversationsReq) GetMaxSeq() int64 {
if x != nil {
return x.MaxSeq
}
return 0
}
type DelGroupChatConversationsResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *DelGroupChatConversationsResp) Reset() {
*x = DelGroupChatConversationsResp{}
if protoimpl.UnsafeEnabled {
mi := &file_conversation_conversation_proto_msgTypes[22]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DelGroupChatConversationsResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DelGroupChatConversationsResp) ProtoMessage() {}
func (x *DelGroupChatConversationsResp) ProtoReflect() protoreflect.Message {
mi := &file_conversation_conversation_proto_msgTypes[22]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DelGroupChatConversationsResp.ProtoReflect.Descriptor instead.
func (*DelGroupChatConversationsResp) Descriptor() ([]byte, []int) {
return file_conversation_conversation_proto_rawDescGZIP(), []int{22}
} }
var File_conversation_conversation_proto protoreflect.FileDescriptor var File_conversation_conversation_proto protoreflect.FileDescriptor
@ -1193,97 +1395,127 @@ var file_conversation_conversation_proto_rawDesc = []byte{
0x4d, 0x73, 0x67, 0x4e, 0x6f, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x73, 0x67, 0x4e, 0x6f, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, 0x73, 0x65, 0x72,
0x49, 0x44, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x49, 0x44, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49,
0x44, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x44, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44,
0x73, 0x22, 0x7a, 0x0a, 0x29, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x73, 0x22, 0x52, 0x0a, 0x20, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c,
0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x4e, 0x65, 0x43, 0x68, 0x61, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f,
0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x4d, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x76, 0x49, 0x44, 0x18,
0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x63, 0x76, 0x49, 0x44, 0x12, 0x16, 0x0a,
0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73,
0x72, 0x76, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x65, 0x6e, 0x64, 0x49, 0x44, 0x22, 0x23, 0x0a, 0x21, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53,
0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x43, 0x68, 0x61, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73,
0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x2c, 0x0a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x55, 0x0a, 0x1f, 0x43, 0x72,
0x2a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x74, 0x43, 0x6f, 0x6e,
0x69, 0x6f, 0x6e, 0x73, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a,
0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x32, 0xad, 0x09, 0x0a, 0x0c, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07,
0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x88, 0x01, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70,
0x17, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49,
0x69, 0x6f, 0x6e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x35, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x44, 0x22, 0x22, 0x0a, 0x20, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70,
0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x43, 0x68, 0x61, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x72, 0x0a, 0x1c, 0x44, 0x65, 0x6c, 0x47, 0x72, 0x6f, 0x75,
0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x70, 0x43, 0x68, 0x61, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f,
0x36, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x63, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44,
0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x12,
0x66, 0x79, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x69, 0x20, 0x0a, 0x0b, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x02,
0x65, 0x6c, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x70, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x49,
0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x2e, 0x4f, 0x70, 0x65, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x61, 0x78, 0x53, 0x65, 0x71, 0x18, 0x03, 0x20, 0x01, 0x28,
0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x03, 0x52, 0x06, 0x6d, 0x61, 0x78, 0x53, 0x65, 0x71, 0x22, 0x1f, 0x0a, 0x1d, 0x44, 0x65, 0x6c,
0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73,
0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x2e, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x32, 0xbd, 0x0b, 0x0a, 0x0c, 0x63,
0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x88, 0x01, 0x0a, 0x17,
0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x35, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d,
0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72,
0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x36,
0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x63, 0x6f,
0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66,
0x79, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x69, 0x65,
0x6c, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x70, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e,
0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x2e, 0x4f, 0x70, 0x65, 0x6e,
0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x7c, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x2e, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49,
0x41, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61,
0x12, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61,
0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x7c, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x41,
0x41, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12,
0x52, 0x65, 0x71, 0x1a, 0x32, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x63,
0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x41,
0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52,
0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x73, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x65, 0x71, 0x1a, 0x32, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65,
0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2e, 0x2e, 0x4f, 0x70, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47,
0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f,
0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x73, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e,
0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x2f, 0x2e, 0x4f, 0x70, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2e, 0x2e, 0x4f, 0x70, 0x65,
0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72,
0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72,
0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x82, 0x01, 0x0a, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x2f, 0x2e, 0x4f, 0x70, 0x65,
0x15, 0x42, 0x61, 0x74, 0x63, 0x68, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x33, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72,
0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x82, 0x01, 0x0a, 0x15,
0x6f, 0x6e, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x42, 0x61, 0x74, 0x63, 0x68, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61,
0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x34, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x33, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65,
0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f,
0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x53, 0x65, 0x74, 0x6e, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72,
0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x34, 0x2e, 0x4f, 0x70, 0x65,
0x70, 0x12, 0x70, 0x0a, 0x0f, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72,
0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x53, 0x65, 0x74, 0x43,
0x76, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70,
0x2e, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x70, 0x0a, 0x0f, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74,
0x52, 0x65, 0x71, 0x1a, 0x2e, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76,
0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e,
0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,
0x65, 0x73, 0x70, 0x12, 0x6a, 0x0a, 0x0d, 0x53, 0x65, 0x74, 0x52, 0x65, 0x63, 0x76, 0x4d, 0x73, 0x65, 0x71, 0x1a, 0x2e, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65,
0x67, 0x4f, 0x70, 0x74, 0x12, 0x2b, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53,
0x65, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65,
0x73, 0x70, 0x12, 0x6a, 0x0a, 0x0d, 0x53, 0x65, 0x74, 0x52, 0x65, 0x63, 0x76, 0x4d, 0x73, 0x67,
0x4f, 0x70, 0x74, 0x12, 0x2b, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76,
0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e,
0x53, 0x65, 0x74, 0x52, 0x65, 0x63, 0x76, 0x4d, 0x73, 0x67, 0x4f, 0x70, 0x74, 0x52, 0x65, 0x71,
0x1a, 0x2c, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e,
0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x74,
0x52, 0x65, 0x63, 0x76, 0x4d, 0x73, 0x67, 0x4f, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x91,
0x01, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x52, 0x65, 0x63, 0x76, 0x4d, 0x73, 0x67, 0x4e, 0x6f, 0x74,
0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x12, 0x38, 0x2e,
0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6e,
0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x63,
0x76, 0x4d, 0x73, 0x67, 0x4e, 0x6f, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, 0x73, 0x65,
0x72, 0x49, 0x44, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x39, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d,
0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x63, 0x76, 0x4d, 0x73, 0x67, 0x4e, 0x6f,
0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x52, 0x65,
0x73, 0x70, 0x12, 0x9a, 0x01, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x69, 0x6e,
0x67, 0x6c, 0x65, 0x43, 0x68, 0x61, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3b, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72,
0x76, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x2e, 0x53, 0x65, 0x74, 0x52, 0x65, 0x63, 0x76, 0x4d, 0x73, 0x67, 0x4f, 0x70, 0x74, 0x52, 0x65, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x43, 0x68, 0x61,
0x71, 0x1a, 0x2c, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65,
0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x71, 0x1a, 0x3c, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72,
0x74, 0x52, 0x65, 0x63, 0x76, 0x4d, 0x73, 0x67, 0x4f, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72,
0x91, 0x01, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x52, 0x65, 0x63, 0x76, 0x4d, 0x73, 0x67, 0x4e, 0x6f, 0x65, 0x61, 0x74, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x43, 0x68, 0x61, 0x74, 0x43, 0x6f,
0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x12, 0x38, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12,
0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x97, 0x01, 0x0a, 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43,
0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x68, 0x61, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,
0x63, 0x76, 0x4d, 0x73, 0x67, 0x4e, 0x6f, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, 0x73, 0x12, 0x3a, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e,
0x65, 0x72, 0x49, 0x44, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x39, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x65,
0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x74, 0x43, 0x6f, 0x6e, 0x76,
0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x63, 0x76, 0x4d, 0x73, 0x67, 0x4e, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x3b, 0x2e, 0x4f,
0x6f, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x52, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x76,
0x65, 0x73, 0x70, 0x12, 0xb5, 0x01, 0x0a, 0x26, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47,
0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61,
0x75, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x44, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x8e, 0x01, 0x0a, 0x19, 0x44, 0x65,
0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72,
0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x37, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d,
0x65, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x57, 0x69, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74,
0x74, 0x68, 0x6f, 0x75, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x74,
0x6e, 0x52, 0x65, 0x71, 0x1a, 0x45, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71,
0x76, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x38, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e,
0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x6c,
0x69, 0x6f, 0x6e, 0x73, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73,
0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x42, 0x3c, 0x5a, 0x3a, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x42, 0x3c, 0x5a, 0x3a, 0x67, 0x69,
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53,
0x53, 0x44, 0x4b, 0x2f, 0x4f, 0x70, 0x65, 0x6e, 0x2d, 0x49, 0x4d, 0x2d, 0x53, 0x65, 0x72, 0x76, 0x44, 0x4b, 0x2f, 0x4f, 0x70, 0x65, 0x6e, 0x2d, 0x49, 0x4d, 0x2d, 0x53, 0x65, 0x72, 0x76, 0x65,
0x65, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x76,
0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x33,
} }
var ( var (
@ -1298,7 +1530,7 @@ func file_conversation_conversation_proto_rawDescGZIP() []byte {
return file_conversation_conversation_proto_rawDescData return file_conversation_conversation_proto_rawDescData
} }
var file_conversation_conversation_proto_msgTypes = make([]protoimpl.MessageInfo, 19) var file_conversation_conversation_proto_msgTypes = make([]protoimpl.MessageInfo, 23)
var file_conversation_conversation_proto_goTypes = []interface{}{ var file_conversation_conversation_proto_goTypes = []interface{}{
(*Conversation)(nil), // 0: OpenIMServer.conversation.Conversation (*Conversation)(nil), // 0: OpenIMServer.conversation.Conversation
(*ModifyConversationFieldReq)(nil), // 1: OpenIMServer.conversation.ModifyConversationFieldReq (*ModifyConversationFieldReq)(nil), // 1: OpenIMServer.conversation.ModifyConversationFieldReq
@ -1317,8 +1549,12 @@ var file_conversation_conversation_proto_goTypes = []interface{}{
(*BatchSetConversationsResp)(nil), // 14: OpenIMServer.conversation.BatchSetConversationsResp (*BatchSetConversationsResp)(nil), // 14: OpenIMServer.conversation.BatchSetConversationsResp
(*GetRecvMsgNotNotifyUserIDsReq)(nil), // 15: OpenIMServer.conversation.GetRecvMsgNotNotifyUserIDsReq (*GetRecvMsgNotNotifyUserIDsReq)(nil), // 15: OpenIMServer.conversation.GetRecvMsgNotNotifyUserIDsReq
(*GetRecvMsgNotNotifyUserIDsResp)(nil), // 16: OpenIMServer.conversation.GetRecvMsgNotNotifyUserIDsResp (*GetRecvMsgNotNotifyUserIDsResp)(nil), // 16: OpenIMServer.conversation.GetRecvMsgNotNotifyUserIDsResp
(*CreateConversationsWithoutNotificationReq)(nil), // 17: OpenIMServer.conversation.CreateConversationsWithoutNotificationReq (*CreateSingleChatConversationsReq)(nil), // 17: OpenIMServer.conversation.CreateSingleChatConversationsReq
(*CreateConversationsWithoutNotificationResp)(nil), // 18: OpenIMServer.conversation.CreateConversationsWithoutNotificationResp (*CreateSingleChatConversationsResp)(nil), // 18: OpenIMServer.conversation.CreateSingleChatConversationsResp
(*CreateGroupChatConversationsReq)(nil), // 19: OpenIMServer.conversation.CreateGroupChatConversationsReq
(*CreateGroupChatConversationsResp)(nil), // 20: OpenIMServer.conversation.CreateGroupChatConversationsResp
(*DelGroupChatConversationsReq)(nil), // 21: OpenIMServer.conversation.DelGroupChatConversationsReq
(*DelGroupChatConversationsResp)(nil), // 22: OpenIMServer.conversation.DelGroupChatConversationsResp
} }
var file_conversation_conversation_proto_depIdxs = []int32{ var file_conversation_conversation_proto_depIdxs = []int32{
0, // 0: OpenIMServer.conversation.ModifyConversationFieldReq.conversation:type_name -> OpenIMServer.conversation.Conversation 0, // 0: OpenIMServer.conversation.ModifyConversationFieldReq.conversation:type_name -> OpenIMServer.conversation.Conversation
@ -1327,30 +1563,33 @@ var file_conversation_conversation_proto_depIdxs = []int32{
0, // 3: OpenIMServer.conversation.GetConversationsResp.conversations:type_name -> OpenIMServer.conversation.Conversation 0, // 3: OpenIMServer.conversation.GetConversationsResp.conversations:type_name -> OpenIMServer.conversation.Conversation
0, // 4: OpenIMServer.conversation.GetAllConversationsResp.conversations:type_name -> OpenIMServer.conversation.Conversation 0, // 4: OpenIMServer.conversation.GetAllConversationsResp.conversations:type_name -> OpenIMServer.conversation.Conversation
0, // 5: OpenIMServer.conversation.BatchSetConversationsReq.Conversations:type_name -> OpenIMServer.conversation.Conversation 0, // 5: OpenIMServer.conversation.BatchSetConversationsReq.Conversations:type_name -> OpenIMServer.conversation.Conversation
0, // 6: OpenIMServer.conversation.CreateConversationsWithoutNotificationReq.conversations:type_name -> OpenIMServer.conversation.Conversation 1, // 6: OpenIMServer.conversation.conversation.ModifyConversationField:input_type -> OpenIMServer.conversation.ModifyConversationFieldReq
1, // 7: OpenIMServer.conversation.conversation.ModifyConversationField:input_type -> OpenIMServer.conversation.ModifyConversationFieldReq 7, // 7: OpenIMServer.conversation.conversation.GetConversation:input_type -> OpenIMServer.conversation.GetConversationReq
7, // 8: OpenIMServer.conversation.conversation.GetConversation:input_type -> OpenIMServer.conversation.GetConversationReq 11, // 8: OpenIMServer.conversation.conversation.GetAllConversations:input_type -> OpenIMServer.conversation.GetAllConversationsReq
11, // 9: OpenIMServer.conversation.conversation.GetAllConversations:input_type -> OpenIMServer.conversation.GetAllConversationsReq 9, // 9: OpenIMServer.conversation.conversation.GetConversations:input_type -> OpenIMServer.conversation.GetConversationsReq
9, // 10: OpenIMServer.conversation.conversation.GetConversations:input_type -> OpenIMServer.conversation.GetConversationsReq 13, // 10: OpenIMServer.conversation.conversation.BatchSetConversations:input_type -> OpenIMServer.conversation.BatchSetConversationsReq
13, // 11: OpenIMServer.conversation.conversation.BatchSetConversations:input_type -> OpenIMServer.conversation.BatchSetConversationsReq 3, // 11: OpenIMServer.conversation.conversation.SetConversation:input_type -> OpenIMServer.conversation.SetConversationReq
3, // 12: OpenIMServer.conversation.conversation.SetConversation:input_type -> OpenIMServer.conversation.SetConversationReq 5, // 12: OpenIMServer.conversation.conversation.SetRecvMsgOpt:input_type -> OpenIMServer.conversation.SetRecvMsgOptReq
5, // 13: OpenIMServer.conversation.conversation.SetRecvMsgOpt:input_type -> OpenIMServer.conversation.SetRecvMsgOptReq 15, // 13: OpenIMServer.conversation.conversation.GetRecvMsgNotNotifyUserIDs:input_type -> OpenIMServer.conversation.GetRecvMsgNotNotifyUserIDsReq
15, // 14: OpenIMServer.conversation.conversation.GetRecvMsgNotNotifyUserIDs:input_type -> OpenIMServer.conversation.GetRecvMsgNotNotifyUserIDsReq 17, // 14: OpenIMServer.conversation.conversation.CreateSingleChatConversations:input_type -> OpenIMServer.conversation.CreateSingleChatConversationsReq
17, // 15: OpenIMServer.conversation.conversation.CreateConversationsWithoutNotification:input_type -> OpenIMServer.conversation.CreateConversationsWithoutNotificationReq 19, // 15: OpenIMServer.conversation.conversation.CreateGroupChatConversations:input_type -> OpenIMServer.conversation.CreateGroupChatConversationsReq
2, // 16: OpenIMServer.conversation.conversation.ModifyConversationField:output_type -> OpenIMServer.conversation.ModifyConversationFieldResp 21, // 16: OpenIMServer.conversation.conversation.DelGroupChatConversations:input_type -> OpenIMServer.conversation.DelGroupChatConversationsReq
8, // 17: OpenIMServer.conversation.conversation.GetConversation:output_type -> OpenIMServer.conversation.GetConversationResp 2, // 17: OpenIMServer.conversation.conversation.ModifyConversationField:output_type -> OpenIMServer.conversation.ModifyConversationFieldResp
12, // 18: OpenIMServer.conversation.conversation.GetAllConversations:output_type -> OpenIMServer.conversation.GetAllConversationsResp 8, // 18: OpenIMServer.conversation.conversation.GetConversation:output_type -> OpenIMServer.conversation.GetConversationResp
10, // 19: OpenIMServer.conversation.conversation.GetConversations:output_type -> OpenIMServer.conversation.GetConversationsResp 12, // 19: OpenIMServer.conversation.conversation.GetAllConversations:output_type -> OpenIMServer.conversation.GetAllConversationsResp
14, // 20: OpenIMServer.conversation.conversation.BatchSetConversations:output_type -> OpenIMServer.conversation.BatchSetConversationsResp 10, // 20: OpenIMServer.conversation.conversation.GetConversations:output_type -> OpenIMServer.conversation.GetConversationsResp
4, // 21: OpenIMServer.conversation.conversation.SetConversation:output_type -> OpenIMServer.conversation.SetConversationResp 14, // 21: OpenIMServer.conversation.conversation.BatchSetConversations:output_type -> OpenIMServer.conversation.BatchSetConversationsResp
6, // 22: OpenIMServer.conversation.conversation.SetRecvMsgOpt:output_type -> OpenIMServer.conversation.SetRecvMsgOptResp 4, // 22: OpenIMServer.conversation.conversation.SetConversation:output_type -> OpenIMServer.conversation.SetConversationResp
16, // 23: OpenIMServer.conversation.conversation.GetRecvMsgNotNotifyUserIDs:output_type -> OpenIMServer.conversation.GetRecvMsgNotNotifyUserIDsResp 6, // 23: OpenIMServer.conversation.conversation.SetRecvMsgOpt:output_type -> OpenIMServer.conversation.SetRecvMsgOptResp
18, // 24: OpenIMServer.conversation.conversation.CreateConversationsWithoutNotification:output_type -> OpenIMServer.conversation.CreateConversationsWithoutNotificationResp 16, // 24: OpenIMServer.conversation.conversation.GetRecvMsgNotNotifyUserIDs:output_type -> OpenIMServer.conversation.GetRecvMsgNotNotifyUserIDsResp
16, // [16:25] is the sub-list for method output_type 18, // 25: OpenIMServer.conversation.conversation.CreateSingleChatConversations:output_type -> OpenIMServer.conversation.CreateSingleChatConversationsResp
7, // [7:16] is the sub-list for method input_type 20, // 26: OpenIMServer.conversation.conversation.CreateGroupChatConversations:output_type -> OpenIMServer.conversation.CreateGroupChatConversationsResp
7, // [7:7] is the sub-list for extension type_name 22, // 27: OpenIMServer.conversation.conversation.DelGroupChatConversations:output_type -> OpenIMServer.conversation.DelGroupChatConversationsResp
7, // [7:7] is the sub-list for extension extendee 17, // [17:28] is the sub-list for method output_type
0, // [0:7] is the sub-list for field type_name 6, // [6:17] is the sub-list for method input_type
6, // [6:6] is the sub-list for extension type_name
6, // [6:6] is the sub-list for extension extendee
0, // [0:6] is the sub-list for field type_name
} }
func init() { file_conversation_conversation_proto_init() } func init() { file_conversation_conversation_proto_init() }
@ -1564,7 +1803,7 @@ func file_conversation_conversation_proto_init() {
} }
} }
file_conversation_conversation_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { file_conversation_conversation_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateConversationsWithoutNotificationReq); i { switch v := v.(*CreateSingleChatConversationsReq); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -1576,7 +1815,55 @@ func file_conversation_conversation_proto_init() {
} }
} }
file_conversation_conversation_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { file_conversation_conversation_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateConversationsWithoutNotificationResp); i { switch v := v.(*CreateSingleChatConversationsResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_conversation_conversation_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateGroupChatConversationsReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_conversation_conversation_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateGroupChatConversationsResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_conversation_conversation_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DelGroupChatConversationsReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_conversation_conversation_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DelGroupChatConversationsResp); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -1594,7 +1881,7 @@ func file_conversation_conversation_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_conversation_conversation_proto_rawDesc, RawDescriptor: file_conversation_conversation_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 19, NumMessages: 23,
NumExtensions: 0, NumExtensions: 0,
NumServices: 1, NumServices: 1,
}, },
@ -1628,7 +1915,9 @@ type ConversationClient interface {
SetConversation(ctx context.Context, in *SetConversationReq, opts ...grpc.CallOption) (*SetConversationResp, error) SetConversation(ctx context.Context, in *SetConversationReq, opts ...grpc.CallOption) (*SetConversationResp, error)
SetRecvMsgOpt(ctx context.Context, in *SetRecvMsgOptReq, opts ...grpc.CallOption) (*SetRecvMsgOptResp, error) SetRecvMsgOpt(ctx context.Context, in *SetRecvMsgOptReq, opts ...grpc.CallOption) (*SetRecvMsgOptResp, error)
GetRecvMsgNotNotifyUserIDs(ctx context.Context, in *GetRecvMsgNotNotifyUserIDsReq, opts ...grpc.CallOption) (*GetRecvMsgNotNotifyUserIDsResp, error) GetRecvMsgNotNotifyUserIDs(ctx context.Context, in *GetRecvMsgNotNotifyUserIDsReq, opts ...grpc.CallOption) (*GetRecvMsgNotNotifyUserIDsResp, error)
CreateConversationsWithoutNotification(ctx context.Context, in *CreateConversationsWithoutNotificationReq, opts ...grpc.CallOption) (*CreateConversationsWithoutNotificationResp, error) CreateSingleChatConversations(ctx context.Context, in *CreateSingleChatConversationsReq, opts ...grpc.CallOption) (*CreateSingleChatConversationsResp, error)
CreateGroupChatConversations(ctx context.Context, in *CreateGroupChatConversationsReq, opts ...grpc.CallOption) (*CreateGroupChatConversationsResp, error)
DelGroupChatConversations(ctx context.Context, in *DelGroupChatConversationsReq, opts ...grpc.CallOption) (*DelGroupChatConversationsResp, error)
} }
type conversationClient struct { type conversationClient struct {
@ -1711,9 +2000,27 @@ func (c *conversationClient) GetRecvMsgNotNotifyUserIDs(ctx context.Context, in
return out, nil return out, nil
} }
func (c *conversationClient) CreateConversationsWithoutNotification(ctx context.Context, in *CreateConversationsWithoutNotificationReq, opts ...grpc.CallOption) (*CreateConversationsWithoutNotificationResp, error) { func (c *conversationClient) CreateSingleChatConversations(ctx context.Context, in *CreateSingleChatConversationsReq, opts ...grpc.CallOption) (*CreateSingleChatConversationsResp, error) {
out := new(CreateConversationsWithoutNotificationResp) out := new(CreateSingleChatConversationsResp)
err := c.cc.Invoke(ctx, "/OpenIMServer.conversation.conversation/CreateConversationsWithoutNotification", in, out, opts...) err := c.cc.Invoke(ctx, "/OpenIMServer.conversation.conversation/CreateSingleChatConversations", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *conversationClient) CreateGroupChatConversations(ctx context.Context, in *CreateGroupChatConversationsReq, opts ...grpc.CallOption) (*CreateGroupChatConversationsResp, error) {
out := new(CreateGroupChatConversationsResp)
err := c.cc.Invoke(ctx, "/OpenIMServer.conversation.conversation/CreateGroupChatConversations", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *conversationClient) DelGroupChatConversations(ctx context.Context, in *DelGroupChatConversationsReq, opts ...grpc.CallOption) (*DelGroupChatConversationsResp, error) {
out := new(DelGroupChatConversationsResp)
err := c.cc.Invoke(ctx, "/OpenIMServer.conversation.conversation/DelGroupChatConversations", in, out, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -1730,7 +2037,9 @@ type ConversationServer interface {
SetConversation(context.Context, *SetConversationReq) (*SetConversationResp, error) SetConversation(context.Context, *SetConversationReq) (*SetConversationResp, error)
SetRecvMsgOpt(context.Context, *SetRecvMsgOptReq) (*SetRecvMsgOptResp, error) SetRecvMsgOpt(context.Context, *SetRecvMsgOptReq) (*SetRecvMsgOptResp, error)
GetRecvMsgNotNotifyUserIDs(context.Context, *GetRecvMsgNotNotifyUserIDsReq) (*GetRecvMsgNotNotifyUserIDsResp, error) GetRecvMsgNotNotifyUserIDs(context.Context, *GetRecvMsgNotNotifyUserIDsReq) (*GetRecvMsgNotNotifyUserIDsResp, error)
CreateConversationsWithoutNotification(context.Context, *CreateConversationsWithoutNotificationReq) (*CreateConversationsWithoutNotificationResp, error) CreateSingleChatConversations(context.Context, *CreateSingleChatConversationsReq) (*CreateSingleChatConversationsResp, error)
CreateGroupChatConversations(context.Context, *CreateGroupChatConversationsReq) (*CreateGroupChatConversationsResp, error)
DelGroupChatConversations(context.Context, *DelGroupChatConversationsReq) (*DelGroupChatConversationsResp, error)
} }
// UnimplementedConversationServer can be embedded to have forward compatible implementations. // UnimplementedConversationServer can be embedded to have forward compatible implementations.
@ -1761,8 +2070,14 @@ func (*UnimplementedConversationServer) SetRecvMsgOpt(context.Context, *SetRecvM
func (*UnimplementedConversationServer) GetRecvMsgNotNotifyUserIDs(context.Context, *GetRecvMsgNotNotifyUserIDsReq) (*GetRecvMsgNotNotifyUserIDsResp, error) { func (*UnimplementedConversationServer) GetRecvMsgNotNotifyUserIDs(context.Context, *GetRecvMsgNotNotifyUserIDsReq) (*GetRecvMsgNotNotifyUserIDsResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetRecvMsgNotNotifyUserIDs not implemented") return nil, status.Errorf(codes.Unimplemented, "method GetRecvMsgNotNotifyUserIDs not implemented")
} }
func (*UnimplementedConversationServer) CreateConversationsWithoutNotification(context.Context, *CreateConversationsWithoutNotificationReq) (*CreateConversationsWithoutNotificationResp, error) { func (*UnimplementedConversationServer) CreateSingleChatConversations(context.Context, *CreateSingleChatConversationsReq) (*CreateSingleChatConversationsResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateConversationsWithoutNotification not implemented") return nil, status.Errorf(codes.Unimplemented, "method CreateSingleChatConversations not implemented")
}
func (*UnimplementedConversationServer) CreateGroupChatConversations(context.Context, *CreateGroupChatConversationsReq) (*CreateGroupChatConversationsResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateGroupChatConversations not implemented")
}
func (*UnimplementedConversationServer) DelGroupChatConversations(context.Context, *DelGroupChatConversationsReq) (*DelGroupChatConversationsResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method DelGroupChatConversations not implemented")
} }
func RegisterConversationServer(s *grpc.Server, srv ConversationServer) { func RegisterConversationServer(s *grpc.Server, srv ConversationServer) {
@ -1913,20 +2228,56 @@ func _Conversation_GetRecvMsgNotNotifyUserIDs_Handler(srv interface{}, ctx conte
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Conversation_CreateConversationsWithoutNotification_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _Conversation_CreateSingleChatConversations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateConversationsWithoutNotificationReq) in := new(CreateSingleChatConversationsReq)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(ConversationServer).CreateConversationsWithoutNotification(ctx, in) return srv.(ConversationServer).CreateSingleChatConversations(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: "/OpenIMServer.conversation.conversation/CreateConversationsWithoutNotification", FullMethod: "/OpenIMServer.conversation.conversation/CreateSingleChatConversations",
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConversationServer).CreateConversationsWithoutNotification(ctx, req.(*CreateConversationsWithoutNotificationReq)) return srv.(ConversationServer).CreateSingleChatConversations(ctx, req.(*CreateSingleChatConversationsReq))
}
return interceptor(ctx, in, info, handler)
}
func _Conversation_CreateGroupChatConversations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateGroupChatConversationsReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConversationServer).CreateGroupChatConversations(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/OpenIMServer.conversation.conversation/CreateGroupChatConversations",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConversationServer).CreateGroupChatConversations(ctx, req.(*CreateGroupChatConversationsReq))
}
return interceptor(ctx, in, info, handler)
}
func _Conversation_DelGroupChatConversations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DelGroupChatConversationsReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConversationServer).DelGroupChatConversations(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/OpenIMServer.conversation.conversation/DelGroupChatConversations",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConversationServer).DelGroupChatConversations(ctx, req.(*DelGroupChatConversationsReq))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
@ -1968,8 +2319,16 @@ var _Conversation_serviceDesc = grpc.ServiceDesc{
Handler: _Conversation_GetRecvMsgNotNotifyUserIDs_Handler, Handler: _Conversation_GetRecvMsgNotNotifyUserIDs_Handler,
}, },
{ {
MethodName: "CreateConversationsWithoutNotification", MethodName: "CreateSingleChatConversations",
Handler: _Conversation_CreateConversationsWithoutNotification_Handler, Handler: _Conversation_CreateSingleChatConversations_Handler,
},
{
MethodName: "CreateGroupChatConversations",
Handler: _Conversation_CreateGroupChatConversations_Handler,
},
{
MethodName: "DelGroupChatConversations",
Handler: _Conversation_DelGroupChatConversations_Handler,
}, },
}, },
Streams: []grpc.StreamDesc{}, Streams: []grpc.StreamDesc{},

View File

@ -90,11 +90,29 @@ message GetRecvMsgNotNotifyUserIDsResp {
repeated string userIDs = 1; repeated string userIDs = 1;
} }
message CreateConversationsWithoutNotificationReq { message CreateSingleChatConversationsReq {
repeated Conversation conversations = 1; string recvID = 1;
string sendID = 2;
} }
message CreateConversationsWithoutNotificationResp { message CreateSingleChatConversationsResp {
}
message CreateGroupChatConversationsReq {
repeated string userIDs = 1;
string groupID = 2;
}
message CreateGroupChatConversationsResp {
}
message DelGroupChatConversationsReq {
string groupID = 1;
repeated string ownerUserID = 2;
int64 maxSeq = 3;
}
message DelGroupChatConversationsResp {
} }
service conversation { service conversation {
@ -106,5 +124,7 @@ service conversation {
rpc SetConversation(SetConversationReq)returns(SetConversationResp); rpc SetConversation(SetConversationReq)returns(SetConversationResp);
rpc SetRecvMsgOpt(SetRecvMsgOptReq)returns(SetRecvMsgOptResp); rpc SetRecvMsgOpt(SetRecvMsgOptReq)returns(SetRecvMsgOptResp);
rpc GetRecvMsgNotNotifyUserIDs(GetRecvMsgNotNotifyUserIDsReq) returns (GetRecvMsgNotNotifyUserIDsResp); rpc GetRecvMsgNotNotifyUserIDs(GetRecvMsgNotNotifyUserIDsReq) returns (GetRecvMsgNotNotifyUserIDsResp);
rpc CreateConversationsWithoutNotification(CreateConversationsWithoutNotificationReq) returns(CreateConversationsWithoutNotificationResp); rpc CreateSingleChatConversations(CreateSingleChatConversationsReq) returns (CreateSingleChatConversationsResp);
rpc CreateGroupChatConversations(CreateGroupChatConversationsReq) returns (CreateGroupChatConversationsResp);
rpc DelGroupChatConversations(DelGroupChatConversationsReq) returns(DelGroupChatConversationsResp);
} }

View File

@ -134,7 +134,7 @@ type PushMsgDataToMQ struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
MsgData *sdkws.MsgData `protobuf:"bytes,1,opt,name=msgData,proto3" json:"msgData"` MsgData *sdkws.MsgData `protobuf:"bytes,1,opt,name=msgData,proto3" json:"msgData"`
SourceID string `protobuf:"bytes,2,opt,name=sourceID,proto3" json:"sourceID"` ConversationID string `protobuf:"bytes,2,opt,name=conversationID,proto3" json:"conversationID"`
} }
func (x *PushMsgDataToMQ) Reset() { func (x *PushMsgDataToMQ) Reset() {
@ -176,9 +176,9 @@ func (x *PushMsgDataToMQ) GetMsgData() *sdkws.MsgData {
return nil return nil
} }
func (x *PushMsgDataToMQ) GetSourceID() string { func (x *PushMsgDataToMQ) GetConversationID() string {
if x != nil { if x != nil {
return x.SourceID return x.ConversationID
} }
return "" return ""
} }
@ -189,7 +189,7 @@ type MsgDataToMongoByMQ struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
LastSeq int64 `protobuf:"varint,1,opt,name=lastSeq,proto3" json:"lastSeq"` LastSeq int64 `protobuf:"varint,1,opt,name=lastSeq,proto3" json:"lastSeq"`
AggregationID string `protobuf:"bytes,2,opt,name=aggregationID,proto3" json:"aggregationID"` ConversationID string `protobuf:"bytes,2,opt,name=conversationID,proto3" json:"conversationID"`
MsgData []*sdkws.MsgData `protobuf:"bytes,3,rep,name=msgData,proto3" json:"msgData"` MsgData []*sdkws.MsgData `protobuf:"bytes,3,rep,name=msgData,proto3" json:"msgData"`
TriggerID string `protobuf:"bytes,4,opt,name=triggerID,proto3" json:"triggerID"` TriggerID string `protobuf:"bytes,4,opt,name=triggerID,proto3" json:"triggerID"`
} }
@ -233,9 +233,9 @@ func (x *MsgDataToMongoByMQ) GetLastSeq() int64 {
return 0 return 0
} }
func (x *MsgDataToMongoByMQ) GetAggregationID() string { func (x *MsgDataToMongoByMQ) GetConversationID() string {
if x != nil { if x != nil {
return x.AggregationID return x.ConversationID
} }
return "" return ""
} }
@ -1116,7 +1116,7 @@ type ModifyMessageReactionExtensionsReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
SourceID string `protobuf:"bytes,1,opt,name=sourceID,proto3" json:"sourceID"` ConversationID string `protobuf:"bytes,1,opt,name=conversationID,proto3" json:"conversationID"`
SessionType int32 `protobuf:"varint,2,opt,name=sessionType,proto3" json:"sessionType"` SessionType int32 `protobuf:"varint,2,opt,name=sessionType,proto3" json:"sessionType"`
ReactionExtensions map[string]*sdkws.KeyValue `protobuf:"bytes,3,rep,name=reactionExtensions,proto3" json:"reactionExtensions" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` ReactionExtensions map[string]*sdkws.KeyValue `protobuf:"bytes,3,rep,name=reactionExtensions,proto3" json:"reactionExtensions" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
ClientMsgID string `protobuf:"bytes,4,opt,name=clientMsgID,proto3" json:"clientMsgID"` ClientMsgID string `protobuf:"bytes,4,opt,name=clientMsgID,proto3" json:"clientMsgID"`
@ -1159,9 +1159,9 @@ func (*ModifyMessageReactionExtensionsReq) Descriptor() ([]byte, []int) {
return file_msg_msg_proto_rawDescGZIP(), []int{22} return file_msg_msg_proto_rawDescGZIP(), []int{22}
} }
func (x *ModifyMessageReactionExtensionsReq) GetSourceID() string { func (x *ModifyMessageReactionExtensionsReq) GetConversationID() string {
if x != nil { if x != nil {
return x.SourceID return x.ConversationID
} }
return "" return ""
} }
@ -1227,7 +1227,7 @@ type SetMessageReactionExtensionsReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
SourceID string `protobuf:"bytes,1,opt,name=sourceID,proto3" json:"sourceID"` ConversationID string `protobuf:"bytes,1,opt,name=conversationID,proto3" json:"conversationID"`
SessionType int32 `protobuf:"varint,2,opt,name=sessionType,proto3" json:"sessionType"` SessionType int32 `protobuf:"varint,2,opt,name=sessionType,proto3" json:"sessionType"`
ReactionExtensions map[string]*sdkws.KeyValue `protobuf:"bytes,3,rep,name=reactionExtensions,proto3" json:"reactionExtensions" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` ReactionExtensions map[string]*sdkws.KeyValue `protobuf:"bytes,3,rep,name=reactionExtensions,proto3" json:"reactionExtensions" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
ClientMsgID string `protobuf:"bytes,4,opt,name=clientMsgID,proto3" json:"clientMsgID"` ClientMsgID string `protobuf:"bytes,4,opt,name=clientMsgID,proto3" json:"clientMsgID"`
@ -1270,9 +1270,9 @@ func (*SetMessageReactionExtensionsReq) Descriptor() ([]byte, []int) {
return file_msg_msg_proto_rawDescGZIP(), []int{23} return file_msg_msg_proto_rawDescGZIP(), []int{23}
} }
func (x *SetMessageReactionExtensionsReq) GetSourceID() string { func (x *SetMessageReactionExtensionsReq) GetConversationID() string {
if x != nil { if x != nil {
return x.SourceID return x.ConversationID
} }
return "" return ""
} }
@ -1409,7 +1409,7 @@ type GetMessagesReactionExtensionsReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
SourceID string `protobuf:"bytes,1,opt,name=sourceID,proto3" json:"sourceID"` ConversationID string `protobuf:"bytes,1,opt,name=conversationID,proto3" json:"conversationID"`
SessionType int32 `protobuf:"varint,2,opt,name=sessionType,proto3" json:"sessionType"` SessionType int32 `protobuf:"varint,2,opt,name=sessionType,proto3" json:"sessionType"`
MessageReactionKeys []*GetMessagesReactionExtensionsReq_MessageReactionKey `protobuf:"bytes,3,rep,name=messageReactionKeys,proto3" json:"messageReactionKeys"` MessageReactionKeys []*GetMessagesReactionExtensionsReq_MessageReactionKey `protobuf:"bytes,3,rep,name=messageReactionKeys,proto3" json:"messageReactionKeys"`
TypeKeys []string `protobuf:"bytes,4,rep,name=TypeKeys,proto3" json:"TypeKeys"` TypeKeys []string `protobuf:"bytes,4,rep,name=TypeKeys,proto3" json:"TypeKeys"`
@ -1447,9 +1447,9 @@ func (*GetMessagesReactionExtensionsReq) Descriptor() ([]byte, []int) {
return file_msg_msg_proto_rawDescGZIP(), []int{25} return file_msg_msg_proto_rawDescGZIP(), []int{25}
} }
func (x *GetMessagesReactionExtensionsReq) GetSourceID() string { func (x *GetMessagesReactionExtensionsReq) GetConversationID() string {
if x != nil { if x != nil {
return x.SourceID return x.ConversationID
} }
return "" return ""
} }
@ -1639,7 +1639,7 @@ type DeleteMessagesReactionExtensionsReq struct {
OperationID string `protobuf:"bytes,1,opt,name=operationID,proto3" json:"operationID"` OperationID string `protobuf:"bytes,1,opt,name=operationID,proto3" json:"operationID"`
OpUserID string `protobuf:"bytes,2,opt,name=opUserID,proto3" json:"opUserID"` OpUserID string `protobuf:"bytes,2,opt,name=opUserID,proto3" json:"opUserID"`
SourceID string `protobuf:"bytes,3,opt,name=sourceID,proto3" json:"sourceID"` ConversationID string `protobuf:"bytes,3,opt,name=conversationID,proto3" json:"conversationID"`
SessionType int32 `protobuf:"varint,4,opt,name=sessionType,proto3" json:"sessionType"` SessionType int32 `protobuf:"varint,4,opt,name=sessionType,proto3" json:"sessionType"`
ClientMsgID string `protobuf:"bytes,5,opt,name=clientMsgID,proto3" json:"clientMsgID"` ClientMsgID string `protobuf:"bytes,5,opt,name=clientMsgID,proto3" json:"clientMsgID"`
IsExternalExtensions bool `protobuf:"varint,6,opt,name=isExternalExtensions,proto3" json:"isExternalExtensions"` IsExternalExtensions bool `protobuf:"varint,6,opt,name=isExternalExtensions,proto3" json:"isExternalExtensions"`
@ -1693,9 +1693,9 @@ func (x *DeleteMessagesReactionExtensionsReq) GetOpUserID() string {
return "" return ""
} }
func (x *DeleteMessagesReactionExtensionsReq) GetSourceID() string { func (x *DeleteMessagesReactionExtensionsReq) GetConversationID() string {
if x != nil { if x != nil {
return x.SourceID return x.ConversationID
} }
return "" return ""
} }
@ -1978,7 +1978,7 @@ type MsgDataToModifyByMQ struct {
Messages []*sdkws.MsgData `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages"` Messages []*sdkws.MsgData `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages"`
TriggerID string `protobuf:"bytes,2,opt,name=triggerID,proto3" json:"triggerID"` TriggerID string `protobuf:"bytes,2,opt,name=triggerID,proto3" json:"triggerID"`
AggregationID string `protobuf:"bytes,3,opt,name=aggregationID,proto3" json:"aggregationID"` ConversationID string `protobuf:"bytes,3,opt,name=conversationID,proto3" json:"conversationID"`
} }
func (x *MsgDataToModifyByMQ) Reset() { func (x *MsgDataToModifyByMQ) Reset() {
@ -2027,9 +2027,9 @@ func (x *MsgDataToModifyByMQ) GetTriggerID() string {
return "" return ""
} }
func (x *MsgDataToModifyByMQ) GetAggregationID() string { func (x *MsgDataToModifyByMQ) GetConversationID() string {
if x != nil { if x != nil {
return x.AggregationID return x.ConversationID
} }
return "" return ""
} }
@ -2200,305 +2200,309 @@ var file_msg_msg_proto_rawDesc = []byte{
0x6d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e,
0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b,
0x77, 0x73, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x44, 0x77, 0x73, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x44,
0x61, 0x74, 0x61, 0x22, 0x64, 0x0a, 0x0f, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x73, 0x67, 0x44, 0x61, 0x61, 0x74, 0x61, 0x22, 0x70, 0x0a, 0x0f, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x73, 0x67, 0x44, 0x61,
0x74, 0x61, 0x54, 0x6f, 0x4d, 0x51, 0x12, 0x35, 0x0a, 0x07, 0x6d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x74, 0x61, 0x54, 0x6f, 0x4d, 0x51, 0x12, 0x35, 0x0a, 0x07, 0x6d, 0x73, 0x67, 0x44, 0x61, 0x74,
0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d,
0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x4d, 0x73, 0x67,
0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1a, 0x0a, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x12, 0x26, 0x0a,
0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18,
0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x44, 0x22, 0xa9, 0x01, 0x0a, 0x12, 0x4d, 0x73, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74,
0x67, 0x44, 0x61, 0x74, 0x61, 0x54, 0x6f, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x42, 0x79, 0x4d, 0x51, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0xab, 0x01, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x44, 0x61, 0x74,
0x12, 0x18, 0x0a, 0x07, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x65, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x61, 0x54, 0x6f, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x42, 0x79, 0x4d, 0x51, 0x12, 0x18, 0x0a, 0x07,
0x03, 0x52, 0x07, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x65, 0x71, 0x12, 0x24, 0x0a, 0x0d, 0x61, 0x67, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x65, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6c,
0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x61, 0x73, 0x74, 0x53, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72,
0x09, 0x52, 0x0d, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e,
0x12, 0x35, 0x0a, 0x07, 0x6d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x35,
0x0b, 0x32, 0x1b, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x0a, 0x07, 0x6d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x1b, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73,
0x6d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x72, 0x69, 0x67, 0x67, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x6d, 0x73,
0x65, 0x72, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x72, 0x69, 0x67, 0x67, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72,
0x67, 0x65, 0x72, 0x49, 0x44, 0x22, 0x2c, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x78, 0x41, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65,
0x6e, 0x64, 0x4d, 0x69, 0x6e, 0x53, 0x65, 0x71, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x72, 0x49, 0x44, 0x22, 0x2c, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x78, 0x41, 0x6e, 0x64,
0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x55, 0x73, 0x65, 0x4d, 0x69, 0x6e, 0x53, 0x65, 0x71, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65,
0x72, 0x49, 0x44, 0x22, 0x45, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x78, 0x41, 0x6e, 0x64, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49,
0x4d, 0x69, 0x6e, 0x53, 0x65, 0x71, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x4d, 0x61, 0x44, 0x22, 0x45, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x78, 0x41, 0x6e, 0x64, 0x4d, 0x69,
0x78, 0x53, 0x65, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x4d, 0x61, 0x78, 0x53, 0x6e, 0x53, 0x65, 0x71, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x4d, 0x61, 0x78, 0x53,
0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x4d, 0x69, 0x6e, 0x53, 0x65, 0x71, 0x18, 0x02, 0x20, 0x01, 0x65, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x4d, 0x61, 0x78, 0x53, 0x65, 0x71,
0x28, 0x03, 0x52, 0x06, 0x4d, 0x69, 0x6e, 0x53, 0x65, 0x71, 0x22, 0x43, 0x0a, 0x0a, 0x53, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x4d, 0x69, 0x6e, 0x53, 0x65, 0x71, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03,
0x6e, 0x64, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x12, 0x35, 0x0a, 0x07, 0x6d, 0x73, 0x67, 0x44, 0x52, 0x06, 0x4d, 0x69, 0x6e, 0x53, 0x65, 0x71, 0x22, 0x43, 0x0a, 0x0a, 0x53, 0x65, 0x6e, 0x64,
0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x12, 0x35, 0x0a, 0x07, 0x6d, 0x73, 0x67, 0x44, 0x61, 0x74,
0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x4d, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d,
0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x22,
0x6d, 0x0a, 0x0b, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x20,
0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4d, 0x73, 0x67, 0x49, 0x44, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4d, 0x73, 0x67, 0x49, 0x44,
0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x73, 0x67, 0x49, 0x44, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x73, 0x67,
0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03,
0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x25,
0x0a, 0x0b, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a,
0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75,
0x73, 0x65, 0x72, 0x49, 0x44, 0x22, 0x0e, 0x0a, 0x0c, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x4d, 0x73,
0x67, 0x52, 0x65, 0x73, 0x70, 0x22, 0x5b, 0x0a, 0x0f, 0x53, 0x65, 0x74, 0x4d, 0x73, 0x67, 0x4d,
0x69, 0x6e, 0x53, 0x65, 0x71, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72,
0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44,
0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28,
0x09, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x69,
0x6e, 0x53, 0x65, 0x71, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6d, 0x69, 0x6e, 0x53,
0x65, 0x71, 0x22, 0x12, 0x0a, 0x10, 0x53, 0x65, 0x74, 0x4d, 0x73, 0x67, 0x4d, 0x69, 0x6e, 0x53,
0x65, 0x71, 0x52, 0x65, 0x73, 0x70, 0x22, 0x2d, 0x0a, 0x13, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e,
0x64, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a,
0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73,
0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x16, 0x0a, 0x14, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64,
0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x15, 0x0a,
0x13, 0x47, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75,
0x73, 0x52, 0x65, 0x71, 0x22, 0x2e, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x4d,
0x73, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06,
0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74,
0x61, 0x74, 0x75, 0x73, 0x22, 0x47, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x53, 0x75, 0x70, 0x65, 0x72,
0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75,
0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65,
0x72, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x22, 0x16, 0x0a,
0x14, 0x44, 0x65, 0x6c, 0x53, 0x75, 0x70, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x73,
0x67, 0x52, 0x65, 0x73, 0x70, 0x22, 0x41, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x65,
0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03,
0x53, 0x65, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x53, 0x65, 0x71, 0x12, 0x18,
0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x22, 0x4d, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x53,
0x75, 0x70, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x70,
0x12, 0x35, 0x0a, 0x07, 0x6d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x1b, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72,
0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07,
0x6d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x22, 0x26, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x57, 0x72,
0x69, 0x74, 0x65, 0x44, 0x69, 0x66, 0x66, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a,
0x03, 0x53, 0x65, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x53, 0x65, 0x71, 0x22,
0x4c, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x57, 0x72, 0x69, 0x74, 0x65, 0x44, 0x69, 0x66, 0x66, 0x4d,
0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x35, 0x0a, 0x07, 0x6d, 0x73, 0x67, 0x44, 0x61, 0x74,
0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d,
0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x4d, 0x73, 0x67,
0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x22, 0xe1, 0x04, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x22, 0x6d, 0x0a,
0x0a, 0x22, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x0b, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x20, 0x0a, 0x0b,
0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4d, 0x73, 0x67, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28,
0x73, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x44, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4d, 0x73, 0x67, 0x49, 0x44, 0x12, 0x20,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x44, 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x73, 0x67, 0x49, 0x44, 0x18, 0x02, 0x20,
0x12, 0x20, 0x0a, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18,
0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79,
0x70, 0x65, 0x12, 0x7c, 0x0a, 0x12, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78,
0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4c,
0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73,
0x67, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52,
0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
0x73, 0x52, 0x65, 0x71, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74,
0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x12, 0x72, 0x65,
0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73,
0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x73, 0x67, 0x49, 0x44, 0x18,
0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x73, 0x67,
0x49, 0x44, 0x12, 0x32, 0x0a, 0x02, 0x65, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22,
0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c,
0x75, 0x65, 0x52, 0x02, 0x65, 0x78, 0x12, 0x46, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68,
0x65, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x4f,
0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65,
0x52, 0x0c, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18,
0x0a, 0x07, 0x69, 0x73, 0x52, 0x65, 0x61, 0x63, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52,
0x07, 0x69, 0x73, 0x52, 0x65, 0x61, 0x63, 0x74, 0x12, 0x32, 0x0a, 0x14, 0x69, 0x73, 0x45, 0x78,
0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73,
0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x69, 0x73, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e,
0x61, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2e, 0x0a, 0x12,
0x6d, 0x73, 0x67, 0x46, 0x69, 0x72, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x54, 0x69,
0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x6d, 0x73, 0x67, 0x46, 0x69, 0x72,
0x73, 0x74, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x1a, 0x63, 0x0a, 0x17,
0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, 0x6c,
0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49,
0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x4b, 0x65,
0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38,
0x01, 0x22, 0xdb, 0x04, 0x0a, 0x1f, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
0x6e, 0x73, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49,
0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49,
0x44, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54,
0x79, 0x70, 0x65, 0x12, 0x79, 0x0a, 0x12, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45,
0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x49, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d,
0x73, 0x67, 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x61,
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52,
0x65, 0x71, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e,
0x73, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x12, 0x72, 0x65, 0x61, 0x63,
0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x20,
0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x73, 0x67, 0x49, 0x44, 0x18, 0x04, 0x20,
0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x73, 0x67, 0x49, 0x44, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x73, 0x67, 0x49, 0x44,
0x12, 0x32, 0x0a, 0x02, 0x65, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x4f, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01,
0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x28, 0x03, 0x52, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x25, 0x0a, 0x0b,
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75,
0x52, 0x02, 0x65, 0x78, 0x12, 0x46, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65,
0x49, 0x6e, 0x66, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x49, 0x44, 0x22, 0x0e, 0x0a, 0x0c, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x4d, 0x73, 0x67, 0x52,
0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x65, 0x73, 0x70, 0x22, 0x5b, 0x0a, 0x0f, 0x53, 0x65, 0x74, 0x4d, 0x73, 0x67, 0x4d, 0x69, 0x6e,
0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x53, 0x65, 0x71, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44,
0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x18,
0x69, 0x73, 0x52, 0x65, 0x61, 0x63, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x73, 0x52, 0x65, 0x61, 0x63, 0x74, 0x12, 0x32, 0x0a, 0x14, 0x69, 0x73, 0x45, 0x78, 0x74, 0x65, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x69, 0x6e, 0x53,
0x72, 0x6e, 0x61, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x08, 0x65, 0x71, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6d, 0x69, 0x6e, 0x53, 0x65, 0x71,
0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x69, 0x73, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x22, 0x12, 0x0a, 0x10, 0x53, 0x65, 0x74, 0x4d, 0x73, 0x67, 0x4d, 0x69, 0x6e, 0x53, 0x65, 0x71,
0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2e, 0x0a, 0x12, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x2d, 0x0a, 0x13, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x4d,
0x67, 0x46, 0x69, 0x72, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x73,
0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x6d, 0x73, 0x67, 0x46, 0x69, 0x72, 0x73, 0x74, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61,
0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x1a, 0x63, 0x0a, 0x17, 0x52, 0x65, 0x74, 0x75, 0x73, 0x22, 0x16, 0x0a, 0x14, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73,
0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x15, 0x0a, 0x13, 0x47,
0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52,
0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x65, 0x71, 0x22, 0x2e, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67,
0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74,
0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74,
0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x75, 0x73, 0x22, 0x47, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x53, 0x75, 0x70, 0x65, 0x72, 0x47, 0x72,
0xc6, 0x01, 0x0a, 0x20, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x6f, 0x75, 0x70, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65,
0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49,
0x52, 0x65, 0x73, 0x70, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x73, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01,
0x67, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x22, 0x16, 0x0a, 0x14, 0x44,
0x74, 0x4d, 0x73, 0x67, 0x49, 0x44, 0x12, 0x2e, 0x0a, 0x12, 0x6d, 0x73, 0x67, 0x46, 0x69, 0x72, 0x65, 0x6c, 0x53, 0x75, 0x70, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x73, 0x67, 0x52,
0x73, 0x74, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x65, 0x73, 0x70, 0x22, 0x41, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x65, 0x72, 0x47,
0x28, 0x03, 0x52, 0x12, 0x6d, 0x73, 0x67, 0x46, 0x69, 0x72, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x69, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x53, 0x65,
0x66, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x73, 0x52, 0x65, 0x61, 0x63, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x53, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07,
0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x52, 0x65, 0x61, 0x63, 0x74, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67,
0x12, 0x36, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x22, 0x4d, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70,
0x32, 0x1e, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x35,
0x6d, 0x73, 0x67, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x0a, 0x07, 0x6d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xdd, 0x02, 0x0a, 0x20, 0x47, 0x65, 0x74, 0x1b, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73,
0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x6d, 0x73,
0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x67, 0x44, 0x61, 0x74, 0x61, 0x22, 0x26, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x57, 0x72, 0x69, 0x74,
0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x65, 0x44, 0x69, 0x66, 0x66, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x53,
0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x65, 0x73, 0x65, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x53, 0x65, 0x71, 0x22, 0x4c, 0x0a,
0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x13, 0x47, 0x65, 0x74, 0x57, 0x72, 0x69, 0x74, 0x65, 0x44, 0x69, 0x66, 0x66, 0x4d, 0x73, 0x67,
0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x77, 0x0a, 0x13, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x12, 0x35, 0x0a, 0x07, 0x6d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x18,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65,
0x79, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x45, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x61,
0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x74, 0x61, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x22, 0xed, 0x04, 0x0a, 0x22,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x61,
0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x2e, 0x4d, 0x65, 0x73, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52,
0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69,
0x13, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x76,
0x4b, 0x65, 0x79, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x54, 0x79, 0x70, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x65,
0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x54, 0x79, 0x70, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
0x1a, 0x66, 0x0a, 0x12, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x7c, 0x0a, 0x12,
0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
0x4d, 0x73, 0x67, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x69, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4c, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49,
0x65, 0x6e, 0x74, 0x4d, 0x73, 0x67, 0x49, 0x44, 0x12, 0x2e, 0x0a, 0x12, 0x6d, 0x73, 0x67, 0x46, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x4d, 0x6f, 0x64, 0x69,
0x69, 0x72, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x66, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f,
0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x6d, 0x73, 0x67, 0x46, 0x69, 0x72, 0x73, 0x74, 0x4d, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x2e, 0x52,
0x64, 0x69, 0x66, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x85, 0x01, 0x0a, 0x21, 0x47, 0x65, 0x74,
0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x60,
0x0a, 0x13, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52,
0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x4f, 0x70,
0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x53,
0x69, 0x6e, 0x67, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x45, 0x78, 0x74, 0x65,
0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x13, 0x73, 0x69, 0x6e,
0x67, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74,
0x22, 0x9d, 0x02, 0x0a, 0x1c, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61,
0x67, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c,
0x74, 0x12, 0x76, 0x0a, 0x12, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74,
0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x46, 0x2e,
0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67,
0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x45, 0x78,
0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x52, 0x65,
0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73,
0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x12, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45,
0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6c, 0x69,
0x65, 0x6e, 0x74, 0x4d, 0x73, 0x67, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b,
0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x73, 0x67, 0x49, 0x44, 0x1a, 0x63, 0x0a, 0x17, 0x52,
0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x12, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6c,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x73, 0x67, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x4b, 0x65, 0x79, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x73, 0x67, 0x49, 0x44, 0x12, 0x32, 0x0a, 0x02,
0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x65, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49,
0x22, 0xa9, 0x01, 0x0a, 0x23, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
0x67, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x02, 0x65, 0x78,
0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x41, 0x0a, 0x0b, 0x73, 0x75, 0x63, 0x63, 0x12, 0x46, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x49, 0x6e, 0x66, 0x6f,
0x65, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53,
0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53,
0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x52, 0x0b, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x61,
0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x0a, 0x66, 0x63, 0x68, 0x65, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x73, 0x52, 0x65,
0x61, 0x69, 0x6c, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x61, 0x63, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x52, 0x65, 0x61,
0x1f, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x63, 0x74, 0x12, 0x32, 0x0a, 0x14, 0x69, 0x73, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c,
0x73, 0x67, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08,
0x52, 0x0a, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x22, 0xf5, 0x02, 0x0a,
0x23, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52,
0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
0x73, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72,
0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72,
0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x44, 0x18, 0x03,
0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x44, 0x12, 0x20,
0x0a, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20,
0x01, 0x28, 0x05, 0x52, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65,
0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x73, 0x67, 0x49, 0x44, 0x18,
0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x73, 0x67,
0x49, 0x44, 0x12, 0x32, 0x0a, 0x14, 0x69, 0x73, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c,
0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08,
0x52, 0x14, 0x69, 0x73, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x52, 0x14, 0x69, 0x73, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x45, 0x78, 0x74, 0x65,
0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2e, 0x0a, 0x12, 0x6d, 0x73, 0x67, 0x46, 0x69, 0x72, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2e, 0x0a, 0x12, 0x6d, 0x73, 0x67, 0x46, 0x69, 0x72,
0x73, 0x74, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01,
0x28, 0x03, 0x52, 0x12, 0x6d, 0x73, 0x67, 0x46, 0x69, 0x72, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x69, 0x28, 0x03, 0x52, 0x12, 0x6d, 0x73, 0x67, 0x46, 0x69, 0x72, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x69,
0x66, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x4c, 0x0a, 0x12, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x66, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x1a, 0x63, 0x0a, 0x17, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69,
0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x08, 0x20, 0x03, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72,
0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65,
0x72, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65,
0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xe7, 0x04, 0x0a, 0x1f,
0x53, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69,
0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x12,
0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49,
0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69,
0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x73, 0x65,
0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x79, 0x0a, 0x12, 0x72, 0x65, 0x61,
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18,
0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x49, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65,
0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73,
0x61, 0x67, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e,
0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f,
0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79,
0x52, 0x12, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x52, 0x12, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73,
0x69, 0x6f, 0x6e, 0x73, 0x22, 0x5e, 0x0a, 0x24, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x73,
0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x67, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e,
0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x36, 0x0a, 0x06, 0x74, 0x4d, 0x73, 0x67, 0x49, 0x44, 0x12, 0x32, 0x0a, 0x02, 0x65, 0x78, 0x18, 0x05, 0x20, 0x01,
0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x4f, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65,
0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e,
0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x52, 0x06, 0x72, 0x65, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x02, 0x65, 0x78, 0x12, 0x46, 0x0a, 0x0c, 0x61, 0x74,
0x73, 0x75, 0x6c, 0x74, 0x22, 0x4a, 0x0a, 0x0d, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b,
0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x39, 0x0a, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x4d, 0x32, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e,
0x73, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56,
0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x49, 0x6e,
0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x73, 0x52, 0x65, 0x61, 0x63, 0x74, 0x18, 0x07, 0x20,
0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x52, 0x65, 0x61, 0x63, 0x74, 0x12, 0x32, 0x0a, 0x14,
0x69, 0x73, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73,
0x69, 0x6f, 0x6e, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x69, 0x73, 0x45, 0x78,
0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73,
0x12, 0x2e, 0x0a, 0x12, 0x6d, 0x73, 0x67, 0x46, 0x69, 0x72, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x69,
0x66, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x6d, 0x73,
0x67, 0x46, 0x69, 0x72, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x54, 0x69, 0x6d, 0x65,
0x1a, 0x63, 0x0a, 0x17, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65,
0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b,
0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a,
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x4f,
0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, 0x77,
0x73, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75,
0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xc6, 0x01, 0x0a, 0x20, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x73,
0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65,
0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6c,
0x69, 0x65, 0x6e, 0x74, 0x4d, 0x73, 0x67, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x73, 0x67, 0x49, 0x44, 0x12, 0x2e, 0x0a, 0x12,
0x6d, 0x73, 0x67, 0x46, 0x69, 0x72, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x54, 0x69,
0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x6d, 0x73, 0x67, 0x46, 0x69, 0x72,
0x73, 0x74, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07,
0x69, 0x73, 0x52, 0x65, 0x61, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69,
0x73, 0x52, 0x65, 0x61, 0x63, 0x74, 0x12, 0x36, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74,
0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53,
0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c,
0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xe9,
0x02, 0x0a, 0x20, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65,
0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73,
0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6e,
0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x73,
0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05,
0x52, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x77, 0x0a,
0x13, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x4b, 0x65, 0x79, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x45, 0x2e, 0x4f, 0x70, 0x65,
0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x47, 0x65,
0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f,
0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x2e, 0x4d,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65,
0x79, 0x52, 0x13, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69,
0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x54, 0x79, 0x70, 0x65, 0x4b, 0x65,
0x79, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x54, 0x79, 0x70, 0x65, 0x4b, 0x65,
0x79, 0x73, 0x1a, 0x66, 0x0a, 0x12, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x61,
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65,
0x6e, 0x74, 0x4d, 0x73, 0x67, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63,
0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x73, 0x67, 0x49, 0x44, 0x12, 0x2e, 0x0a, 0x12, 0x6d, 0x73,
0x67, 0x46, 0x69, 0x72, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x54, 0x69, 0x6d, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x6d, 0x73, 0x67, 0x46, 0x69, 0x72, 0x73, 0x74,
0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x85, 0x01, 0x0a, 0x21, 0x47,
0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69,
0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70,
0x12, 0x60, 0x0a, 0x13, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e,
0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67,
0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x45, 0x78,
0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x13, 0x73,
0x69, 0x6e, 0x67, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x75,
0x6c, 0x74, 0x22, 0x9d, 0x02, 0x0a, 0x1c, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x4d, 0x65, 0x73,
0x73, 0x61, 0x67, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73,
0x75, 0x6c, 0x74, 0x12, 0x76, 0x0a, 0x12, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45,
0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x46, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d,
0x73, 0x67, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e,
0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x12, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f,
0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x63,
0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x73, 0x67, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x52, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x73, 0x67, 0x49, 0x44, 0x1a, 0x63, 0x0a,
0x17, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69,
0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61,
0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x4f, 0x70, 0x65, 0x6e,
0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x4b,
0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02,
0x38, 0x01, 0x22, 0xa9, 0x01, 0x0a, 0x23, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x4d, 0x65, 0x73,
0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65,
0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x41, 0x0a, 0x0b, 0x73, 0x75,
0x63, 0x63, 0x65, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x1f, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d,
0x73, 0x67, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x70,
0x52, 0x0b, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x3f, 0x0a,
0x0a, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x1f, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72,
0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x52, 0x65,
0x73, 0x70, 0x52, 0x0a, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x81,
0x03, 0x0a, 0x23, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x73, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69,
0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, 0x65,
0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x55, 0x73,
0x65, 0x72, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x55, 0x73,
0x65, 0x72, 0x49, 0x44, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f,
0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b,
0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
0x05, 0x52, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x20,
0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x73, 0x67, 0x49, 0x44, 0x18, 0x05, 0x20,
0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x73, 0x67, 0x49, 0x44,
0x12, 0x32, 0x0a, 0x14, 0x69, 0x73, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x45, 0x78,
0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14,
0x69, 0x73, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73,
0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2e, 0x0a, 0x12, 0x6d, 0x73, 0x67, 0x46, 0x69, 0x72, 0x73, 0x74,
0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03,
0x52, 0x12, 0x6d, 0x73, 0x67, 0x46, 0x69, 0x72, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79,
0x54, 0x69, 0x6d, 0x65, 0x12, 0x4c, 0x0a, 0x12, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x1c, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e,
0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x12,
0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
0x6e, 0x73, 0x22, 0x5e, 0x0a, 0x24, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73,
0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65,
0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x36, 0x0a, 0x06, 0x72, 0x65,
0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x4f, 0x70, 0x65,
0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x4b, 0x65,
0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75,
0x6c, 0x74, 0x22, 0x4a, 0x0a, 0x0d, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x52,
0x65, 0x73, 0x70, 0x12, 0x39, 0x0a, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53,
0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64,
0x4d, 0x73, 0x67, 0x52, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x22, 0xdd,
0x02, 0x0a, 0x09, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x12, 0x63, 0x0a, 0x12,
0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49,
0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x45, 0x78, 0x74, 0x65,
0x6e, 0x64, 0x4d, 0x73, 0x67, 0x52, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78,
0x22, 0xdd, 0x02, 0x0a, 0x09, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x12, 0x63, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x12, 0x72,
0x0a, 0x12, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x4f, 0x70, 0x65, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x73, 0x67, 0x49, 0x44,
0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x45, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x73,
0x74, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x67, 0x49, 0x44, 0x12, 0x2e, 0x0a, 0x12, 0x6d, 0x73, 0x67, 0x46, 0x69, 0x72, 0x73, 0x74, 0x4d,
0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52,
0x12, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x12, 0x6d, 0x73, 0x67, 0x46, 0x69, 0x72, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x54,
0x6f, 0x6e, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x73, 0x67, 0x69, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x49,
0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x6e, 0x66, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x61, 0x63,
0x4d, 0x73, 0x67, 0x49, 0x44, 0x12, 0x2e, 0x0a, 0x12, 0x6d, 0x73, 0x67, 0x46, 0x69, 0x72, 0x73, 0x68, 0x65, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x65, 0x78, 0x18, 0x05, 0x20,
0x74, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x28, 0x09, 0x52, 0x02, 0x65, 0x78, 0x1a, 0x65, 0x0a, 0x17, 0x52, 0x65, 0x61, 0x63, 0x74,
0x03, 0x52, 0x12, 0x6d, 0x73, 0x67, 0x46, 0x69, 0x72, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74,
0x79, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x65, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x64, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x74, 0x74, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x34, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20,
0x61, 0x63, 0x68, 0x65, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x65, 0x78, 0x18, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76,
0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x65, 0x78, 0x1a, 0x65, 0x0a, 0x17, 0x52, 0x65, 0x61, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52,
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x65, 0x73, 0x70, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x7a,
0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0a, 0x0c, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x38,
0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x34, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x32, 0x1c, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e,
0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08,
0x65, 0x52, 0x65, 0x73, 0x70, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x6b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x43,
0x22, 0x7a, 0x0a, 0x0c, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f,
0x12, 0x38, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x18, 0x03, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, 0x94, 0x01, 0x0a, 0x13, 0x4d,
0x72, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x54, 0x6f, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x42, 0x79,
0x52, 0x08, 0x6b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x72, 0x4d, 0x51, 0x12, 0x37, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01,
0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x72, 0x72, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72,
0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x18, 0x03, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x61, 0x74,
0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, 0x92, 0x01, 0x0a, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x74,
0x13, 0x4d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x54, 0x6f, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,
0x42, 0x79, 0x4d, 0x51, 0x12, 0x37, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x49, 0x44, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x6e,
0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28,
0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49,
0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x1c, 0x0a,
0x09, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x52, 0x09, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x49, 0x44, 0x12, 0x24, 0x0a, 0x0d, 0x61,
0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x52, 0x0d, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49,
0x44, 0x22, 0x38, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x4d, 0x73, 0x67, 0x73, 0x52, 0x65, 0x71, 0x12, 0x44, 0x22, 0x38, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x4d, 0x73, 0x67, 0x73, 0x52, 0x65, 0x71, 0x12,
0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x65, 0x71, 0x73, 0x18, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x65, 0x71, 0x73, 0x18,

View File

@ -16,12 +16,12 @@ message MsgDataToDB {
message PushMsgDataToMQ{ message PushMsgDataToMQ{
sdkws.MsgData msgData = 1; sdkws.MsgData msgData = 1;
string sourceID = 2; string conversationID = 2;
} }
message MsgDataToMongoByMQ{ message MsgDataToMongoByMQ{
int64 lastSeq = 1; int64 lastSeq = 1;
string aggregationID = 2; string conversationID = 2;
repeated sdkws.MsgData msgData = 3; repeated sdkws.MsgData msgData = 3;
string triggerID = 4; string triggerID = 4;
} }
@ -99,7 +99,7 @@ message GetWriteDiffMsgResp{
} }
message ModifyMessageReactionExtensionsReq { message ModifyMessageReactionExtensionsReq {
string sourceID = 1; string conversationID = 1;
int32 sessionType = 2; int32 sessionType = 2;
map <string, sdkws.KeyValue>reactionExtensions = 3; map <string, sdkws.KeyValue>reactionExtensions = 3;
string clientMsgID = 4; string clientMsgID = 4;
@ -110,7 +110,7 @@ message ModifyMessageReactionExtensionsReq {
int64 msgFirstModifyTime = 9; int64 msgFirstModifyTime = 9;
} }
message SetMessageReactionExtensionsReq { message SetMessageReactionExtensionsReq {
string sourceID = 1; string conversationID = 1;
int32 sessionType = 2; int32 sessionType = 2;
map <string, sdkws.KeyValue>reactionExtensions = 3; map <string, sdkws.KeyValue>reactionExtensions = 3;
string clientMsgID = 4; string clientMsgID = 4;
@ -128,7 +128,7 @@ message SetMessageReactionExtensionsResp {
} }
message GetMessagesReactionExtensionsReq { message GetMessagesReactionExtensionsReq {
string sourceID = 1; string conversationID = 1;
int32 sessionType = 2; int32 sessionType = 2;
message MessageReactionKey { message MessageReactionKey {
string clientMsgID = 1; string clientMsgID = 1;
@ -155,7 +155,7 @@ message ModifyMessageReactionExtensionsResp {
message DeleteMessagesReactionExtensionsReq { message DeleteMessagesReactionExtensionsReq {
string operationID = 1; string operationID = 1;
string opUserID = 2; string opUserID = 2;
string sourceID = 3; string conversationID = 3;
int32 sessionType = 4; int32 sessionType = 4;
string clientMsgID = 5; string clientMsgID = 5;
bool isExternalExtensions = 6; bool isExternalExtensions = 6;
@ -188,7 +188,7 @@ message KeyValueResp {
message MsgDataToModifyByMQ{ message MsgDataToModifyByMQ{
repeated sdkws.MsgData messages = 1; repeated sdkws.MsgData messages = 1;
string triggerID = 2; string triggerID = 2;
string aggregationID = 3; string conversationID = 3;
} }
message DelMsgsReq{ message DelMsgsReq{

View File

@ -31,7 +31,7 @@ type PushMsgReq struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
MsgData *sdkws.MsgData `protobuf:"bytes,1,opt,name=msgData,proto3" json:"msgData"` MsgData *sdkws.MsgData `protobuf:"bytes,1,opt,name=msgData,proto3" json:"msgData"`
SourceID string `protobuf:"bytes,2,opt,name=sourceID,proto3" json:"sourceID"` ConversationID string `protobuf:"bytes,2,opt,name=conversationID,proto3" json:"conversationID"`
} }
func (x *PushMsgReq) Reset() { func (x *PushMsgReq) Reset() {
@ -73,9 +73,9 @@ func (x *PushMsgReq) GetMsgData() *sdkws.MsgData {
return nil return nil
} }
func (x *PushMsgReq) GetSourceID() string { func (x *PushMsgReq) GetConversationID() string {
if x != nil { if x != nil {
return x.SourceID return x.ConversationID
} }
return "" return ""
} }
@ -217,36 +217,37 @@ var file_push_push_proto_rawDesc = []byte{
0x0a, 0x0f, 0x70, 0x75, 0x73, 0x68, 0x2f, 0x70, 0x75, 0x73, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x0a, 0x0f, 0x70, 0x75, 0x73, 0x68, 0x2f, 0x70, 0x75, 0x73, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x12, 0x11, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6f, 0x12, 0x11, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e,
0x70, 0x75, 0x73, 0x68, 0x1a, 0x11, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2f, 0x73, 0x64, 0x6b, 0x77, 0x70, 0x75, 0x73, 0x68, 0x1a, 0x11, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2f, 0x73, 0x64, 0x6b, 0x77,
0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5f, 0x0a, 0x0a, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6b, 0x0a, 0x0a, 0x50, 0x75, 0x73, 0x68, 0x4d,
0x73, 0x67, 0x52, 0x65, 0x71, 0x12, 0x35, 0x0a, 0x07, 0x6d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x73, 0x67, 0x52, 0x65, 0x71, 0x12, 0x35, 0x0a, 0x07, 0x6d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53,
0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x4d, 0x73, 0x67, 0x44,
0x61, 0x74, 0x61, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x74, 0x61, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x12, 0x26, 0x0a, 0x0e,
0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02,
0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x44, 0x22, 0x0d, 0x0a, 0x0b, 0x50, 0x75, 0x73, 0x68, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69,
0x4d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x22, 0x4d, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x55, 0x73, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0x0d, 0x0a, 0x0b, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x73, 0x67, 0x52,
0x65, 0x72, 0x50, 0x75, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x16, 0x65, 0x73, 0x70, 0x22, 0x4d, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75,
0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73,
0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72,
0x72, 0x6d, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x70, 0x6c, 0x61, 0x74, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x49, 0x44,
0x66, 0x6f, 0x72, 0x6d, 0x49, 0x44, 0x22, 0x16, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x55, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d,
0x72, 0x50, 0x75, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x32, 0xbf, 0x49, 0x44, 0x22, 0x16, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x73,
0x01, 0x0a, 0x0e, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x32, 0xbf, 0x01, 0x0a, 0x0e, 0x50,
0x65, 0x12, 0x48, 0x0a, 0x07, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x73, 0x67, 0x12, 0x1d, 0x2e, 0x4f, 0x75, 0x73, 0x68, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x48, 0x0a,
0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x07, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x73, 0x67, 0x12, 0x1d, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49,
0x2e, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x4f, 0x70, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x2e, 0x50, 0x75, 0x73,
0x68, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d,
0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x2e, 0x50, 0x75, 0x73, 0x68,
0x4d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x63, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x55, 0x73,
0x65, 0x72, 0x50, 0x75, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x26, 0x2e, 0x4f, 0x70,
0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x2e, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x2e,
0x50, 0x75, 0x73, 0x68, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x63, 0x0a, 0x10, 0x44, 0x44, 0x65, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
0x65, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x52, 0x65, 0x71, 0x1a, 0x27, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76,
0x26, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x65, 0x72, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x2e, 0x44, 0x65, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x50,
0x75, 0x73, 0x68, 0x2e, 0x44, 0x65, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x73, 0x68, 0x54, 0x75, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x42, 0x34, 0x5a, 0x32,
0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x27, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4f, 0x70, 0x65, 0x6e, 0x49,
0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x2e, 0x44, 0x65, 0x6c, 0x55, 0x4d, 0x53, 0x44, 0x4b, 0x2f, 0x4f, 0x70, 0x65, 0x6e, 0x2d, 0x49, 0x4d, 0x2d, 0x53, 0x65, 0x72,
0x73, 0x65, 0x72, 0x50, 0x75, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x75,
0x42, 0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4f, 0x73, 0x68, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x44, 0x4b, 0x2f, 0x4f, 0x70, 0x65, 0x6e, 0x2d, 0x49, 0x4d,
0x2d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x2f, 0x70, 0x75, 0x73, 0x68, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (

View File

@ -5,7 +5,7 @@ option go_package = "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/push";
message PushMsgReq { message PushMsgReq {
sdkws.MsgData msgData = 1; sdkws.MsgData msgData = 1;
string sourceID = 2; string conversationID = 2;
} }
message PushMsgResp{ message PushMsgResp{

File diff suppressed because it is too large Load Diff

View File

@ -123,28 +123,30 @@ message FriendRequest{
///////////////////////////////////base end///////////////////////////////////// ///////////////////////////////////base end/////////////////////////////////////
message PullMessageBySeqsReq{ message PullMessageBySeqsReq{
string userID = 1; string userID = 1;
repeated int64 seqs = 3; repeated SeqRange seqRanges = 2;
map <string, seqs>groupSeqs = 4;
} }
message seqs { message SeqRange {
repeated int64 seqs = 1; string conversationID = 1;
int64 begin = 2;
int64 end = 3;
bool isNotification = 4;
int64 num = 5;
} }
message MsgDataList { message PullMsgs {
repeated MsgData msgDataList = 1; repeated MsgData Msgs = 1;
bool isNotification = 2;
string conversationID = 3;
} }
message PullMessageBySeqsResp { message PullMessageBySeqsResp {
repeated MsgData list = 1; repeated PullMsgs msgs = 1;
map<string, MsgDataList> groupMsgDataList = 2;
} }
message GetMaxAndMinSeqReq { message GetMaxAndMinSeqReq {
repeated string groupIDs = 1; repeated string conversationIDs = 1;
string userID = 2; string userID = 2;
} }
message MaxAndMinSeq{ message MaxAndMinSeq{
@ -152,9 +154,7 @@ message MaxAndMinSeq{
int64 minSeq = 2; int64 minSeq = 2;
} }
message GetMaxAndMinSeqResp { message GetMaxAndMinSeqResp {
int64 maxSeq = 1; map<string, MaxAndMinSeq> MaxAndMinSeqs = 1;
int64 minSeq = 2;
map<string, MaxAndMinSeq> groupMaxAndMinSeq = 5;
} }
message UserSendMsgResp { message UserSendMsgResp {
@ -183,10 +183,11 @@ message MsgData {
map<string, bool> options = 18; map<string, bool> options = 18;
OfflinePushInfo offlinePushInfo = 19; OfflinePushInfo offlinePushInfo = 19;
repeated string atUserIDList = 20; repeated string atUserIDList = 20;
bytes msgDataList = 21; string attachedInfo = 21;
string attachedInfo = 22; string ex = 22;
string ex = 23; }
message PushMessages{
repeated MsgData msgs = 1;
} }
message OfflinePushInfo{ message OfflinePushInfo{
string title = 1; string title = 1;
@ -412,6 +413,10 @@ message ConversationSetPrivateTips{
} }
////////////////////message/////////////////////// ////////////////////message///////////////////////
message seqs {
repeated int64 seqs = 1;
}
message DeleteMessageTips{ message DeleteMessageTips{
string opUserID = 1; string opUserID = 1;
string userID = 2; string userID = 2;
@ -598,7 +603,7 @@ message SetAppBackgroundStatusResp {
} }
message ExtendMsgSet { message ExtendMsgSet {
string sourceID = 1; string conversationID = 1;
int32 sessionType = 2; int32 sessionType = 2;
map <string, ExtendMsg>extendMsgs = 3; map <string, ExtendMsg>extendMsgs = 3;
int64 MaxMsgUpdateTime = 4; int64 MaxMsgUpdateTime = 4;
@ -621,7 +626,7 @@ message KeyValue {
} }
message ReactionMessageModifierNotification { message ReactionMessageModifierNotification {
string sourceID = 1; string conversationID = 1;
string opUserID = 2; string opUserID = 2;
int32 sessionType = 3; int32 sessionType = 3;
map <string, KeyValue>successReactionExtensions = 4; map <string, KeyValue>successReactionExtensions = 4;
@ -632,7 +637,7 @@ message ReactionMessageModifierNotification {
} }
message ReactionMessageDeleteNotification { message ReactionMessageDeleteNotification {
string sourceID = 1; string conversationID = 1;
string opUserID = 2; string opUserID = 2;
int32 sessionType = 3; int32 sessionType = 3;
map <string, KeyValue>successReactionExtensions = 4; map <string, KeyValue>successReactionExtensions = 4;

View File

@ -41,11 +41,29 @@ func (c *ConversationClient) GetSingleConversationRecvMsgOpt(ctx context.Context
return conversation.GetConversation().RecvMsgOpt, err return conversation.GetConversation().RecvMsgOpt, err
} }
func (c *ConversationClient) CreateConversationsWithoutNotification(ctx context.Context, conversations []*pbConversation.Conversation) error { func (c *ConversationClient) SingleChatFirstCreateConversation(ctx context.Context, recvID, sendID string) error {
cc, err := c.getConn() cc, err := c.getConn()
if err != nil { if err != nil {
return err return err
} }
_, err = conversation.NewConversationClient(cc).CreateConversationsWithoutNotification(ctx, &pbConversation.CreateConversationsWithoutNotificationReq{Conversations: conversations}) _, err = conversation.NewConversationClient(cc).CreateSingleChatConversations(ctx, &pbConversation.CreateSingleChatConversationsReq{RecvID: recvID, SendID: sendID})
return err
}
func (c *ConversationClient) GroupChatFirstCreateConversation(ctx context.Context, groupID string, userIDs []string) error {
cc, err := c.getConn()
if err != nil {
return err
}
_, err = conversation.NewConversationClient(cc).CreateGroupChatConversations(ctx, &pbConversation.CreateGroupChatConversationsReq{UserIDs: userIDs, GroupID: groupID})
return err
}
func (c *ConversationClient) DelGroupChatConversations(ctx context.Context, ownerUserIDs []string, groupID string, maxSeq int64) error {
cc, err := c.getConn()
if err != nil {
return err
}
_, err = conversation.NewConversationClient(cc).DelGroupChatConversations(ctx, &pbConversation.DelGroupChatConversationsReq{OwnerUserID: ownerUserIDs, GroupID: groupID, MaxSeq: maxSeq})
return err return err
} }

View File

@ -23,10 +23,10 @@ func NewExtendMsgNotificationSender(client discoveryregistry.SvcDiscoveryRegistr
return &ExtendMsgNotificationSender{rpcclient.NewMsgClient(client)} return &ExtendMsgNotificationSender{rpcclient.NewMsgClient(client)}
} }
func (e *ExtendMsgNotificationSender) ExtendMessageUpdatedNotification(ctx context.Context, sendID string, sourceID string, sessionType int32, func (e *ExtendMsgNotificationSender) ExtendMessageUpdatedNotification(ctx context.Context, sendID string, conversationID string, sessionType int32,
req *msg.SetMessageReactionExtensionsReq, resp *msg.SetMessageReactionExtensionsResp, isHistory bool, isReactionFromCache bool) { req *msg.SetMessageReactionExtensionsReq, resp *msg.SetMessageReactionExtensionsResp, isHistory bool, isReactionFromCache bool) {
var content sdkws.ReactionMessageModifierNotification var content sdkws.ReactionMessageModifierNotification
content.SourceID = req.SourceID content.ConversationID = req.ConversationID
content.OpUserID = mcontext.GetOpUserID(ctx) content.OpUserID = mcontext.GetOpUserID(ctx)
content.SessionType = req.SessionType content.SessionType = req.SessionType
keyMap := make(map[string]*sdkws.KeyValue) keyMap := make(map[string]*sdkws.KeyValue)
@ -43,12 +43,12 @@ func (e *ExtendMsgNotificationSender) ExtendMessageUpdatedNotification(ctx conte
content.IsReact = resp.IsReact content.IsReact = resp.IsReact
content.IsExternalExtensions = req.IsExternalExtensions content.IsExternalExtensions = req.IsExternalExtensions
content.MsgFirstModifyTime = resp.MsgFirstModifyTime content.MsgFirstModifyTime = resp.MsgFirstModifyTime
e.messageReactionSender(ctx, sendID, sourceID, sessionType, constant.ReactionMessageModifier, &content, isHistory, isReactionFromCache) e.messageReactionSender(ctx, sendID, conversationID, sessionType, constant.ReactionMessageModifier, &content, isHistory, isReactionFromCache)
} }
func (e *ExtendMsgNotificationSender) ExtendMessageDeleteNotification(ctx context.Context, sendID string, sourceID string, sessionType int32, func (e *ExtendMsgNotificationSender) ExtendMessageDeleteNotification(ctx context.Context, sendID string, conversationID string, sessionType int32,
req *msg.DeleteMessagesReactionExtensionsReq, resp *msg.DeleteMessagesReactionExtensionsResp, isHistory bool, isReactionFromCache bool) { req *msg.DeleteMessagesReactionExtensionsReq, resp *msg.DeleteMessagesReactionExtensionsResp, isHistory bool, isReactionFromCache bool) {
var content sdkws.ReactionMessageDeleteNotification var content sdkws.ReactionMessageDeleteNotification
content.SourceID = req.SourceID content.ConversationID = req.ConversationID
content.OpUserID = req.OpUserID content.OpUserID = req.OpUserID
content.SessionType = req.SessionType content.SessionType = req.SessionType
keyMap := make(map[string]*sdkws.KeyValue) keyMap := make(map[string]*sdkws.KeyValue)
@ -63,9 +63,9 @@ func (e *ExtendMsgNotificationSender) ExtendMessageDeleteNotification(ctx contex
content.SuccessReactionExtensions = keyMap content.SuccessReactionExtensions = keyMap
content.ClientMsgID = req.ClientMsgID content.ClientMsgID = req.ClientMsgID
content.MsgFirstModifyTime = req.MsgFirstModifyTime content.MsgFirstModifyTime = req.MsgFirstModifyTime
e.messageReactionSender(ctx, sendID, sourceID, sessionType, constant.ReactionMessageDeleter, &content, isHistory, isReactionFromCache) e.messageReactionSender(ctx, sendID, conversationID, sessionType, constant.ReactionMessageDeleter, &content, isHistory, isReactionFromCache)
} }
func (e *ExtendMsgNotificationSender) messageReactionSender(ctx context.Context, sendID string, sourceID string, sessionType, contentType int32, m proto.Message, isHistory bool, isReactionFromCache bool) error { func (e *ExtendMsgNotificationSender) messageReactionSender(ctx context.Context, sendID string, conversationID string, sessionType, contentType int32, m proto.Message, isHistory bool, isReactionFromCache bool) error {
options := make(map[string]bool, 5) options := make(map[string]bool, 5)
utils.SetSwitchFromOptions(options, constant.IsOfflinePush, false) utils.SetSwitchFromOptions(options, constant.IsOfflinePush, false)
utils.SetSwitchFromOptions(options, constant.IsConversationUpdate, false) utils.SetSwitchFromOptions(options, constant.IsConversationUpdate, false)
@ -94,9 +94,9 @@ func (e *ExtendMsgNotificationSender) messageReactionSender(ctx context.Context,
} }
switch sessionType { switch sessionType {
case constant.SingleChatType, constant.NotificationChatType: case constant.SingleChatType, constant.NotificationChatType:
pbData.MsgData.RecvID = sourceID pbData.MsgData.RecvID = conversationID
case constant.GroupChatType, constant.SuperGroupChatType: case constant.GroupChatType, constant.SuperGroupChatType:
pbData.MsgData.GroupID = sourceID pbData.MsgData.GroupID = conversationID
} }
_, err = e.SendMsg(ctx, &pbData) _, err = e.SendMsg(ctx, &pbData)
return err return err

View File

@ -8,9 +8,12 @@ package utils
import ( import (
"encoding/json" "encoding/json"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant"
"math/rand" "math/rand"
"sort"
"strconv" "strconv"
"strings"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant"
) )
func IntToString(i int) string { func IntToString(i int) string {
@ -90,16 +93,21 @@ func GetMsgID(sendID string) string {
t := int64ToString(GetCurrentTimestampByNano()) t := int64ToString(GetCurrentTimestampByNano())
return Md5(t + sendID + int64ToString(rand.Int63n(GetCurrentTimestampByNano()))) return Md5(t + sendID + int64ToString(rand.Int63n(GetCurrentTimestampByNano())))
} }
func GetConversationIDBySessionType(sourceID string, sessionType int) string {
func GetConversationIDBySessionType(sessionType int, ids ...string) string {
sort.Strings(ids)
if len(ids) > 2 || len(ids) < 1 {
return ""
}
switch sessionType { switch sessionType {
case constant.SingleChatType: case constant.SingleChatType:
return "single_" + sourceID return "single_" + strings.Join(ids, "_")
case constant.GroupChatType: case constant.GroupChatType:
return "group_" + sourceID return "group_" + ids[0]
case constant.SuperGroupChatType: case constant.SuperGroupChatType:
return "super_group_" + sourceID return "super_group_" + ids[0]
case constant.NotificationChatType: case constant.NotificationChatType:
return "notification_" + sourceID return "notification_" + ids[0]
} }
return "" return ""
} }

View File

@ -1,17 +1,13 @@
package utils package utils
import ( import (
"bytes"
"encoding/json"
"hash/crc32" "hash/crc32"
"math/rand" "math/rand"
"reflect"
"runtime" "runtime"
"strconv" "strconv"
"strings" "strings"
"time" "time"
"github.com/gogo/protobuf/jsonpb"
"github.com/jinzhu/copier" "github.com/jinzhu/copier"
"github.com/pkg/errors" "github.com/pkg/errors"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
@ -155,99 +151,18 @@ func OperationIDGenerator() string {
return strconv.FormatInt(time.Now().UnixNano()+int64(rand.Uint32()), 10) return strconv.FormatInt(time.Now().UnixNano()+int64(rand.Uint32()), 10)
} }
func RemoveRepeatedStringInList(slc []string) []string {
var result []string
tempMap := map[string]byte{}
for _, e := range slc {
l := len(tempMap)
tempMap[e] = 0
if len(tempMap) != l {
result = append(result, e)
}
}
return result
}
func Pb2String(pb proto.Message) (string, error) { func Pb2String(pb proto.Message) (string, error) {
marshaler := jsonpb.Marshaler{ s, err := proto.Marshal(pb)
OrigName: true, if err != nil {
EnumsAsInts: false, return "", err
EmitDefaults: false,
} }
return marshaler.MarshalToString(pb) return string(s), nil
} }
func String2Pb(s string, pb proto.Message) error { func String2Pb(s string, pb proto.Message) error {
return proto.Unmarshal([]byte(s), pb) return proto.Unmarshal([]byte(s), pb)
} }
func Map2Pb(m map[string]string) (pb proto.Message, err error) {
b, err := json.Marshal(m)
if err != nil {
return nil, err
}
err = proto.Unmarshal(b, pb)
if err != nil {
return nil, err
}
return pb, nil
}
func Pb2Map(pb proto.Message) (map[string]interface{}, error) {
_buffer := bytes.Buffer{}
jsonbMarshaller := &jsonpb.Marshaler{
OrigName: true,
EnumsAsInts: true,
EmitDefaults: false,
}
_ = jsonbMarshaller.Marshal(&_buffer, pb)
jsonCnt := _buffer.Bytes()
var out map[string]interface{}
err := json.Unmarshal(jsonCnt, &out)
return out, err
}
func JsonDataList(resp interface{}) []map[string]interface{} {
var list []proto.Message
if reflect.TypeOf(resp).Kind() == reflect.Slice {
s := reflect.ValueOf(resp)
for i := 0; i < s.Len(); i++ {
ele := s.Index(i)
list = append(list, ele.Interface().(proto.Message))
}
}
result := make([]map[string]interface{}, 0)
for _, v := range list {
m := ProtoToMap(v, false)
result = append(result, m)
}
return result
}
func JsonDataOne(pb proto.Message) map[string]interface{} {
return ProtoToMap(pb, false)
}
func ProtoToMap(pb proto.Message, idFix bool) map[string]interface{} {
marshaler := jsonpb.Marshaler{
OrigName: true,
EnumsAsInts: false,
EmitDefaults: false,
}
s, _ := marshaler.MarshalToString(pb)
out := make(map[string]interface{})
json.Unmarshal([]byte(s), &out)
if idFix {
if _, ok := out["id"]; ok {
out["_id"] = out["id"]
delete(out, "id")
}
}
return out
}
func GetHashCode(s string) uint32 { func GetHashCode(s string) uint32 {
return crc32.ChecksumIEEE([]byte(s)) return crc32.ChecksumIEEE([]byte(s))
} }