mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-05 03:52:15 +08:00
fix:fix push filter logic
This commit is contained in:
parent
98339fa657
commit
c2a4047279
@ -150,16 +150,6 @@ func (p *Pusher) k8sOfflinePush2SuperGroup(ctx context.Context, groupID string,
|
|||||||
needOfflinePushUserIDs = append(needOfflinePushUserIDs, v.UserID)
|
needOfflinePushUserIDs = append(needOfflinePushUserIDs, v.UserID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(needOfflinePushUserIDs) > 0 {
|
|
||||||
if msg.ContentType != constant.SignalingNotification {
|
|
||||||
notNotificationUserIDs, err := p.conversationLocalCache.GetRecvMsgNotNotifyUserIDs(ctx, groupID)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
needOfflinePushUserIDs = utils.SliceSub(needOfflinePushUserIDs, notNotificationUserIDs)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if len(needOfflinePushUserIDs) > 0 {
|
if len(needOfflinePushUserIDs) > 0 {
|
||||||
var offlinePushUserIDs []string
|
var offlinePushUserIDs []string
|
||||||
err := callbackOfflinePush(ctx, needOfflinePushUserIDs, msg, &offlinePushUserIDs)
|
err := callbackOfflinePush(ctx, needOfflinePushUserIDs, msg, &offlinePushUserIDs)
|
||||||
@ -170,6 +160,7 @@ func (p *Pusher) k8sOfflinePush2SuperGroup(ctx context.Context, groupID string,
|
|||||||
if len(offlinePushUserIDs) > 0 {
|
if len(offlinePushUserIDs) > 0 {
|
||||||
needOfflinePushUserIDs = offlinePushUserIDs
|
needOfflinePushUserIDs = offlinePushUserIDs
|
||||||
}
|
}
|
||||||
|
if msg.ContentType != constant.SignalingNotification {
|
||||||
resp, err := p.conversationRpcClient.Client.GetConversationOfflinePushUserIDs(
|
resp, err := p.conversationRpcClient.Client.GetConversationOfflinePushUserIDs(
|
||||||
ctx,
|
ctx,
|
||||||
&conversation.GetConversationOfflinePushUserIDsReq{ConversationID: utils.GenGroupConversationID(groupID), UserIDs: needOfflinePushUserIDs},
|
&conversation.GetConversationOfflinePushUserIDsReq{ConversationID: utils.GenGroupConversationID(groupID), UserIDs: needOfflinePushUserIDs},
|
||||||
@ -185,6 +176,8 @@ func (p *Pusher) k8sOfflinePush2SuperGroup(ctx context.Context, groupID string,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (p *Pusher) Push2SuperGroup(ctx context.Context, groupID string, msg *sdkws.MsgData) (err error) {
|
func (p *Pusher) Push2SuperGroup(ctx context.Context, groupID string, msg *sdkws.MsgData) (err error) {
|
||||||
@ -287,14 +280,7 @@ func (p *Pusher) Push2SuperGroup(ctx context.Context, groupID string, msg *sdkws
|
|||||||
}
|
}
|
||||||
|
|
||||||
needOfflinePushUserIDs := utils.DifferenceString(onlineSuccessUserIDs, pushToUserIDs)
|
needOfflinePushUserIDs := utils.DifferenceString(onlineSuccessUserIDs, pushToUserIDs)
|
||||||
if msg.ContentType != constant.SignalingNotification {
|
|
||||||
notNotificationUserIDs, err := p.conversationLocalCache.GetRecvMsgNotNotifyUserIDs(ctx, groupID)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
needOfflinePushUserIDs = utils.SliceSub(needOfflinePushUserIDs, notNotificationUserIDs)
|
|
||||||
}
|
|
||||||
// Use offline push messaging
|
// Use offline push messaging
|
||||||
if len(needOfflinePushUserIDs) > 0 {
|
if len(needOfflinePushUserIDs) > 0 {
|
||||||
var offlinePushUserIDs []string
|
var offlinePushUserIDs []string
|
||||||
@ -306,6 +292,7 @@ func (p *Pusher) Push2SuperGroup(ctx context.Context, groupID string, msg *sdkws
|
|||||||
if len(offlinePushUserIDs) > 0 {
|
if len(offlinePushUserIDs) > 0 {
|
||||||
needOfflinePushUserIDs = offlinePushUserIDs
|
needOfflinePushUserIDs = offlinePushUserIDs
|
||||||
}
|
}
|
||||||
|
if msg.ContentType != constant.SignalingNotification {
|
||||||
resp, err := p.conversationRpcClient.Client.GetConversationOfflinePushUserIDs(
|
resp, err := p.conversationRpcClient.Client.GetConversationOfflinePushUserIDs(
|
||||||
ctx,
|
ctx,
|
||||||
&conversation.GetConversationOfflinePushUserIDsReq{ConversationID: utils.GenGroupConversationID(groupID), UserIDs: needOfflinePushUserIDs},
|
&conversation.GetConversationOfflinePushUserIDsReq{ConversationID: utils.GenGroupConversationID(groupID), UserIDs: needOfflinePushUserIDs},
|
||||||
@ -325,6 +312,8 @@ func (p *Pusher) Push2SuperGroup(ctx context.Context, groupID string, msg *sdkws
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user