|
|
@ -30,7 +30,7 @@ type Pusher struct {
|
|
|
|
offlinePusher offlinepush.OfflinePusher
|
|
|
|
offlinePusher offlinepush.OfflinePusher
|
|
|
|
groupLocalCache *localcache.GroupLocalCache
|
|
|
|
groupLocalCache *localcache.GroupLocalCache
|
|
|
|
conversationLocalCache *localcache.ConversationLocalCache
|
|
|
|
conversationLocalCache *localcache.ConversationLocalCache
|
|
|
|
msgClient *rpcclient.MessageRpcClient
|
|
|
|
msgRpcClient *rpcclient.MessageRpcClient
|
|
|
|
conversationRpcClient *rpcclient.ConversationRpcClient
|
|
|
|
conversationRpcClient *rpcclient.ConversationRpcClient
|
|
|
|
groupRpcClient *rpcclient.GroupRpcClient
|
|
|
|
groupRpcClient *rpcclient.GroupRpcClient
|
|
|
|
successCount int
|
|
|
|
successCount int
|
|
|
@ -39,19 +39,17 @@ type Pusher struct {
|
|
|
|
var errNoOfflinePusher = errors.New("no offlinePusher is configured")
|
|
|
|
var errNoOfflinePusher = errors.New("no offlinePusher is configured")
|
|
|
|
|
|
|
|
|
|
|
|
func NewPusher(discov discoveryregistry.SvcDiscoveryRegistry, offlinePusher offlinepush.OfflinePusher, database controller.PushDatabase,
|
|
|
|
func NewPusher(discov discoveryregistry.SvcDiscoveryRegistry, offlinePusher offlinepush.OfflinePusher, database controller.PushDatabase,
|
|
|
|
groupLocalCache *localcache.GroupLocalCache, conversationLocalCache *localcache.ConversationLocalCache) *Pusher {
|
|
|
|
groupLocalCache *localcache.GroupLocalCache, conversationLocalCache *localcache.ConversationLocalCache,
|
|
|
|
msgClient := rpcclient.NewMessageRpcClient(discov)
|
|
|
|
conversationRpcClient *rpcclient.ConversationRpcClient, groupRpcClient *rpcclient.GroupRpcClient, msgRpcClient *rpcclient.MessageRpcClient) *Pusher {
|
|
|
|
conversationRpcClient := rpcclient.NewConversationRpcClient(discov)
|
|
|
|
|
|
|
|
groupRpcClient := rpcclient.NewGroupRpcClient(discov)
|
|
|
|
|
|
|
|
return &Pusher{
|
|
|
|
return &Pusher{
|
|
|
|
discov: discov,
|
|
|
|
discov: discov,
|
|
|
|
database: database,
|
|
|
|
database: database,
|
|
|
|
offlinePusher: offlinePusher,
|
|
|
|
offlinePusher: offlinePusher,
|
|
|
|
groupLocalCache: groupLocalCache,
|
|
|
|
groupLocalCache: groupLocalCache,
|
|
|
|
conversationLocalCache: conversationLocalCache,
|
|
|
|
conversationLocalCache: conversationLocalCache,
|
|
|
|
msgClient: &msgClient,
|
|
|
|
msgRpcClient: msgRpcClient,
|
|
|
|
conversationRpcClient: &conversationRpcClient,
|
|
|
|
conversationRpcClient: conversationRpcClient,
|
|
|
|
groupRpcClient: &groupRpcClient,
|
|
|
|
groupRpcClient: groupRpcClient,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -70,7 +68,7 @@ func NewOfflinePusher(cache cache.MsgModel) offlinepush.OfflinePusher {
|
|
|
|
|
|
|
|
|
|
|
|
func (p *Pusher) DeleteMemberAndSetConversationSeq(ctx context.Context, groupID string, userIDs []string) error {
|
|
|
|
func (p *Pusher) DeleteMemberAndSetConversationSeq(ctx context.Context, groupID string, userIDs []string) error {
|
|
|
|
conevrsationID := utils.GetConversationIDBySessionType(constant.SuperGroupChatType, groupID)
|
|
|
|
conevrsationID := utils.GetConversationIDBySessionType(constant.SuperGroupChatType, groupID)
|
|
|
|
maxSeq, err := p.msgClient.GetConversationMaxSeq(ctx, conevrsationID)
|
|
|
|
maxSeq, err := p.msgRpcClient.GetConversationMaxSeq(ctx, conevrsationID)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|