mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
Error code standardization
This commit is contained in:
parent
adc84b68e7
commit
452d9840bf
289
internal/common/notification/c.go
Normal file
289
internal/common/notification/c.go
Normal file
@ -0,0 +1,289 @@
|
||||
package notification
|
||||
|
||||
import (
|
||||
"Open_IM/pkg/common/constant"
|
||||
pbChat "Open_IM/pkg/proto/msg"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type NotificationMsg struct {
|
||||
SendID string
|
||||
RecvID string
|
||||
Content []byte // sdkws.TipsComm
|
||||
MsgFrom int32
|
||||
ContentType int32
|
||||
SessionType int32
|
||||
OperationID string
|
||||
SenderNickname string
|
||||
SenderFaceURL string
|
||||
}
|
||||
|
||||
func Notification(n *NotificationMsg) {
|
||||
var req pbChat.SendMsgReq
|
||||
var msg sdkws.MsgData
|
||||
var offlineInfo sdkws.OfflinePushInfo
|
||||
var title, desc, ex string
|
||||
var pushSwitch, unReadCount bool
|
||||
var reliabilityLevel int
|
||||
req.OperationID = n.OperationID
|
||||
msg.SendID = n.SendID
|
||||
msg.RecvID = n.RecvID
|
||||
msg.Content = n.Content
|
||||
msg.MsgFrom = n.MsgFrom
|
||||
msg.ContentType = n.ContentType
|
||||
msg.SessionType = n.SessionType
|
||||
msg.CreateTime = utils.GetCurrentTimestampByMill()
|
||||
msg.ClientMsgID = utils.GetMsgID(n.SendID)
|
||||
msg.Options = make(map[string]bool, 7)
|
||||
msg.SenderNickname = n.SenderNickname
|
||||
msg.SenderFaceURL = n.SenderFaceURL
|
||||
switch n.SessionType {
|
||||
case constant.GroupChatType, constant.SuperGroupChatType:
|
||||
msg.RecvID = ""
|
||||
msg.GroupID = n.RecvID
|
||||
}
|
||||
offlineInfo.IOSBadgeCount = config.Config.IOSPush.BadgeCount
|
||||
offlineInfo.IOSPushSound = config.Config.IOSPush.PushSound
|
||||
switch msg.ContentType {
|
||||
case constant.GroupCreatedNotification:
|
||||
pushSwitch = config.Config.Notification.GroupCreated.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.GroupCreated.OfflinePush.Title
|
||||
desc = config.Config.Notification.GroupCreated.OfflinePush.Desc
|
||||
ex = config.Config.Notification.GroupCreated.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.GroupCreated.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.GroupCreated.Conversation.UnreadCount
|
||||
case constant.GroupInfoSetNotification:
|
||||
pushSwitch = config.Config.Notification.GroupInfoSet.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.GroupInfoSet.OfflinePush.Title
|
||||
desc = config.Config.Notification.GroupInfoSet.OfflinePush.Desc
|
||||
ex = config.Config.Notification.GroupInfoSet.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.GroupInfoSet.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.GroupInfoSet.Conversation.UnreadCount
|
||||
case constant.JoinGroupApplicationNotification:
|
||||
pushSwitch = config.Config.Notification.JoinGroupApplication.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.JoinGroupApplication.OfflinePush.Title
|
||||
desc = config.Config.Notification.JoinGroupApplication.OfflinePush.Desc
|
||||
ex = config.Config.Notification.JoinGroupApplication.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.JoinGroupApplication.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.JoinGroupApplication.Conversation.UnreadCount
|
||||
case constant.MemberQuitNotification:
|
||||
pushSwitch = config.Config.Notification.MemberQuit.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.MemberQuit.OfflinePush.Title
|
||||
desc = config.Config.Notification.MemberQuit.OfflinePush.Desc
|
||||
ex = config.Config.Notification.MemberQuit.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.MemberQuit.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.MemberQuit.Conversation.UnreadCount
|
||||
case constant.GroupApplicationAcceptedNotification:
|
||||
pushSwitch = config.Config.Notification.GroupApplicationAccepted.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.GroupApplicationAccepted.OfflinePush.Title
|
||||
desc = config.Config.Notification.GroupApplicationAccepted.OfflinePush.Desc
|
||||
ex = config.Config.Notification.GroupApplicationAccepted.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.GroupApplicationAccepted.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.GroupApplicationAccepted.Conversation.UnreadCount
|
||||
case constant.GroupApplicationRejectedNotification:
|
||||
pushSwitch = config.Config.Notification.GroupApplicationRejected.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.GroupApplicationRejected.OfflinePush.Title
|
||||
desc = config.Config.Notification.GroupApplicationRejected.OfflinePush.Desc
|
||||
ex = config.Config.Notification.GroupApplicationRejected.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.GroupApplicationRejected.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.GroupApplicationRejected.Conversation.UnreadCount
|
||||
case constant.GroupOwnerTransferredNotification:
|
||||
pushSwitch = config.Config.Notification.GroupOwnerTransferred.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.GroupOwnerTransferred.OfflinePush.Title
|
||||
desc = config.Config.Notification.GroupOwnerTransferred.OfflinePush.Desc
|
||||
ex = config.Config.Notification.GroupOwnerTransferred.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.GroupOwnerTransferred.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.GroupOwnerTransferred.Conversation.UnreadCount
|
||||
case constant.MemberKickedNotification:
|
||||
pushSwitch = config.Config.Notification.MemberKicked.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.MemberKicked.OfflinePush.Title
|
||||
desc = config.Config.Notification.MemberKicked.OfflinePush.Desc
|
||||
ex = config.Config.Notification.MemberKicked.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.MemberKicked.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.MemberKicked.Conversation.UnreadCount
|
||||
case constant.MemberInvitedNotification:
|
||||
pushSwitch = config.Config.Notification.MemberInvited.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.MemberInvited.OfflinePush.Title
|
||||
desc = config.Config.Notification.MemberInvited.OfflinePush.Desc
|
||||
ex = config.Config.Notification.MemberInvited.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.MemberInvited.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.MemberInvited.Conversation.UnreadCount
|
||||
case constant.MemberEnterNotification:
|
||||
pushSwitch = config.Config.Notification.MemberEnter.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.MemberEnter.OfflinePush.Title
|
||||
desc = config.Config.Notification.MemberEnter.OfflinePush.Desc
|
||||
ex = config.Config.Notification.MemberEnter.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.MemberEnter.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.MemberEnter.Conversation.UnreadCount
|
||||
case constant.UserInfoUpdatedNotification:
|
||||
pushSwitch = config.Config.Notification.UserInfoUpdated.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.UserInfoUpdated.OfflinePush.Title
|
||||
desc = config.Config.Notification.UserInfoUpdated.OfflinePush.Desc
|
||||
ex = config.Config.Notification.UserInfoUpdated.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.UserInfoUpdated.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.UserInfoUpdated.Conversation.UnreadCount
|
||||
case constant.FriendApplicationNotification:
|
||||
pushSwitch = config.Config.Notification.FriendApplication.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.FriendApplication.OfflinePush.Title
|
||||
desc = config.Config.Notification.FriendApplication.OfflinePush.Desc
|
||||
ex = config.Config.Notification.FriendApplication.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.FriendApplication.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.FriendApplication.Conversation.UnreadCount
|
||||
case constant.FriendApplicationApprovedNotification:
|
||||
pushSwitch = config.Config.Notification.FriendApplicationApproved.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.FriendApplicationApproved.OfflinePush.Title
|
||||
desc = config.Config.Notification.FriendApplicationApproved.OfflinePush.Desc
|
||||
ex = config.Config.Notification.FriendApplicationApproved.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.FriendApplicationApproved.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.FriendApplicationApproved.Conversation.UnreadCount
|
||||
case constant.FriendApplicationRejectedNotification:
|
||||
pushSwitch = config.Config.Notification.FriendApplicationRejected.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.FriendApplicationRejected.OfflinePush.Title
|
||||
desc = config.Config.Notification.FriendApplicationRejected.OfflinePush.Desc
|
||||
ex = config.Config.Notification.FriendApplicationRejected.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.FriendApplicationRejected.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.FriendApplicationRejected.Conversation.UnreadCount
|
||||
case constant.FriendAddedNotification:
|
||||
pushSwitch = config.Config.Notification.FriendAdded.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.FriendAdded.OfflinePush.Title
|
||||
desc = config.Config.Notification.FriendAdded.OfflinePush.Desc
|
||||
ex = config.Config.Notification.FriendAdded.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.FriendAdded.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.FriendAdded.Conversation.UnreadCount
|
||||
case constant.FriendDeletedNotification:
|
||||
pushSwitch = config.Config.Notification.FriendDeleted.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.FriendDeleted.OfflinePush.Title
|
||||
desc = config.Config.Notification.FriendDeleted.OfflinePush.Desc
|
||||
ex = config.Config.Notification.FriendDeleted.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.FriendDeleted.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.FriendDeleted.Conversation.UnreadCount
|
||||
case constant.FriendRemarkSetNotification:
|
||||
pushSwitch = config.Config.Notification.FriendRemarkSet.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.FriendRemarkSet.OfflinePush.Title
|
||||
desc = config.Config.Notification.FriendRemarkSet.OfflinePush.Desc
|
||||
ex = config.Config.Notification.FriendRemarkSet.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.FriendRemarkSet.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.FriendRemarkSet.Conversation.UnreadCount
|
||||
case constant.BlackAddedNotification:
|
||||
pushSwitch = config.Config.Notification.BlackAdded.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.BlackAdded.OfflinePush.Title
|
||||
desc = config.Config.Notification.BlackAdded.OfflinePush.Desc
|
||||
ex = config.Config.Notification.BlackAdded.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.BlackAdded.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.BlackAdded.Conversation.UnreadCount
|
||||
case constant.BlackDeletedNotification:
|
||||
pushSwitch = config.Config.Notification.BlackDeleted.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.BlackDeleted.OfflinePush.Title
|
||||
desc = config.Config.Notification.BlackDeleted.OfflinePush.Desc
|
||||
ex = config.Config.Notification.BlackDeleted.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.BlackDeleted.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.BlackDeleted.Conversation.UnreadCount
|
||||
case constant.ConversationOptChangeNotification:
|
||||
pushSwitch = config.Config.Notification.ConversationOptUpdate.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.ConversationOptUpdate.OfflinePush.Title
|
||||
desc = config.Config.Notification.ConversationOptUpdate.OfflinePush.Desc
|
||||
ex = config.Config.Notification.ConversationOptUpdate.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.ConversationOptUpdate.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.ConversationOptUpdate.Conversation.UnreadCount
|
||||
|
||||
case constant.GroupDismissedNotification:
|
||||
pushSwitch = config.Config.Notification.GroupDismissed.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.GroupDismissed.OfflinePush.Title
|
||||
desc = config.Config.Notification.GroupDismissed.OfflinePush.Desc
|
||||
ex = config.Config.Notification.GroupDismissed.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.GroupDismissed.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.GroupDismissed.Conversation.UnreadCount
|
||||
|
||||
case constant.GroupMutedNotification:
|
||||
pushSwitch = config.Config.Notification.GroupMuted.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.GroupMuted.OfflinePush.Title
|
||||
desc = config.Config.Notification.GroupMuted.OfflinePush.Desc
|
||||
ex = config.Config.Notification.GroupMuted.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.GroupMuted.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.GroupMuted.Conversation.UnreadCount
|
||||
|
||||
case constant.GroupCancelMutedNotification:
|
||||
pushSwitch = config.Config.Notification.GroupCancelMuted.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.GroupCancelMuted.OfflinePush.Title
|
||||
desc = config.Config.Notification.GroupCancelMuted.OfflinePush.Desc
|
||||
ex = config.Config.Notification.GroupCancelMuted.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.GroupCancelMuted.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.GroupCancelMuted.Conversation.UnreadCount
|
||||
|
||||
case constant.GroupMemberMutedNotification:
|
||||
pushSwitch = config.Config.Notification.GroupMemberMuted.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.GroupMemberMuted.OfflinePush.Title
|
||||
desc = config.Config.Notification.GroupMemberMuted.OfflinePush.Desc
|
||||
ex = config.Config.Notification.GroupMemberMuted.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.GroupMemberMuted.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.GroupMemberMuted.Conversation.UnreadCount
|
||||
|
||||
case constant.GroupMemberCancelMutedNotification:
|
||||
pushSwitch = config.Config.Notification.GroupMemberCancelMuted.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.GroupMemberCancelMuted.OfflinePush.Title
|
||||
desc = config.Config.Notification.GroupMemberCancelMuted.OfflinePush.Desc
|
||||
ex = config.Config.Notification.GroupMemberCancelMuted.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.GroupMemberCancelMuted.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.GroupMemberCancelMuted.Conversation.UnreadCount
|
||||
|
||||
case constant.GroupMemberInfoSetNotification:
|
||||
pushSwitch = config.Config.Notification.GroupMemberInfoSet.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.GroupMemberInfoSet.OfflinePush.Title
|
||||
desc = config.Config.Notification.GroupMemberInfoSet.OfflinePush.Desc
|
||||
ex = config.Config.Notification.GroupMemberInfoSet.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.GroupMemberInfoSet.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.GroupMemberInfoSet.Conversation.UnreadCount
|
||||
|
||||
case constant.ConversationPrivateChatNotification:
|
||||
pushSwitch = config.Config.Notification.ConversationSetPrivate.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.ConversationSetPrivate.OfflinePush.Title
|
||||
desc = config.Config.Notification.ConversationSetPrivate.OfflinePush.Desc
|
||||
ex = config.Config.Notification.ConversationSetPrivate.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.ConversationSetPrivate.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.ConversationSetPrivate.Conversation.UnreadCount
|
||||
case constant.FriendInfoUpdatedNotification:
|
||||
pushSwitch = config.Config.Notification.FriendInfoUpdated.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.FriendInfoUpdated.OfflinePush.Title
|
||||
desc = config.Config.Notification.FriendInfoUpdated.OfflinePush.Desc
|
||||
ex = config.Config.Notification.FriendInfoUpdated.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.FriendInfoUpdated.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.FriendInfoUpdated.Conversation.UnreadCount
|
||||
case constant.DeleteMessageNotification:
|
||||
reliabilityLevel = constant.ReliableNotificationNoMsg
|
||||
case constant.ConversationUnreadNotification, constant.SuperGroupUpdateNotification:
|
||||
reliabilityLevel = constant.UnreliableNotification
|
||||
}
|
||||
switch reliabilityLevel {
|
||||
case constant.UnreliableNotification:
|
||||
utils.SetSwitchFromOptions(msg.Options, constant.IsHistory, false)
|
||||
utils.SetSwitchFromOptions(msg.Options, constant.IsPersistent, false)
|
||||
utils.SetSwitchFromOptions(msg.Options, constant.IsConversationUpdate, false)
|
||||
utils.SetSwitchFromOptions(msg.Options, constant.IsSenderConversationUpdate, false)
|
||||
case constant.ReliableNotificationNoMsg:
|
||||
utils.SetSwitchFromOptions(msg.Options, constant.IsConversationUpdate, false)
|
||||
utils.SetSwitchFromOptions(msg.Options, constant.IsSenderConversationUpdate, false)
|
||||
case constant.ReliableNotificationMsg:
|
||||
|
||||
}
|
||||
utils.SetSwitchFromOptions(msg.Options, constant.IsUnreadCount, unReadCount)
|
||||
utils.SetSwitchFromOptions(msg.Options, constant.IsOfflinePush, pushSwitch)
|
||||
offlineInfo.Title = title
|
||||
offlineInfo.Desc = desc
|
||||
offlineInfo.Ex = ex
|
||||
msg.OfflinePushInfo = &offlineInfo
|
||||
req.MsgData = &msg
|
||||
etcdConn := rpc.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMsgName, req.OperationID)
|
||||
if etcdConn == nil {
|
||||
errMsg := req.OperationID + "getcdv3.GetDefaultConn == nil"
|
||||
log.NewError(req.OperationID, errMsg)
|
||||
return
|
||||
}
|
||||
|
||||
client := pbChat.NewMsgClient(etcdConn)
|
||||
reply, err := client.SendMsg(context.Background(), &req)
|
||||
if err != nil {
|
||||
log.NewError(req.OperationID, "SendMsg rpc failed, ", req.String(), err.Error())
|
||||
} else if reply.ErrCode != 0 {
|
||||
log.NewError(req.OperationID, "SendMsg rpc failed, ", req.String(), reply.ErrCode, reply.ErrMsg)
|
||||
}
|
||||
}
|
@ -1,100 +0,0 @@
|
||||
package notification
|
||||
|
||||
import (
|
||||
"Open_IM/pkg/common/config"
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/log"
|
||||
"Open_IM/pkg/proto/msg"
|
||||
sdkws "Open_IM/pkg/proto/sdkws"
|
||||
"Open_IM/pkg/utils"
|
||||
"context"
|
||||
)
|
||||
|
||||
func ExtendMessageUpdatedNotification(operationID, sendID string, sourceID string, sessionType int32,
|
||||
req *msg.SetMessageReactionExtensionsReq, resp *msg.SetMessageReactionExtensionsResp, isHistory bool, isReactionFromCache bool) {
|
||||
var m apistruct.ReactionMessageModifierNotification
|
||||
m.SourceID = req.SourceID
|
||||
m.OpUserID = req.OpUserID
|
||||
m.SessionType = req.SessionType
|
||||
keyMap := make(map[string]*sdkws.KeyValue)
|
||||
for _, valueResp := range resp.Result {
|
||||
if valueResp.ErrCode == 0 {
|
||||
keyMap[valueResp.KeyValue.TypeKey] = valueResp.KeyValue
|
||||
}
|
||||
}
|
||||
if len(keyMap) == 0 {
|
||||
log.NewWarn(operationID, "all key set failed can not send notification", *req)
|
||||
return
|
||||
}
|
||||
m.SuccessReactionExtensionList = keyMap
|
||||
m.ClientMsgID = req.ClientMsgID
|
||||
m.IsReact = resp.IsReact
|
||||
m.IsExternalExtensions = req.IsExternalExtensions
|
||||
m.MsgFirstModifyTime = resp.MsgFirstModifyTime
|
||||
messageReactionSender(operationID, sendID, sourceID, sessionType, constant.ReactionMessageModifier, utils.StructToJsonString(m), isHistory, isReactionFromCache)
|
||||
}
|
||||
func ExtendMessageDeleteNotification(operationID, sendID string, sourceID string, sessionType int32,
|
||||
req *msg.DeleteMessageListReactionExtensionsReq, resp *msg.DeleteMessageListReactionExtensionsResp, isHistory bool, isReactionFromCache bool) {
|
||||
var m apistruct.ReactionMessageDeleteNotification
|
||||
m.SourceID = req.SourceID
|
||||
m.OpUserID = req.OpUserID
|
||||
m.SessionType = req.SessionType
|
||||
keyMap := make(map[string]*sdkws.KeyValue)
|
||||
for _, valueResp := range resp.Result {
|
||||
if valueResp.ErrCode == 0 {
|
||||
keyMap[valueResp.KeyValue.TypeKey] = valueResp.KeyValue
|
||||
}
|
||||
}
|
||||
if len(keyMap) == 0 {
|
||||
log.NewWarn(operationID, "all key set failed can not send notification", *req)
|
||||
return
|
||||
}
|
||||
m.SuccessReactionExtensionList = keyMap
|
||||
m.ClientMsgID = req.ClientMsgID
|
||||
m.MsgFirstModifyTime = req.MsgFirstModifyTime
|
||||
|
||||
messageReactionSender(operationID, sendID, sourceID, sessionType, constant.ReactionMessageDeleter, utils.StructToJsonString(m), isHistory, isReactionFromCache)
|
||||
}
|
||||
func messageReactionSender(operationID, sendID string, sourceID string, sessionType, contentType int32, content string, isHistory bool, isReactionFromCache bool) {
|
||||
options := make(map[string]bool, 5)
|
||||
utils.SetSwitchFromOptions(options, constant.IsOfflinePush, false)
|
||||
utils.SetSwitchFromOptions(options, constant.IsConversationUpdate, false)
|
||||
utils.SetSwitchFromOptions(options, constant.IsSenderConversationUpdate, false)
|
||||
utils.SetSwitchFromOptions(options, constant.IsUnreadCount, false)
|
||||
utils.SetSwitchFromOptions(options, constant.IsReactionFromCache, isReactionFromCache)
|
||||
if !isHistory {
|
||||
utils.SetSwitchFromOptions(options, constant.IsHistory, false)
|
||||
utils.SetSwitchFromOptions(options, constant.IsPersistent, false)
|
||||
}
|
||||
pbData := msg.SendMsgReq{
|
||||
OperationID: operationID,
|
||||
MsgData: &sdkws.MsgData{
|
||||
SendID: sendID,
|
||||
ClientMsgID: utils.GetMsgID(sendID),
|
||||
SessionType: sessionType,
|
||||
MsgFrom: constant.SysMsgType,
|
||||
ContentType: contentType,
|
||||
Content: []byte(content),
|
||||
// ForceList: params.ForceList,
|
||||
CreateTime: utils.GetCurrentTimestampByMill(),
|
||||
Options: options,
|
||||
},
|
||||
}
|
||||
switch sessionType {
|
||||
case constant.SingleChatType, constant.NotificationChatType:
|
||||
pbData.MsgData.RecvID = sourceID
|
||||
case constant.GroupChatType, constant.SuperGroupChatType:
|
||||
pbData.MsgData.GroupID = sourceID
|
||||
}
|
||||
etcdConn, err := rpc.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImMsgName)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
client := msg.NewMsgClient(etcdConn)
|
||||
reply, err := client.SendMsg(context.Background(), &pbData)
|
||||
if err != nil {
|
||||
log.NewError(operationID, "SendMsg rpc failed, ", pbData.String(), err.Error())
|
||||
} else if reply.ErrCode != 0 {
|
||||
log.NewError(operationID, "SendMsg rpc failed, ", pbData.String(), reply.ErrCode, reply.ErrMsg)
|
||||
}
|
||||
}
|
@ -1,62 +0,0 @@
|
||||
package notification
|
||||
|
||||
import (
|
||||
cbApi "Open_IM/pkg/callback_struct"
|
||||
"Open_IM/pkg/common/config"
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/http"
|
||||
"Open_IM/pkg/common/log"
|
||||
"Open_IM/pkg/proto/msg"
|
||||
"Open_IM/pkg/utils"
|
||||
http2 "net/http"
|
||||
)
|
||||
|
||||
func callbackSetMessageReactionExtensions(setReq *msg.SetMessageReactionExtensionsReq) *cbApi.CallbackBeforeSetMessageReactionExtResp {
|
||||
callbackResp := cbApi.CommonCallbackResp{OperationID: setReq.OperationID}
|
||||
log.NewDebug(setReq.OperationID, utils.GetSelfFuncName(), setReq.String())
|
||||
req := cbApi.CallbackBeforeSetMessageReactionExtReq{
|
||||
OperationID: setReq.OperationID,
|
||||
CallbackCommand: constant.CallbackBeforeSetMessageReactionExtensionCommand,
|
||||
SourceID: setReq.SourceID,
|
||||
OpUserID: setReq.OpUserID,
|
||||
SessionType: setReq.SessionType,
|
||||
ReactionExtensionList: setReq.ReactionExtensionList,
|
||||
ClientMsgID: setReq.ClientMsgID,
|
||||
IsReact: setReq.IsReact,
|
||||
IsExternalExtensions: setReq.IsExternalExtensions,
|
||||
MsgFirstModifyTime: setReq.MsgFirstModifyTime,
|
||||
}
|
||||
resp := &cbApi.CallbackBeforeSetMessageReactionExtResp{CommonCallbackResp: &callbackResp}
|
||||
defer log.NewDebug(setReq.OperationID, utils.GetSelfFuncName(), req, *resp)
|
||||
if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackBeforeSetMessageReactionExtensionCommand,
|
||||
req, resp, config.Config.Callback.CallbackAfterSendGroupMsg.CallbackTimeOut, nil); err != nil {
|
||||
callbackResp.ErrCode = http2.StatusInternalServerError
|
||||
callbackResp.ErrMsg = err.Error()
|
||||
}
|
||||
return resp
|
||||
|
||||
}
|
||||
|
||||
func callbackDeleteMessageReactionExtensions(setReq *msg.DeleteMessageListReactionExtensionsReq) *cbApi.CallbackDeleteMessageReactionExtResp {
|
||||
callbackResp := cbApi.CommonCallbackResp{OperationID: setReq.OperationID}
|
||||
log.NewDebug(setReq.OperationID, utils.GetSelfFuncName(), setReq.String())
|
||||
req := cbApi.CallbackDeleteMessageReactionExtReq{
|
||||
OperationID: setReq.OperationID,
|
||||
CallbackCommand: constant.CallbackBeforeDeleteMessageReactionExtensionsCommand,
|
||||
SourceID: setReq.SourceID,
|
||||
OpUserID: setReq.OpUserID,
|
||||
SessionType: setReq.SessionType,
|
||||
ReactionExtensionList: setReq.ReactionExtensionList,
|
||||
ClientMsgID: setReq.ClientMsgID,
|
||||
IsExternalExtensions: setReq.IsExternalExtensions,
|
||||
MsgFirstModifyTime: setReq.MsgFirstModifyTime,
|
||||
}
|
||||
resp := &cbApi.CallbackDeleteMessageReactionExtResp{CommonCallbackResp: &callbackResp}
|
||||
defer log.NewDebug(setReq.OperationID, utils.GetSelfFuncName(), req, *resp)
|
||||
if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackBeforeDeleteMessageReactionExtensionsCommand,
|
||||
req, resp, config.Config.Callback.CallbackAfterSendGroupMsg.CallbackTimeOut, nil); err != nil {
|
||||
callbackResp.ErrCode = http2.StatusInternalServerError
|
||||
callbackResp.ErrMsg = err.Error()
|
||||
}
|
||||
return resp
|
||||
}
|
@ -1,174 +0,0 @@
|
||||
package notification
|
||||
|
||||
import (
|
||||
"Open_IM/internal/common/check"
|
||||
"Open_IM/internal/rpc/msg"
|
||||
"Open_IM/pkg/common/config"
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/log"
|
||||
"Open_IM/pkg/common/tracelog"
|
||||
pbFriend "Open_IM/pkg/proto/friend"
|
||||
sdkws "Open_IM/pkg/proto/sdkws"
|
||||
"Open_IM/pkg/utils"
|
||||
"context"
|
||||
"github.com/golang/protobuf/jsonpb"
|
||||
"github.com/golang/protobuf/proto"
|
||||
)
|
||||
|
||||
func getFromToUserNickname(fromUserID, toUserID string) (string, string, error) {
|
||||
users, err := check.GetUsersInfo(context.Background(), fromUserID, toUserID)
|
||||
if err != nil {
|
||||
return "", "", nil
|
||||
}
|
||||
if users[0].UserID == fromUserID {
|
||||
return users[0].Nickname, users[1].Nickname, nil
|
||||
}
|
||||
return users[1].Nickname, users[0].Nickname, nil
|
||||
|
||||
}
|
||||
|
||||
func friendNotification(operationID, fromUserID, toUserID string, contentType int32, m proto.Message) {
|
||||
log.Info(operationID, utils.GetSelfFuncName(), "args: ", contentType)
|
||||
var err error
|
||||
var tips sdkws.TipsComm
|
||||
tips.Detail, err = proto.Marshal(m)
|
||||
if err != nil {
|
||||
log.Error(operationID, "Marshal failed ", err.Error(), m.String())
|
||||
return
|
||||
}
|
||||
|
||||
marshaler := jsonpb.Marshaler{
|
||||
OrigName: true,
|
||||
EnumsAsInts: false,
|
||||
EmitDefaults: false,
|
||||
}
|
||||
|
||||
tips.JsonDetail, _ = marshaler.MarshalToString(m)
|
||||
|
||||
fromUserNickname, toUserNickname, err := getFromToUserNickname(fromUserID, toUserID)
|
||||
if err != nil {
|
||||
log.Error(operationID, "getFromToUserNickname failed ", err.Error(), fromUserID, toUserID)
|
||||
return
|
||||
}
|
||||
cn := config.Config.Notification
|
||||
switch contentType {
|
||||
case constant.FriendApplicationNotification:
|
||||
tips.DefaultTips = fromUserNickname + cn.FriendApplication.DefaultTips.Tips
|
||||
case constant.FriendApplicationApprovedNotification:
|
||||
tips.DefaultTips = fromUserNickname + cn.FriendApplicationApproved.DefaultTips.Tips
|
||||
case constant.FriendApplicationRejectedNotification:
|
||||
tips.DefaultTips = fromUserNickname + cn.FriendApplicationRejected.DefaultTips.Tips
|
||||
case constant.FriendAddedNotification:
|
||||
tips.DefaultTips = cn.FriendAdded.DefaultTips.Tips
|
||||
case constant.FriendDeletedNotification:
|
||||
tips.DefaultTips = cn.FriendDeleted.DefaultTips.Tips + toUserNickname
|
||||
case constant.FriendRemarkSetNotification:
|
||||
tips.DefaultTips = fromUserNickname + cn.FriendRemarkSet.DefaultTips.Tips
|
||||
case constant.BlackAddedNotification:
|
||||
tips.DefaultTips = cn.BlackAdded.DefaultTips.Tips
|
||||
case constant.BlackDeletedNotification:
|
||||
tips.DefaultTips = cn.BlackDeleted.DefaultTips.Tips + toUserNickname
|
||||
case constant.UserInfoUpdatedNotification:
|
||||
tips.DefaultTips = cn.UserInfoUpdated.DefaultTips.Tips
|
||||
case constant.FriendInfoUpdatedNotification:
|
||||
tips.DefaultTips = cn.FriendInfoUpdated.DefaultTips.Tips + toUserNickname
|
||||
default:
|
||||
log.Error(operationID, "contentType failed ", contentType)
|
||||
return
|
||||
}
|
||||
|
||||
var n msg.NotificationMsg
|
||||
n.SendID = fromUserID
|
||||
n.RecvID = toUserID
|
||||
n.ContentType = contentType
|
||||
n.SessionType = constant.SingleChatType
|
||||
n.MsgFrom = constant.SysMsgType
|
||||
n.OperationID = operationID
|
||||
n.Content, err = proto.Marshal(&tips)
|
||||
if err != nil {
|
||||
log.Error(operationID, "Marshal failed ", err.Error(), tips.String())
|
||||
return
|
||||
}
|
||||
msg.Notification(&n)
|
||||
}
|
||||
|
||||
func FriendApplicationAddNotification(ctx context.Context, req *pbFriend.AddFriendReq) {
|
||||
FriendApplicationTips := sdkws.FriendApplicationTips{FromToUserID: &sdkws.FromToUserID{}}
|
||||
FriendApplicationTips.FromToUserID.FromUserID = req.FromUserID
|
||||
FriendApplicationTips.FromToUserID.ToUserID = req.ToUserID
|
||||
friendNotification(tracelog.GetOperationID(ctx), req.FromUserID, req.ToUserID, constant.FriendApplicationNotification, &FriendApplicationTips)
|
||||
}
|
||||
|
||||
func FriendApplicationAgreedNotification(ctx context.Context, req *pbFriend.RespondFriendApplyReq) {
|
||||
FriendApplicationApprovedTips := sdkws.FriendApplicationApprovedTips{FromToUserID: &sdkws.FromToUserID{}}
|
||||
FriendApplicationApprovedTips.FromToUserID.FromUserID = req.FromUserID
|
||||
FriendApplicationApprovedTips.FromToUserID.ToUserID = req.ToUserID
|
||||
FriendApplicationApprovedTips.HandleMsg = req.HandleMsg
|
||||
friendNotification(tracelog.GetOperationID(ctx), req.ToUserID, req.FromUserID, constant.FriendApplicationApprovedNotification, &FriendApplicationApprovedTips)
|
||||
}
|
||||
|
||||
func FriendApplicationRefusedNotification(ctx context.Context, req *pbFriend.RespondFriendApplyReq) {
|
||||
FriendApplicationApprovedTips := sdkws.FriendApplicationApprovedTips{FromToUserID: &sdkws.FromToUserID{}}
|
||||
FriendApplicationApprovedTips.FromToUserID.FromUserID = req.FromUserID
|
||||
FriendApplicationApprovedTips.FromToUserID.ToUserID = req.ToUserID
|
||||
FriendApplicationApprovedTips.HandleMsg = req.HandleMsg
|
||||
friendNotification(tracelog.GetOperationID(ctx), req.ToUserID, req.FromUserID, constant.FriendApplicationRejectedNotification, &FriendApplicationApprovedTips)
|
||||
}
|
||||
|
||||
func FriendAddedNotification(ctx context.Context, operationID, opUserID, fromUserID, toUserID string) {
|
||||
friendAddedTips := sdkws.FriendAddedTips{Friend: &sdkws.FriendInfo{}, OpUser: &sdkws.PublicUserInfo{}}
|
||||
user, err := check.GetUsersInfo(context.Background(), opUserID)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
friendAddedTips.OpUser.UserID = user[0].UserID
|
||||
friendAddedTips.OpUser.Ex = user[0].Ex
|
||||
friendAddedTips.OpUser.Nickname = user[0].Nickname
|
||||
friendAddedTips.OpUser.FaceURL = user[0].FaceURL
|
||||
|
||||
friend, err := check.GetFriendsInfo(ctx, fromUserID, toUserID)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
friendAddedTips.Friend = friend
|
||||
friendNotification(operationID, fromUserID, toUserID, constant.FriendAddedNotification, &friendAddedTips)
|
||||
}
|
||||
|
||||
func FriendDeletedNotification(ctx context.Context, req *pbFriend.DeleteFriendReq) {
|
||||
friendDeletedTips := sdkws.FriendDeletedTips{FromToUserID: &sdkws.FromToUserID{}}
|
||||
friendDeletedTips.FromToUserID.FromUserID = req.OwnerUserID
|
||||
friendDeletedTips.FromToUserID.ToUserID = req.FriendUserID
|
||||
friendNotification(tracelog.GetOperationID(ctx), req.OwnerUserID, req.FriendUserID, constant.FriendDeletedNotification, &friendDeletedTips)
|
||||
}
|
||||
|
||||
func FriendRemarkSetNotification(ctx context.Context, fromUserID, toUserID string) {
|
||||
friendInfoChangedTips := sdkws.FriendInfoChangedTips{FromToUserID: &sdkws.FromToUserID{}}
|
||||
friendInfoChangedTips.FromToUserID.FromUserID = fromUserID
|
||||
friendInfoChangedTips.FromToUserID.ToUserID = toUserID
|
||||
friendNotification(tracelog.GetOperationID(ctx), fromUserID, toUserID, constant.FriendRemarkSetNotification, &friendInfoChangedTips)
|
||||
}
|
||||
|
||||
func BlackAddedNotification(ctx context.Context, req *pbFriend.AddBlackReq) {
|
||||
blackAddedTips := sdkws.BlackAddedTips{FromToUserID: &sdkws.FromToUserID{}}
|
||||
blackAddedTips.FromToUserID.FromUserID = req.OwnerUserID
|
||||
blackAddedTips.FromToUserID.ToUserID = req.BlackUserID
|
||||
friendNotification(tracelog.GetOperationID(ctx), req.OwnerUserID, req.BlackUserID, constant.BlackAddedNotification, &blackAddedTips)
|
||||
}
|
||||
|
||||
func BlackDeletedNotification(ctx context.Context, req *pbFriend.RemoveBlackReq) {
|
||||
blackDeletedTips := sdkws.BlackDeletedTips{FromToUserID: &sdkws.FromToUserID{}}
|
||||
blackDeletedTips.FromToUserID.FromUserID = req.OwnerUserID
|
||||
blackDeletedTips.FromToUserID.ToUserID = req.BlackUserID
|
||||
friendNotification(tracelog.GetOperationID(ctx), req.OwnerUserID, req.BlackUserID, constant.BlackDeletedNotification, &blackDeletedTips)
|
||||
}
|
||||
|
||||
// send to myself
|
||||
func UserInfoUpdatedNotification(ctx context.Context, opUserID string, changedUserID string) {
|
||||
selfInfoUpdatedTips := sdkws.UserInfoUpdatedTips{UserID: changedUserID}
|
||||
friendNotification(tracelog.GetOperationID(ctx), opUserID, changedUserID, constant.UserInfoUpdatedNotification, &selfInfoUpdatedTips)
|
||||
}
|
||||
|
||||
func FriendInfoUpdatedNotification(ctx context.Context, changedUserID string, needNotifiedUserID string, opUserID string) {
|
||||
selfInfoUpdatedTips := sdkws.UserInfoUpdatedTips{UserID: changedUserID}
|
||||
friendNotification(tracelog.GetOperationID(ctx), opUserID, needNotifiedUserID, constant.FriendInfoUpdatedNotification, &selfInfoUpdatedTips)
|
||||
}
|
@ -1,622 +0,0 @@
|
||||
package notification
|
||||
|
||||
import (
|
||||
"Open_IM/internal/rpc/msg"
|
||||
"Open_IM/pkg/common/config"
|
||||
"Open_IM/pkg/common/constant"
|
||||
imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model"
|
||||
"Open_IM/pkg/common/log"
|
||||
"Open_IM/pkg/common/tokenverify"
|
||||
utils2 "Open_IM/pkg/common/utils"
|
||||
pbGroup "Open_IM/pkg/proto/group"
|
||||
"Open_IM/pkg/proto/sdkws"
|
||||
"Open_IM/pkg/utils"
|
||||
"context"
|
||||
"github.com/golang/protobuf/jsonpb"
|
||||
"github.com/golang/protobuf/proto"
|
||||
"google.golang.org/protobuf/types/known/wrapperspb"
|
||||
)
|
||||
|
||||
//message GroupCreatedTips{
|
||||
// GroupInfo Group = 1;
|
||||
// GroupMemberFullInfo Creator = 2;
|
||||
// repeated GroupMemberFullInfo MemberList = 3;
|
||||
// uint64 OperationTime = 4;
|
||||
//} creator->group
|
||||
|
||||
func setOpUserInfo(opUserID, groupID string, groupMemberInfo *sdkws.GroupMemberFullInfo) error {
|
||||
if tokenverify.IsManagerUserID(opUserID) {
|
||||
u, err := imdb.GetUserByUserID(opUserID)
|
||||
if err != nil {
|
||||
return utils.Wrap(err, "GetUserByUserID failed")
|
||||
}
|
||||
utils.CopyStructFields(groupMemberInfo, u)
|
||||
groupMemberInfo.GroupID = groupID
|
||||
} else {
|
||||
u, err := imdb.GetGroupMemberInfoByGroupIDAndUserID(groupID, opUserID)
|
||||
if err == nil {
|
||||
if err = utils2.GroupMemberDBCopyOpenIM(groupMemberInfo, u); err != nil {
|
||||
return utils.Wrap(err, "")
|
||||
}
|
||||
}
|
||||
user, err := imdb.GetUserByUserID(opUserID)
|
||||
if err != nil {
|
||||
return utils.Wrap(err, "")
|
||||
}
|
||||
groupMemberInfo.GroupID = groupID
|
||||
groupMemberInfo.UserID = user.UserID
|
||||
groupMemberInfo.Nickname = user.Nickname
|
||||
groupMemberInfo.AppMangerLevel = user.AppMangerLevel
|
||||
groupMemberInfo.FaceURL = user.FaceURL
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func setGroupInfo(groupID string, groupInfo *sdkws.GroupInfo) error {
|
||||
group, err := imdb.GetGroupInfoByGroupID(groupID)
|
||||
if err != nil {
|
||||
return utils.Wrap(err, "GetGroupInfoByGroupID failed")
|
||||
}
|
||||
err = utils2.GroupDBCopyOpenIM(groupInfo, group)
|
||||
if err != nil {
|
||||
log.NewWarn("", "GroupDBCopyOpenIM failed ", groupID, err.Error())
|
||||
return nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func setGroupMemberInfo(groupID, userID string, groupMemberInfo *sdkws.GroupMemberFullInfo) error {
|
||||
groupMember, err := imdb.GetGroupMemberInfoByGroupIDAndUserID(groupID, userID)
|
||||
if err == nil {
|
||||
return utils.Wrap(utils2.GroupMemberDBCopyOpenIM(groupMemberInfo, groupMember), "")
|
||||
}
|
||||
|
||||
user, err := imdb.GetUserByUserID(userID)
|
||||
if err != nil {
|
||||
return utils.Wrap(err, "")
|
||||
}
|
||||
groupMemberInfo.GroupID = groupID
|
||||
groupMemberInfo.UserID = user.UserID
|
||||
groupMemberInfo.Nickname = user.Nickname
|
||||
groupMemberInfo.AppMangerLevel = user.AppMangerLevel
|
||||
groupMemberInfo.FaceURL = user.FaceURL
|
||||
return nil
|
||||
}
|
||||
|
||||
func setGroupOwnerInfo(groupID string, groupMemberInfo *sdkws.GroupMemberFullInfo) error {
|
||||
groupMember, err := imdb.GetGroupOwnerInfoByGroupID(groupID)
|
||||
if err != nil {
|
||||
return utils.Wrap(err, "")
|
||||
}
|
||||
if err = utils2.GroupMemberDBCopyOpenIM(groupMemberInfo, groupMember); err != nil {
|
||||
return utils.Wrap(err, "")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func setPublicUserInfo(userID string, publicUserInfo *sdkws.PublicUserInfo) error {
|
||||
user, err := imdb.GetUserByUserID(userID)
|
||||
if err != nil {
|
||||
return utils.Wrap(err, "")
|
||||
}
|
||||
utils2.UserDBCopyOpenIMPublicUser(publicUserInfo, user)
|
||||
return nil
|
||||
}
|
||||
|
||||
func groupNotification(contentType int32, m proto.Message, sendID, groupID, recvUserID, operationID string) {
|
||||
log.Info(operationID, utils.GetSelfFuncName(), "args: ", contentType, sendID, groupID, recvUserID)
|
||||
|
||||
var err error
|
||||
var tips sdkws.TipsComm
|
||||
tips.Detail, err = proto.Marshal(m)
|
||||
if err != nil {
|
||||
log.Error(operationID, "Marshal failed ", err.Error(), m.String())
|
||||
return
|
||||
}
|
||||
marshaler := jsonpb.Marshaler{
|
||||
OrigName: true,
|
||||
EnumsAsInts: false,
|
||||
EmitDefaults: false,
|
||||
}
|
||||
|
||||
tips.JsonDetail, _ = marshaler.MarshalToString(m)
|
||||
var nickname string
|
||||
|
||||
from, err := imdb.GetUserByUserID(sendID)
|
||||
if err != nil {
|
||||
log.Error(operationID, "GetUserByUserID failed ", err.Error(), sendID)
|
||||
}
|
||||
if from != nil {
|
||||
nickname = from.Nickname
|
||||
}
|
||||
|
||||
to, err := imdb.GetUserByUserID(recvUserID)
|
||||
if err != nil {
|
||||
log.NewWarn(operationID, "GetUserByUserID failed ", err.Error(), recvUserID)
|
||||
}
|
||||
toNickname := ""
|
||||
if to != nil {
|
||||
toNickname = to.Nickname
|
||||
}
|
||||
|
||||
cn := config.Config.Notification
|
||||
switch contentType {
|
||||
case constant.GroupCreatedNotification:
|
||||
tips.DefaultTips = nickname + " " + cn.GroupCreated.DefaultTips.Tips
|
||||
case constant.GroupInfoSetNotification:
|
||||
tips.DefaultTips = nickname + " " + cn.GroupInfoSet.DefaultTips.Tips
|
||||
case constant.JoinGroupApplicationNotification:
|
||||
tips.DefaultTips = nickname + " " + cn.JoinGroupApplication.DefaultTips.Tips
|
||||
case constant.MemberQuitNotification:
|
||||
tips.DefaultTips = nickname + " " + cn.MemberQuit.DefaultTips.Tips
|
||||
case constant.GroupApplicationAcceptedNotification: //
|
||||
tips.DefaultTips = toNickname + " " + cn.GroupApplicationAccepted.DefaultTips.Tips
|
||||
case constant.GroupApplicationRejectedNotification: //
|
||||
tips.DefaultTips = toNickname + " " + cn.GroupApplicationRejected.DefaultTips.Tips
|
||||
case constant.GroupOwnerTransferredNotification: //
|
||||
tips.DefaultTips = toNickname + " " + cn.GroupOwnerTransferred.DefaultTips.Tips
|
||||
case constant.MemberKickedNotification: //
|
||||
tips.DefaultTips = toNickname + " " + cn.MemberKicked.DefaultTips.Tips
|
||||
case constant.MemberInvitedNotification: //
|
||||
tips.DefaultTips = toNickname + " " + cn.MemberInvited.DefaultTips.Tips
|
||||
case constant.MemberEnterNotification:
|
||||
tips.DefaultTips = toNickname + " " + cn.MemberEnter.DefaultTips.Tips
|
||||
case constant.GroupDismissedNotification:
|
||||
tips.DefaultTips = toNickname + "" + cn.GroupDismissed.DefaultTips.Tips
|
||||
case constant.GroupMutedNotification:
|
||||
tips.DefaultTips = toNickname + "" + cn.GroupMuted.DefaultTips.Tips
|
||||
case constant.GroupCancelMutedNotification:
|
||||
tips.DefaultTips = toNickname + "" + cn.GroupCancelMuted.DefaultTips.Tips
|
||||
case constant.GroupMemberMutedNotification:
|
||||
tips.DefaultTips = toNickname + "" + cn.GroupMemberMuted.DefaultTips.Tips
|
||||
case constant.GroupMemberCancelMutedNotification:
|
||||
tips.DefaultTips = toNickname + "" + cn.GroupMemberCancelMuted.DefaultTips.Tips
|
||||
case constant.GroupMemberInfoSetNotification:
|
||||
tips.DefaultTips = toNickname + "" + cn.GroupMemberInfoSet.DefaultTips.Tips
|
||||
case constant.GroupMemberSetToAdminNotification:
|
||||
tips.DefaultTips = toNickname + "" + cn.GroupMemberSetToAdmin.DefaultTips.Tips
|
||||
case constant.GroupMemberSetToOrdinaryUserNotification:
|
||||
tips.DefaultTips = toNickname + "" + cn.GroupMemberSetToOrdinary.DefaultTips.Tips
|
||||
default:
|
||||
log.Error(operationID, "contentType failed ", contentType)
|
||||
return
|
||||
}
|
||||
|
||||
var n msg.NotificationMsg
|
||||
n.SendID = sendID
|
||||
if groupID != "" {
|
||||
n.RecvID = groupID
|
||||
group, err := imdb.GetGroupInfoByGroupID(groupID)
|
||||
if err != nil {
|
||||
log.NewError(operationID, "GetGroupInfoByGroupID failed ", err.Error(), groupID)
|
||||
}
|
||||
switch group.GroupType {
|
||||
case constant.NormalGroup:
|
||||
n.SessionType = constant.GroupChatType
|
||||
default:
|
||||
n.SessionType = constant.SuperGroupChatType
|
||||
}
|
||||
} else {
|
||||
n.RecvID = recvUserID
|
||||
n.SessionType = constant.SingleChatType
|
||||
}
|
||||
n.ContentType = contentType
|
||||
n.OperationID = operationID
|
||||
n.Content, err = proto.Marshal(&tips)
|
||||
if err != nil {
|
||||
log.Error(operationID, "Marshal failed ", err.Error(), tips.String())
|
||||
return
|
||||
}
|
||||
msg.Notification(&n)
|
||||
}
|
||||
|
||||
// 创建群后调用
|
||||
func GroupCreatedNotification(operationID, opUserID, groupID string, initMemberList []string) {
|
||||
GroupCreatedTips := sdkws.GroupCreatedTips{Group: &sdkws.GroupInfo{},
|
||||
OpUser: &sdkws.GroupMemberFullInfo{}, GroupOwnerUser: &sdkws.GroupMemberFullInfo{}}
|
||||
if err := setOpUserInfo(opUserID, groupID, GroupCreatedTips.OpUser); err != nil {
|
||||
log.NewError(operationID, "setOpUserInfo failed ", err.Error(), opUserID, groupID, GroupCreatedTips.OpUser)
|
||||
return
|
||||
}
|
||||
err := setGroupInfo(groupID, GroupCreatedTips.Group)
|
||||
if err != nil {
|
||||
log.Error(operationID, "setGroupInfo failed ", groupID, GroupCreatedTips.Group)
|
||||
return
|
||||
}
|
||||
imdb.GetGroupOwnerInfoByGroupID(groupID)
|
||||
if err := setGroupOwnerInfo(groupID, GroupCreatedTips.GroupOwnerUser); err != nil {
|
||||
log.Error(operationID, "setGroupOwnerInfo failed", err.Error(), groupID)
|
||||
return
|
||||
}
|
||||
for _, v := range initMemberList {
|
||||
var groupMemberInfo sdkws.GroupMemberFullInfo
|
||||
if err := setGroupMemberInfo(groupID, v, &groupMemberInfo); err != nil {
|
||||
log.Error(operationID, "setGroupMemberInfo failed ", err.Error(), groupID, v)
|
||||
continue
|
||||
}
|
||||
GroupCreatedTips.MemberList = append(GroupCreatedTips.MemberList, &groupMemberInfo)
|
||||
if len(GroupCreatedTips.MemberList) == constant.MaxNotificationNum {
|
||||
break
|
||||
}
|
||||
}
|
||||
groupNotification(constant.GroupCreatedNotification, &GroupCreatedTips, opUserID, groupID, "", operationID)
|
||||
}
|
||||
|
||||
// 群信息改变后掉用
|
||||
// groupName := ""
|
||||
//
|
||||
// notification := ""
|
||||
// introduction := ""
|
||||
// faceURL := ""
|
||||
func GroupInfoSetNotification(operationID, opUserID, groupID string, groupName, notification, introduction, faceURL string, needVerification *wrapperspb.Int32Value) {
|
||||
GroupInfoChangedTips := sdkws.GroupInfoSetTips{Group: &sdkws.GroupInfo{}, OpUser: &sdkws.GroupMemberFullInfo{}}
|
||||
if err := setGroupInfo(groupID, GroupInfoChangedTips.Group); err != nil {
|
||||
log.Error(operationID, "setGroupInfo failed ", err.Error(), groupID)
|
||||
return
|
||||
}
|
||||
GroupInfoChangedTips.Group.GroupName = groupName
|
||||
GroupInfoChangedTips.Group.Notification = notification
|
||||
GroupInfoChangedTips.Group.Introduction = introduction
|
||||
GroupInfoChangedTips.Group.FaceURL = faceURL
|
||||
if needVerification != nil {
|
||||
GroupInfoChangedTips.Group.NeedVerification = needVerification.Value
|
||||
}
|
||||
|
||||
if err := setOpUserInfo(opUserID, groupID, GroupInfoChangedTips.OpUser); err != nil {
|
||||
log.Error(operationID, "setOpUserInfo failed ", err.Error(), opUserID, groupID)
|
||||
return
|
||||
}
|
||||
groupNotification(constant.GroupInfoSetNotification, &GroupInfoChangedTips, opUserID, groupID, "", operationID)
|
||||
}
|
||||
|
||||
func GroupMutedNotification(operationID, opUserID, groupID string) {
|
||||
tips := sdkws.GroupMutedTips{Group: &sdkws.GroupInfo{},
|
||||
OpUser: &sdkws.GroupMemberFullInfo{}}
|
||||
if err := setGroupInfo(groupID, tips.Group); err != nil {
|
||||
log.Error(operationID, "setGroupInfo failed ", err.Error(), groupID)
|
||||
return
|
||||
}
|
||||
if err := setOpUserInfo(opUserID, groupID, tips.OpUser); err != nil {
|
||||
log.Error(operationID, "setOpUserInfo failed ", err.Error(), opUserID, groupID)
|
||||
return
|
||||
}
|
||||
groupNotification(constant.GroupMutedNotification, &tips, opUserID, groupID, "", operationID)
|
||||
}
|
||||
|
||||
func GroupCancelMutedNotification(operationID, opUserID, groupID string) {
|
||||
tips := sdkws.GroupCancelMutedTips{Group: &sdkws.GroupInfo{},
|
||||
OpUser: &sdkws.GroupMemberFullInfo{}}
|
||||
if err := setGroupInfo(groupID, tips.Group); err != nil {
|
||||
log.Error(operationID, "setGroupInfo failed ", err.Error(), groupID)
|
||||
return
|
||||
}
|
||||
if err := setOpUserInfo(opUserID, groupID, tips.OpUser); err != nil {
|
||||
log.Error(operationID, "setOpUserInfo failed ", err.Error(), opUserID, groupID)
|
||||
return
|
||||
}
|
||||
groupNotification(constant.GroupCancelMutedNotification, &tips, opUserID, groupID, "", operationID)
|
||||
}
|
||||
|
||||
func GroupMemberMutedNotification(operationID, opUserID, groupID, groupMemberUserID string, mutedSeconds uint32) {
|
||||
tips := sdkws.GroupMemberMutedTips{Group: &sdkws.GroupInfo{},
|
||||
OpUser: &sdkws.GroupMemberFullInfo{}, MutedUser: &sdkws.GroupMemberFullInfo{}}
|
||||
tips.MutedSeconds = mutedSeconds
|
||||
if err := setGroupInfo(groupID, tips.Group); err != nil {
|
||||
log.Error(operationID, "setGroupInfo failed ", err.Error(), groupID)
|
||||
return
|
||||
}
|
||||
if err := setOpUserInfo(opUserID, groupID, tips.OpUser); err != nil {
|
||||
log.Error(operationID, "setOpUserInfo failed ", err.Error(), opUserID, groupID)
|
||||
return
|
||||
}
|
||||
if err := setGroupMemberInfo(groupID, groupMemberUserID, tips.MutedUser); err != nil {
|
||||
log.Error(operationID, "setGroupMemberInfo failed ", err.Error(), groupID, groupMemberUserID)
|
||||
return
|
||||
}
|
||||
groupNotification(constant.GroupMemberMutedNotification, &tips, opUserID, groupID, "", operationID)
|
||||
}
|
||||
|
||||
func GroupMemberInfoSetNotification(operationID, opUserID, groupID, groupMemberUserID string) {
|
||||
tips := sdkws.GroupMemberInfoSetTips{Group: &sdkws.GroupInfo{},
|
||||
OpUser: &sdkws.GroupMemberFullInfo{}, ChangedUser: &sdkws.GroupMemberFullInfo{}}
|
||||
if err := setGroupInfo(groupID, tips.Group); err != nil {
|
||||
log.Error(operationID, "setGroupInfo failed ", err.Error(), groupID)
|
||||
return
|
||||
}
|
||||
if err := setOpUserInfo(opUserID, groupID, tips.OpUser); err != nil {
|
||||
log.Error(operationID, "setOpUserInfo failed ", err.Error(), opUserID, groupID)
|
||||
return
|
||||
}
|
||||
if err := setGroupMemberInfo(groupID, groupMemberUserID, tips.ChangedUser); err != nil {
|
||||
log.Error(operationID, "setGroupMemberInfo failed ", err.Error(), groupID, groupMemberUserID)
|
||||
return
|
||||
}
|
||||
groupNotification(constant.GroupMemberInfoSetNotification, &tips, opUserID, groupID, "", operationID)
|
||||
}
|
||||
|
||||
func GroupMemberRoleLevelChangeNotification(operationID, opUserID, groupID, groupMemberUserID string, notificationType int32) {
|
||||
if notificationType != constant.GroupMemberSetToAdminNotification && notificationType != constant.GroupMemberSetToOrdinaryUserNotification {
|
||||
log.NewError(operationID, utils.GetSelfFuncName(), "invalid notificationType: ", notificationType)
|
||||
return
|
||||
}
|
||||
tips := sdkws.GroupMemberInfoSetTips{Group: &sdkws.GroupInfo{},
|
||||
OpUser: &sdkws.GroupMemberFullInfo{}, ChangedUser: &sdkws.GroupMemberFullInfo{}}
|
||||
if err := setGroupInfo(groupID, tips.Group); err != nil {
|
||||
log.Error(operationID, "setGroupInfo failed ", err.Error(), groupID)
|
||||
return
|
||||
}
|
||||
if err := setOpUserInfo(opUserID, groupID, tips.OpUser); err != nil {
|
||||
log.Error(operationID, "setOpUserInfo failed ", err.Error(), opUserID, groupID)
|
||||
return
|
||||
}
|
||||
if err := setGroupMemberInfo(groupID, groupMemberUserID, tips.ChangedUser); err != nil {
|
||||
log.Error(operationID, "setGroupMemberInfo failed ", err.Error(), groupID, groupMemberUserID)
|
||||
return
|
||||
}
|
||||
groupNotification(notificationType, &tips, opUserID, groupID, "", operationID)
|
||||
}
|
||||
|
||||
func GroupMemberCancelMutedNotification(operationID, opUserID, groupID, groupMemberUserID string) {
|
||||
tips := sdkws.GroupMemberCancelMutedTips{Group: &sdkws.GroupInfo{},
|
||||
OpUser: &sdkws.GroupMemberFullInfo{}, MutedUser: &sdkws.GroupMemberFullInfo{}}
|
||||
if err := setGroupInfo(groupID, tips.Group); err != nil {
|
||||
log.Error(operationID, "setGroupInfo failed ", err.Error(), groupID)
|
||||
return
|
||||
}
|
||||
if err := setOpUserInfo(opUserID, groupID, tips.OpUser); err != nil {
|
||||
log.Error(operationID, "setOpUserInfo failed ", err.Error(), opUserID, groupID)
|
||||
return
|
||||
}
|
||||
if err := setGroupMemberInfo(groupID, groupMemberUserID, tips.MutedUser); err != nil {
|
||||
log.Error(operationID, "setGroupMemberInfo failed ", err.Error(), groupID, groupMemberUserID)
|
||||
return
|
||||
}
|
||||
groupNotification(constant.GroupMemberCancelMutedNotification, &tips, opUserID, groupID, "", operationID)
|
||||
}
|
||||
|
||||
// message ReceiveJoinApplicationTips{
|
||||
// GroupInfo Group = 1;
|
||||
// PublicUserInfo Applicant = 2;
|
||||
// string Reason = 3;
|
||||
// } apply->all managers GroupID string `protobuf:"bytes,1,opt,name=GroupID" json:"GroupID,omitempty"`
|
||||
//
|
||||
// ReqMessage string `protobuf:"bytes,2,opt,name=ReqMessage" json:"ReqMessage,omitempty"`
|
||||
// OpUserID string `protobuf:"bytes,3,opt,name=OpUserID" json:"OpUserID,omitempty"`
|
||||
// OperationID string `protobuf:"bytes,4,opt,name=OperationID" json:"OperationID,omitempty"`
|
||||
//
|
||||
// 申请进群后调用
|
||||
func JoinGroupApplicationNotification(ctx context.Context, req *pbGroup.JoinGroupReq) {
|
||||
JoinGroupApplicationTips := sdkws.JoinGroupApplicationTips{Group: &sdkws.GroupInfo{}, Applicant: &sdkws.PublicUserInfo{}}
|
||||
err := setGroupInfo(req.GroupID, JoinGroupApplicationTips.Group)
|
||||
if err != nil {
|
||||
log.Error(utils.OperationID(ctx), "setGroupInfo failed ", err.Error(), req.GroupID)
|
||||
return
|
||||
}
|
||||
if err = setPublicUserInfo(utils.OpUserID(ctx), JoinGroupApplicationTips.Applicant); err != nil {
|
||||
log.Error(utils.OperationID(ctx), "setPublicUserInfo failed ", err.Error(), utils.OpUserID(ctx))
|
||||
return
|
||||
}
|
||||
JoinGroupApplicationTips.ReqMsg = req.ReqMessage
|
||||
|
||||
managerList, err := imdb.GetOwnerManagerByGroupID(req.GroupID)
|
||||
if err != nil {
|
||||
log.NewError(utils.OperationID(ctx), "GetOwnerManagerByGroupId failed ", err.Error(), req.GroupID)
|
||||
return
|
||||
}
|
||||
for _, v := range managerList {
|
||||
groupNotification(constant.JoinGroupApplicationNotification, &JoinGroupApplicationTips, utils.OpUserID(ctx), "", v.UserID, utils.OperationID(ctx))
|
||||
log.NewInfo(utils.OperationID(ctx), "Notification ", v)
|
||||
}
|
||||
}
|
||||
|
||||
func MemberQuitNotification(req *pbGroup.QuitGroupReq) {
|
||||
MemberQuitTips := sdkws.MemberQuitTips{Group: &sdkws.GroupInfo{}, QuitUser: &sdkws.GroupMemberFullInfo{}}
|
||||
if err := setGroupInfo(req.GroupID, MemberQuitTips.Group); err != nil {
|
||||
log.Error(req.OperationID, "setGroupInfo failed ", err.Error(), req.GroupID)
|
||||
return
|
||||
}
|
||||
if err := setOpUserInfo(req.OpUserID, req.GroupID, MemberQuitTips.QuitUser); err != nil {
|
||||
log.Error(req.OperationID, "setOpUserInfo failed ", err.Error(), req.OpUserID, req.GroupID)
|
||||
return
|
||||
}
|
||||
|
||||
groupNotification(constant.MemberQuitNotification, &MemberQuitTips, req.OpUserID, req.GroupID, "", req.OperationID)
|
||||
}
|
||||
|
||||
// message ApplicationProcessedTips{
|
||||
// GroupInfo Group = 1;
|
||||
// GroupMemberFullInfo OpUser = 2;
|
||||
// int32 Result = 3;
|
||||
// string Reason = 4;
|
||||
// }
|
||||
//
|
||||
// 处理进群请求后调用
|
||||
func GroupApplicationAcceptedNotification(req *pbGroup.GroupApplicationResponseReq) {
|
||||
GroupApplicationAcceptedTips := sdkws.GroupApplicationAcceptedTips{Group: &sdkws.GroupInfo{}, OpUser: &sdkws.GroupMemberFullInfo{}, HandleMsg: req.HandledMsg}
|
||||
if err := setGroupInfo(req.GroupID, GroupApplicationAcceptedTips.Group); err != nil {
|
||||
log.NewError(req.OperationID, "setGroupInfo failed ", err.Error(), req.GroupID, GroupApplicationAcceptedTips.Group)
|
||||
return
|
||||
}
|
||||
if err := setOpUserInfo(req.OpUserID, req.GroupID, GroupApplicationAcceptedTips.OpUser); err != nil {
|
||||
log.Error(req.OperationID, "setOpUserInfo failed", req.OpUserID, req.GroupID, GroupApplicationAcceptedTips.OpUser)
|
||||
return
|
||||
}
|
||||
|
||||
groupNotification(constant.GroupApplicationAcceptedNotification, &GroupApplicationAcceptedTips, req.OpUserID, "", req.FromUserID, req.OperationID)
|
||||
adminList, err := imdb.GetOwnerManagerByGroupID(req.GroupID)
|
||||
if err != nil {
|
||||
log.Error(req.OperationID, "GetOwnerManagerByGroupID failed", req.GroupID)
|
||||
return
|
||||
}
|
||||
for _, v := range adminList {
|
||||
if v.UserID == req.OpUserID {
|
||||
continue
|
||||
}
|
||||
GroupApplicationAcceptedTips.ReceiverAs = 1
|
||||
groupNotification(constant.GroupApplicationAcceptedNotification, &GroupApplicationAcceptedTips, req.OpUserID, "", v.UserID, req.OperationID)
|
||||
}
|
||||
}
|
||||
|
||||
func GroupApplicationRejectedNotification(req *pbGroup.GroupApplicationResponseReq) {
|
||||
GroupApplicationRejectedTips := sdkws.GroupApplicationRejectedTips{Group: &sdkws.GroupInfo{}, OpUser: &sdkws.GroupMemberFullInfo{}, HandleMsg: req.HandledMsg}
|
||||
if err := setGroupInfo(req.GroupID, GroupApplicationRejectedTips.Group); err != nil {
|
||||
log.NewError(req.OperationID, "setGroupInfo failed ", err.Error(), req.GroupID, GroupApplicationRejectedTips.Group)
|
||||
return
|
||||
}
|
||||
if err := setOpUserInfo(req.OpUserID, req.GroupID, GroupApplicationRejectedTips.OpUser); err != nil {
|
||||
log.Error(req.OperationID, "setOpUserInfo failed", req.OpUserID, req.GroupID, GroupApplicationRejectedTips.OpUser)
|
||||
return
|
||||
}
|
||||
groupNotification(constant.GroupApplicationRejectedNotification, &GroupApplicationRejectedTips, req.OpUserID, "", req.FromUserID, req.OperationID)
|
||||
adminList, err := imdb.GetOwnerManagerByGroupID(req.GroupID)
|
||||
if err != nil {
|
||||
log.Error(req.OperationID, "GetOwnerManagerByGroupID failed", req.GroupID)
|
||||
return
|
||||
}
|
||||
for _, v := range adminList {
|
||||
if v.UserID == req.OpUserID {
|
||||
continue
|
||||
}
|
||||
GroupApplicationRejectedTips.ReceiverAs = 1
|
||||
groupNotification(constant.GroupApplicationRejectedNotification, &GroupApplicationRejectedTips, req.OpUserID, "", v.UserID, req.OperationID)
|
||||
}
|
||||
}
|
||||
|
||||
func GroupOwnerTransferredNotification(req *pbGroup.TransferGroupOwnerReq) {
|
||||
GroupOwnerTransferredTips := sdkws.GroupOwnerTransferredTips{Group: &sdkws.GroupInfo{}, OpUser: &sdkws.GroupMemberFullInfo{}, NewGroupOwner: &sdkws.GroupMemberFullInfo{}}
|
||||
if err := setGroupInfo(req.GroupID, GroupOwnerTransferredTips.Group); err != nil {
|
||||
log.NewError(req.OperationID, "setGroupInfo failed ", err.Error(), req.GroupID)
|
||||
return
|
||||
}
|
||||
if err := setOpUserInfo(req.OpUserID, req.GroupID, GroupOwnerTransferredTips.OpUser); err != nil {
|
||||
log.Error(req.OperationID, "setOpUserInfo failed", req.OpUserID, req.GroupID)
|
||||
return
|
||||
}
|
||||
if err := setGroupMemberInfo(req.GroupID, req.NewOwnerUserID, GroupOwnerTransferredTips.NewGroupOwner); err != nil {
|
||||
log.Error(req.OperationID, "setGroupMemberInfo failed", req.GroupID, req.NewOwnerUserID)
|
||||
return
|
||||
}
|
||||
groupNotification(constant.GroupOwnerTransferredNotification, &GroupOwnerTransferredTips, req.OpUserID, req.GroupID, "", req.OperationID)
|
||||
}
|
||||
|
||||
func GroupDismissedNotification(req *pbGroup.DismissGroupReq) {
|
||||
tips := sdkws.GroupDismissedTips{Group: &sdkws.GroupInfo{}, OpUser: &sdkws.GroupMemberFullInfo{}}
|
||||
if err := setGroupInfo(req.GroupID, tips.Group); err != nil {
|
||||
log.NewError(req.OperationID, "setGroupInfo failed ", err.Error(), req.GroupID)
|
||||
return
|
||||
}
|
||||
if err := setOpUserInfo(req.OpUserID, req.GroupID, tips.OpUser); err != nil {
|
||||
log.Error(req.OperationID, "setOpUserInfo failed", req.OpUserID, req.GroupID)
|
||||
return
|
||||
}
|
||||
groupNotification(constant.GroupDismissedNotification, &tips, req.OpUserID, req.GroupID, "", req.OperationID)
|
||||
}
|
||||
|
||||
// message MemberKickedTips{
|
||||
// GroupInfo Group = 1;
|
||||
// GroupMemberFullInfo OpUser = 2;
|
||||
// GroupMemberFullInfo KickedUser = 3;
|
||||
// uint64 OperationTime = 4;
|
||||
// }
|
||||
//
|
||||
// 被踢后调用
|
||||
func MemberKickedNotification(req *pbGroup.KickGroupMemberReq, kickedUserIDList []string) {
|
||||
MemberKickedTips := sdkws.MemberKickedTips{Group: &sdkws.GroupInfo{}, OpUser: &sdkws.GroupMemberFullInfo{}}
|
||||
if err := setGroupInfo(req.GroupID, MemberKickedTips.Group); err != nil {
|
||||
log.Error(req.OperationID, "setGroupInfo failed ", err.Error(), req.GroupID)
|
||||
return
|
||||
}
|
||||
if err := setOpUserInfo(req.OpUserID, req.GroupID, MemberKickedTips.OpUser); err != nil {
|
||||
log.Error(req.OperationID, "setOpUserInfo failed ", err.Error(), req.OpUserID)
|
||||
return
|
||||
}
|
||||
for _, v := range kickedUserIDList {
|
||||
var groupMemberInfo sdkws.GroupMemberFullInfo
|
||||
if err := setGroupMemberInfo(req.GroupID, v, &groupMemberInfo); err != nil {
|
||||
log.Error(req.OperationID, "setGroupMemberInfo failed ", err.Error(), req.GroupID, v)
|
||||
continue
|
||||
}
|
||||
MemberKickedTips.KickedUserList = append(MemberKickedTips.KickedUserList, &groupMemberInfo)
|
||||
}
|
||||
groupNotification(constant.MemberKickedNotification, &MemberKickedTips, req.OpUserID, req.GroupID, "", req.OperationID)
|
||||
//
|
||||
//for _, v := range kickedUserIDList {
|
||||
// groupNotification(constant.MemberKickedNotification, &MemberKickedTips, req.OpUserID, "", v, req.OperationID)
|
||||
//}
|
||||
}
|
||||
|
||||
// message MemberInvitedTips{
|
||||
// GroupInfo Group = 1;
|
||||
// GroupMemberFullInfo OpUser = 2;
|
||||
// GroupMemberFullInfo InvitedUser = 3;
|
||||
// uint64 OperationTime = 4;
|
||||
// }
|
||||
//
|
||||
// 被邀请进群后调用
|
||||
func MemberInvitedNotification(operationID, groupID, opUserID, reason string, invitedUserIDList []string) {
|
||||
MemberInvitedTips := sdkws.MemberInvitedTips{Group: &sdkws.GroupInfo{}, OpUser: &sdkws.GroupMemberFullInfo{}}
|
||||
if err := setGroupInfo(groupID, MemberInvitedTips.Group); err != nil {
|
||||
log.Error(operationID, "setGroupInfo failed ", err.Error(), groupID)
|
||||
return
|
||||
}
|
||||
if err := setOpUserInfo(opUserID, groupID, MemberInvitedTips.OpUser); err != nil {
|
||||
log.Error(operationID, "setOpUserInfo failed ", err.Error(), opUserID, groupID)
|
||||
return
|
||||
}
|
||||
for _, v := range invitedUserIDList {
|
||||
var groupMemberInfo sdkws.GroupMemberFullInfo
|
||||
if err := setGroupMemberInfo(groupID, v, &groupMemberInfo); err != nil {
|
||||
log.Error(operationID, "setGroupMemberInfo failed ", err.Error(), groupID)
|
||||
continue
|
||||
}
|
||||
MemberInvitedTips.InvitedUserList = append(MemberInvitedTips.InvitedUserList, &groupMemberInfo)
|
||||
}
|
||||
groupNotification(constant.MemberInvitedNotification, &MemberInvitedTips, opUserID, groupID, "", operationID)
|
||||
}
|
||||
|
||||
//message GroupInfoChangedTips{
|
||||
// int32 ChangedType = 1; //bitwise operators: 1:groupName; 10:Notification 100:Introduction; 1000:FaceUrl
|
||||
// GroupInfo Group = 2;
|
||||
// GroupMemberFullInfo OpUser = 3;
|
||||
//}
|
||||
|
||||
//message MemberLeaveTips{
|
||||
// GroupInfo Group = 1;
|
||||
// GroupMemberFullInfo LeaverUser = 2;
|
||||
// uint64 OperationTime = 3;
|
||||
//}
|
||||
|
||||
//群成员退群后调用
|
||||
|
||||
// message MemberEnterTips{
|
||||
// GroupInfo Group = 1;
|
||||
// GroupMemberFullInfo EntrantUser = 2;
|
||||
// uint64 OperationTime = 3;
|
||||
// }
|
||||
//
|
||||
// 群成员主动申请进群,管理员同意后调用,
|
||||
func MemberEnterNotification(ctx context.Context, req *pbGroup.GroupApplicationResponseReq) {
|
||||
MemberEnterTips := sdkws.MemberEnterTips{Group: &sdkws.GroupInfo{}, EntrantUser: &sdkws.GroupMemberFullInfo{}}
|
||||
if err := setGroupInfo(req.GroupID, MemberEnterTips.Group); err != nil {
|
||||
log.Error(req.OperationID, "setGroupInfo failed ", err.Error(), req.GroupID, MemberEnterTips.Group)
|
||||
return
|
||||
}
|
||||
if err := setGroupMemberInfo(req.GroupID, req.FromUserID, MemberEnterTips.EntrantUser); err != nil {
|
||||
log.Error(req.OperationID, "setGroupMemberInfo failed ", err.Error(), req.OpUserID, req.GroupID, MemberEnterTips.EntrantUser)
|
||||
return
|
||||
}
|
||||
groupNotification(constant.MemberEnterNotification, &MemberEnterTips, req.OpUserID, req.GroupID, "", req.OperationID)
|
||||
}
|
||||
|
||||
func MemberEnterDirectlyNotification(groupID string, entrantUserID string, operationID string) {
|
||||
MemberEnterTips := sdkws.MemberEnterTips{Group: &sdkws.GroupInfo{}, EntrantUser: &sdkws.GroupMemberFullInfo{}}
|
||||
if err := setGroupInfo(groupID, MemberEnterTips.Group); err != nil {
|
||||
log.Error(operationID, "setGroupInfo failed ", err.Error(), groupID, MemberEnterTips.Group)
|
||||
return
|
||||
}
|
||||
if err := setGroupMemberInfo(groupID, entrantUserID, MemberEnterTips.EntrantUser); err != nil {
|
||||
log.Error(operationID, "setGroupMemberInfo failed ", err.Error(), groupID, entrantUserID, MemberEnterTips.EntrantUser)
|
||||
return
|
||||
}
|
||||
groupNotification(constant.MemberEnterNotification, &MemberEnterTips, entrantUserID, groupID, "", operationID)
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
package notification
|
||||
|
||||
import (
|
||||
"Open_IM/internal/rpc/msg"
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/log"
|
||||
sdkws "Open_IM/pkg/proto/sdkws"
|
||||
"Open_IM/pkg/utils"
|
||||
"github.com/golang/protobuf/jsonpb"
|
||||
"github.com/golang/protobuf/proto"
|
||||
)
|
||||
|
||||
func DeleteMessageNotification(opUserID, userID string, seqList []uint32, operationID string) {
|
||||
DeleteMessageTips := sdkws.DeleteMessageTips{OpUserID: opUserID, UserID: userID, SeqList: seqList}
|
||||
MessageNotification(operationID, userID, userID, constant.DeleteMessageNotification, &DeleteMessageTips)
|
||||
}
|
||||
|
||||
func MessageNotification(operationID, sendID, recvID string, contentType int32, m proto.Message) {
|
||||
log.Debug(operationID, utils.GetSelfFuncName(), "args: ", m.String(), contentType)
|
||||
var err error
|
||||
var tips sdkws.TipsComm
|
||||
tips.Detail, err = proto.Marshal(m)
|
||||
if err != nil {
|
||||
log.Error(operationID, "Marshal failed ", err.Error(), m.String())
|
||||
return
|
||||
}
|
||||
|
||||
marshaler := jsonpb.Marshaler{
|
||||
OrigName: true,
|
||||
EnumsAsInts: false,
|
||||
EmitDefaults: false,
|
||||
}
|
||||
|
||||
tips.JsonDetail, _ = marshaler.MarshalToString(m)
|
||||
var n msg.NotificationMsg
|
||||
n.SendID = sendID
|
||||
n.RecvID = recvID
|
||||
n.ContentType = contentType
|
||||
n.SessionType = constant.SingleChatType
|
||||
n.MsgFrom = constant.SysMsgType
|
||||
n.OperationID = operationID
|
||||
n.Content, err = proto.Marshal(&tips)
|
||||
if err != nil {
|
||||
log.Error(operationID, "Marshal failed ", err.Error(), tips.String())
|
||||
return
|
||||
}
|
||||
msg.Notification(&n)
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
package notification
|
||||
|
||||
import (
|
||||
"Open_IM/internal/rpc/msg"
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/log"
|
||||
//sdk "Open_IM/pkg/proto/sdkws"
|
||||
"Open_IM/pkg/utils"
|
||||
//"github.com/golang/protobuf/jsonpb"
|
||||
//"github.com/golang/protobuf/proto"
|
||||
)
|
||||
|
||||
func SuperGroupNotification(operationID, sendID, recvID string) {
|
||||
n := &msg.NotificationMsg{
|
||||
SendID: sendID,
|
||||
RecvID: recvID,
|
||||
MsgFrom: constant.SysMsgType,
|
||||
ContentType: constant.SuperGroupUpdateNotification,
|
||||
SessionType: constant.SingleChatType,
|
||||
OperationID: operationID,
|
||||
}
|
||||
log.NewInfo(operationID, utils.GetSelfFuncName(), string(n.Content))
|
||||
msg.Notification(n)
|
||||
}
|
@ -24,7 +24,6 @@ import (
|
||||
|
||||
type friendServer struct {
|
||||
*rpcserver.RpcServer
|
||||
|
||||
controller.FriendInterface
|
||||
controller.BlackInterface
|
||||
}
|
||||
|
@ -1,63 +0,0 @@
|
||||
package msg
|
||||
|
||||
import (
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/db"
|
||||
"Open_IM/pkg/common/log"
|
||||
"Open_IM/pkg/common/tokenverify"
|
||||
pbChat "Open_IM/pkg/proto/msg"
|
||||
"Open_IM/pkg/utils"
|
||||
"context"
|
||||
)
|
||||
|
||||
func (rpc *rpcChat) ClearMsg(_ context.Context, req *pbChat.ClearMsgReq) (*pbChat.ClearMsgResp, error) {
|
||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc req: ", req.String())
|
||||
if req.OpUserID != req.UserID && !tokenverify.IsManagerUserID(req.UserID) {
|
||||
errMsg := "No permission" + req.OpUserID + req.UserID
|
||||
log.Error(req.OperationID, errMsg)
|
||||
return &pbChat.ClearMsgResp{ErrCode: constant.ErrNoPermission.ErrCode, ErrMsg: errMsg}, nil
|
||||
}
|
||||
log.Debug(req.OperationID, "CleanUpOneUserAllMsgFromRedis args", req.UserID)
|
||||
err := db.DB.CleanUpOneUserAllMsgFromRedis(req.UserID, req.OperationID)
|
||||
if err != nil {
|
||||
errMsg := "CleanUpOneUserAllMsgFromRedis failed " + err.Error() + req.OperationID + req.UserID
|
||||
log.Error(req.OperationID, errMsg)
|
||||
return &pbChat.ClearMsgResp{ErrCode: constant.ErrDatabase.ErrCode, ErrMsg: errMsg}, nil
|
||||
}
|
||||
log.Debug(req.OperationID, "CleanUpUserMsgFromMongo args", req.UserID)
|
||||
err = db.DB.CleanUpUserMsgFromMongo(req.UserID, req.OperationID)
|
||||
if err != nil {
|
||||
errMsg := "CleanUpUserMsgFromMongo failed " + err.Error() + req.OperationID + req.UserID
|
||||
log.Error(req.OperationID, errMsg)
|
||||
return &pbChat.ClearMsgResp{ErrCode: constant.ErrDatabase.ErrCode, ErrMsg: errMsg}, nil
|
||||
}
|
||||
|
||||
resp := pbChat.ClearMsgResp{ErrCode: 0}
|
||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String())
|
||||
return &resp, nil
|
||||
}
|
||||
|
||||
func (rpc *rpcChat) SetMsgMinSeq(_ context.Context, req *pbChat.SetMsgMinSeqReq) (*pbChat.SetMsgMinSeqResp, error) {
|
||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc req: ", req.String())
|
||||
if req.OpUserID != req.UserID && !tokenverify.IsManagerUserID(req.UserID) {
|
||||
errMsg := "No permission" + req.OpUserID + req.UserID
|
||||
log.Error(req.OperationID, errMsg)
|
||||
return &pbChat.SetMsgMinSeqResp{ErrCode: constant.ErrNoPermission.ErrCode, ErrMsg: errMsg}, nil
|
||||
}
|
||||
if req.GroupID == "" {
|
||||
err := db.DB.SetUserMinSeq(req.UserID, req.MinSeq)
|
||||
if err != nil {
|
||||
errMsg := "SetUserMinSeq failed " + err.Error() + req.OperationID + req.UserID + utils.Uint32ToString(req.MinSeq)
|
||||
log.Error(req.OperationID, errMsg)
|
||||
return &pbChat.SetMsgMinSeqResp{ErrCode: constant.ErrDatabase.ErrCode, ErrMsg: errMsg}, nil
|
||||
}
|
||||
return &pbChat.SetMsgMinSeqResp{}, nil
|
||||
}
|
||||
err := db.DB.SetGroupUserMinSeq(req.GroupID, req.UserID, uint64(req.MinSeq))
|
||||
if err != nil {
|
||||
errMsg := "SetGroupUserMinSeq failed " + err.Error() + req.OperationID + req.GroupID + req.UserID + utils.Uint32ToString(req.MinSeq)
|
||||
log.Error(req.OperationID, errMsg)
|
||||
return &pbChat.SetMsgMinSeqResp{ErrCode: constant.ErrDatabase.ErrCode, ErrMsg: errMsg}, nil
|
||||
}
|
||||
return &pbChat.SetMsgMinSeqResp{}, nil
|
||||
}
|
@ -54,3 +54,30 @@ func (rpc *rpcChat) DelSuperGroupMsg(ctx context.Context, req *msg.DelSuperGroup
|
||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String())
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func (rpc *rpcChat) ClearMsg(_ context.Context, req *pbChat.ClearMsgReq) (*pbChat.ClearMsgResp, error) {
|
||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc req: ", req.String())
|
||||
if req.OpUserID != req.UserID && !tokenverify.IsManagerUserID(req.UserID) {
|
||||
errMsg := "No permission" + req.OpUserID + req.UserID
|
||||
log.Error(req.OperationID, errMsg)
|
||||
return &pbChat.ClearMsgResp{ErrCode: constant.ErrNoPermission.ErrCode, ErrMsg: errMsg}, nil
|
||||
}
|
||||
log.Debug(req.OperationID, "CleanUpOneUserAllMsgFromRedis args", req.UserID)
|
||||
err := db.DB.CleanUpOneUserAllMsgFromRedis(req.UserID, req.OperationID)
|
||||
if err != nil {
|
||||
errMsg := "CleanUpOneUserAllMsgFromRedis failed " + err.Error() + req.OperationID + req.UserID
|
||||
log.Error(req.OperationID, errMsg)
|
||||
return &pbChat.ClearMsgResp{ErrCode: constant.ErrDatabase.ErrCode, ErrMsg: errMsg}, nil
|
||||
}
|
||||
log.Debug(req.OperationID, "CleanUpUserMsgFromMongo args", req.UserID)
|
||||
err = db.DB.CleanUpUserMsgFromMongo(req.UserID, req.OperationID)
|
||||
if err != nil {
|
||||
errMsg := "CleanUpUserMsgFromMongo failed " + err.Error() + req.OperationID + req.UserID
|
||||
log.Error(req.OperationID, errMsg)
|
||||
return &pbChat.ClearMsgResp{ErrCode: constant.ErrDatabase.ErrCode, ErrMsg: errMsg}, nil
|
||||
}
|
||||
|
||||
resp := pbChat.ClearMsgResp{ErrCode: 0}
|
||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String())
|
||||
return &resp, nil
|
||||
}
|
@ -1,126 +0,0 @@
|
||||
package msg
|
||||
|
||||
import (
|
||||
"Open_IM/pkg/utils"
|
||||
"context"
|
||||
go_redis "github.com/go-redis/redis/v8"
|
||||
|
||||
commonDB "Open_IM/pkg/common/db"
|
||||
"Open_IM/pkg/common/log"
|
||||
sdkws "Open_IM/pkg/proto/sdkws"
|
||||
|
||||
promePkg "Open_IM/pkg/common/prometheus"
|
||||
)
|
||||
|
||||
func (rpc *rpcChat) GetMaxAndMinSeq(_ context.Context, in *sdkws.GetMaxAndMinSeqReq) (*sdkws.GetMaxAndMinSeqResp, error) {
|
||||
log.NewInfo(in.OperationID, "rpc getMaxAndMinSeq is arriving", in.String())
|
||||
resp := new(sdkws.GetMaxAndMinSeqResp)
|
||||
m := make(map[string]*sdkws.MaxAndMinSeq)
|
||||
var maxSeq, minSeq uint64
|
||||
var err1, err2 error
|
||||
maxSeq, err1 = commonDB.DB.GetUserMaxSeq(in.UserID)
|
||||
minSeq, err2 = commonDB.DB.GetUserMinSeq(in.UserID)
|
||||
if (err1 != nil && err1 != go_redis.Nil) || (err2 != nil && err2 != go_redis.Nil) {
|
||||
log.NewError(in.OperationID, "getMaxSeq from redis error", in.String())
|
||||
if err1 != nil {
|
||||
log.NewError(in.OperationID, utils.GetSelfFuncName(), err1.Error())
|
||||
}
|
||||
if err2 != nil {
|
||||
log.NewError(in.OperationID, utils.GetSelfFuncName(), err2.Error())
|
||||
}
|
||||
resp.ErrCode = 200
|
||||
resp.ErrMsg = "redis get err"
|
||||
return resp, nil
|
||||
}
|
||||
resp.MaxSeq = uint32(maxSeq)
|
||||
resp.MinSeq = uint32(minSeq)
|
||||
for _, groupID := range in.GroupIDList {
|
||||
x := new(sdkws.MaxAndMinSeq)
|
||||
maxSeq, _ := commonDB.DB.GetGroupMaxSeq(groupID)
|
||||
minSeq, _ := commonDB.DB.GetGroupUserMinSeq(groupID, in.UserID)
|
||||
x.MaxSeq = uint32(maxSeq)
|
||||
x.MinSeq = uint32(minSeq)
|
||||
m[groupID] = x
|
||||
}
|
||||
resp.GroupMaxAndMinSeq = m
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func (rpc *rpcChat) PullMessageBySeqList(_ context.Context, in *sdkws.PullMessageBySeqListReq) (*sdkws.PullMessageBySeqListResp, error) {
|
||||
log.NewInfo(in.OperationID, "rpc PullMessageBySeqList is arriving", in.String())
|
||||
resp := new(sdkws.PullMessageBySeqListResp)
|
||||
m := make(map[string]*sdkws.MsgDataList)
|
||||
redisMsgList, failedSeqList, err := commonDB.DB.GetMessageListBySeq(in.UserID, in.SeqList, in.OperationID)
|
||||
if err != nil {
|
||||
if err != go_redis.Nil {
|
||||
promePkg.PromeAdd(promePkg.MsgPullFromRedisFailedCounter, len(failedSeqList))
|
||||
log.Error(in.OperationID, "get message from redis exception", err.Error(), failedSeqList)
|
||||
} else {
|
||||
log.Debug(in.OperationID, "get message from redis is nil", failedSeqList)
|
||||
}
|
||||
msgList, err1 := commonDB.DB.GetMsgBySeqListMongo2(in.UserID, failedSeqList, in.OperationID)
|
||||
if err1 != nil {
|
||||
promePkg.PromeAdd(promePkg.MsgPullFromMongoFailedCounter, len(failedSeqList))
|
||||
log.Error(in.OperationID, "PullMessageBySeqList data error", in.String(), err1.Error())
|
||||
resp.ErrCode = 201
|
||||
resp.ErrMsg = err1.Error()
|
||||
return resp, nil
|
||||
} else {
|
||||
promePkg.PromeAdd(promePkg.MsgPullFromMongoSuccessCounter, len(msgList))
|
||||
redisMsgList = append(redisMsgList, msgList...)
|
||||
resp.List = redisMsgList
|
||||
}
|
||||
} else {
|
||||
promePkg.PromeAdd(promePkg.MsgPullFromRedisSuccessCounter, len(redisMsgList))
|
||||
resp.List = redisMsgList
|
||||
}
|
||||
|
||||
for k, v := range in.GroupSeqList {
|
||||
x := new(sdkws.MsgDataList)
|
||||
redisMsgList, failedSeqList, err := commonDB.DB.GetMessageListBySeq(k, v.SeqList, in.OperationID)
|
||||
if err != nil {
|
||||
if err != go_redis.Nil {
|
||||
promePkg.PromeAdd(promePkg.MsgPullFromRedisFailedCounter, len(failedSeqList))
|
||||
log.Error(in.OperationID, "get message from redis exception", err.Error(), failedSeqList)
|
||||
} else {
|
||||
log.Debug(in.OperationID, "get message from redis is nil", failedSeqList)
|
||||
}
|
||||
msgList, err1 := commonDB.DB.GetSuperGroupMsgBySeqListMongo(k, failedSeqList, in.OperationID)
|
||||
if err1 != nil {
|
||||
promePkg.PromeAdd(promePkg.MsgPullFromMongoFailedCounter, len(failedSeqList))
|
||||
log.Error(in.OperationID, "PullMessageBySeqList data error", in.String(), err1.Error())
|
||||
resp.ErrCode = 201
|
||||
resp.ErrMsg = err1.Error()
|
||||
return resp, nil
|
||||
} else {
|
||||
promePkg.PromeAdd(promePkg.MsgPullFromMongoSuccessCounter, len(msgList))
|
||||
redisMsgList = append(redisMsgList, msgList...)
|
||||
x.MsgDataList = redisMsgList
|
||||
m[k] = x
|
||||
}
|
||||
} else {
|
||||
promePkg.PromeAdd(promePkg.MsgPullFromRedisSuccessCounter, len(redisMsgList))
|
||||
x.MsgDataList = redisMsgList
|
||||
m[k] = x
|
||||
}
|
||||
}
|
||||
resp.GroupMsgDataList = m
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
type MsgFormats []*sdkws.MsgData
|
||||
|
||||
// Implement the sort.Interface interface to get the number of elements method
|
||||
func (s MsgFormats) Len() int {
|
||||
return len(s)
|
||||
}
|
||||
|
||||
//Implement the sort.Interface interface comparison element method
|
||||
func (s MsgFormats) Less(i, j int) bool {
|
||||
return s[i].SendTime < s[j].SendTime
|
||||
}
|
||||
|
||||
//Implement the sort.Interface interface exchange element method
|
||||
func (s MsgFormats) Swap(i, j int) {
|
||||
s[i], s[j] = s[j], s[i]
|
||||
}
|
@ -45,7 +45,3 @@ func (rpc *rpcChat) GetSuperGroupMsg(context context.Context, req *msg.GetSuperG
|
||||
log.Debug(req.OperationID, utils.GetSelfFuncName(), resp.String())
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func (rpc *rpcChat) GetWriteDiffMsg(context context.Context, req *msg.GetWriteDiffMsgReq) (*msg.GetWriteDiffMsgResp, error) {
|
||||
panic("implement me")
|
||||
}
|
||||
|
@ -7,10 +7,8 @@ import (
|
||||
rocksCache "Open_IM/pkg/common/db/rocks_cache"
|
||||
"Open_IM/pkg/common/log"
|
||||
"Open_IM/pkg/common/tokenverify"
|
||||
"Open_IM/pkg/getcdv3"
|
||||
cacheRpc "Open_IM/pkg/proto/cache"
|
||||
pbConversation "Open_IM/pkg/proto/conversation"
|
||||
pbChat "Open_IM/pkg/proto/msg"
|
||||
"Open_IM/pkg/proto/msg"
|
||||
pbPush "Open_IM/pkg/proto/push"
|
||||
pbRelay "Open_IM/pkg/proto/relay"
|
||||
sdkws "Open_IM/pkg/proto/sdkws"
|
||||
@ -23,26 +21,17 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
promePkg "Open_IM/pkg/common/prometheus"
|
||||
go_redis "github.com/go-redis/redis/v8"
|
||||
"github.com/golang/protobuf/proto"
|
||||
)
|
||||
|
||||
//When the number of group members is greater than this value,Online users will be sent first,Guaranteed service availability
|
||||
const GroupMemberNum = 500
|
||||
|
||||
var (
|
||||
ExcludeContentType = []int{constant.HasReadReceipt, constant.GroupHasReadReceipt}
|
||||
)
|
||||
|
||||
type Validator interface {
|
||||
validate(pb *pbChat.SendMsgReq) (bool, int32, string)
|
||||
validate(pb *msg.SendMsgReq) (bool, int32, string)
|
||||
}
|
||||
|
||||
//type MessageValidator struct {
|
||||
//
|
||||
//}
|
||||
|
||||
type MessageRevoked struct {
|
||||
RevokerID string `json:"revokerID"`
|
||||
RevokerRole int32 `json:"revokerRole"`
|
||||
@ -77,7 +66,7 @@ type MsgCallBackResp struct {
|
||||
}
|
||||
}
|
||||
|
||||
func isMessageHasReadEnabled(pb *pbChat.SendMsgReq) (bool, int32, string) {
|
||||
func isMessageHasReadEnabled(pb *msg.SendMsgReq) (bool, int32, string) {
|
||||
switch pb.MsgData.ContentType {
|
||||
case constant.HasReadReceipt:
|
||||
if config.Config.SingleMessageHasReadReceiptEnable {
|
||||
@ -341,298 +330,6 @@ func (rpc *rpcChat) encapsulateMsgData(msg *sdkws.MsgData) {
|
||||
utils.SetSwitchFromOptions(msg.Options, constant.IsOfflinePush, false)
|
||||
}
|
||||
}
|
||||
func (rpc *rpcChat) SendMsg(ctx context.Context, pb *pbChat.SendMsgReq) (*pbChat.SendMsgResp, error) {
|
||||
replay := pbChat.SendMsgResp{}
|
||||
log.Info(pb.OperationID, "rpc sendMsg come here ", pb.String())
|
||||
flag, errCode, errMsg := isMessageHasReadEnabled(pb)
|
||||
if !flag {
|
||||
return returnMsg(&replay, pb, errCode, errMsg, "", 0)
|
||||
}
|
||||
t1 := time.Now()
|
||||
rpc.encapsulateMsgData(pb.MsgData)
|
||||
log.Debug(pb.OperationID, "encapsulateMsgData ", " cost time: ", time.Since(t1))
|
||||
msgToMQSingle := pbChat.MsgDataToMQ{Token: pb.Token, OperationID: pb.OperationID, MsgData: pb.MsgData}
|
||||
// callback
|
||||
t1 = time.Now()
|
||||
callbackResp := callbackMsgModify(pb)
|
||||
log.Debug(pb.OperationID, "callbackMsgModify ", callbackResp, "cost time: ", time.Since(t1))
|
||||
if callbackResp.ErrCode != 0 {
|
||||
log.Error(pb.OperationID, utils.GetSelfFuncName(), "callbackMsgModify resp: ", callbackResp)
|
||||
}
|
||||
log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackResp: ", callbackResp)
|
||||
if callbackResp.ActionCode != constant.ActionAllow {
|
||||
if callbackResp.ErrCode == 0 {
|
||||
callbackResp.ErrCode = 201
|
||||
}
|
||||
log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackMsgModify result", "end rpc and return", pb.MsgData)
|
||||
return returnMsg(&replay, pb, int32(callbackResp.ErrCode), callbackResp.ErrMsg, "", 0)
|
||||
}
|
||||
switch pb.MsgData.SessionType {
|
||||
case constant.SingleChatType:
|
||||
promePkg.PromeInc(promePkg.SingleChatMsgRecvSuccessCounter)
|
||||
// callback
|
||||
t1 = time.Now()
|
||||
callbackResp := callbackBeforeSendSingleMsg(pb)
|
||||
log.Debug(pb.OperationID, "callbackBeforeSendSingleMsg ", " cost time: ", time.Since(t1))
|
||||
if callbackResp.ErrCode != 0 {
|
||||
log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendSingleMsg resp: ", callbackResp)
|
||||
}
|
||||
if callbackResp.ActionCode != constant.ActionAllow {
|
||||
if callbackResp.ErrCode == 0 {
|
||||
callbackResp.ErrCode = 201
|
||||
}
|
||||
log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendSingleMsg result", "end rpc and return", callbackResp)
|
||||
promePkg.PromeInc(promePkg.SingleChatMsgProcessFailedCounter)
|
||||
return returnMsg(&replay, pb, int32(callbackResp.ErrCode), callbackResp.ErrMsg, "", 0)
|
||||
}
|
||||
t1 = time.Now()
|
||||
flag, errCode, errMsg, _ = rpc.messageVerification(ctx, pb)
|
||||
log.Debug(pb.OperationID, "messageVerification ", flag, " cost time: ", time.Since(t1))
|
||||
if !flag {
|
||||
return returnMsg(&replay, pb, errCode, errMsg, "", 0)
|
||||
}
|
||||
t1 = time.Now()
|
||||
isSend := modifyMessageByUserMessageReceiveOpt(pb.MsgData.RecvID, pb.MsgData.SendID, constant.SingleChatType, pb)
|
||||
log.Info(pb.OperationID, "modifyMessageByUserMessageReceiveOpt ", " cost time: ", time.Since(t1))
|
||||
if isSend {
|
||||
msgToMQSingle.MsgData = pb.MsgData
|
||||
log.NewInfo(msgToMQSingle.OperationID, msgToMQSingle)
|
||||
t1 = time.Now()
|
||||
err1 := rpc.sendMsgToWriter(ctx, &msgToMQSingle, msgToMQSingle.MsgData.RecvID, constant.OnlineStatus)
|
||||
log.Info(pb.OperationID, "sendMsgToWriter ", " cost time: ", time.Since(t1))
|
||||
if err1 != nil {
|
||||
log.NewError(msgToMQSingle.OperationID, "kafka send msg err :RecvID", msgToMQSingle.MsgData.RecvID, msgToMQSingle.String(), err1.Error())
|
||||
promePkg.PromeInc(promePkg.SingleChatMsgProcessFailedCounter)
|
||||
return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0)
|
||||
}
|
||||
}
|
||||
if msgToMQSingle.MsgData.SendID != msgToMQSingle.MsgData.RecvID { //Filter messages sent to yourself
|
||||
t1 = time.Now()
|
||||
err2 := rpc.sendMsgToWriter(ctx, &msgToMQSingle, msgToMQSingle.MsgData.SendID, constant.OnlineStatus)
|
||||
log.Info(pb.OperationID, "sendMsgToWriter ", " cost time: ", time.Since(t1))
|
||||
if err2 != nil {
|
||||
log.NewError(msgToMQSingle.OperationID, "kafka send msg err:SendID", msgToMQSingle.MsgData.SendID, msgToMQSingle.String())
|
||||
promePkg.PromeInc(promePkg.SingleChatMsgProcessFailedCounter)
|
||||
return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0)
|
||||
}
|
||||
}
|
||||
// callback
|
||||
t1 = time.Now()
|
||||
callbackResp = callbackAfterSendSingleMsg(pb)
|
||||
log.Info(pb.OperationID, "callbackAfterSendSingleMsg ", " cost time: ", time.Since(t1))
|
||||
if callbackResp.ErrCode != 0 {
|
||||
log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackAfterSendSingleMsg resp: ", callbackResp)
|
||||
}
|
||||
promePkg.PromeInc(promePkg.SingleChatMsgProcessSuccessCounter)
|
||||
return returnMsg(&replay, pb, 0, "", msgToMQSingle.MsgData.ServerMsgID, msgToMQSingle.MsgData.SendTime)
|
||||
case constant.GroupChatType:
|
||||
// callback
|
||||
promePkg.PromeInc(promePkg.GroupChatMsgRecvSuccessCounter)
|
||||
callbackResp := callbackBeforeSendGroupMsg(pb)
|
||||
if callbackResp.ErrCode != 0 {
|
||||
log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendGroupMsg resp:", callbackResp)
|
||||
}
|
||||
if callbackResp.ActionCode != constant.ActionAllow {
|
||||
if callbackResp.ErrCode == 0 {
|
||||
callbackResp.ErrCode = 201
|
||||
}
|
||||
log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendSingleMsg result", "end rpc and return", callbackResp)
|
||||
promePkg.PromeInc(promePkg.GroupChatMsgProcessFailedCounter)
|
||||
return returnMsg(&replay, pb, int32(callbackResp.ErrCode), callbackResp.ErrMsg, "", 0)
|
||||
}
|
||||
var memberUserIDList []string
|
||||
if flag, errCode, errMsg, memberUserIDList = rpc.messageVerification(ctx, pb); !flag {
|
||||
promePkg.PromeInc(promePkg.GroupChatMsgProcessFailedCounter)
|
||||
return returnMsg(&replay, pb, errCode, errMsg, "", 0)
|
||||
}
|
||||
log.Debug(pb.OperationID, "GetGroupAllMember userID list", memberUserIDList, "len: ", len(memberUserIDList))
|
||||
var addUidList []string
|
||||
switch pb.MsgData.ContentType {
|
||||
case constant.MemberKickedNotification:
|
||||
var tips sdkws.TipsComm
|
||||
var memberKickedTips sdkws.MemberKickedTips
|
||||
err := proto.Unmarshal(pb.MsgData.Content, &tips)
|
||||
if err != nil {
|
||||
log.Error(pb.OperationID, "Unmarshal err", err.Error())
|
||||
}
|
||||
err = proto.Unmarshal(tips.Detail, &memberKickedTips)
|
||||
if err != nil {
|
||||
log.Error(pb.OperationID, "Unmarshal err", err.Error())
|
||||
}
|
||||
log.Info(pb.OperationID, "data is ", memberKickedTips)
|
||||
for _, v := range memberKickedTips.KickedUserList {
|
||||
addUidList = append(addUidList, v.UserID)
|
||||
}
|
||||
case constant.MemberQuitNotification:
|
||||
addUidList = append(addUidList, pb.MsgData.SendID)
|
||||
|
||||
default:
|
||||
}
|
||||
if len(addUidList) > 0 {
|
||||
memberUserIDList = append(memberUserIDList, addUidList...)
|
||||
}
|
||||
m := make(map[string][]string, 2)
|
||||
m[constant.OnlineStatus] = memberUserIDList
|
||||
t1 = time.Now()
|
||||
|
||||
//split parallel send
|
||||
var wg sync.WaitGroup
|
||||
var sendTag bool
|
||||
var split = 20
|
||||
for k, v := range m {
|
||||
remain := len(v) % split
|
||||
for i := 0; i < len(v)/split; i++ {
|
||||
wg.Add(1)
|
||||
tmp := valueCopy(pb)
|
||||
// go rpc.sendMsgToGroup(v[i*split:(i+1)*split], *pb, k, &sendTag, &wg)
|
||||
go rpc.sendMsgToGroupOptimization(ctx, v[i*split:(i+1)*split], tmp, k, &sendTag, &wg)
|
||||
}
|
||||
if remain > 0 {
|
||||
wg.Add(1)
|
||||
tmp := valueCopy(pb)
|
||||
// go rpc.sendMsgToGroup(v[split*(len(v)/split):], *pb, k, &sendTag, &wg)
|
||||
go rpc.sendMsgToGroupOptimization(ctx, v[split*(len(v)/split):], tmp, k, &sendTag, &wg)
|
||||
}
|
||||
}
|
||||
log.Debug(pb.OperationID, "send msg cost time22 ", time.Since(t1), pb.MsgData.ClientMsgID, "uidList : ", len(addUidList))
|
||||
//wg.Add(1)
|
||||
//go rpc.sendMsgToGroup(addUidList, *pb, constant.OnlineStatus, &sendTag, &wg)
|
||||
wg.Wait()
|
||||
t1 = time.Now()
|
||||
// callback
|
||||
callbackResp = callbackAfterSendGroupMsg(pb)
|
||||
if callbackResp.ErrCode != 0 {
|
||||
log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackAfterSendGroupMsg resp: ", callbackResp)
|
||||
}
|
||||
if !sendTag {
|
||||
log.NewWarn(pb.OperationID, "send tag is ", sendTag)
|
||||
promePkg.PromeInc(promePkg.GroupChatMsgProcessFailedCounter)
|
||||
return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0)
|
||||
} else {
|
||||
if pb.MsgData.ContentType == constant.AtText {
|
||||
go func() {
|
||||
var conversationReq pbConversation.ModifyConversationFieldReq
|
||||
var tag bool
|
||||
var atUserID []string
|
||||
conversation := pbConversation.Conversation{
|
||||
OwnerUserID: pb.MsgData.SendID,
|
||||
ConversationID: utils.GetConversationIDBySessionType(pb.MsgData.GroupID, constant.GroupChatType),
|
||||
ConversationType: constant.GroupChatType,
|
||||
GroupID: pb.MsgData.GroupID,
|
||||
}
|
||||
conversationReq.Conversation = &conversation
|
||||
conversationReq.OperationID = pb.OperationID
|
||||
conversationReq.FieldType = constant.FieldGroupAtType
|
||||
tagAll := utils.IsContain(constant.AtAllString, pb.MsgData.AtUserIDList)
|
||||
if tagAll {
|
||||
atUserID = utils.DifferenceString([]string{constant.AtAllString}, pb.MsgData.AtUserIDList)
|
||||
if len(atUserID) == 0 { //just @everyone
|
||||
conversationReq.UserIDList = memberUserIDList
|
||||
conversation.GroupAtType = constant.AtAll
|
||||
} else { //@Everyone and @other people
|
||||
conversationReq.UserIDList = atUserID
|
||||
conversation.GroupAtType = constant.AtAllAtMe
|
||||
tag = true
|
||||
}
|
||||
} else {
|
||||
conversationReq.UserIDList = pb.MsgData.AtUserIDList
|
||||
conversation.GroupAtType = constant.AtMe
|
||||
}
|
||||
etcdConn, err := rpc.GetConn(ctx, config.Config.RpcRegisterName.OpenImConversationName)
|
||||
if err != nil {
|
||||
errMsg := pb.OperationID + "getcdv3.GetDefaultConn == nil"
|
||||
log.NewError(pb.OperationID, errMsg)
|
||||
return
|
||||
}
|
||||
client := pbConversation.NewConversationClient(etcdConn)
|
||||
conversationReply, err := client.ModifyConversationField(context.Background(), &conversationReq)
|
||||
if err != nil {
|
||||
log.NewError(conversationReq.OperationID, "ModifyConversationField rpc failed, ", conversationReq.String(), err.Error())
|
||||
} else if conversationReply.CommonResp.ErrCode != 0 {
|
||||
log.NewError(conversationReq.OperationID, "ModifyConversationField rpc failed, ", conversationReq.String(), conversationReply.String())
|
||||
}
|
||||
if tag {
|
||||
conversationReq.UserIDList = utils.DifferenceString(atUserID, memberUserIDList)
|
||||
conversation.GroupAtType = constant.AtAll
|
||||
etcdConn := rpc.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImConversationName, pb.OperationID)
|
||||
if etcdConn == nil {
|
||||
errMsg := pb.OperationID + "getcdv3.GetDefaultConn == nil"
|
||||
log.NewError(pb.OperationID, errMsg)
|
||||
return
|
||||
}
|
||||
client := pbConversation.NewConversationClient(etcdConn)
|
||||
conversationReply, err := client.ModifyConversationField(context.Background(), &conversationReq)
|
||||
if err != nil {
|
||||
log.NewError(conversationReq.OperationID, "ModifyConversationField rpc failed, ", conversationReq.String(), err.Error())
|
||||
} else if conversationReply.CommonResp.ErrCode != 0 {
|
||||
log.NewError(conversationReq.OperationID, "ModifyConversationField rpc failed, ", conversationReq.String(), conversationReply.String())
|
||||
}
|
||||
}
|
||||
}()
|
||||
}
|
||||
log.Debug(pb.OperationID, "send msg cost time3 ", time.Since(t1), pb.MsgData.ClientMsgID)
|
||||
promePkg.PromeInc(promePkg.GroupChatMsgProcessSuccessCounter)
|
||||
return returnMsg(&replay, pb, 0, "", msgToMQSingle.MsgData.ServerMsgID, msgToMQSingle.MsgData.SendTime)
|
||||
}
|
||||
case constant.NotificationChatType:
|
||||
t1 = time.Now()
|
||||
msgToMQSingle.MsgData = pb.MsgData
|
||||
log.NewInfo(msgToMQSingle.OperationID, msgToMQSingle)
|
||||
err1 := rpc.sendMsgToWriter(ctx, &msgToMQSingle, msgToMQSingle.MsgData.RecvID, constant.OnlineStatus)
|
||||
if err1 != nil {
|
||||
log.NewError(msgToMQSingle.OperationID, "kafka send msg err:RecvID", msgToMQSingle.MsgData.RecvID, msgToMQSingle.String())
|
||||
return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0)
|
||||
}
|
||||
|
||||
if msgToMQSingle.MsgData.SendID != msgToMQSingle.MsgData.RecvID { //Filter messages sent to yourself
|
||||
err2 := rpc.sendMsgToWriter(ctx, &msgToMQSingle, msgToMQSingle.MsgData.SendID, constant.OnlineStatus)
|
||||
if err2 != nil {
|
||||
log.NewError(msgToMQSingle.OperationID, "kafka send msg err:SendID", msgToMQSingle.MsgData.SendID, msgToMQSingle.String())
|
||||
return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0)
|
||||
}
|
||||
}
|
||||
|
||||
log.Debug(pb.OperationID, "send msg cost time ", time.Since(t1), pb.MsgData.ClientMsgID)
|
||||
return returnMsg(&replay, pb, 0, "", msgToMQSingle.MsgData.ServerMsgID, msgToMQSingle.MsgData.SendTime)
|
||||
case constant.SuperGroupChatType:
|
||||
promePkg.PromeInc(promePkg.WorkSuperGroupChatMsgRecvSuccessCounter)
|
||||
// callback
|
||||
callbackResp := callbackBeforeSendGroupMsg(pb)
|
||||
if callbackResp.ErrCode != 0 {
|
||||
log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendSuperGroupMsg resp: ", callbackResp)
|
||||
}
|
||||
if callbackResp.ActionCode != constant.ActionAllow {
|
||||
if callbackResp.ErrCode == 0 {
|
||||
callbackResp.ErrCode = 201
|
||||
}
|
||||
promePkg.PromeInc(promePkg.WorkSuperGroupChatMsgProcessFailedCounter)
|
||||
log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendSuperGroupMsg result", "end rpc and return", callbackResp)
|
||||
return returnMsg(&replay, pb, int32(callbackResp.ErrCode), callbackResp.ErrMsg, "", 0)
|
||||
}
|
||||
if flag, errCode, errMsg, _ = rpc.messageVerification(ctx, pb); !flag {
|
||||
promePkg.PromeInc(promePkg.WorkSuperGroupChatMsgProcessFailedCounter)
|
||||
return returnMsg(&replay, pb, errCode, errMsg, "", 0)
|
||||
}
|
||||
msgToMQSingle.MsgData = pb.MsgData
|
||||
log.NewInfo(msgToMQSingle.OperationID, msgToMQSingle)
|
||||
err1 := rpc.sendMsgToWriter(ctx, &msgToMQSingle, msgToMQSingle.MsgData.GroupID, constant.OnlineStatus)
|
||||
if err1 != nil {
|
||||
log.NewError(msgToMQSingle.OperationID, "kafka send msg err:RecvID", msgToMQSingle.MsgData.RecvID, msgToMQSingle.String())
|
||||
promePkg.PromeInc(promePkg.WorkSuperGroupChatMsgProcessFailedCounter)
|
||||
return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0)
|
||||
}
|
||||
// callback
|
||||
callbackResp = callbackAfterSendGroupMsg(pb)
|
||||
if callbackResp.ErrCode != 0 {
|
||||
log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackAfterSendSuperGroupMsg resp: ", callbackResp)
|
||||
}
|
||||
promePkg.PromeInc(promePkg.WorkSuperGroupChatMsgProcessSuccessCounter)
|
||||
return returnMsg(&replay, pb, 0, "", msgToMQSingle.MsgData.ServerMsgID, msgToMQSingle.MsgData.SendTime)
|
||||
|
||||
default:
|
||||
return returnMsg(&replay, pb, 203, "unknown sessionType", "", 0)
|
||||
}
|
||||
}
|
||||
|
||||
func (rpc *rpcChat) sendMsgToWriter(ctx context.Context, m *pbChat.MsgDataToMQ, key string, status string) error {
|
||||
switch status {
|
||||
@ -747,288 +444,6 @@ func modifyMessageByUserMessageReceiveOptoptimization(userID, sourceID string, s
|
||||
return true
|
||||
}
|
||||
|
||||
type NotificationMsg struct {
|
||||
SendID string
|
||||
RecvID string
|
||||
Content []byte // sdkws.TipsComm
|
||||
MsgFrom int32
|
||||
ContentType int32
|
||||
SessionType int32
|
||||
OperationID string
|
||||
SenderNickname string
|
||||
SenderFaceURL string
|
||||
}
|
||||
|
||||
func Notification(n *NotificationMsg) {
|
||||
var req pbChat.SendMsgReq
|
||||
var msg sdkws.MsgData
|
||||
var offlineInfo sdkws.OfflinePushInfo
|
||||
var title, desc, ex string
|
||||
var pushSwitch, unReadCount bool
|
||||
var reliabilityLevel int
|
||||
req.OperationID = n.OperationID
|
||||
msg.SendID = n.SendID
|
||||
msg.RecvID = n.RecvID
|
||||
msg.Content = n.Content
|
||||
msg.MsgFrom = n.MsgFrom
|
||||
msg.ContentType = n.ContentType
|
||||
msg.SessionType = n.SessionType
|
||||
msg.CreateTime = utils.GetCurrentTimestampByMill()
|
||||
msg.ClientMsgID = utils.GetMsgID(n.SendID)
|
||||
msg.Options = make(map[string]bool, 7)
|
||||
msg.SenderNickname = n.SenderNickname
|
||||
msg.SenderFaceURL = n.SenderFaceURL
|
||||
switch n.SessionType {
|
||||
case constant.GroupChatType, constant.SuperGroupChatType:
|
||||
msg.RecvID = ""
|
||||
msg.GroupID = n.RecvID
|
||||
}
|
||||
offlineInfo.IOSBadgeCount = config.Config.IOSPush.BadgeCount
|
||||
offlineInfo.IOSPushSound = config.Config.IOSPush.PushSound
|
||||
switch msg.ContentType {
|
||||
case constant.GroupCreatedNotification:
|
||||
pushSwitch = config.Config.Notification.GroupCreated.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.GroupCreated.OfflinePush.Title
|
||||
desc = config.Config.Notification.GroupCreated.OfflinePush.Desc
|
||||
ex = config.Config.Notification.GroupCreated.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.GroupCreated.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.GroupCreated.Conversation.UnreadCount
|
||||
case constant.GroupInfoSetNotification:
|
||||
pushSwitch = config.Config.Notification.GroupInfoSet.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.GroupInfoSet.OfflinePush.Title
|
||||
desc = config.Config.Notification.GroupInfoSet.OfflinePush.Desc
|
||||
ex = config.Config.Notification.GroupInfoSet.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.GroupInfoSet.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.GroupInfoSet.Conversation.UnreadCount
|
||||
case constant.JoinGroupApplicationNotification:
|
||||
pushSwitch = config.Config.Notification.JoinGroupApplication.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.JoinGroupApplication.OfflinePush.Title
|
||||
desc = config.Config.Notification.JoinGroupApplication.OfflinePush.Desc
|
||||
ex = config.Config.Notification.JoinGroupApplication.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.JoinGroupApplication.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.JoinGroupApplication.Conversation.UnreadCount
|
||||
case constant.MemberQuitNotification:
|
||||
pushSwitch = config.Config.Notification.MemberQuit.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.MemberQuit.OfflinePush.Title
|
||||
desc = config.Config.Notification.MemberQuit.OfflinePush.Desc
|
||||
ex = config.Config.Notification.MemberQuit.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.MemberQuit.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.MemberQuit.Conversation.UnreadCount
|
||||
case constant.GroupApplicationAcceptedNotification:
|
||||
pushSwitch = config.Config.Notification.GroupApplicationAccepted.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.GroupApplicationAccepted.OfflinePush.Title
|
||||
desc = config.Config.Notification.GroupApplicationAccepted.OfflinePush.Desc
|
||||
ex = config.Config.Notification.GroupApplicationAccepted.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.GroupApplicationAccepted.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.GroupApplicationAccepted.Conversation.UnreadCount
|
||||
case constant.GroupApplicationRejectedNotification:
|
||||
pushSwitch = config.Config.Notification.GroupApplicationRejected.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.GroupApplicationRejected.OfflinePush.Title
|
||||
desc = config.Config.Notification.GroupApplicationRejected.OfflinePush.Desc
|
||||
ex = config.Config.Notification.GroupApplicationRejected.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.GroupApplicationRejected.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.GroupApplicationRejected.Conversation.UnreadCount
|
||||
case constant.GroupOwnerTransferredNotification:
|
||||
pushSwitch = config.Config.Notification.GroupOwnerTransferred.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.GroupOwnerTransferred.OfflinePush.Title
|
||||
desc = config.Config.Notification.GroupOwnerTransferred.OfflinePush.Desc
|
||||
ex = config.Config.Notification.GroupOwnerTransferred.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.GroupOwnerTransferred.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.GroupOwnerTransferred.Conversation.UnreadCount
|
||||
case constant.MemberKickedNotification:
|
||||
pushSwitch = config.Config.Notification.MemberKicked.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.MemberKicked.OfflinePush.Title
|
||||
desc = config.Config.Notification.MemberKicked.OfflinePush.Desc
|
||||
ex = config.Config.Notification.MemberKicked.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.MemberKicked.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.MemberKicked.Conversation.UnreadCount
|
||||
case constant.MemberInvitedNotification:
|
||||
pushSwitch = config.Config.Notification.MemberInvited.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.MemberInvited.OfflinePush.Title
|
||||
desc = config.Config.Notification.MemberInvited.OfflinePush.Desc
|
||||
ex = config.Config.Notification.MemberInvited.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.MemberInvited.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.MemberInvited.Conversation.UnreadCount
|
||||
case constant.MemberEnterNotification:
|
||||
pushSwitch = config.Config.Notification.MemberEnter.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.MemberEnter.OfflinePush.Title
|
||||
desc = config.Config.Notification.MemberEnter.OfflinePush.Desc
|
||||
ex = config.Config.Notification.MemberEnter.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.MemberEnter.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.MemberEnter.Conversation.UnreadCount
|
||||
case constant.UserInfoUpdatedNotification:
|
||||
pushSwitch = config.Config.Notification.UserInfoUpdated.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.UserInfoUpdated.OfflinePush.Title
|
||||
desc = config.Config.Notification.UserInfoUpdated.OfflinePush.Desc
|
||||
ex = config.Config.Notification.UserInfoUpdated.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.UserInfoUpdated.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.UserInfoUpdated.Conversation.UnreadCount
|
||||
case constant.FriendApplicationNotification:
|
||||
pushSwitch = config.Config.Notification.FriendApplication.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.FriendApplication.OfflinePush.Title
|
||||
desc = config.Config.Notification.FriendApplication.OfflinePush.Desc
|
||||
ex = config.Config.Notification.FriendApplication.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.FriendApplication.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.FriendApplication.Conversation.UnreadCount
|
||||
case constant.FriendApplicationApprovedNotification:
|
||||
pushSwitch = config.Config.Notification.FriendApplicationApproved.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.FriendApplicationApproved.OfflinePush.Title
|
||||
desc = config.Config.Notification.FriendApplicationApproved.OfflinePush.Desc
|
||||
ex = config.Config.Notification.FriendApplicationApproved.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.FriendApplicationApproved.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.FriendApplicationApproved.Conversation.UnreadCount
|
||||
case constant.FriendApplicationRejectedNotification:
|
||||
pushSwitch = config.Config.Notification.FriendApplicationRejected.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.FriendApplicationRejected.OfflinePush.Title
|
||||
desc = config.Config.Notification.FriendApplicationRejected.OfflinePush.Desc
|
||||
ex = config.Config.Notification.FriendApplicationRejected.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.FriendApplicationRejected.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.FriendApplicationRejected.Conversation.UnreadCount
|
||||
case constant.FriendAddedNotification:
|
||||
pushSwitch = config.Config.Notification.FriendAdded.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.FriendAdded.OfflinePush.Title
|
||||
desc = config.Config.Notification.FriendAdded.OfflinePush.Desc
|
||||
ex = config.Config.Notification.FriendAdded.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.FriendAdded.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.FriendAdded.Conversation.UnreadCount
|
||||
case constant.FriendDeletedNotification:
|
||||
pushSwitch = config.Config.Notification.FriendDeleted.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.FriendDeleted.OfflinePush.Title
|
||||
desc = config.Config.Notification.FriendDeleted.OfflinePush.Desc
|
||||
ex = config.Config.Notification.FriendDeleted.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.FriendDeleted.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.FriendDeleted.Conversation.UnreadCount
|
||||
case constant.FriendRemarkSetNotification:
|
||||
pushSwitch = config.Config.Notification.FriendRemarkSet.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.FriendRemarkSet.OfflinePush.Title
|
||||
desc = config.Config.Notification.FriendRemarkSet.OfflinePush.Desc
|
||||
ex = config.Config.Notification.FriendRemarkSet.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.FriendRemarkSet.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.FriendRemarkSet.Conversation.UnreadCount
|
||||
case constant.BlackAddedNotification:
|
||||
pushSwitch = config.Config.Notification.BlackAdded.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.BlackAdded.OfflinePush.Title
|
||||
desc = config.Config.Notification.BlackAdded.OfflinePush.Desc
|
||||
ex = config.Config.Notification.BlackAdded.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.BlackAdded.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.BlackAdded.Conversation.UnreadCount
|
||||
case constant.BlackDeletedNotification:
|
||||
pushSwitch = config.Config.Notification.BlackDeleted.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.BlackDeleted.OfflinePush.Title
|
||||
desc = config.Config.Notification.BlackDeleted.OfflinePush.Desc
|
||||
ex = config.Config.Notification.BlackDeleted.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.BlackDeleted.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.BlackDeleted.Conversation.UnreadCount
|
||||
case constant.ConversationOptChangeNotification:
|
||||
pushSwitch = config.Config.Notification.ConversationOptUpdate.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.ConversationOptUpdate.OfflinePush.Title
|
||||
desc = config.Config.Notification.ConversationOptUpdate.OfflinePush.Desc
|
||||
ex = config.Config.Notification.ConversationOptUpdate.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.ConversationOptUpdate.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.ConversationOptUpdate.Conversation.UnreadCount
|
||||
|
||||
case constant.GroupDismissedNotification:
|
||||
pushSwitch = config.Config.Notification.GroupDismissed.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.GroupDismissed.OfflinePush.Title
|
||||
desc = config.Config.Notification.GroupDismissed.OfflinePush.Desc
|
||||
ex = config.Config.Notification.GroupDismissed.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.GroupDismissed.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.GroupDismissed.Conversation.UnreadCount
|
||||
|
||||
case constant.GroupMutedNotification:
|
||||
pushSwitch = config.Config.Notification.GroupMuted.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.GroupMuted.OfflinePush.Title
|
||||
desc = config.Config.Notification.GroupMuted.OfflinePush.Desc
|
||||
ex = config.Config.Notification.GroupMuted.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.GroupMuted.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.GroupMuted.Conversation.UnreadCount
|
||||
|
||||
case constant.GroupCancelMutedNotification:
|
||||
pushSwitch = config.Config.Notification.GroupCancelMuted.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.GroupCancelMuted.OfflinePush.Title
|
||||
desc = config.Config.Notification.GroupCancelMuted.OfflinePush.Desc
|
||||
ex = config.Config.Notification.GroupCancelMuted.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.GroupCancelMuted.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.GroupCancelMuted.Conversation.UnreadCount
|
||||
|
||||
case constant.GroupMemberMutedNotification:
|
||||
pushSwitch = config.Config.Notification.GroupMemberMuted.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.GroupMemberMuted.OfflinePush.Title
|
||||
desc = config.Config.Notification.GroupMemberMuted.OfflinePush.Desc
|
||||
ex = config.Config.Notification.GroupMemberMuted.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.GroupMemberMuted.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.GroupMemberMuted.Conversation.UnreadCount
|
||||
|
||||
case constant.GroupMemberCancelMutedNotification:
|
||||
pushSwitch = config.Config.Notification.GroupMemberCancelMuted.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.GroupMemberCancelMuted.OfflinePush.Title
|
||||
desc = config.Config.Notification.GroupMemberCancelMuted.OfflinePush.Desc
|
||||
ex = config.Config.Notification.GroupMemberCancelMuted.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.GroupMemberCancelMuted.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.GroupMemberCancelMuted.Conversation.UnreadCount
|
||||
|
||||
case constant.GroupMemberInfoSetNotification:
|
||||
pushSwitch = config.Config.Notification.GroupMemberInfoSet.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.GroupMemberInfoSet.OfflinePush.Title
|
||||
desc = config.Config.Notification.GroupMemberInfoSet.OfflinePush.Desc
|
||||
ex = config.Config.Notification.GroupMemberInfoSet.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.GroupMemberInfoSet.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.GroupMemberInfoSet.Conversation.UnreadCount
|
||||
|
||||
case constant.ConversationPrivateChatNotification:
|
||||
pushSwitch = config.Config.Notification.ConversationSetPrivate.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.ConversationSetPrivate.OfflinePush.Title
|
||||
desc = config.Config.Notification.ConversationSetPrivate.OfflinePush.Desc
|
||||
ex = config.Config.Notification.ConversationSetPrivate.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.ConversationSetPrivate.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.ConversationSetPrivate.Conversation.UnreadCount
|
||||
case constant.FriendInfoUpdatedNotification:
|
||||
pushSwitch = config.Config.Notification.FriendInfoUpdated.OfflinePush.PushSwitch
|
||||
title = config.Config.Notification.FriendInfoUpdated.OfflinePush.Title
|
||||
desc = config.Config.Notification.FriendInfoUpdated.OfflinePush.Desc
|
||||
ex = config.Config.Notification.FriendInfoUpdated.OfflinePush.Ext
|
||||
reliabilityLevel = config.Config.Notification.FriendInfoUpdated.Conversation.ReliabilityLevel
|
||||
unReadCount = config.Config.Notification.FriendInfoUpdated.Conversation.UnreadCount
|
||||
case constant.DeleteMessageNotification:
|
||||
reliabilityLevel = constant.ReliableNotificationNoMsg
|
||||
case constant.ConversationUnreadNotification, constant.SuperGroupUpdateNotification:
|
||||
reliabilityLevel = constant.UnreliableNotification
|
||||
}
|
||||
switch reliabilityLevel {
|
||||
case constant.UnreliableNotification:
|
||||
utils.SetSwitchFromOptions(msg.Options, constant.IsHistory, false)
|
||||
utils.SetSwitchFromOptions(msg.Options, constant.IsPersistent, false)
|
||||
utils.SetSwitchFromOptions(msg.Options, constant.IsConversationUpdate, false)
|
||||
utils.SetSwitchFromOptions(msg.Options, constant.IsSenderConversationUpdate, false)
|
||||
case constant.ReliableNotificationNoMsg:
|
||||
utils.SetSwitchFromOptions(msg.Options, constant.IsConversationUpdate, false)
|
||||
utils.SetSwitchFromOptions(msg.Options, constant.IsSenderConversationUpdate, false)
|
||||
case constant.ReliableNotificationMsg:
|
||||
|
||||
}
|
||||
utils.SetSwitchFromOptions(msg.Options, constant.IsUnreadCount, unReadCount)
|
||||
utils.SetSwitchFromOptions(msg.Options, constant.IsOfflinePush, pushSwitch)
|
||||
offlineInfo.Title = title
|
||||
offlineInfo.Desc = desc
|
||||
offlineInfo.Ex = ex
|
||||
msg.OfflinePushInfo = &offlineInfo
|
||||
req.MsgData = &msg
|
||||
etcdConn := rpc.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMsgName, req.OperationID)
|
||||
if etcdConn == nil {
|
||||
errMsg := req.OperationID + "getcdv3.GetDefaultConn == nil"
|
||||
log.NewError(req.OperationID, errMsg)
|
||||
return
|
||||
}
|
||||
|
||||
client := pbChat.NewMsgClient(etcdConn)
|
||||
reply, err := client.SendMsg(context.Background(), &req)
|
||||
if err != nil {
|
||||
log.NewError(req.OperationID, "SendMsg rpc failed, ", req.String(), err.Error())
|
||||
} else if reply.ErrCode != 0 {
|
||||
log.NewError(req.OperationID, "SendMsg rpc failed, ", req.String(), reply.ErrCode, reply.ErrMsg)
|
||||
}
|
||||
}
|
||||
|
||||
func getOnlineAndOfflineUserIDList(memberList []string, m map[string][]string, operationID string) {
|
||||
var onllUserIDList, offlUserIDList []string
|
||||
var wsResult []*pbRelay.GetUsersOnlineStatusResp_SuccessResult
|
||||
|
403
internal/rpc/msg/send_pull.go
Normal file
403
internal/rpc/msg/send_pull.go
Normal file
@ -0,0 +1,403 @@
|
||||
package msg
|
||||
|
||||
import (
|
||||
"Open_IM/pkg/common/constant"
|
||||
promePkg "Open_IM/pkg/common/prometheus"
|
||||
pbConversation "Open_IM/pkg/proto/conversation"
|
||||
pbChat "Open_IM/pkg/proto/msg"
|
||||
"Open_IM/pkg/proto/sdkws"
|
||||
"context"
|
||||
go_redis "github.com/go-redis/redis/v8"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
func (m *msgServer) SendMsg(ctx context.Context, pb *pbChat.SendMsgReq) (*pbChat.SendMsgResp, error) {
|
||||
replay := pbChat.SendMsgResp{}
|
||||
|
||||
flag, errCode, errMsg := isMessageHasReadEnabled(pb)
|
||||
if !flag {
|
||||
return returnMsg(&replay, pb, errCode, errMsg, "", 0)
|
||||
}
|
||||
t1 := time.Now()
|
||||
rpc.encapsulateMsgData(pb.MsgData)
|
||||
log.Debug(pb.OperationID, "encapsulateMsgData ", " cost time: ", time.Since(t1))
|
||||
msgToMQSingle := pbChat.MsgDataToMQ{Token: pb.Token, OperationID: pb.OperationID, MsgData: pb.MsgData}
|
||||
// callback
|
||||
t1 = time.Now()
|
||||
callbackResp := callbackMsgModify(pb)
|
||||
log.Debug(pb.OperationID, "callbackMsgModify ", callbackResp, "cost time: ", time.Since(t1))
|
||||
if callbackResp.ErrCode != 0 {
|
||||
log.Error(pb.OperationID, utils.GetSelfFuncName(), "callbackMsgModify resp: ", callbackResp)
|
||||
}
|
||||
log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackResp: ", callbackResp)
|
||||
if callbackResp.ActionCode != constant.ActionAllow {
|
||||
if callbackResp.ErrCode == 0 {
|
||||
callbackResp.ErrCode = 201
|
||||
}
|
||||
log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackMsgModify result", "end rpc and return", pb.MsgData)
|
||||
return returnMsg(&replay, pb, int32(callbackResp.ErrCode), callbackResp.ErrMsg, "", 0)
|
||||
}
|
||||
switch pb.MsgData.SessionType {
|
||||
case constant.SingleChatType:
|
||||
promePkg.PromeInc(promePkg.SingleChatMsgRecvSuccessCounter)
|
||||
// callback
|
||||
t1 = time.Now()
|
||||
callbackResp := callbackBeforeSendSingleMsg(pb)
|
||||
log.Debug(pb.OperationID, "callbackBeforeSendSingleMsg ", " cost time: ", time.Since(t1))
|
||||
if callbackResp.ErrCode != 0 {
|
||||
log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendSingleMsg resp: ", callbackResp)
|
||||
}
|
||||
if callbackResp.ActionCode != constant.ActionAllow {
|
||||
if callbackResp.ErrCode == 0 {
|
||||
callbackResp.ErrCode = 201
|
||||
}
|
||||
log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendSingleMsg result", "end rpc and return", callbackResp)
|
||||
promePkg.PromeInc(promePkg.SingleChatMsgProcessFailedCounter)
|
||||
return returnMsg(&replay, pb, int32(callbackResp.ErrCode), callbackResp.ErrMsg, "", 0)
|
||||
}
|
||||
t1 = time.Now()
|
||||
flag, errCode, errMsg, _ = rpc.messageVerification(ctx, pb)
|
||||
log.Debug(pb.OperationID, "messageVerification ", flag, " cost time: ", time.Since(t1))
|
||||
if !flag {
|
||||
return returnMsg(&replay, pb, errCode, errMsg, "", 0)
|
||||
}
|
||||
t1 = time.Now()
|
||||
isSend := modifyMessageByUserMessageReceiveOpt(pb.MsgData.RecvID, pb.MsgData.SendID, constant.SingleChatType, pb)
|
||||
log.Info(pb.OperationID, "modifyMessageByUserMessageReceiveOpt ", " cost time: ", time.Since(t1))
|
||||
if isSend {
|
||||
msgToMQSingle.MsgData = pb.MsgData
|
||||
log.NewInfo(msgToMQSingle.OperationID, msgToMQSingle)
|
||||
t1 = time.Now()
|
||||
err1 := rpc.sendMsgToWriter(ctx, &msgToMQSingle, msgToMQSingle.MsgData.RecvID, constant.OnlineStatus)
|
||||
log.Info(pb.OperationID, "sendMsgToWriter ", " cost time: ", time.Since(t1))
|
||||
if err1 != nil {
|
||||
log.NewError(msgToMQSingle.OperationID, "kafka send msg err :RecvID", msgToMQSingle.MsgData.RecvID, msgToMQSingle.String(), err1.Error())
|
||||
promePkg.PromeInc(promePkg.SingleChatMsgProcessFailedCounter)
|
||||
return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0)
|
||||
}
|
||||
}
|
||||
if msgToMQSingle.MsgData.SendID != msgToMQSingle.MsgData.RecvID { //Filter messages sent to yourself
|
||||
t1 = time.Now()
|
||||
err2 := rpc.sendMsgToWriter(ctx, &msgToMQSingle, msgToMQSingle.MsgData.SendID, constant.OnlineStatus)
|
||||
log.Info(pb.OperationID, "sendMsgToWriter ", " cost time: ", time.Since(t1))
|
||||
if err2 != nil {
|
||||
log.NewError(msgToMQSingle.OperationID, "kafka send msg err:SendID", msgToMQSingle.MsgData.SendID, msgToMQSingle.String())
|
||||
promePkg.PromeInc(promePkg.SingleChatMsgProcessFailedCounter)
|
||||
return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0)
|
||||
}
|
||||
}
|
||||
// callback
|
||||
t1 = time.Now()
|
||||
callbackResp = callbackAfterSendSingleMsg(pb)
|
||||
log.Info(pb.OperationID, "callbackAfterSendSingleMsg ", " cost time: ", time.Since(t1))
|
||||
if callbackResp.ErrCode != 0 {
|
||||
log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackAfterSendSingleMsg resp: ", callbackResp)
|
||||
}
|
||||
promePkg.PromeInc(promePkg.SingleChatMsgProcessSuccessCounter)
|
||||
return returnMsg(&replay, pb, 0, "", msgToMQSingle.MsgData.ServerMsgID, msgToMQSingle.MsgData.SendTime)
|
||||
case constant.GroupChatType:
|
||||
// callback
|
||||
promePkg.PromeInc(promePkg.GroupChatMsgRecvSuccessCounter)
|
||||
callbackResp := callbackBeforeSendGroupMsg(pb)
|
||||
if callbackResp.ErrCode != 0 {
|
||||
log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendGroupMsg resp:", callbackResp)
|
||||
}
|
||||
if callbackResp.ActionCode != constant.ActionAllow {
|
||||
if callbackResp.ErrCode == 0 {
|
||||
callbackResp.ErrCode = 201
|
||||
}
|
||||
log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendSingleMsg result", "end rpc and return", callbackResp)
|
||||
promePkg.PromeInc(promePkg.GroupChatMsgProcessFailedCounter)
|
||||
return returnMsg(&replay, pb, int32(callbackResp.ErrCode), callbackResp.ErrMsg, "", 0)
|
||||
}
|
||||
var memberUserIDList []string
|
||||
if flag, errCode, errMsg, memberUserIDList = rpc.messageVerification(ctx, pb); !flag {
|
||||
promePkg.PromeInc(promePkg.GroupChatMsgProcessFailedCounter)
|
||||
return returnMsg(&replay, pb, errCode, errMsg, "", 0)
|
||||
}
|
||||
log.Debug(pb.OperationID, "GetGroupAllMember userID list", memberUserIDList, "len: ", len(memberUserIDList))
|
||||
var addUidList []string
|
||||
switch pb.MsgData.ContentType {
|
||||
case constant.MemberKickedNotification:
|
||||
var tips sdkws.TipsComm
|
||||
var memberKickedTips sdkws.MemberKickedTips
|
||||
err := proto.Unmarshal(pb.MsgData.Content, &tips)
|
||||
if err != nil {
|
||||
log.Error(pb.OperationID, "Unmarshal err", err.Error())
|
||||
}
|
||||
err = proto.Unmarshal(tips.Detail, &memberKickedTips)
|
||||
if err != nil {
|
||||
log.Error(pb.OperationID, "Unmarshal err", err.Error())
|
||||
}
|
||||
log.Info(pb.OperationID, "data is ", memberKickedTips)
|
||||
for _, v := range memberKickedTips.KickedUserList {
|
||||
addUidList = append(addUidList, v.UserID)
|
||||
}
|
||||
case constant.MemberQuitNotification:
|
||||
addUidList = append(addUidList, pb.MsgData.SendID)
|
||||
|
||||
default:
|
||||
}
|
||||
if len(addUidList) > 0 {
|
||||
memberUserIDList = append(memberUserIDList, addUidList...)
|
||||
}
|
||||
m := make(map[string][]string, 2)
|
||||
m[constant.OnlineStatus] = memberUserIDList
|
||||
t1 = time.Now()
|
||||
|
||||
//split parallel send
|
||||
var wg sync.WaitGroup
|
||||
var sendTag bool
|
||||
var split = 20
|
||||
for k, v := range m {
|
||||
remain := len(v) % split
|
||||
for i := 0; i < len(v)/split; i++ {
|
||||
wg.Add(1)
|
||||
tmp := valueCopy(pb)
|
||||
// go rpc.sendMsgToGroup(v[i*split:(i+1)*split], *pb, k, &sendTag, &wg)
|
||||
go rpc.sendMsgToGroupOptimization(ctx, v[i*split:(i+1)*split], tmp, k, &sendTag, &wg)
|
||||
}
|
||||
if remain > 0 {
|
||||
wg.Add(1)
|
||||
tmp := valueCopy(pb)
|
||||
// go rpc.sendMsgToGroup(v[split*(len(v)/split):], *pb, k, &sendTag, &wg)
|
||||
go rpc.sendMsgToGroupOptimization(ctx, v[split*(len(v)/split):], tmp, k, &sendTag, &wg)
|
||||
}
|
||||
}
|
||||
log.Debug(pb.OperationID, "send msg cost time22 ", time.Since(t1), pb.MsgData.ClientMsgID, "uidList : ", len(addUidList))
|
||||
//wg.Add(1)
|
||||
//go rpc.sendMsgToGroup(addUidList, *pb, constant.OnlineStatus, &sendTag, &wg)
|
||||
wg.Wait()
|
||||
t1 = time.Now()
|
||||
// callback
|
||||
callbackResp = callbackAfterSendGroupMsg(pb)
|
||||
if callbackResp.ErrCode != 0 {
|
||||
log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackAfterSendGroupMsg resp: ", callbackResp)
|
||||
}
|
||||
if !sendTag {
|
||||
log.NewWarn(pb.OperationID, "send tag is ", sendTag)
|
||||
promePkg.PromeInc(promePkg.GroupChatMsgProcessFailedCounter)
|
||||
return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0)
|
||||
} else {
|
||||
if pb.MsgData.ContentType == constant.AtText {
|
||||
go func() {
|
||||
var conversationReq pbConversation.ModifyConversationFieldReq
|
||||
var tag bool
|
||||
var atUserID []string
|
||||
conversation := pbConversation.Conversation{
|
||||
OwnerUserID: pb.MsgData.SendID,
|
||||
ConversationID: utils.GetConversationIDBySessionType(pb.MsgData.GroupID, constant.GroupChatType),
|
||||
ConversationType: constant.GroupChatType,
|
||||
GroupID: pb.MsgData.GroupID,
|
||||
}
|
||||
conversationReq.Conversation = &conversation
|
||||
conversationReq.OperationID = pb.OperationID
|
||||
conversationReq.FieldType = constant.FieldGroupAtType
|
||||
tagAll := utils.IsContain(constant.AtAllString, pb.MsgData.AtUserIDList)
|
||||
if tagAll {
|
||||
atUserID = utils.DifferenceString([]string{constant.AtAllString}, pb.MsgData.AtUserIDList)
|
||||
if len(atUserID) == 0 { //just @everyone
|
||||
conversationReq.UserIDList = memberUserIDList
|
||||
conversation.GroupAtType = constant.AtAll
|
||||
} else { //@Everyone and @other people
|
||||
conversationReq.UserIDList = atUserID
|
||||
conversation.GroupAtType = constant.AtAllAtMe
|
||||
tag = true
|
||||
}
|
||||
} else {
|
||||
conversationReq.UserIDList = pb.MsgData.AtUserIDList
|
||||
conversation.GroupAtType = constant.AtMe
|
||||
}
|
||||
etcdConn, err := rpc.GetConn(ctx, config.Config.RpcRegisterName.OpenImConversationName)
|
||||
if err != nil {
|
||||
errMsg := pb.OperationID + "getcdv3.GetDefaultConn == nil"
|
||||
log.NewError(pb.OperationID, errMsg)
|
||||
return
|
||||
}
|
||||
client := pbConversation.NewConversationClient(etcdConn)
|
||||
conversationReply, err := client.ModifyConversationField(context.Background(), &conversationReq)
|
||||
if err != nil {
|
||||
log.NewError(conversationReq.OperationID, "ModifyConversationField rpc failed, ", conversationReq.String(), err.Error())
|
||||
} else if conversationReply.CommonResp.ErrCode != 0 {
|
||||
log.NewError(conversationReq.OperationID, "ModifyConversationField rpc failed, ", conversationReq.String(), conversationReply.String())
|
||||
}
|
||||
if tag {
|
||||
conversationReq.UserIDList = utils.DifferenceString(atUserID, memberUserIDList)
|
||||
conversation.GroupAtType = constant.AtAll
|
||||
etcdConn := rpc.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImConversationName, pb.OperationID)
|
||||
if etcdConn == nil {
|
||||
errMsg := pb.OperationID + "getcdv3.GetDefaultConn == nil"
|
||||
log.NewError(pb.OperationID, errMsg)
|
||||
return
|
||||
}
|
||||
client := pbConversation.NewConversationClient(etcdConn)
|
||||
conversationReply, err := client.ModifyConversationField(context.Background(), &conversationReq)
|
||||
if err != nil {
|
||||
log.NewError(conversationReq.OperationID, "ModifyConversationField rpc failed, ", conversationReq.String(), err.Error())
|
||||
} else if conversationReply.CommonResp.ErrCode != 0 {
|
||||
log.NewError(conversationReq.OperationID, "ModifyConversationField rpc failed, ", conversationReq.String(), conversationReply.String())
|
||||
}
|
||||
}
|
||||
}()
|
||||
}
|
||||
log.Debug(pb.OperationID, "send msg cost time3 ", time.Since(t1), pb.MsgData.ClientMsgID)
|
||||
promePkg.PromeInc(promePkg.GroupChatMsgProcessSuccessCounter)
|
||||
return returnMsg(&replay, pb, 0, "", msgToMQSingle.MsgData.ServerMsgID, msgToMQSingle.MsgData.SendTime)
|
||||
}
|
||||
case constant.NotificationChatType:
|
||||
t1 = time.Now()
|
||||
msgToMQSingle.MsgData = pb.MsgData
|
||||
log.NewInfo(msgToMQSingle.OperationID, msgToMQSingle)
|
||||
err1 := rpc.sendMsgToWriter(ctx, &msgToMQSingle, msgToMQSingle.MsgData.RecvID, constant.OnlineStatus)
|
||||
if err1 != nil {
|
||||
log.NewError(msgToMQSingle.OperationID, "kafka send msg err:RecvID", msgToMQSingle.MsgData.RecvID, msgToMQSingle.String())
|
||||
return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0)
|
||||
}
|
||||
|
||||
if msgToMQSingle.MsgData.SendID != msgToMQSingle.MsgData.RecvID { //Filter messages sent to yourself
|
||||
err2 := rpc.sendMsgToWriter(ctx, &msgToMQSingle, msgToMQSingle.MsgData.SendID, constant.OnlineStatus)
|
||||
if err2 != nil {
|
||||
log.NewError(msgToMQSingle.OperationID, "kafka send msg err:SendID", msgToMQSingle.MsgData.SendID, msgToMQSingle.String())
|
||||
return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0)
|
||||
}
|
||||
}
|
||||
|
||||
log.Debug(pb.OperationID, "send msg cost time ", time.Since(t1), pb.MsgData.ClientMsgID)
|
||||
return returnMsg(&replay, pb, 0, "", msgToMQSingle.MsgData.ServerMsgID, msgToMQSingle.MsgData.SendTime)
|
||||
case constant.SuperGroupChatType:
|
||||
promePkg.PromeInc(promePkg.WorkSuperGroupChatMsgRecvSuccessCounter)
|
||||
// callback
|
||||
callbackResp := callbackBeforeSendGroupMsg(pb)
|
||||
if callbackResp.ErrCode != 0 {
|
||||
log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendSuperGroupMsg resp: ", callbackResp)
|
||||
}
|
||||
if callbackResp.ActionCode != constant.ActionAllow {
|
||||
if callbackResp.ErrCode == 0 {
|
||||
callbackResp.ErrCode = 201
|
||||
}
|
||||
promePkg.PromeInc(promePkg.WorkSuperGroupChatMsgProcessFailedCounter)
|
||||
log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendSuperGroupMsg result", "end rpc and return", callbackResp)
|
||||
return returnMsg(&replay, pb, int32(callbackResp.ErrCode), callbackResp.ErrMsg, "", 0)
|
||||
}
|
||||
if flag, errCode, errMsg, _ = rpc.messageVerification(ctx, pb); !flag {
|
||||
promePkg.PromeInc(promePkg.WorkSuperGroupChatMsgProcessFailedCounter)
|
||||
return returnMsg(&replay, pb, errCode, errMsg, "", 0)
|
||||
}
|
||||
msgToMQSingle.MsgData = pb.MsgData
|
||||
log.NewInfo(msgToMQSingle.OperationID, msgToMQSingle)
|
||||
err1 := rpc.sendMsgToWriter(ctx, &msgToMQSingle, msgToMQSingle.MsgData.GroupID, constant.OnlineStatus)
|
||||
if err1 != nil {
|
||||
log.NewError(msgToMQSingle.OperationID, "kafka send msg err:RecvID", msgToMQSingle.MsgData.RecvID, msgToMQSingle.String())
|
||||
promePkg.PromeInc(promePkg.WorkSuperGroupChatMsgProcessFailedCounter)
|
||||
return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0)
|
||||
}
|
||||
// callback
|
||||
callbackResp = callbackAfterSendGroupMsg(pb)
|
||||
if callbackResp.ErrCode != 0 {
|
||||
log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackAfterSendSuperGroupMsg resp: ", callbackResp)
|
||||
}
|
||||
promePkg.PromeInc(promePkg.WorkSuperGroupChatMsgProcessSuccessCounter)
|
||||
return returnMsg(&replay, pb, 0, "", msgToMQSingle.MsgData.ServerMsgID, msgToMQSingle.MsgData.SendTime)
|
||||
|
||||
default:
|
||||
return returnMsg(&replay, pb, 203, "unknown sessionType", "", 0)
|
||||
}
|
||||
}
|
||||
|
||||
func (rpc *rpcChat) GetMaxAndMinSeq(_ context.Context, in *sdkws.GetMaxAndMinSeqReq) (*sdkws.GetMaxAndMinSeqResp, error) {
|
||||
log.NewInfo(in.OperationID, "rpc getMaxAndMinSeq is arriving", in.String())
|
||||
resp := new(sdkws.GetMaxAndMinSeqResp)
|
||||
m := make(map[string]*sdkws.MaxAndMinSeq)
|
||||
var maxSeq, minSeq uint64
|
||||
var err1, err2 error
|
||||
maxSeq, err1 = commonDB.DB.GetUserMaxSeq(in.UserID)
|
||||
minSeq, err2 = commonDB.DB.GetUserMinSeq(in.UserID)
|
||||
if (err1 != nil && err1 != go_redis.Nil) || (err2 != nil && err2 != go_redis.Nil) {
|
||||
log.NewError(in.OperationID, "getMaxSeq from redis error", in.String())
|
||||
if err1 != nil {
|
||||
log.NewError(in.OperationID, utils.GetSelfFuncName(), err1.Error())
|
||||
}
|
||||
if err2 != nil {
|
||||
log.NewError(in.OperationID, utils.GetSelfFuncName(), err2.Error())
|
||||
}
|
||||
resp.ErrCode = 200
|
||||
resp.ErrMsg = "redis get err"
|
||||
return resp, nil
|
||||
}
|
||||
resp.MaxSeq = uint32(maxSeq)
|
||||
resp.MinSeq = uint32(minSeq)
|
||||
for _, groupID := range in.GroupIDList {
|
||||
x := new(sdkws.MaxAndMinSeq)
|
||||
maxSeq, _ := commonDB.DB.GetGroupMaxSeq(groupID)
|
||||
minSeq, _ := commonDB.DB.GetGroupUserMinSeq(groupID, in.UserID)
|
||||
x.MaxSeq = uint32(maxSeq)
|
||||
x.MinSeq = uint32(minSeq)
|
||||
m[groupID] = x
|
||||
}
|
||||
resp.GroupMaxAndMinSeq = m
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func (rpc *rpcChat) PullMessageBySeqList(_ context.Context, in *sdkws.PullMessageBySeqListReq) (*sdkws.PullMessageBySeqListResp, error) {
|
||||
log.NewInfo(in.OperationID, "rpc PullMessageBySeqList is arriving", in.String())
|
||||
resp := new(sdkws.PullMessageBySeqListResp)
|
||||
m := make(map[string]*sdkws.MsgDataList)
|
||||
redisMsgList, failedSeqList, err := commonDB.DB.GetMessageListBySeq(in.UserID, in.SeqList, in.OperationID)
|
||||
if err != nil {
|
||||
if err != go_redis.Nil {
|
||||
promePkg.PromeAdd(promePkg.MsgPullFromRedisFailedCounter, len(failedSeqList))
|
||||
log.Error(in.OperationID, "get message from redis exception", err.Error(), failedSeqList)
|
||||
} else {
|
||||
log.Debug(in.OperationID, "get message from redis is nil", failedSeqList)
|
||||
}
|
||||
msgList, err1 := commonDB.DB.GetMsgBySeqListMongo2(in.UserID, failedSeqList, in.OperationID)
|
||||
if err1 != nil {
|
||||
promePkg.PromeAdd(promePkg.MsgPullFromMongoFailedCounter, len(failedSeqList))
|
||||
log.Error(in.OperationID, "PullMessageBySeqList data error", in.String(), err1.Error())
|
||||
resp.ErrCode = 201
|
||||
resp.ErrMsg = err1.Error()
|
||||
return resp, nil
|
||||
} else {
|
||||
promePkg.PromeAdd(promePkg.MsgPullFromMongoSuccessCounter, len(msgList))
|
||||
redisMsgList = append(redisMsgList, msgList...)
|
||||
resp.List = redisMsgList
|
||||
}
|
||||
} else {
|
||||
promePkg.PromeAdd(promePkg.MsgPullFromRedisSuccessCounter, len(redisMsgList))
|
||||
resp.List = redisMsgList
|
||||
}
|
||||
|
||||
for k, v := range in.GroupSeqList {
|
||||
x := new(sdkws.MsgDataList)
|
||||
redisMsgList, failedSeqList, err := commonDB.DB.GetMessageListBySeq(k, v.SeqList, in.OperationID)
|
||||
if err != nil {
|
||||
if err != go_redis.Nil {
|
||||
promePkg.PromeAdd(promePkg.MsgPullFromRedisFailedCounter, len(failedSeqList))
|
||||
log.Error(in.OperationID, "get message from redis exception", err.Error(), failedSeqList)
|
||||
} else {
|
||||
log.Debug(in.OperationID, "get message from redis is nil", failedSeqList)
|
||||
}
|
||||
msgList, err1 := commonDB.DB.GetSuperGroupMsgBySeqListMongo(k, failedSeqList, in.OperationID)
|
||||
if err1 != nil {
|
||||
promePkg.PromeAdd(promePkg.MsgPullFromMongoFailedCounter, len(failedSeqList))
|
||||
log.Error(in.OperationID, "PullMessageBySeqList data error", in.String(), err1.Error())
|
||||
resp.ErrCode = 201
|
||||
resp.ErrMsg = err1.Error()
|
||||
return resp, nil
|
||||
} else {
|
||||
promePkg.PromeAdd(promePkg.MsgPullFromMongoSuccessCounter, len(msgList))
|
||||
redisMsgList = append(redisMsgList, msgList...)
|
||||
x.MsgDataList = redisMsgList
|
||||
m[k] = x
|
||||
}
|
||||
} else {
|
||||
promePkg.PromeAdd(promePkg.MsgPullFromRedisSuccessCounter, len(redisMsgList))
|
||||
x.MsgDataList = redisMsgList
|
||||
m[k] = x
|
||||
}
|
||||
}
|
||||
resp.GroupMsgDataList = m
|
||||
return resp, nil
|
||||
}
|
@ -2,9 +2,10 @@ package msg
|
||||
|
||||
import (
|
||||
"Open_IM/internal/common/notification"
|
||||
"Open_IM/internal/common/rpcserver"
|
||||
"Open_IM/pkg/common/config"
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/db"
|
||||
|
||||
"Open_IM/pkg/common/kafka"
|
||||
"Open_IM/pkg/common/log"
|
||||
promePkg "Open_IM/pkg/common/prometheus"
|
||||
@ -15,25 +16,13 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
|
||||
grpcPrometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
type MessageWriter interface {
|
||||
SendMessage(m proto.Message, key string, operationID string) (int32, int64, error)
|
||||
}
|
||||
type rpcChat struct {
|
||||
rpcPort int
|
||||
rpcRegisterName string
|
||||
etcdSchema string
|
||||
etcdAddr []string
|
||||
messageWriter MessageWriter
|
||||
//offlineProducer *kafka.Producer
|
||||
delMsgCh chan deleteMsg
|
||||
dMessageLocker MessageLocker
|
||||
type msgServer struct {
|
||||
*rpcserver.RpcServer
|
||||
}
|
||||
|
||||
type deleteMsg struct {
|
@ -1,11 +1,15 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"Open_IM/pkg/proto/msg"
|
||||
pbMsg "Open_IM/pkg/proto/msg"
|
||||
"context"
|
||||
)
|
||||
|
||||
type MsgInterface interface {
|
||||
//消息写入队列
|
||||
MsgToMQ(ctx context.Context, key string, m *msg.MsgDataToMQ) error
|
||||
|
||||
BatchInsertChat2DB(ctx context.Context, userID string, msgList []*pbMsg.MsgDataToMQ, currentMaxSeq uint64) error
|
||||
BatchInsertChat2Cache(ctx context.Context, insertID string, msgList []*pbMsg.MsgDataToMQ) (error, uint64)
|
||||
|
||||
|
@ -6,7 +6,7 @@ package msg // import "Open_IM/pkg/proto/msg"
|
||||
import proto "github.com/golang/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
import sdk_ws "Open_IM/pkg/proto/sdk_ws"
|
||||
import sdkws "Open_IM/pkg/proto/sdkws"
|
||||
import wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
|
||||
|
||||
import (
|
||||
@ -26,19 +26,19 @@ var _ = math.Inf
|
||||
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
|
||||
|
||||
type MsgDataToMQ struct {
|
||||
Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"`
|
||||
OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"`
|
||||
MsgData *sdk_ws.MsgData `protobuf:"bytes,3,opt,name=msgData" json:"msgData,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"`
|
||||
OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"`
|
||||
MsgData *sdkws.MsgData `protobuf:"bytes,3,opt,name=msgData" json:"msgData,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *MsgDataToMQ) Reset() { *m = MsgDataToMQ{} }
|
||||
func (m *MsgDataToMQ) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgDataToMQ) ProtoMessage() {}
|
||||
func (*MsgDataToMQ) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{0}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{0}
|
||||
}
|
||||
func (m *MsgDataToMQ) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_MsgDataToMQ.Unmarshal(m, b)
|
||||
@ -72,7 +72,7 @@ func (m *MsgDataToMQ) GetOperationID() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *MsgDataToMQ) GetMsgData() *sdk_ws.MsgData {
|
||||
func (m *MsgDataToMQ) GetMsgData() *sdkws.MsgData {
|
||||
if m != nil {
|
||||
return m.MsgData
|
||||
}
|
||||
@ -80,18 +80,18 @@ func (m *MsgDataToMQ) GetMsgData() *sdk_ws.MsgData {
|
||||
}
|
||||
|
||||
type MsgDataToDB struct {
|
||||
MsgData *sdk_ws.MsgData `protobuf:"bytes,1,opt,name=msgData" json:"msgData,omitempty"`
|
||||
OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
MsgData *sdkws.MsgData `protobuf:"bytes,1,opt,name=msgData" json:"msgData,omitempty"`
|
||||
OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *MsgDataToDB) Reset() { *m = MsgDataToDB{} }
|
||||
func (m *MsgDataToDB) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgDataToDB) ProtoMessage() {}
|
||||
func (*MsgDataToDB) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{1}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{1}
|
||||
}
|
||||
func (m *MsgDataToDB) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_MsgDataToDB.Unmarshal(m, b)
|
||||
@ -111,7 +111,7 @@ func (m *MsgDataToDB) XXX_DiscardUnknown() {
|
||||
|
||||
var xxx_messageInfo_MsgDataToDB proto.InternalMessageInfo
|
||||
|
||||
func (m *MsgDataToDB) GetMsgData() *sdk_ws.MsgData {
|
||||
func (m *MsgDataToDB) GetMsgData() *sdkws.MsgData {
|
||||
if m != nil {
|
||||
return m.MsgData
|
||||
}
|
||||
@ -126,19 +126,19 @@ func (m *MsgDataToDB) GetOperationID() string {
|
||||
}
|
||||
|
||||
type PushMsgDataToMQ struct {
|
||||
OperationID string `protobuf:"bytes,1,opt,name=OperationID" json:"OperationID,omitempty"`
|
||||
MsgData *sdk_ws.MsgData `protobuf:"bytes,2,opt,name=msgData" json:"msgData,omitempty"`
|
||||
PushToUserID string `protobuf:"bytes,3,opt,name=pushToUserID" json:"pushToUserID,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
OperationID string `protobuf:"bytes,1,opt,name=OperationID" json:"OperationID,omitempty"`
|
||||
MsgData *sdkws.MsgData `protobuf:"bytes,2,opt,name=msgData" json:"msgData,omitempty"`
|
||||
PushToUserID string `protobuf:"bytes,3,opt,name=pushToUserID" json:"pushToUserID,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *PushMsgDataToMQ) Reset() { *m = PushMsgDataToMQ{} }
|
||||
func (m *PushMsgDataToMQ) String() string { return proto.CompactTextString(m) }
|
||||
func (*PushMsgDataToMQ) ProtoMessage() {}
|
||||
func (*PushMsgDataToMQ) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{2}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{2}
|
||||
}
|
||||
func (m *PushMsgDataToMQ) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PushMsgDataToMQ.Unmarshal(m, b)
|
||||
@ -165,7 +165,7 @@ func (m *PushMsgDataToMQ) GetOperationID() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *PushMsgDataToMQ) GetMsgData() *sdk_ws.MsgData {
|
||||
func (m *PushMsgDataToMQ) GetMsgData() *sdkws.MsgData {
|
||||
if m != nil {
|
||||
return m.MsgData
|
||||
}
|
||||
@ -193,7 +193,7 @@ func (m *MsgDataToMongoByMQ) Reset() { *m = MsgDataToMongoByMQ{} }
|
||||
func (m *MsgDataToMongoByMQ) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgDataToMongoByMQ) ProtoMessage() {}
|
||||
func (*MsgDataToMongoByMQ) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{3}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{3}
|
||||
}
|
||||
func (m *MsgDataToMongoByMQ) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_MsgDataToMongoByMQ.Unmarshal(m, b)
|
||||
@ -253,7 +253,7 @@ func (m *GetMaxAndMinSeqReq) Reset() { *m = GetMaxAndMinSeqReq{} }
|
||||
func (m *GetMaxAndMinSeqReq) String() string { return proto.CompactTextString(m) }
|
||||
func (*GetMaxAndMinSeqReq) ProtoMessage() {}
|
||||
func (*GetMaxAndMinSeqReq) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{4}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{4}
|
||||
}
|
||||
func (m *GetMaxAndMinSeqReq) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_GetMaxAndMinSeqReq.Unmarshal(m, b)
|
||||
@ -301,7 +301,7 @@ func (m *GetMaxAndMinSeqResp) Reset() { *m = GetMaxAndMinSeqResp{} }
|
||||
func (m *GetMaxAndMinSeqResp) String() string { return proto.CompactTextString(m) }
|
||||
func (*GetMaxAndMinSeqResp) ProtoMessage() {}
|
||||
func (*GetMaxAndMinSeqResp) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{5}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{5}
|
||||
}
|
||||
func (m *GetMaxAndMinSeqResp) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_GetMaxAndMinSeqResp.Unmarshal(m, b)
|
||||
@ -350,17 +350,17 @@ func (m *GetMaxAndMinSeqResp) GetMinSeq() uint32 {
|
||||
}
|
||||
|
||||
type SendMsgReq struct {
|
||||
MsgData *sdk_ws.MsgData `protobuf:"bytes,3,opt,name=msgData" json:"msgData,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
MsgData *sdkws.MsgData `protobuf:"bytes,3,opt,name=msgData" json:"msgData,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *SendMsgReq) Reset() { *m = SendMsgReq{} }
|
||||
func (m *SendMsgReq) String() string { return proto.CompactTextString(m) }
|
||||
func (*SendMsgReq) ProtoMessage() {}
|
||||
func (*SendMsgReq) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{6}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{6}
|
||||
}
|
||||
func (m *SendMsgReq) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_SendMsgReq.Unmarshal(m, b)
|
||||
@ -380,7 +380,7 @@ func (m *SendMsgReq) XXX_DiscardUnknown() {
|
||||
|
||||
var xxx_messageInfo_SendMsgReq proto.InternalMessageInfo
|
||||
|
||||
func (m *SendMsgReq) GetMsgData() *sdk_ws.MsgData {
|
||||
func (m *SendMsgReq) GetMsgData() *sdkws.MsgData {
|
||||
if m != nil {
|
||||
return m.MsgData
|
||||
}
|
||||
@ -400,7 +400,7 @@ func (m *SendMsgResp) Reset() { *m = SendMsgResp{} }
|
||||
func (m *SendMsgResp) String() string { return proto.CompactTextString(m) }
|
||||
func (*SendMsgResp) ProtoMessage() {}
|
||||
func (*SendMsgResp) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{7}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{7}
|
||||
}
|
||||
func (m *SendMsgResp) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_SendMsgResp.Unmarshal(m, b)
|
||||
@ -452,7 +452,7 @@ func (m *ClearMsgReq) Reset() { *m = ClearMsgReq{} }
|
||||
func (m *ClearMsgReq) String() string { return proto.CompactTextString(m) }
|
||||
func (*ClearMsgReq) ProtoMessage() {}
|
||||
func (*ClearMsgReq) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{8}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{8}
|
||||
}
|
||||
func (m *ClearMsgReq) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ClearMsgReq.Unmarshal(m, b)
|
||||
@ -489,7 +489,7 @@ func (m *ClearMsgResp) Reset() { *m = ClearMsgResp{} }
|
||||
func (m *ClearMsgResp) String() string { return proto.CompactTextString(m) }
|
||||
func (*ClearMsgResp) ProtoMessage() {}
|
||||
func (*ClearMsgResp) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{9}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{9}
|
||||
}
|
||||
func (m *ClearMsgResp) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ClearMsgResp.Unmarshal(m, b)
|
||||
@ -522,7 +522,7 @@ func (m *SetMsgMinSeqReq) Reset() { *m = SetMsgMinSeqReq{} }
|
||||
func (m *SetMsgMinSeqReq) String() string { return proto.CompactTextString(m) }
|
||||
func (*SetMsgMinSeqReq) ProtoMessage() {}
|
||||
func (*SetMsgMinSeqReq) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{10}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{10}
|
||||
}
|
||||
func (m *SetMsgMinSeqReq) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_SetMsgMinSeqReq.Unmarshal(m, b)
|
||||
@ -573,7 +573,7 @@ func (m *SetMsgMinSeqResp) Reset() { *m = SetMsgMinSeqResp{} }
|
||||
func (m *SetMsgMinSeqResp) String() string { return proto.CompactTextString(m) }
|
||||
func (*SetMsgMinSeqResp) ProtoMessage() {}
|
||||
func (*SetMsgMinSeqResp) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{11}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{11}
|
||||
}
|
||||
func (m *SetMsgMinSeqResp) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_SetMsgMinSeqResp.Unmarshal(m, b)
|
||||
@ -604,7 +604,7 @@ func (m *SetSendMsgStatusReq) Reset() { *m = SetSendMsgStatusReq{} }
|
||||
func (m *SetSendMsgStatusReq) String() string { return proto.CompactTextString(m) }
|
||||
func (*SetSendMsgStatusReq) ProtoMessage() {}
|
||||
func (*SetSendMsgStatusReq) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{12}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{12}
|
||||
}
|
||||
func (m *SetSendMsgStatusReq) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_SetSendMsgStatusReq.Unmarshal(m, b)
|
||||
@ -641,7 +641,7 @@ func (m *SetSendMsgStatusResp) Reset() { *m = SetSendMsgStatusResp{} }
|
||||
func (m *SetSendMsgStatusResp) String() string { return proto.CompactTextString(m) }
|
||||
func (*SetSendMsgStatusResp) ProtoMessage() {}
|
||||
func (*SetSendMsgStatusResp) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{13}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{13}
|
||||
}
|
||||
func (m *SetSendMsgStatusResp) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_SetSendMsgStatusResp.Unmarshal(m, b)
|
||||
@ -672,7 +672,7 @@ func (m *GetSendMsgStatusReq) Reset() { *m = GetSendMsgStatusReq{} }
|
||||
func (m *GetSendMsgStatusReq) String() string { return proto.CompactTextString(m) }
|
||||
func (*GetSendMsgStatusReq) ProtoMessage() {}
|
||||
func (*GetSendMsgStatusReq) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{14}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{14}
|
||||
}
|
||||
func (m *GetSendMsgStatusReq) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_GetSendMsgStatusReq.Unmarshal(m, b)
|
||||
@ -712,7 +712,7 @@ func (m *GetSendMsgStatusResp) Reset() { *m = GetSendMsgStatusResp{} }
|
||||
func (m *GetSendMsgStatusResp) String() string { return proto.CompactTextString(m) }
|
||||
func (*GetSendMsgStatusResp) ProtoMessage() {}
|
||||
func (*GetSendMsgStatusResp) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{15}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{15}
|
||||
}
|
||||
func (m *GetSendMsgStatusResp) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_GetSendMsgStatusResp.Unmarshal(m, b)
|
||||
@ -765,7 +765,7 @@ func (m *DelSuperGroupMsgReq) Reset() { *m = DelSuperGroupMsgReq{} }
|
||||
func (m *DelSuperGroupMsgReq) String() string { return proto.CompactTextString(m) }
|
||||
func (*DelSuperGroupMsgReq) ProtoMessage() {}
|
||||
func (*DelSuperGroupMsgReq) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{16}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{16}
|
||||
}
|
||||
func (m *DelSuperGroupMsgReq) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_DelSuperGroupMsgReq.Unmarshal(m, b)
|
||||
@ -809,7 +809,7 @@ func (m *DelSuperGroupMsgResp) Reset() { *m = DelSuperGroupMsgResp{} }
|
||||
func (m *DelSuperGroupMsgResp) String() string { return proto.CompactTextString(m) }
|
||||
func (*DelSuperGroupMsgResp) ProtoMessage() {}
|
||||
func (*DelSuperGroupMsgResp) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{17}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{17}
|
||||
}
|
||||
func (m *DelSuperGroupMsgResp) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_DelSuperGroupMsgResp.Unmarshal(m, b)
|
||||
@ -842,7 +842,7 @@ func (m *GetSuperGroupMsgReq) Reset() { *m = GetSuperGroupMsgReq{} }
|
||||
func (m *GetSuperGroupMsgReq) String() string { return proto.CompactTextString(m) }
|
||||
func (*GetSuperGroupMsgReq) ProtoMessage() {}
|
||||
func (*GetSuperGroupMsgReq) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{18}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{18}
|
||||
}
|
||||
func (m *GetSuperGroupMsgReq) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_GetSuperGroupMsgReq.Unmarshal(m, b)
|
||||
@ -884,19 +884,19 @@ func (m *GetSuperGroupMsgReq) GetGroupID() string {
|
||||
}
|
||||
|
||||
type GetSuperGroupMsgResp struct {
|
||||
ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"`
|
||||
ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"`
|
||||
MsgData *sdk_ws.MsgData `protobuf:"bytes,3,opt,name=msgData" json:"msgData,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"`
|
||||
ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"`
|
||||
MsgData *sdkws.MsgData `protobuf:"bytes,3,opt,name=msgData" json:"msgData,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *GetSuperGroupMsgResp) Reset() { *m = GetSuperGroupMsgResp{} }
|
||||
func (m *GetSuperGroupMsgResp) String() string { return proto.CompactTextString(m) }
|
||||
func (*GetSuperGroupMsgResp) ProtoMessage() {}
|
||||
func (*GetSuperGroupMsgResp) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{19}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{19}
|
||||
}
|
||||
func (m *GetSuperGroupMsgResp) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_GetSuperGroupMsgResp.Unmarshal(m, b)
|
||||
@ -930,7 +930,7 @@ func (m *GetSuperGroupMsgResp) GetErrMsg() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *GetSuperGroupMsgResp) GetMsgData() *sdk_ws.MsgData {
|
||||
func (m *GetSuperGroupMsgResp) GetMsgData() *sdkws.MsgData {
|
||||
if m != nil {
|
||||
return m.MsgData
|
||||
}
|
||||
@ -949,7 +949,7 @@ func (m *GetWriteDiffMsgReq) Reset() { *m = GetWriteDiffMsgReq{} }
|
||||
func (m *GetWriteDiffMsgReq) String() string { return proto.CompactTextString(m) }
|
||||
func (*GetWriteDiffMsgReq) ProtoMessage() {}
|
||||
func (*GetWriteDiffMsgReq) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{20}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{20}
|
||||
}
|
||||
func (m *GetWriteDiffMsgReq) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_GetWriteDiffMsgReq.Unmarshal(m, b)
|
||||
@ -984,19 +984,19 @@ func (m *GetWriteDiffMsgReq) GetSeq() uint32 {
|
||||
}
|
||||
|
||||
type GetWriteDiffMsgResp struct {
|
||||
ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"`
|
||||
ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"`
|
||||
MsgData *sdk_ws.MsgData `protobuf:"bytes,3,opt,name=msgData" json:"msgData,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"`
|
||||
ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"`
|
||||
MsgData *sdkws.MsgData `protobuf:"bytes,3,opt,name=msgData" json:"msgData,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *GetWriteDiffMsgResp) Reset() { *m = GetWriteDiffMsgResp{} }
|
||||
func (m *GetWriteDiffMsgResp) String() string { return proto.CompactTextString(m) }
|
||||
func (*GetWriteDiffMsgResp) ProtoMessage() {}
|
||||
func (*GetWriteDiffMsgResp) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{21}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{21}
|
||||
}
|
||||
func (m *GetWriteDiffMsgResp) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_GetWriteDiffMsgResp.Unmarshal(m, b)
|
||||
@ -1030,7 +1030,7 @@ func (m *GetWriteDiffMsgResp) GetErrMsg() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *GetWriteDiffMsgResp) GetMsgData() *sdk_ws.MsgData {
|
||||
func (m *GetWriteDiffMsgResp) GetMsgData() *sdkws.MsgData {
|
||||
if m != nil {
|
||||
return m.MsgData
|
||||
}
|
||||
@ -1038,27 +1038,27 @@ func (m *GetWriteDiffMsgResp) GetMsgData() *sdk_ws.MsgData {
|
||||
}
|
||||
|
||||
type ModifyMessageReactionExtensionsReq struct {
|
||||
OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"`
|
||||
SourceID string `protobuf:"bytes,2,opt,name=sourceID" json:"sourceID,omitempty"`
|
||||
OpUserID string `protobuf:"bytes,3,opt,name=opUserID" json:"opUserID,omitempty"`
|
||||
SessionType int32 `protobuf:"varint,4,opt,name=sessionType" json:"sessionType,omitempty"`
|
||||
ReactionExtensionList map[string]*sdk_ws.KeyValue `protobuf:"bytes,5,rep,name=reactionExtensionList" json:"reactionExtensionList,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
|
||||
ClientMsgID string `protobuf:"bytes,6,opt,name=clientMsgID" json:"clientMsgID,omitempty"`
|
||||
Ex *wrapperspb.StringValue `protobuf:"bytes,7,opt,name=ex" json:"ex,omitempty"`
|
||||
AttachedInfo *wrapperspb.StringValue `protobuf:"bytes,8,opt,name=attachedInfo" json:"attachedInfo,omitempty"`
|
||||
IsReact bool `protobuf:"varint,9,opt,name=isReact" json:"isReact,omitempty"`
|
||||
IsExternalExtensions bool `protobuf:"varint,10,opt,name=isExternalExtensions" json:"isExternalExtensions,omitempty"`
|
||||
MsgFirstModifyTime int64 `protobuf:"varint,11,opt,name=msgFirstModifyTime" json:"msgFirstModifyTime,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"`
|
||||
SourceID string `protobuf:"bytes,2,opt,name=sourceID" json:"sourceID,omitempty"`
|
||||
OpUserID string `protobuf:"bytes,3,opt,name=opUserID" json:"opUserID,omitempty"`
|
||||
SessionType int32 `protobuf:"varint,4,opt,name=sessionType" json:"sessionType,omitempty"`
|
||||
ReactionExtensionList map[string]*sdkws.KeyValue `protobuf:"bytes,5,rep,name=reactionExtensionList" json:"reactionExtensionList,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
|
||||
ClientMsgID string `protobuf:"bytes,6,opt,name=clientMsgID" json:"clientMsgID,omitempty"`
|
||||
Ex *wrapperspb.StringValue `protobuf:"bytes,7,opt,name=ex" json:"ex,omitempty"`
|
||||
AttachedInfo *wrapperspb.StringValue `protobuf:"bytes,8,opt,name=attachedInfo" json:"attachedInfo,omitempty"`
|
||||
IsReact bool `protobuf:"varint,9,opt,name=isReact" json:"isReact,omitempty"`
|
||||
IsExternalExtensions bool `protobuf:"varint,10,opt,name=isExternalExtensions" json:"isExternalExtensions,omitempty"`
|
||||
MsgFirstModifyTime int64 `protobuf:"varint,11,opt,name=msgFirstModifyTime" json:"msgFirstModifyTime,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ModifyMessageReactionExtensionsReq) Reset() { *m = ModifyMessageReactionExtensionsReq{} }
|
||||
func (m *ModifyMessageReactionExtensionsReq) String() string { return proto.CompactTextString(m) }
|
||||
func (*ModifyMessageReactionExtensionsReq) ProtoMessage() {}
|
||||
func (*ModifyMessageReactionExtensionsReq) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{22}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{22}
|
||||
}
|
||||
func (m *ModifyMessageReactionExtensionsReq) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ModifyMessageReactionExtensionsReq.Unmarshal(m, b)
|
||||
@ -1106,7 +1106,7 @@ func (m *ModifyMessageReactionExtensionsReq) GetSessionType() int32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *ModifyMessageReactionExtensionsReq) GetReactionExtensionList() map[string]*sdk_ws.KeyValue {
|
||||
func (m *ModifyMessageReactionExtensionsReq) GetReactionExtensionList() map[string]*sdkws.KeyValue {
|
||||
if m != nil {
|
||||
return m.ReactionExtensionList
|
||||
}
|
||||
@ -1156,27 +1156,27 @@ func (m *ModifyMessageReactionExtensionsReq) GetMsgFirstModifyTime() int64 {
|
||||
}
|
||||
|
||||
type SetMessageReactionExtensionsReq struct {
|
||||
OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"`
|
||||
SourceID string `protobuf:"bytes,2,opt,name=sourceID" json:"sourceID,omitempty"`
|
||||
OpUserID string `protobuf:"bytes,3,opt,name=opUserID" json:"opUserID,omitempty"`
|
||||
SessionType int32 `protobuf:"varint,4,opt,name=sessionType" json:"sessionType,omitempty"`
|
||||
ReactionExtensionList map[string]*sdk_ws.KeyValue `protobuf:"bytes,5,rep,name=reactionExtensionList" json:"reactionExtensionList,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
|
||||
ClientMsgID string `protobuf:"bytes,6,opt,name=clientMsgID" json:"clientMsgID,omitempty"`
|
||||
Ex *wrapperspb.StringValue `protobuf:"bytes,7,opt,name=ex" json:"ex,omitempty"`
|
||||
AttachedInfo *wrapperspb.StringValue `protobuf:"bytes,8,opt,name=attachedInfo" json:"attachedInfo,omitempty"`
|
||||
IsReact bool `protobuf:"varint,9,opt,name=isReact" json:"isReact,omitempty"`
|
||||
IsExternalExtensions bool `protobuf:"varint,10,opt,name=isExternalExtensions" json:"isExternalExtensions,omitempty"`
|
||||
MsgFirstModifyTime int64 `protobuf:"varint,11,opt,name=msgFirstModifyTime" json:"msgFirstModifyTime,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"`
|
||||
SourceID string `protobuf:"bytes,2,opt,name=sourceID" json:"sourceID,omitempty"`
|
||||
OpUserID string `protobuf:"bytes,3,opt,name=opUserID" json:"opUserID,omitempty"`
|
||||
SessionType int32 `protobuf:"varint,4,opt,name=sessionType" json:"sessionType,omitempty"`
|
||||
ReactionExtensionList map[string]*sdkws.KeyValue `protobuf:"bytes,5,rep,name=reactionExtensionList" json:"reactionExtensionList,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
|
||||
ClientMsgID string `protobuf:"bytes,6,opt,name=clientMsgID" json:"clientMsgID,omitempty"`
|
||||
Ex *wrapperspb.StringValue `protobuf:"bytes,7,opt,name=ex" json:"ex,omitempty"`
|
||||
AttachedInfo *wrapperspb.StringValue `protobuf:"bytes,8,opt,name=attachedInfo" json:"attachedInfo,omitempty"`
|
||||
IsReact bool `protobuf:"varint,9,opt,name=isReact" json:"isReact,omitempty"`
|
||||
IsExternalExtensions bool `protobuf:"varint,10,opt,name=isExternalExtensions" json:"isExternalExtensions,omitempty"`
|
||||
MsgFirstModifyTime int64 `protobuf:"varint,11,opt,name=msgFirstModifyTime" json:"msgFirstModifyTime,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *SetMessageReactionExtensionsReq) Reset() { *m = SetMessageReactionExtensionsReq{} }
|
||||
func (m *SetMessageReactionExtensionsReq) String() string { return proto.CompactTextString(m) }
|
||||
func (*SetMessageReactionExtensionsReq) ProtoMessage() {}
|
||||
func (*SetMessageReactionExtensionsReq) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{23}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{23}
|
||||
}
|
||||
func (m *SetMessageReactionExtensionsReq) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_SetMessageReactionExtensionsReq.Unmarshal(m, b)
|
||||
@ -1224,7 +1224,7 @@ func (m *SetMessageReactionExtensionsReq) GetSessionType() int32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *SetMessageReactionExtensionsReq) GetReactionExtensionList() map[string]*sdk_ws.KeyValue {
|
||||
func (m *SetMessageReactionExtensionsReq) GetReactionExtensionList() map[string]*sdkws.KeyValue {
|
||||
if m != nil {
|
||||
return m.ReactionExtensionList
|
||||
}
|
||||
@ -1289,7 +1289,7 @@ func (m *SetMessageReactionExtensionsResp) Reset() { *m = SetMessageReac
|
||||
func (m *SetMessageReactionExtensionsResp) String() string { return proto.CompactTextString(m) }
|
||||
func (*SetMessageReactionExtensionsResp) ProtoMessage() {}
|
||||
func (*SetMessageReactionExtensionsResp) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{24}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{24}
|
||||
}
|
||||
func (m *SetMessageReactionExtensionsResp) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_SetMessageReactionExtensionsResp.Unmarshal(m, b)
|
||||
@ -1366,7 +1366,7 @@ func (m *GetMessageListReactionExtensionsReq) Reset() { *m = GetMessageL
|
||||
func (m *GetMessageListReactionExtensionsReq) String() string { return proto.CompactTextString(m) }
|
||||
func (*GetMessageListReactionExtensionsReq) ProtoMessage() {}
|
||||
func (*GetMessageListReactionExtensionsReq) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{25}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{25}
|
||||
}
|
||||
func (m *GetMessageListReactionExtensionsReq) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_GetMessageListReactionExtensionsReq.Unmarshal(m, b)
|
||||
@ -1437,7 +1437,7 @@ func (m *GetMessageListReactionExtensionsReq_MessageReactionKey) String() string
|
||||
}
|
||||
func (*GetMessageListReactionExtensionsReq_MessageReactionKey) ProtoMessage() {}
|
||||
func (*GetMessageListReactionExtensionsReq_MessageReactionKey) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{25, 0}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{25, 0}
|
||||
}
|
||||
func (m *GetMessageListReactionExtensionsReq_MessageReactionKey) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_GetMessageListReactionExtensionsReq_MessageReactionKey.Unmarshal(m, b)
|
||||
@ -1484,7 +1484,7 @@ func (m *GetMessageListReactionExtensionsResp) Reset() { *m = GetMessage
|
||||
func (m *GetMessageListReactionExtensionsResp) String() string { return proto.CompactTextString(m) }
|
||||
func (*GetMessageListReactionExtensionsResp) ProtoMessage() {}
|
||||
func (*GetMessageListReactionExtensionsResp) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{26}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{26}
|
||||
}
|
||||
func (m *GetMessageListReactionExtensionsResp) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_GetMessageListReactionExtensionsResp.Unmarshal(m, b)
|
||||
@ -1526,20 +1526,20 @@ func (m *GetMessageListReactionExtensionsResp) GetSingleMessageResult() []*Singl
|
||||
}
|
||||
|
||||
type SingleMessageExtensionResult struct {
|
||||
ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"`
|
||||
ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"`
|
||||
ReactionExtensionList map[string]*sdk_ws.KeyValue `protobuf:"bytes,3,rep,name=reactionExtensionList" json:"reactionExtensionList,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
|
||||
ClientMsgID string `protobuf:"bytes,4,opt,name=clientMsgID" json:"clientMsgID,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"`
|
||||
ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"`
|
||||
ReactionExtensionList map[string]*sdkws.KeyValue `protobuf:"bytes,3,rep,name=reactionExtensionList" json:"reactionExtensionList,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
|
||||
ClientMsgID string `protobuf:"bytes,4,opt,name=clientMsgID" json:"clientMsgID,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *SingleMessageExtensionResult) Reset() { *m = SingleMessageExtensionResult{} }
|
||||
func (m *SingleMessageExtensionResult) String() string { return proto.CompactTextString(m) }
|
||||
func (*SingleMessageExtensionResult) ProtoMessage() {}
|
||||
func (*SingleMessageExtensionResult) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{27}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{27}
|
||||
}
|
||||
func (m *SingleMessageExtensionResult) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_SingleMessageExtensionResult.Unmarshal(m, b)
|
||||
@ -1573,7 +1573,7 @@ func (m *SingleMessageExtensionResult) GetErrMsg() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *SingleMessageExtensionResult) GetReactionExtensionList() map[string]*sdk_ws.KeyValue {
|
||||
func (m *SingleMessageExtensionResult) GetReactionExtensionList() map[string]*sdkws.KeyValue {
|
||||
if m != nil {
|
||||
return m.ReactionExtensionList
|
||||
}
|
||||
@ -1601,7 +1601,7 @@ func (m *ModifyMessageReactionExtensionsResp) Reset() { *m = ModifyMessa
|
||||
func (m *ModifyMessageReactionExtensionsResp) String() string { return proto.CompactTextString(m) }
|
||||
func (*ModifyMessageReactionExtensionsResp) ProtoMessage() {}
|
||||
func (*ModifyMessageReactionExtensionsResp) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{28}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{28}
|
||||
}
|
||||
func (m *ModifyMessageReactionExtensionsResp) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ModifyMessageReactionExtensionsResp.Unmarshal(m, b)
|
||||
@ -1650,17 +1650,17 @@ func (m *ModifyMessageReactionExtensionsResp) GetFailedList() []*ExtendMsgResp {
|
||||
}
|
||||
|
||||
type DeleteMessageListReactionExtensionsReq struct {
|
||||
OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"`
|
||||
OpUserID string `protobuf:"bytes,2,opt,name=opUserID" json:"opUserID,omitempty"`
|
||||
SourceID string `protobuf:"bytes,3,opt,name=sourceID" json:"sourceID,omitempty"`
|
||||
SessionType int32 `protobuf:"varint,4,opt,name=sessionType" json:"sessionType,omitempty"`
|
||||
ClientMsgID string `protobuf:"bytes,5,opt,name=clientMsgID" json:"clientMsgID,omitempty"`
|
||||
IsExternalExtensions bool `protobuf:"varint,6,opt,name=isExternalExtensions" json:"isExternalExtensions,omitempty"`
|
||||
MsgFirstModifyTime int64 `protobuf:"varint,7,opt,name=msgFirstModifyTime" json:"msgFirstModifyTime,omitempty"`
|
||||
ReactionExtensionList []*sdk_ws.KeyValue `protobuf:"bytes,8,rep,name=reactionExtensionList" json:"reactionExtensionList,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"`
|
||||
OpUserID string `protobuf:"bytes,2,opt,name=opUserID" json:"opUserID,omitempty"`
|
||||
SourceID string `protobuf:"bytes,3,opt,name=sourceID" json:"sourceID,omitempty"`
|
||||
SessionType int32 `protobuf:"varint,4,opt,name=sessionType" json:"sessionType,omitempty"`
|
||||
ClientMsgID string `protobuf:"bytes,5,opt,name=clientMsgID" json:"clientMsgID,omitempty"`
|
||||
IsExternalExtensions bool `protobuf:"varint,6,opt,name=isExternalExtensions" json:"isExternalExtensions,omitempty"`
|
||||
MsgFirstModifyTime int64 `protobuf:"varint,7,opt,name=msgFirstModifyTime" json:"msgFirstModifyTime,omitempty"`
|
||||
ReactionExtensionList []*sdkws.KeyValue `protobuf:"bytes,8,rep,name=reactionExtensionList" json:"reactionExtensionList,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *DeleteMessageListReactionExtensionsReq) Reset() {
|
||||
@ -1669,7 +1669,7 @@ func (m *DeleteMessageListReactionExtensionsReq) Reset() {
|
||||
func (m *DeleteMessageListReactionExtensionsReq) String() string { return proto.CompactTextString(m) }
|
||||
func (*DeleteMessageListReactionExtensionsReq) ProtoMessage() {}
|
||||
func (*DeleteMessageListReactionExtensionsReq) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{29}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{29}
|
||||
}
|
||||
func (m *DeleteMessageListReactionExtensionsReq) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_DeleteMessageListReactionExtensionsReq.Unmarshal(m, b)
|
||||
@ -1738,7 +1738,7 @@ func (m *DeleteMessageListReactionExtensionsReq) GetMsgFirstModifyTime() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *DeleteMessageListReactionExtensionsReq) GetReactionExtensionList() []*sdk_ws.KeyValue {
|
||||
func (m *DeleteMessageListReactionExtensionsReq) GetReactionExtensionList() []*sdkws.KeyValue {
|
||||
if m != nil {
|
||||
return m.ReactionExtensionList
|
||||
}
|
||||
@ -1760,7 +1760,7 @@ func (m *DeleteMessageListReactionExtensionsResp) Reset() {
|
||||
func (m *DeleteMessageListReactionExtensionsResp) String() string { return proto.CompactTextString(m) }
|
||||
func (*DeleteMessageListReactionExtensionsResp) ProtoMessage() {}
|
||||
func (*DeleteMessageListReactionExtensionsResp) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{30}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{30}
|
||||
}
|
||||
func (m *DeleteMessageListReactionExtensionsResp) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_DeleteMessageListReactionExtensionsResp.Unmarshal(m, b)
|
||||
@ -1814,7 +1814,7 @@ func (m *ExtendMsgResp) Reset() { *m = ExtendMsgResp{} }
|
||||
func (m *ExtendMsgResp) String() string { return proto.CompactTextString(m) }
|
||||
func (*ExtendMsgResp) ProtoMessage() {}
|
||||
func (*ExtendMsgResp) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{31}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{31}
|
||||
}
|
||||
func (m *ExtendMsgResp) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ExtendMsgResp.Unmarshal(m, b)
|
||||
@ -1870,7 +1870,7 @@ func (m *ExtendMsg) Reset() { *m = ExtendMsg{} }
|
||||
func (m *ExtendMsg) String() string { return proto.CompactTextString(m) }
|
||||
func (*ExtendMsg) ProtoMessage() {}
|
||||
func (*ExtendMsg) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{32}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{32}
|
||||
}
|
||||
func (m *ExtendMsg) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ExtendMsg.Unmarshal(m, b)
|
||||
@ -1926,19 +1926,19 @@ func (m *ExtendMsg) GetEx() string {
|
||||
}
|
||||
|
||||
type KeyValueResp struct {
|
||||
KeyValue *sdk_ws.KeyValue `protobuf:"bytes,1,opt,name=keyValue" json:"keyValue,omitempty"`
|
||||
ErrCode int32 `protobuf:"varint,2,opt,name=errCode" json:"errCode,omitempty"`
|
||||
ErrMsg string `protobuf:"bytes,3,opt,name=errMsg" json:"errMsg,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
KeyValue *sdkws.KeyValue `protobuf:"bytes,1,opt,name=keyValue" json:"keyValue,omitempty"`
|
||||
ErrCode int32 `protobuf:"varint,2,opt,name=errCode" json:"errCode,omitempty"`
|
||||
ErrMsg string `protobuf:"bytes,3,opt,name=errMsg" json:"errMsg,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *KeyValueResp) Reset() { *m = KeyValueResp{} }
|
||||
func (m *KeyValueResp) String() string { return proto.CompactTextString(m) }
|
||||
func (*KeyValueResp) ProtoMessage() {}
|
||||
func (*KeyValueResp) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{33}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{33}
|
||||
}
|
||||
func (m *KeyValueResp) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_KeyValueResp.Unmarshal(m, b)
|
||||
@ -1958,7 +1958,7 @@ func (m *KeyValueResp) XXX_DiscardUnknown() {
|
||||
|
||||
var xxx_messageInfo_KeyValueResp proto.InternalMessageInfo
|
||||
|
||||
func (m *KeyValueResp) GetKeyValue() *sdk_ws.KeyValue {
|
||||
func (m *KeyValueResp) GetKeyValue() *sdkws.KeyValue {
|
||||
if m != nil {
|
||||
return m.KeyValue
|
||||
}
|
||||
@ -1992,7 +1992,7 @@ func (m *MsgDataToModifyByMQ) Reset() { *m = MsgDataToModifyByMQ{} }
|
||||
func (m *MsgDataToModifyByMQ) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgDataToModifyByMQ) ProtoMessage() {}
|
||||
func (*MsgDataToModifyByMQ) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_msg_69316330d19ec9fa, []int{34}
|
||||
return fileDescriptor_msg_9bd9d9abca588885, []int{34}
|
||||
}
|
||||
func (m *MsgDataToModifyByMQ) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_MsgDataToModifyByMQ.Unmarshal(m, b)
|
||||
@ -2057,15 +2057,15 @@ func init() {
|
||||
proto.RegisterType((*GetWriteDiffMsgReq)(nil), "msg.GetWriteDiffMsgReq")
|
||||
proto.RegisterType((*GetWriteDiffMsgResp)(nil), "msg.GetWriteDiffMsgResp")
|
||||
proto.RegisterType((*ModifyMessageReactionExtensionsReq)(nil), "msg.ModifyMessageReactionExtensionsReq")
|
||||
proto.RegisterMapType((map[string]*sdk_ws.KeyValue)(nil), "msg.ModifyMessageReactionExtensionsReq.ReactionExtensionListEntry")
|
||||
proto.RegisterMapType((map[string]*sdkws.KeyValue)(nil), "msg.ModifyMessageReactionExtensionsReq.ReactionExtensionListEntry")
|
||||
proto.RegisterType((*SetMessageReactionExtensionsReq)(nil), "msg.SetMessageReactionExtensionsReq")
|
||||
proto.RegisterMapType((map[string]*sdk_ws.KeyValue)(nil), "msg.SetMessageReactionExtensionsReq.ReactionExtensionListEntry")
|
||||
proto.RegisterMapType((map[string]*sdkws.KeyValue)(nil), "msg.SetMessageReactionExtensionsReq.ReactionExtensionListEntry")
|
||||
proto.RegisterType((*SetMessageReactionExtensionsResp)(nil), "msg.SetMessageReactionExtensionsResp")
|
||||
proto.RegisterType((*GetMessageListReactionExtensionsReq)(nil), "msg.GetMessageListReactionExtensionsReq")
|
||||
proto.RegisterType((*GetMessageListReactionExtensionsReq_MessageReactionKey)(nil), "msg.GetMessageListReactionExtensionsReq.MessageReactionKey")
|
||||
proto.RegisterType((*GetMessageListReactionExtensionsResp)(nil), "msg.GetMessageListReactionExtensionsResp")
|
||||
proto.RegisterType((*SingleMessageExtensionResult)(nil), "msg.SingleMessageExtensionResult")
|
||||
proto.RegisterMapType((map[string]*sdk_ws.KeyValue)(nil), "msg.SingleMessageExtensionResult.ReactionExtensionListEntry")
|
||||
proto.RegisterMapType((map[string]*sdkws.KeyValue)(nil), "msg.SingleMessageExtensionResult.ReactionExtensionListEntry")
|
||||
proto.RegisterType((*ModifyMessageReactionExtensionsResp)(nil), "msg.ModifyMessageReactionExtensionsResp")
|
||||
proto.RegisterType((*DeleteMessageListReactionExtensionsReq)(nil), "msg.DeleteMessageListReactionExtensionsReq")
|
||||
proto.RegisterType((*DeleteMessageListReactionExtensionsResp)(nil), "msg.DeleteMessageListReactionExtensionsResp")
|
||||
@ -2088,13 +2088,13 @@ const _ = grpc.SupportPackageIsVersion4
|
||||
|
||||
type MsgClient interface {
|
||||
// 获取最小最大seq(包括用户的,以及指定群组的)
|
||||
GetMaxAndMinSeq(ctx context.Context, in *sdk_ws.GetMaxAndMinSeqReq, opts ...grpc.CallOption) (*sdk_ws.GetMaxAndMinSeqResp, error)
|
||||
GetMaxAndMinSeq(ctx context.Context, in *sdkws.GetMaxAndMinSeqReq, opts ...grpc.CallOption) (*sdkws.GetMaxAndMinSeqResp, error)
|
||||
// 拉取历史消息(包括用户的,以及指定群组的)
|
||||
PullMessageBySeqList(ctx context.Context, in *sdk_ws.PullMessageBySeqListReq, opts ...grpc.CallOption) (*sdk_ws.PullMessageBySeqListResp, error)
|
||||
PullMessageBySeqList(ctx context.Context, in *sdkws.PullMessageBySeqListReq, opts ...grpc.CallOption) (*sdkws.PullMessageBySeqListResp, error)
|
||||
// 发送消息
|
||||
SendMsg(ctx context.Context, in *SendMsgReq, opts ...grpc.CallOption) (*SendMsgResp, error)
|
||||
// 删除某人消息
|
||||
DelMsgList(ctx context.Context, in *sdk_ws.DelMsgListReq, opts ...grpc.CallOption) (*sdk_ws.DelMsgListResp, error)
|
||||
DelMsgList(ctx context.Context, in *sdkws.DelMsgListReq, opts ...grpc.CallOption) (*sdkws.DelMsgListResp, error)
|
||||
// 删除某个用户某个大群消息
|
||||
DelSuperGroupMsg(ctx context.Context, in *DelSuperGroupMsgReq, opts ...grpc.CallOption) (*DelSuperGroupMsgResp, error)
|
||||
// 清空某人所有消息
|
||||
@ -2118,8 +2118,8 @@ func NewMsgClient(cc *grpc.ClientConn) MsgClient {
|
||||
return &msgClient{cc}
|
||||
}
|
||||
|
||||
func (c *msgClient) GetMaxAndMinSeq(ctx context.Context, in *sdk_ws.GetMaxAndMinSeqReq, opts ...grpc.CallOption) (*sdk_ws.GetMaxAndMinSeqResp, error) {
|
||||
out := new(sdk_ws.GetMaxAndMinSeqResp)
|
||||
func (c *msgClient) GetMaxAndMinSeq(ctx context.Context, in *sdkws.GetMaxAndMinSeqReq, opts ...grpc.CallOption) (*sdkws.GetMaxAndMinSeqResp, error) {
|
||||
out := new(sdkws.GetMaxAndMinSeqResp)
|
||||
err := grpc.Invoke(ctx, "/msg.msg/GetMaxAndMinSeq", in, out, c.cc, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -2127,8 +2127,8 @@ func (c *msgClient) GetMaxAndMinSeq(ctx context.Context, in *sdk_ws.GetMaxAndMin
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *msgClient) PullMessageBySeqList(ctx context.Context, in *sdk_ws.PullMessageBySeqListReq, opts ...grpc.CallOption) (*sdk_ws.PullMessageBySeqListResp, error) {
|
||||
out := new(sdk_ws.PullMessageBySeqListResp)
|
||||
func (c *msgClient) PullMessageBySeqList(ctx context.Context, in *sdkws.PullMessageBySeqListReq, opts ...grpc.CallOption) (*sdkws.PullMessageBySeqListResp, error) {
|
||||
out := new(sdkws.PullMessageBySeqListResp)
|
||||
err := grpc.Invoke(ctx, "/msg.msg/PullMessageBySeqList", in, out, c.cc, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -2145,8 +2145,8 @@ func (c *msgClient) SendMsg(ctx context.Context, in *SendMsgReq, opts ...grpc.Ca
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *msgClient) DelMsgList(ctx context.Context, in *sdk_ws.DelMsgListReq, opts ...grpc.CallOption) (*sdk_ws.DelMsgListResp, error) {
|
||||
out := new(sdk_ws.DelMsgListResp)
|
||||
func (c *msgClient) DelMsgList(ctx context.Context, in *sdkws.DelMsgListReq, opts ...grpc.CallOption) (*sdkws.DelMsgListResp, error) {
|
||||
out := new(sdkws.DelMsgListResp)
|
||||
err := grpc.Invoke(ctx, "/msg.msg/DelMsgList", in, out, c.cc, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -2230,13 +2230,13 @@ func (c *msgClient) DeleteMessageReactionExtensions(ctx context.Context, in *Del
|
||||
|
||||
type MsgServer interface {
|
||||
// 获取最小最大seq(包括用户的,以及指定群组的)
|
||||
GetMaxAndMinSeq(context.Context, *sdk_ws.GetMaxAndMinSeqReq) (*sdk_ws.GetMaxAndMinSeqResp, error)
|
||||
GetMaxAndMinSeq(context.Context, *sdkws.GetMaxAndMinSeqReq) (*sdkws.GetMaxAndMinSeqResp, error)
|
||||
// 拉取历史消息(包括用户的,以及指定群组的)
|
||||
PullMessageBySeqList(context.Context, *sdk_ws.PullMessageBySeqListReq) (*sdk_ws.PullMessageBySeqListResp, error)
|
||||
PullMessageBySeqList(context.Context, *sdkws.PullMessageBySeqListReq) (*sdkws.PullMessageBySeqListResp, error)
|
||||
// 发送消息
|
||||
SendMsg(context.Context, *SendMsgReq) (*SendMsgResp, error)
|
||||
// 删除某人消息
|
||||
DelMsgList(context.Context, *sdk_ws.DelMsgListReq) (*sdk_ws.DelMsgListResp, error)
|
||||
DelMsgList(context.Context, *sdkws.DelMsgListReq) (*sdkws.DelMsgListResp, error)
|
||||
// 删除某个用户某个大群消息
|
||||
DelSuperGroupMsg(context.Context, *DelSuperGroupMsgReq) (*DelSuperGroupMsgResp, error)
|
||||
// 清空某人所有消息
|
||||
@ -2257,7 +2257,7 @@ func RegisterMsgServer(s *grpc.Server, srv MsgServer) {
|
||||
}
|
||||
|
||||
func _Msg_GetMaxAndMinSeq_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(sdk_ws.GetMaxAndMinSeqReq)
|
||||
in := new(sdkws.GetMaxAndMinSeqReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -2269,13 +2269,13 @@ func _Msg_GetMaxAndMinSeq_Handler(srv interface{}, ctx context.Context, dec func
|
||||
FullMethod: "/msg.msg/GetMaxAndMinSeq",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MsgServer).GetMaxAndMinSeq(ctx, req.(*sdk_ws.GetMaxAndMinSeqReq))
|
||||
return srv.(MsgServer).GetMaxAndMinSeq(ctx, req.(*sdkws.GetMaxAndMinSeqReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Msg_PullMessageBySeqList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(sdk_ws.PullMessageBySeqListReq)
|
||||
in := new(sdkws.PullMessageBySeqListReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -2287,7 +2287,7 @@ func _Msg_PullMessageBySeqList_Handler(srv interface{}, ctx context.Context, dec
|
||||
FullMethod: "/msg.msg/PullMessageBySeqList",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MsgServer).PullMessageBySeqList(ctx, req.(*sdk_ws.PullMessageBySeqListReq))
|
||||
return srv.(MsgServer).PullMessageBySeqList(ctx, req.(*sdkws.PullMessageBySeqListReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@ -2311,7 +2311,7 @@ func _Msg_SendMsg_Handler(srv interface{}, ctx context.Context, dec func(interfa
|
||||
}
|
||||
|
||||
func _Msg_DelMsgList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(sdk_ws.DelMsgListReq)
|
||||
in := new(sdkws.DelMsgListReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -2323,7 +2323,7 @@ func _Msg_DelMsgList_Handler(srv interface{}, ctx context.Context, dec func(inte
|
||||
FullMethod: "/msg.msg/DelMsgList",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MsgServer).DelMsgList(ctx, req.(*sdk_ws.DelMsgListReq))
|
||||
return srv.(MsgServer).DelMsgList(ctx, req.(*sdkws.DelMsgListReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@ -2529,107 +2529,107 @@ var _Msg_serviceDesc = grpc.ServiceDesc{
|
||||
Metadata: "msg/msg.proto",
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("msg/msg.proto", fileDescriptor_msg_69316330d19ec9fa) }
|
||||
func init() { proto.RegisterFile("msg/msg.proto", fileDescriptor_msg_9bd9d9abca588885) }
|
||||
|
||||
var fileDescriptor_msg_69316330d19ec9fa = []byte{
|
||||
// 1572 bytes of a gzipped FileDescriptorProto
|
||||
var fileDescriptor_msg_9bd9d9abca588885 = []byte{
|
||||
// 1569 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x59, 0xcd, 0x6e, 0xdb, 0x46,
|
||||
0x10, 0x06, 0x49, 0x4b, 0xb6, 0x47, 0x76, 0xec, 0xac, 0x1d, 0x43, 0x61, 0x8d, 0x46, 0x65, 0x92,
|
||||
0x46, 0x41, 0x12, 0x19, 0x70, 0x8b, 0xfe, 0xa5, 0x40, 0x1b, 0x47, 0xae, 0x62, 0xa4, 0x6c, 0x12,
|
||||
0xca, 0x6d, 0x90, 0xe6, 0x90, 0x32, 0xd6, 0x9a, 0x21, 0xc4, 0x3f, 0x73, 0xa9, 0x58, 0x02, 0x7a,
|
||||
0x5a, 0x41, 0x62, 0x19, 0x70, 0x8b, 0xfe, 0xa5, 0x40, 0x1b, 0x47, 0xae, 0x62, 0xa4, 0x6c, 0x12,
|
||||
0xca, 0x6d, 0x90, 0xe6, 0x90, 0x32, 0xd6, 0x9a, 0x21, 0xcc, 0x3f, 0x73, 0xa9, 0x58, 0x02, 0x7a,
|
||||
0xe9, 0xa1, 0xbd, 0xf5, 0x35, 0x7a, 0xeb, 0x43, 0xe4, 0x09, 0xfa, 0x20, 0x3d, 0x15, 0xe8, 0xb9,
|
||||
0x2d, 0x76, 0xb9, 0xa2, 0xf8, 0x2b, 0xd1, 0x0a, 0x02, 0xe4, 0xd0, 0x9b, 0x67, 0x76, 0x76, 0x7e,
|
||||
0xbf, 0x19, 0x2d, 0xc7, 0xb0, 0x6a, 0x13, 0x63, 0xc7, 0x26, 0x46, 0xcb, 0xf3, 0xdd, 0xc0, 0x45,
|
||||
0x92, 0x4d, 0x0c, 0xb9, 0xf9, 0xc0, 0xc3, 0xce, 0xad, 0x03, 0xf5, 0x56, 0x17, 0xfb, 0x2f, 0xb1,
|
||||
0xbf, 0xe3, 0xf5, 0x8d, 0x1d, 0x76, 0xbc, 0x43, 0x7a, 0xfd, 0x67, 0xa7, 0x64, 0xe7, 0x94, 0x84,
|
||||
0xe2, 0x72, 0x6b, 0xa6, 0xa4, 0xaf, 0x7b, 0x1e, 0xf6, 0xb9, 0xbc, 0xe2, 0x42, 0x4d, 0x25, 0x46,
|
||||
0x5b, 0x0f, 0xf4, 0x43, 0x57, 0x7d, 0x84, 0x36, 0xa1, 0x12, 0xb8, 0x7d, 0xec, 0xd4, 0x85, 0x86,
|
||||
0xd0, 0x5c, 0xd6, 0x42, 0x02, 0x35, 0xa0, 0xe6, 0x7a, 0xd8, 0xd7, 0x03, 0xd3, 0x75, 0x0e, 0xda,
|
||||
0x75, 0x91, 0x9d, 0xc5, 0x59, 0xa8, 0x09, 0x8b, 0x76, 0xa8, 0xa6, 0x2e, 0x35, 0x84, 0x66, 0x6d,
|
||||
0xf7, 0x5c, 0x8b, 0xf4, 0xfa, 0xa7, 0xa4, 0xc5, 0x95, 0x6b, 0xe3, 0x63, 0xe5, 0x49, 0xcc, 0x60,
|
||||
0x7b, 0x2f, 0x7e, 0x51, 0x98, 0x7a, 0x71, 0xb6, 0x13, 0xca, 0x4f, 0x02, 0xac, 0x3d, 0x1c, 0x90,
|
||||
0x17, 0xf1, 0x80, 0x1a, 0x50, 0x7b, 0x10, 0xbb, 0x15, 0x86, 0x15, 0x67, 0xc5, 0x3d, 0x10, 0xa7,
|
||||
0x7b, 0xa0, 0xc0, 0x8a, 0x37, 0x20, 0x2f, 0x0e, 0xdd, 0x6f, 0x09, 0xf6, 0x0f, 0xda, 0x2c, 0xd2,
|
||||
0x65, 0x2d, 0xc1, 0x53, 0x7e, 0x13, 0x00, 0x4d, 0xec, 0xbb, 0x8e, 0xe1, 0xee, 0x8d, 0xd4, 0x47,
|
||||
0xa8, 0x0e, 0x8b, 0x96, 0x4e, 0x82, 0x2e, 0x3e, 0x61, 0x2e, 0x2c, 0x68, 0x63, 0x12, 0x5d, 0x81,
|
||||
0x55, 0xdd, 0x30, 0x7c, 0x6c, 0x24, 0x03, 0x4b, 0x32, 0xd1, 0x2e, 0xd4, 0x6c, 0x4c, 0x88, 0x6e,
|
||||
0xe0, 0xaf, 0x4d, 0x12, 0xd4, 0xa5, 0x86, 0xd4, 0xac, 0xed, 0xae, 0xb7, 0x28, 0x4c, 0x62, 0xd1,
|
||||
0x6a, 0x71, 0x21, 0xb4, 0x0d, 0xcb, 0x81, 0x6f, 0x1a, 0x06, 0xf3, 0x75, 0x81, 0x69, 0x9d, 0x30,
|
||||
0x94, 0x6f, 0x00, 0x75, 0x70, 0xa0, 0xea, 0xc3, 0x3b, 0x4e, 0x4f, 0x35, 0x9d, 0x2e, 0x3e, 0xd1,
|
||||
0xf0, 0x09, 0xda, 0x82, 0x2a, 0x0f, 0x2e, 0xcc, 0x14, 0xa7, 0xd2, 0x69, 0x14, 0x33, 0x69, 0x54,
|
||||
0x4e, 0x61, 0x23, 0xa3, 0x8f, 0x78, 0x34, 0xf0, 0x7d, 0xdf, 0xbf, 0xeb, 0xf6, 0x30, 0xd3, 0x58,
|
||||
0xd1, 0xc6, 0x24, 0x35, 0xb5, 0xef, 0xfb, 0x2a, 0x31, 0xb8, 0x36, 0x4e, 0x51, 0xbe, 0xaa, 0x0f,
|
||||
0x69, 0xa6, 0x68, 0x7e, 0x57, 0x35, 0x4e, 0x31, 0x3e, 0xd3, 0xcb, 0x62, 0xa1, 0x7c, 0x46, 0x29,
|
||||
0x1f, 0x01, 0x74, 0xb1, 0xd3, 0x53, 0x89, 0x41, 0x03, 0x28, 0x0f, 0x44, 0x1b, 0x6a, 0xd1, 0x3d,
|
||||
0xe2, 0xd1, 0x08, 0x09, 0x6b, 0x19, 0x95, 0x18, 0x51, 0xbe, 0xe2, 0x2c, 0x2a, 0x71, 0x64, 0x99,
|
||||
0xd8, 0x09, 0x42, 0x89, 0x4a, 0x28, 0x11, 0x63, 0x21, 0x19, 0x96, 0x08, 0x76, 0x7a, 0x87, 0xa6,
|
||||
0x8d, 0xeb, 0xd5, 0x86, 0xd0, 0x94, 0xb4, 0x88, 0x56, 0xae, 0x42, 0xed, 0xae, 0x85, 0x75, 0x9f,
|
||||
0xfb, 0xb9, 0x05, 0xd5, 0x41, 0x22, 0xd1, 0x21, 0xa5, 0x9c, 0x83, 0x95, 0x89, 0x18, 0xf1, 0x94,
|
||||
0xa7, 0xb0, 0xd6, 0xc5, 0x54, 0x7d, 0xa2, 0x46, 0x79, 0x57, 0x69, 0xaa, 0x0d, 0xdf, 0x1d, 0x78,
|
||||
0x51, 0x7d, 0xc6, 0x24, 0xbd, 0x61, 0x87, 0xa9, 0xe3, 0x29, 0x0d, 0x29, 0x05, 0xc1, 0x7a, 0x52,
|
||||
0x39, 0xf1, 0x94, 0x5b, 0xb0, 0xd1, 0xc5, 0x01, 0xcf, 0x4c, 0x37, 0xd0, 0x83, 0x01, 0xe1, 0x46,
|
||||
0x09, 0x23, 0x98, 0xee, 0x8a, 0xc6, 0x29, 0x65, 0x0b, 0x36, 0xb3, 0xe2, 0xc4, 0x53, 0x3e, 0x66,
|
||||
0x70, 0xc8, 0xa8, 0x49, 0x35, 0xb1, 0x90, 0x6d, 0xe2, 0x1f, 0x60, 0xb3, 0x93, 0xa3, 0x90, 0x46,
|
||||
0x87, 0x93, 0x40, 0xc2, 0x13, 0x20, 0xe1, 0x04, 0x90, 0x70, 0x04, 0x24, 0xee, 0xb2, 0x94, 0x70,
|
||||
0xb9, 0x03, 0x1b, 0x6d, 0x6c, 0x75, 0x07, 0x1e, 0xf6, 0x3b, 0x34, 0x41, 0x99, 0x8a, 0x88, 0x45,
|
||||
0x69, 0x95, 0x12, 0x69, 0xa5, 0xb1, 0x67, 0x15, 0x11, 0x4f, 0x39, 0x0a, 0x63, 0x4f, 0x1b, 0x98,
|
||||
0x19, 0x3b, 0x5a, 0x07, 0x89, 0x16, 0x49, 0x64, 0x45, 0xa2, 0x7f, 0x4e, 0x31, 0xee, 0x87, 0x79,
|
||||
0x4a, 0x1b, 0x9f, 0x23, 0x4f, 0xe5, 0x5b, 0xe6, 0x1e, 0x9b, 0x19, 0x8f, 0x7d, 0x33, 0xc0, 0x6d,
|
||||
0xf3, 0xf8, 0x78, 0xfe, 0xb8, 0x94, 0x13, 0x96, 0xa2, 0xa4, 0xa6, 0x37, 0xec, 0xfc, 0xcf, 0x15,
|
||||
0x50, 0x54, 0xb7, 0x67, 0x1e, 0x8f, 0xd4, 0x70, 0x48, 0x6a, 0x58, 0x3f, 0xa2, 0x0e, 0xee, 0x0f,
|
||||
0x03, 0xec, 0x10, 0xd3, 0x75, 0xca, 0x21, 0x94, 0x75, 0xb9, 0x3b, 0xf0, 0x8f, 0x70, 0x04, 0x95,
|
||||
0x88, 0xa6, 0x67, 0xae, 0x97, 0xf8, 0x79, 0x88, 0xe8, 0x70, 0xc2, 0x10, 0x6a, 0xe8, 0x70, 0xe4,
|
||||
0x61, 0x36, 0x61, 0x2a, 0x5a, 0x9c, 0x85, 0x86, 0x70, 0xc1, 0x4f, 0x3b, 0xc5, 0xe6, 0x7d, 0x85,
|
||||
0xcd, 0xfb, 0xbd, 0x70, 0xde, 0xcf, 0x8c, 0xa1, 0xa5, 0xe5, 0x29, 0xd9, 0x77, 0x02, 0x7f, 0xa4,
|
||||
0xe5, 0x1b, 0x48, 0xcf, 0xb6, 0x6a, 0x76, 0xb6, 0xdd, 0x04, 0x11, 0x0f, 0xeb, 0x8b, 0x2c, 0xc7,
|
||||
0xdb, 0x2d, 0xc3, 0x75, 0x0d, 0x0b, 0x87, 0x6f, 0x88, 0xe7, 0x83, 0xe3, 0x56, 0x37, 0xf0, 0x4d,
|
||||
0xc7, 0xf8, 0x4e, 0xb7, 0x06, 0x58, 0x13, 0xf1, 0x10, 0x7d, 0x09, 0x2b, 0x7a, 0x10, 0xe8, 0x47,
|
||||
0x2f, 0x70, 0xef, 0xc0, 0x39, 0x76, 0xeb, 0x4b, 0x25, 0xee, 0x25, 0x6e, 0x50, 0x28, 0x98, 0x84,
|
||||
0x05, 0x52, 0x5f, 0x6e, 0x08, 0xcd, 0x25, 0x6d, 0x4c, 0xa2, 0x5d, 0xd8, 0x34, 0x09, 0x75, 0xdf,
|
||||
0x77, 0x74, 0x6b, 0x12, 0x78, 0x1d, 0x98, 0x58, 0xee, 0x19, 0x6a, 0x01, 0xb2, 0x89, 0xf1, 0x95,
|
||||
0xe9, 0x93, 0x20, 0xcc, 0x1f, 0x9b, 0xd1, 0x35, 0x36, 0xa3, 0x73, 0x4e, 0xe4, 0x27, 0x20, 0x17,
|
||||
0x27, 0x91, 0xe2, 0xb9, 0x8f, 0x47, 0x1c, 0x1b, 0xf4, 0x4f, 0x74, 0x15, 0x2a, 0x2f, 0x69, 0x10,
|
||||
0xfc, 0x09, 0xb1, 0xc6, 0x41, 0x78, 0x1f, 0x8f, 0xc2, 0xd8, 0xc2, 0xd3, 0xcf, 0xc4, 0x4f, 0x04,
|
||||
0xe5, 0xdf, 0x05, 0xb8, 0x44, 0xa7, 0xee, 0xdb, 0x0a, 0xc2, 0xc1, 0x74, 0x10, 0x7e, 0xc1, 0x40,
|
||||
0x38, 0x23, 0x80, 0xff, 0x11, 0xf8, 0x36, 0x23, 0xf0, 0x4f, 0x01, 0x1a, 0xd3, 0x0b, 0x38, 0xd7,
|
||||
0x28, 0x4e, 0x55, 0x50, 0xca, 0x56, 0x30, 0x3f, 0x07, 0x0b, 0x45, 0x39, 0x88, 0x57, 0xa0, 0x92,
|
||||
0xac, 0xc0, 0x75, 0xa8, 0xfa, 0x98, 0x0c, 0xac, 0xa0, 0x5e, 0x65, 0xa8, 0x3c, 0xcf, 0x50, 0x19,
|
||||
0x05, 0x8b, 0x89, 0xa7, 0x71, 0x01, 0xe5, 0x1f, 0x11, 0x2e, 0x77, 0xa2, 0x68, 0x69, 0x0a, 0x5f,
|
||||
0xa3, 0xe7, 0xa2, 0xbe, 0x12, 0x53, 0x7d, 0x15, 0xef, 0x47, 0x29, 0xd5, 0x8f, 0xb3, 0x7b, 0x8e,
|
||||
0xc0, 0x96, 0x9d, 0xac, 0xc6, 0x7d, 0x3c, 0x8a, 0x35, 0xdd, 0x6d, 0x16, 0x5e, 0x89, 0x28, 0x5a,
|
||||
0x6a, 0x46, 0x8d, 0x56, 0xa0, 0x5a, 0x3e, 0x06, 0x94, 0x95, 0x4e, 0x57, 0x51, 0x28, 0x5b, 0x45,
|
||||
0xb1, 0xa8, 0x8a, 0xca, 0xef, 0x02, 0x5c, 0x99, 0xed, 0xfa, 0x5c, 0x90, 0xeb, 0xc2, 0x06, 0x31,
|
||||
0x1d, 0xc3, 0xc2, 0x51, 0x20, 0x0c, 0x13, 0xe1, 0xe7, 0xd1, 0x7b, 0xe1, 0xa4, 0x8a, 0x9f, 0x47,
|
||||
0x06, 0x43, 0x41, 0x2d, 0xef, 0xb6, 0xf2, 0x4a, 0x84, 0xed, 0x69, 0xb7, 0xe6, 0xf0, 0xd3, 0x2f,
|
||||
0x9a, 0xa9, 0xa1, 0xa7, 0x9f, 0xcf, 0xf4, 0xf4, 0xf5, 0x07, 0xea, 0x42, 0xa6, 0x90, 0x6f, 0x72,
|
||||
0xc4, 0xbc, 0x12, 0xe0, 0xf2, 0xcc, 0x87, 0xca, 0x5c, 0x25, 0xff, 0x10, 0x6a, 0x64, 0x70, 0x74,
|
||||
0x84, 0x09, 0x89, 0x25, 0x10, 0xb1, 0x04, 0x32, 0xdd, 0xe3, 0x0f, 0x3a, 0x2d, 0x2e, 0x86, 0x76,
|
||||
0x01, 0x8e, 0x75, 0xd3, 0xc2, 0x3d, 0x76, 0x69, 0xa1, 0xf0, 0x52, 0x4c, 0x4a, 0xf9, 0x4b, 0x84,
|
||||
0xf7, 0xdb, 0xd8, 0xc2, 0x01, 0x7e, 0xab, 0x67, 0xc7, 0xec, 0xcf, 0xd2, 0xa2, 0x9f, 0xab, 0xea,
|
||||
0x99, 0x7f, 0xae, 0x16, 0x0b, 0x47, 0xf5, 0x7e, 0x11, 0xc2, 0x97, 0x58, 0xae, 0x33, 0x58, 0xc9,
|
||||
0x97, 0x56, 0x7e, 0x11, 0xe0, 0x5a, 0xa9, 0x9c, 0xcf, 0x85, 0x9d, 0x33, 0xfc, 0x6a, 0xb8, 0xb0,
|
||||
0x9a, 0x40, 0x06, 0xba, 0x09, 0xcb, 0x78, 0xcc, 0x88, 0x56, 0x55, 0x49, 0x00, 0x4d, 0x04, 0xe2,
|
||||
0xbe, 0x89, 0x45, 0xbe, 0x49, 0x71, 0xdf, 0x94, 0x3f, 0x44, 0x58, 0x8e, 0x54, 0xa1, 0x67, 0x45,
|
||||
0xe9, 0x14, 0x98, 0xe3, 0xd7, 0x93, 0x96, 0x5f, 0x7f, 0x3a, 0x88, 0x65, 0xc7, 0xbc, 0x54, 0x88,
|
||||
0x00, 0x25, 0xf5, 0xe0, 0x0a, 0x07, 0x4e, 0xf2, 0x49, 0x75, 0x8e, 0x3d, 0xe1, 0x42, 0x88, 0x8a,
|
||||
0x78, 0x28, 0x3f, 0x3d, 0xe3, 0x04, 0xba, 0x96, 0x9c, 0x40, 0x39, 0xf5, 0x8b, 0xcd, 0x20, 0x1b,
|
||||
0x56, 0xe2, 0x47, 0xe8, 0x06, 0x2c, 0xf5, 0x39, 0xcd, 0x0b, 0x98, 0x41, 0x65, 0x24, 0x30, 0x47,
|
||||
0x01, 0x7f, 0x15, 0x60, 0x23, 0xb6, 0xf9, 0xa3, 0x79, 0x61, 0xab, 0xbf, 0xcc, 0x82, 0x4f, 0x28,
|
||||
0xb1, 0xe0, 0x13, 0xcf, 0xbc, 0xe0, 0x93, 0x52, 0x0b, 0xbe, 0xdd, 0xbf, 0x17, 0x41, 0xb2, 0x89,
|
||||
0x81, 0xee, 0xc1, 0x5a, 0x6a, 0x31, 0x87, 0x2e, 0xf2, 0xb8, 0xb3, 0x0b, 0x40, 0x59, 0x2e, 0x3a,
|
||||
0x22, 0x1e, 0x7a, 0x0c, 0x9b, 0x0f, 0x07, 0x96, 0xc5, 0x3b, 0x73, 0x6f, 0xd4, 0xc5, 0x27, 0xcc,
|
||||
0x8f, 0x77, 0xf9, 0x9d, 0xbc, 0x43, 0xaa, 0xf3, 0xd2, 0xd4, 0x73, 0xd6, 0x5b, 0x8b, 0x7c, 0xe1,
|
||||
0x83, 0xd6, 0xf8, 0xe7, 0xc5, 0x78, 0xa1, 0x27, 0xaf, 0x27, 0x19, 0xc4, 0x43, 0x9f, 0x02, 0xb4,
|
||||
0xb1, 0xa5, 0x12, 0x83, 0x19, 0xdf, 0xe4, 0xca, 0x27, 0x2c, 0x7a, 0xeb, 0x42, 0x0e, 0x97, 0x78,
|
||||
0xa8, 0x03, 0xeb, 0xe9, 0x8d, 0x0d, 0xaa, 0x33, 0x03, 0x39, 0x1b, 0x21, 0xf9, 0x62, 0xc1, 0x09,
|
||||
0xf1, 0xd0, 0x0e, 0x2c, 0x8d, 0xd7, 0x74, 0x28, 0xf4, 0x30, 0xb6, 0xdc, 0x93, 0xcf, 0xa7, 0x38,
|
||||
0xa1, 0xe5, 0xf4, 0x9e, 0x8c, 0x5b, 0xce, 0xd9, 0xb6, 0x71, 0xcb, 0x79, 0x8b, 0x35, 0xaa, 0xa8,
|
||||
0x93, 0xaf, 0xa8, 0x53, 0xa8, 0x28, 0x77, 0xa1, 0xd6, 0x87, 0xed, 0x69, 0x1f, 0x01, 0xe8, 0x4a,
|
||||
0x99, 0x0f, 0x3d, 0xf9, 0x6a, 0x09, 0x29, 0xe2, 0xa1, 0x53, 0x68, 0xcc, 0x7a, 0x02, 0xa2, 0x66,
|
||||
0xd9, 0x47, 0xae, 0x7c, 0xbd, 0xa4, 0x24, 0xf1, 0xd0, 0x09, 0x6c, 0xdf, 0xe9, 0xf5, 0x8a, 0xa3,
|
||||
0xbc, 0x56, 0x72, 0xa7, 0x22, 0x37, 0xcb, 0x09, 0x12, 0x0f, 0xfd, 0x08, 0x97, 0x12, 0x3f, 0x61,
|
||||
0x39, 0x56, 0x6f, 0x8c, 0x91, 0x55, 0xe2, 0x71, 0x21, 0xdf, 0x2c, 0x2f, 0x4c, 0xbc, 0xbd, 0x77,
|
||||
0xbe, 0xbf, 0xf8, 0xc0, 0xc3, 0xce, 0xb3, 0x03, 0x35, 0xf6, 0xbf, 0x1f, 0x9b, 0x18, 0xb7, 0x6d,
|
||||
0x62, 0x3c, 0xaf, 0x32, 0xf2, 0x83, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x01, 0x9d, 0x0b, 0x79,
|
||||
0x64, 0x1a, 0x00, 0x00,
|
||||
0xbf, 0x19, 0x2d, 0xc7, 0xb0, 0x6c, 0x13, 0x63, 0xc7, 0x26, 0x46, 0xcb, 0xf3, 0xdd, 0xc0, 0x45,
|
||||
0x92, 0x4d, 0x0c, 0x79, 0xeb, 0x81, 0x87, 0x9d, 0xed, 0x03, 0x75, 0xbb, 0x8b, 0xfd, 0x97, 0xd8,
|
||||
0xdf, 0xf1, 0x4e, 0x8c, 0x1d, 0x76, 0xbc, 0x43, 0x7a, 0x27, 0x67, 0x64, 0xe7, 0x8c, 0x84, 0xd2,
|
||||
0xf2, 0xf6, 0x34, 0x41, 0x5f, 0xf7, 0x3c, 0xec, 0x73, 0x71, 0xc5, 0x85, 0x9a, 0x4a, 0x8c, 0xb6,
|
||||
0x1e, 0xe8, 0x87, 0xae, 0xfa, 0x08, 0xad, 0x43, 0x25, 0x70, 0x4f, 0xb0, 0x53, 0x17, 0x1a, 0x42,
|
||||
0x73, 0x51, 0x0b, 0x09, 0xd4, 0x80, 0x9a, 0xeb, 0x61, 0x5f, 0x0f, 0x4c, 0xd7, 0x39, 0x68, 0xd7,
|
||||
0x45, 0x76, 0x16, 0x67, 0xa1, 0x26, 0xcc, 0xdb, 0xa1, 0x9a, 0xba, 0xd4, 0x10, 0x9a, 0xb5, 0xdd,
|
||||
0x0b, 0x2d, 0x66, 0xae, 0xc5, 0x95, 0x6b, 0xa3, 0x63, 0xe5, 0x49, 0xcc, 0x60, 0x7b, 0x2f, 0x7e,
|
||||
0x51, 0x98, 0x78, 0x71, 0xba, 0x13, 0xca, 0x4f, 0x02, 0xac, 0x3c, 0xec, 0x93, 0x17, 0xf1, 0x80,
|
||||
0x1a, 0x50, 0x7b, 0x10, 0xbb, 0x15, 0x86, 0x15, 0x67, 0xc5, 0x3d, 0x10, 0x27, 0x7b, 0xa0, 0xc0,
|
||||
0x92, 0xd7, 0x27, 0x2f, 0x0e, 0xdd, 0x6f, 0x09, 0xf6, 0x0f, 0xda, 0x2c, 0xd2, 0x45, 0x2d, 0xc1,
|
||||
0x53, 0x7e, 0x13, 0x00, 0x8d, 0xed, 0xbb, 0x8e, 0xe1, 0xee, 0x0d, 0xd5, 0x47, 0xa8, 0x0e, 0xf3,
|
||||
0x96, 0x4e, 0x82, 0x2e, 0x3e, 0x65, 0x2e, 0xcc, 0x69, 0x23, 0x12, 0x5d, 0x83, 0x65, 0xdd, 0x30,
|
||||
0x7c, 0x6c, 0x24, 0x03, 0x4b, 0x32, 0xd1, 0x2e, 0xd4, 0x6c, 0x4c, 0x88, 0x6e, 0xe0, 0xaf, 0x4d,
|
||||
0x12, 0xd4, 0xa5, 0x86, 0xd4, 0xac, 0xed, 0xae, 0xb6, 0x28, 0x48, 0x62, 0xd1, 0x6a, 0x71, 0x21,
|
||||
0xb4, 0x09, 0x8b, 0x81, 0x6f, 0x1a, 0x06, 0xf3, 0x75, 0x8e, 0x69, 0x1d, 0x33, 0x94, 0x6f, 0x00,
|
||||
0x75, 0x70, 0xa0, 0xea, 0x83, 0x3b, 0x4e, 0x4f, 0x35, 0x9d, 0x2e, 0x3e, 0xd5, 0xf0, 0x29, 0xda,
|
||||
0x80, 0x2a, 0x0f, 0x2e, 0xcc, 0x14, 0xa7, 0xd2, 0x69, 0x14, 0x33, 0x69, 0x54, 0xce, 0x60, 0x2d,
|
||||
0xa3, 0x8f, 0x78, 0x34, 0xf0, 0x7d, 0xdf, 0xbf, 0xeb, 0xf6, 0x30, 0xd3, 0x58, 0xd1, 0x46, 0x24,
|
||||
0x35, 0xb5, 0xef, 0xfb, 0x2a, 0x31, 0xb8, 0x36, 0x4e, 0x51, 0xbe, 0xaa, 0x0f, 0x68, 0xa6, 0x68,
|
||||
0x7e, 0x97, 0x35, 0x4e, 0x31, 0x3e, 0xd3, 0xcb, 0x62, 0xa1, 0x7c, 0x46, 0x29, 0x1f, 0x01, 0x74,
|
||||
0xb1, 0xd3, 0x53, 0x89, 0x41, 0x03, 0x28, 0x0f, 0x44, 0x1b, 0x6a, 0xd1, 0x3d, 0xe2, 0xd1, 0x08,
|
||||
0x09, 0xeb, 0x18, 0x95, 0x18, 0x51, 0xbe, 0xe2, 0x2c, 0x2a, 0x71, 0x64, 0x99, 0xd8, 0x09, 0x42,
|
||||
0x89, 0x4a, 0x28, 0x11, 0x63, 0x21, 0x19, 0x16, 0x08, 0x76, 0x7a, 0x87, 0xa6, 0x8d, 0xeb, 0xd5,
|
||||
0x86, 0xd0, 0x94, 0xb4, 0x88, 0x56, 0xae, 0x43, 0xed, 0xae, 0x85, 0x75, 0x9f, 0xfb, 0xb9, 0x01,
|
||||
0xd5, 0x7e, 0x22, 0xd1, 0x21, 0xa5, 0x5c, 0x80, 0xa5, 0xb1, 0x18, 0xf1, 0x94, 0xa7, 0xb0, 0xd2,
|
||||
0xc5, 0x54, 0x7d, 0xa2, 0x46, 0x79, 0x57, 0x69, 0xaa, 0x0d, 0xdf, 0xed, 0x7b, 0x51, 0x7d, 0x46,
|
||||
0x24, 0xbd, 0x61, 0x87, 0xa9, 0xe3, 0x29, 0x0d, 0x29, 0x05, 0xc1, 0x6a, 0x52, 0x39, 0xf1, 0x94,
|
||||
0x6d, 0x58, 0xeb, 0xe2, 0x80, 0x67, 0xa6, 0x1b, 0xe8, 0x41, 0x9f, 0x70, 0xa3, 0x84, 0x11, 0x4c,
|
||||
0x77, 0x45, 0xe3, 0x94, 0xb2, 0x01, 0xeb, 0x59, 0x71, 0xe2, 0x29, 0x1f, 0x33, 0x38, 0x64, 0xd4,
|
||||
0xa4, 0x9a, 0x58, 0xc8, 0x36, 0xf1, 0x0f, 0xb0, 0xde, 0xc9, 0x51, 0x48, 0xa3, 0xc3, 0x49, 0x20,
|
||||
0xe1, 0x31, 0x90, 0x70, 0x02, 0x48, 0x38, 0x02, 0x12, 0x77, 0x59, 0x4a, 0xb8, 0xdc, 0x81, 0xb5,
|
||||
0x36, 0xb6, 0xba, 0x7d, 0x0f, 0xfb, 0x1d, 0x9a, 0xa0, 0x4c, 0x45, 0xc4, 0xa2, 0xb4, 0x4a, 0x89,
|
||||
0xb4, 0xd2, 0xd8, 0xb3, 0x8a, 0x88, 0xa7, 0x1c, 0x85, 0xb1, 0xa7, 0x0d, 0x4c, 0x8d, 0x1d, 0xad,
|
||||
0x82, 0x44, 0x8b, 0x24, 0xb2, 0x22, 0xd1, 0x3f, 0x27, 0x18, 0xf7, 0xc3, 0x3c, 0xa5, 0x8d, 0xcf,
|
||||
0x90, 0xa7, 0xf2, 0x2d, 0x73, 0x8f, 0xcd, 0x8c, 0xc7, 0xbe, 0x19, 0xe0, 0xb6, 0x79, 0x7c, 0x3c,
|
||||
0x7b, 0x5c, 0xca, 0x29, 0x4b, 0x51, 0x52, 0xd3, 0x1b, 0x76, 0xfe, 0xe7, 0x0a, 0x28, 0xaa, 0xdb,
|
||||
0x33, 0x8f, 0x87, 0x6a, 0x38, 0x24, 0x35, 0xac, 0x1f, 0x51, 0x07, 0xf7, 0x07, 0x01, 0x76, 0x88,
|
||||
0xe9, 0x3a, 0xe5, 0x10, 0xca, 0xba, 0xdc, 0xed, 0xfb, 0x47, 0x38, 0x82, 0x4a, 0x44, 0xd3, 0x33,
|
||||
0xd7, 0x4b, 0xfc, 0x3c, 0x44, 0x74, 0x38, 0x61, 0x08, 0x35, 0x74, 0x38, 0xf4, 0x30, 0x9b, 0x30,
|
||||
0x15, 0x2d, 0xce, 0x42, 0x03, 0xb8, 0xe4, 0xa7, 0x9d, 0x62, 0xf3, 0xbe, 0xc2, 0xe6, 0xfd, 0x5e,
|
||||
0x38, 0xef, 0xa7, 0xc6, 0xd0, 0xd2, 0xf2, 0x94, 0xec, 0x3b, 0x81, 0x3f, 0xd4, 0xf2, 0x0d, 0xa4,
|
||||
0x67, 0x5b, 0x35, 0x3b, 0xdb, 0x6e, 0x81, 0x88, 0x07, 0xf5, 0x79, 0x96, 0xe3, 0xcd, 0x96, 0xe1,
|
||||
0xba, 0x86, 0x85, 0xc3, 0x37, 0xc4, 0xf3, 0xfe, 0x71, 0xab, 0x1b, 0xf8, 0xa6, 0x63, 0x7c, 0xa7,
|
||||
0x5b, 0x7d, 0xac, 0x89, 0x78, 0x80, 0xbe, 0x84, 0x25, 0x3d, 0x08, 0xf4, 0xa3, 0x17, 0xb8, 0x77,
|
||||
0xe0, 0x1c, 0xbb, 0xf5, 0x85, 0x12, 0xf7, 0x12, 0x37, 0x28, 0x14, 0x4c, 0xc2, 0x02, 0xa9, 0x2f,
|
||||
0x36, 0x84, 0xe6, 0x82, 0x36, 0x22, 0xd1, 0x2e, 0xac, 0x9b, 0x84, 0xba, 0xef, 0x3b, 0xba, 0x35,
|
||||
0x0e, 0xbc, 0x0e, 0x4c, 0x2c, 0xf7, 0x0c, 0xb5, 0x00, 0xd9, 0xc4, 0xf8, 0xca, 0xf4, 0x49, 0x10,
|
||||
0xe6, 0x8f, 0xcd, 0xe8, 0x1a, 0x9b, 0xd1, 0x39, 0x27, 0xf2, 0x13, 0x90, 0x8b, 0x93, 0x48, 0xf1,
|
||||
0x7c, 0x82, 0x87, 0x1c, 0x1b, 0xf4, 0x4f, 0x74, 0x1d, 0x2a, 0x2f, 0x69, 0x10, 0xfc, 0x09, 0xb1,
|
||||
0xc2, 0x41, 0x78, 0x1f, 0x0f, 0xc3, 0xd8, 0xc2, 0xd3, 0xcf, 0xc4, 0x4f, 0x04, 0xe5, 0xdf, 0x39,
|
||||
0xb8, 0x42, 0xa7, 0xee, 0xdb, 0x0a, 0xc2, 0xfe, 0x64, 0x10, 0x7e, 0xc1, 0x40, 0x38, 0x25, 0x80,
|
||||
0xff, 0x11, 0xf8, 0x36, 0x23, 0xf0, 0x4f, 0x01, 0x1a, 0x93, 0x0b, 0x38, 0xd3, 0x28, 0x4e, 0x55,
|
||||
0x50, 0xca, 0x56, 0x30, 0x3f, 0x07, 0x73, 0x45, 0x39, 0x88, 0x57, 0xa0, 0x92, 0xac, 0xc0, 0x0d,
|
||||
0xa8, 0xfa, 0x98, 0xf4, 0xad, 0xa0, 0x5e, 0x65, 0xa8, 0xbc, 0xc8, 0x50, 0x19, 0x05, 0x8b, 0x89,
|
||||
0xa7, 0x71, 0x01, 0xe5, 0x1f, 0x11, 0xae, 0x76, 0xa2, 0x68, 0x69, 0x0a, 0x5f, 0xa3, 0xe7, 0xa2,
|
||||
0xbe, 0x12, 0x53, 0x7d, 0x15, 0xef, 0x47, 0x29, 0xd5, 0x8f, 0xd3, 0x7b, 0x8e, 0xc0, 0x86, 0x9d,
|
||||
0xac, 0xc6, 0x7d, 0x3c, 0x8c, 0x35, 0xdd, 0x6d, 0x16, 0x5e, 0x89, 0x28, 0x5a, 0x6a, 0x46, 0x8d,
|
||||
0x56, 0xa0, 0x5a, 0x3e, 0x06, 0x94, 0x95, 0x4e, 0x57, 0x51, 0x28, 0x5b, 0x45, 0xb1, 0xa8, 0x8a,
|
||||
0xca, 0xef, 0x02, 0x5c, 0x9b, 0xee, 0xfa, 0x4c, 0x90, 0xeb, 0xc2, 0x1a, 0x31, 0x1d, 0xc3, 0xc2,
|
||||
0x51, 0x20, 0x0c, 0x13, 0xe1, 0xe7, 0xd1, 0x7b, 0xe1, 0xa4, 0x8a, 0x9f, 0x47, 0x06, 0x43, 0x41,
|
||||
0x2d, 0xef, 0xb6, 0xf2, 0x4a, 0x84, 0xcd, 0x49, 0xb7, 0x66, 0xf0, 0xd3, 0x2f, 0x9a, 0xa9, 0xa1,
|
||||
0xa7, 0x9f, 0x4f, 0xf5, 0xf4, 0xf5, 0x07, 0xea, 0x5c, 0xa6, 0x90, 0x6f, 0x72, 0xc4, 0xbc, 0x12,
|
||||
0xe0, 0xea, 0xd4, 0x87, 0xca, 0x4c, 0x25, 0xff, 0x10, 0x6a, 0xa4, 0x7f, 0x74, 0x84, 0x09, 0x89,
|
||||
0x25, 0x10, 0xb1, 0x04, 0x32, 0xdd, 0xa3, 0x0f, 0x3a, 0x2d, 0x2e, 0x86, 0x76, 0x01, 0x8e, 0x75,
|
||||
0xd3, 0xc2, 0x3d, 0x76, 0x69, 0xae, 0xf0, 0x52, 0x4c, 0x4a, 0xf9, 0x4b, 0x84, 0xf7, 0xdb, 0xd8,
|
||||
0xc2, 0x01, 0x7e, 0xab, 0x67, 0xc7, 0xf4, 0xcf, 0xd2, 0xa2, 0x9f, 0xab, 0xea, 0xb9, 0x7f, 0xae,
|
||||
0xe6, 0x0b, 0x47, 0xf5, 0x7e, 0x11, 0xc2, 0x17, 0x58, 0xae, 0x33, 0x58, 0xc9, 0x97, 0x56, 0x7e,
|
||||
0x11, 0x60, 0xab, 0x54, 0xce, 0x67, 0xc2, 0xce, 0x39, 0x7e, 0x35, 0x5c, 0x58, 0x4e, 0x20, 0x03,
|
||||
0xdd, 0x82, 0x45, 0x3c, 0x62, 0x44, 0xab, 0xaa, 0x24, 0x80, 0xc6, 0x02, 0x71, 0xdf, 0xc4, 0x22,
|
||||
0xdf, 0xa4, 0xb8, 0x6f, 0xca, 0x1f, 0x22, 0x2c, 0x46, 0xaa, 0xd0, 0xb3, 0xa2, 0x74, 0x0a, 0xcc,
|
||||
0xf1, 0x1b, 0x49, 0xcb, 0xaf, 0x3f, 0x1d, 0xc4, 0xb2, 0x63, 0x5e, 0x2a, 0x44, 0x80, 0x92, 0x7a,
|
||||
0x70, 0x85, 0x03, 0x27, 0xf9, 0xa4, 0xba, 0xc0, 0x9e, 0x70, 0x21, 0x44, 0x45, 0x3c, 0x90, 0x9f,
|
||||
0x9e, 0x73, 0x02, 0x6d, 0x25, 0x27, 0x50, 0x4e, 0xfd, 0x62, 0x33, 0xc8, 0x86, 0xa5, 0xf8, 0x11,
|
||||
0xba, 0x09, 0x0b, 0x27, 0x9c, 0xe6, 0x05, 0xcc, 0xa0, 0x32, 0x12, 0x98, 0xa1, 0x80, 0xbf, 0x0a,
|
||||
0xb0, 0x16, 0xdb, 0xfc, 0xd1, 0xbc, 0xb0, 0xd5, 0x5f, 0x66, 0xc1, 0x27, 0x94, 0x58, 0xf0, 0x89,
|
||||
0xe7, 0x5e, 0xf0, 0x49, 0xa9, 0x05, 0xdf, 0xee, 0xdf, 0xf3, 0x20, 0xd9, 0xc4, 0x40, 0xf7, 0x60,
|
||||
0x25, 0xb5, 0x98, 0x43, 0x97, 0x79, 0xdc, 0xd9, 0x05, 0xa0, 0x2c, 0x17, 0x1d, 0x11, 0x0f, 0x3d,
|
||||
0x86, 0xf5, 0x87, 0x7d, 0xcb, 0xe2, 0x9d, 0xb9, 0x37, 0xec, 0xe2, 0x53, 0xe6, 0xc7, 0xbb, 0xfc,
|
||||
0x4e, 0xde, 0x21, 0xd5, 0x79, 0x65, 0xe2, 0x39, 0xeb, 0xad, 0x79, 0xbe, 0xf0, 0x41, 0x2b, 0xfc,
|
||||
0xf3, 0x62, 0xb4, 0xd0, 0x93, 0x57, 0x93, 0x0c, 0xe2, 0xa1, 0x4f, 0x01, 0xda, 0xd8, 0x52, 0x89,
|
||||
0xc1, 0x8c, 0xaf, 0x73, 0xe5, 0x63, 0x16, 0xbd, 0x75, 0x29, 0x87, 0x4b, 0x3c, 0xd4, 0x81, 0xd5,
|
||||
0xf4, 0xc6, 0x06, 0xd5, 0x99, 0x81, 0x9c, 0x8d, 0x90, 0x7c, 0xb9, 0xe0, 0x84, 0x78, 0x68, 0x07,
|
||||
0x16, 0x46, 0x6b, 0x3a, 0x14, 0x7a, 0x18, 0x5b, 0xee, 0xc9, 0x17, 0x53, 0x9c, 0xd0, 0x72, 0x7a,
|
||||
0x4f, 0xc6, 0x2d, 0xe7, 0x6c, 0xdb, 0xb8, 0xe5, 0xbc, 0xc5, 0x1a, 0x55, 0xd4, 0xc9, 0x57, 0xd4,
|
||||
0x29, 0x54, 0x94, 0xbb, 0x50, 0x3b, 0x81, 0xcd, 0x49, 0x1f, 0x01, 0xe8, 0x5a, 0x99, 0x0f, 0x3d,
|
||||
0xf9, 0x7a, 0x09, 0x29, 0xe2, 0xa1, 0x33, 0x68, 0x4c, 0x7b, 0x02, 0xa2, 0x66, 0xd9, 0x47, 0xae,
|
||||
0x7c, 0xa3, 0xa4, 0x24, 0xf1, 0xd0, 0x29, 0x6c, 0xde, 0xe9, 0xf5, 0x8a, 0xa3, 0xdc, 0x2a, 0xb9,
|
||||
0x53, 0x91, 0x9b, 0xe5, 0x04, 0x89, 0x87, 0x7e, 0x84, 0x2b, 0x89, 0x9f, 0xb0, 0x1c, 0xab, 0x37,
|
||||
0x47, 0xc8, 0x2a, 0xf1, 0xb8, 0x90, 0x6f, 0x95, 0x17, 0x26, 0xde, 0xde, 0x3b, 0xdf, 0x5f, 0x7e,
|
||||
0xe0, 0x61, 0xe7, 0xd9, 0x81, 0x1a, 0xfb, 0xd7, 0x8f, 0x4d, 0x8c, 0xdb, 0x36, 0x31, 0x9e, 0x57,
|
||||
0x19, 0xf9, 0xc1, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xb1, 0x5e, 0x2e, 0xb4, 0x62, 0x1a, 0x00,
|
||||
0x00,
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
syntax = "proto3";
|
||||
import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto";
|
||||
import "Open-IM-Server/pkg/proto/sdk_ws/wrappers.proto";
|
||||
import "Open-IM-Server/pkg/proto/sdkws/ws.proto";
|
||||
import "Open-IM-Server/pkg/proto/sdkws/wrappers.proto";
|
||||
option go_package = "Open_IM/pkg/proto/msg;msg";
|
||||
package msg;
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
syntax = "proto3";
|
||||
import "Open-IM-Server/pkg/proto/sdk_ws/wrappers.proto";
|
||||
option go_package = "Open_IM/pkg/proto/sdk_ws;sdkws";
|
||||
import "Open-IM-Server/pkg/proto/sdkws/wrappers.proto";
|
||||
option go_package = "Open_IM/pkg/proto/sdkws;sdkws";
|
||||
package sdkws;
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user