(ctx context.Context, before *config.BeforeConfig, userIDs []string, msg *sdkws.MsgData)
| 68 | } |
| 69 | |
| 70 | func (c *ConsumerHandler) webhookBeforeOnlinePush(ctx context.Context, before *config.BeforeConfig, userIDs []string, msg *sdkws.MsgData) error { |
| 71 | return webhook.WithCondition(ctx, before, func(ctx context.Context) error { |
| 72 | if msg.ContentType == constant.Typing { |
| 73 | return nil |
| 74 | } |
| 75 | req := callbackstruct.CallbackBeforePushReq{ |
| 76 | UserStatusBatchCallbackReq: callbackstruct.UserStatusBatchCallbackReq{ |
| 77 | UserStatusBaseCallback: callbackstruct.UserStatusBaseCallback{ |
| 78 | CallbackCommand: callbackstruct.CallbackBeforeOnlinePushCommand, |
| 79 | OperationID: mcontext.GetOperationID(ctx), |
| 80 | PlatformID: int(msg.SenderPlatformID), |
| 81 | Platform: constant.PlatformIDToName(int(msg.SenderPlatformID)), |
| 82 | }, |
| 83 | UserIDList: userIDs, |
| 84 | }, |
| 85 | ClientMsgID: msg.ClientMsgID, |
| 86 | SendID: msg.SendID, |
| 87 | GroupID: msg.GroupID, |
| 88 | ContentType: msg.ContentType, |
| 89 | SessionType: msg.SessionType, |
| 90 | AtUserIDs: msg.AtUserIDList, |
| 91 | Content: GetContent(msg), |
| 92 | } |
| 93 | resp := &callbackstruct.CallbackBeforePushResp{} |
| 94 | if err := c.webhookClient.SyncPost(ctx, req.GetCallbackCommand(), req, resp, before); err != nil { |
| 95 | return err |
| 96 | } |
| 97 | return nil |
| 98 | }) |
| 99 | } |
| 100 | |
| 101 | func (c *ConsumerHandler) webhookBeforeGroupOnlinePush( |
| 102 | ctx context.Context, |
no test coverage detected