|
|
|
@ -18,6 +18,7 @@ import (
|
|
|
|
|
"context"
|
|
|
|
|
"github.com/openimsdk/open-im-server/v3/internal/push/offlinepush/options"
|
|
|
|
|
"github.com/openimsdk/tools/log"
|
|
|
|
|
"sync/atomic"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func NewClient() *Dummy {
|
|
|
|
@ -25,10 +26,12 @@ func NewClient() *Dummy {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Dummy struct {
|
|
|
|
|
v atomic.Bool
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (d *Dummy) Push(ctx context.Context, userIDs []string, title, content string, opts *options.Opts) error {
|
|
|
|
|
log.ZDebug(ctx, "dummy push")
|
|
|
|
|
log.ZWarn(ctx, "Dummy push", nil, "ps", "The offline push is not configured. To configure it, please go to config/openim-push.yml.")
|
|
|
|
|
if d.v.CompareAndSwap(false, true) {
|
|
|
|
|
log.ZWarn(ctx, "dummy push", nil, "ps", "the offline push is not configured. to configure it, please go to config/openim-push.yml")
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|