|
|
@ -4,6 +4,7 @@ import (
|
|
|
|
"context"
|
|
|
|
"context"
|
|
|
|
"encoding/json"
|
|
|
|
"encoding/json"
|
|
|
|
"errors"
|
|
|
|
"errors"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/internal/push/offlinepush"
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/internal/push/offlinepush"
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/internal/push/offlinepush/fcm"
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/internal/push/offlinepush/fcm"
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/internal/push/offlinepush/getui"
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/internal/push/offlinepush/getui"
|
|
|
@ -35,6 +36,8 @@ type Pusher struct {
|
|
|
|
successCount int
|
|
|
|
successCount int
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var errNoOfflinePusher = errors.New("no offlinePusher is configured")
|
|
|
|
|
|
|
|
|
|
|
|
func NewPusher(client discoveryregistry.SvcDiscoveryRegistry, offlinePusher offlinepush.OfflinePusher, database controller.PushDatabase,
|
|
|
|
func NewPusher(client discoveryregistry.SvcDiscoveryRegistry, offlinePusher offlinepush.OfflinePusher, database controller.PushDatabase,
|
|
|
|
groupLocalCache *localcache.GroupLocalCache, conversationLocalCache *localcache.ConversationLocalCache) *Pusher {
|
|
|
|
groupLocalCache *localcache.GroupLocalCache, conversationLocalCache *localcache.ConversationLocalCache) *Pusher {
|
|
|
|
rpcclient.NewGroupClient(client)
|
|
|
|
rpcclient.NewGroupClient(client)
|
|
|
@ -286,7 +289,7 @@ func (p *Pusher) GetOfflinePushOpts(msg *sdkws.MsgData) (opts *offlinepush.Opts,
|
|
|
|
|
|
|
|
|
|
|
|
func (p *Pusher) getOfflinePushInfos(conversationID string, msg *sdkws.MsgData) (title, content string, opts *offlinepush.Opts, err error) {
|
|
|
|
func (p *Pusher) getOfflinePushInfos(conversationID string, msg *sdkws.MsgData) (title, content string, opts *offlinepush.Opts, err error) {
|
|
|
|
if p.offlinePusher == nil {
|
|
|
|
if p.offlinePusher == nil {
|
|
|
|
err = errors.New("no offlinePusher is configured")
|
|
|
|
err = errNoOfflinePusher
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
type AtContent struct {
|
|
|
|
type AtContent struct {
|
|
|
|