MCPcopy
hub / github.com/openimsdk/open-im-server / webhookBeforeOnlinePush

Method webhookBeforeOnlinePush

internal/push/callback.go:70–99  ·  view source on GitHub ↗
(ctx context.Context, before *config.BeforeConfig, userIDs []string, msg *sdkws.MsgData)

Source from the content-addressed store, hash-verified

68}
69
70func (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
101func (c *ConsumerHandler) webhookBeforeGroupOnlinePush(
102 ctx context.Context,

Callers 1

Push2UserMethod · 0.95

Calls 5

WithConditionFunction · 0.92
GetOperationIDMethod · 0.80
SyncPostMethod · 0.80
GetContentFunction · 0.70
GetCallbackCommandMethod · 0.65

Tested by

no test coverage detected