Skip to content

Commit

Permalink
fix: webhookBeforeSendSingleMsg will call before black and friend check
Browse files Browse the repository at this point in the history
  • Loading branch information
icey-yu committed Nov 25, 2024
1 parent cbade46 commit 0ea54c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 0 additions & 3 deletions internal/rpc/msg/send.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,6 @@ func (m *msgServer) sendMsgSingleChat(ctx context.Context, req *pbmsg.SendMsgReq
prommetrics.SingleChatMsgProcessFailedCounter.Inc()
return nil, nil
} else {
if err = m.webhookBeforeSendSingleMsg(ctx, &m.config.WebhooksConfig.BeforeSendSingleMsg, req); err != nil {
return nil, err
}
if err := m.webhookBeforeMsgModify(ctx, &m.config.WebhooksConfig.BeforeMsgModify, req); err != nil {
return nil, err
}
Expand Down
3 changes: 3 additions & 0 deletions internal/rpc/msg/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ func (m *msgServer) messageVerification(ctx context.Context, data *msg.SendMsgRe
data.MsgData.ContentType >= constant.NotificationBegin {
return nil
}
if err := m.webhookBeforeSendSingleMsg(ctx, &m.config.WebhooksConfig.BeforeSendSingleMsg, data); err != nil {
return err
}
black, err := m.FriendLocalCache.IsBlack(ctx, data.MsgData.SendID, data.MsgData.RecvID)
if err != nil {
return err
Expand Down

0 comments on commit 0ea54c1

Please sign in to comment.