From 0d03b46ac8d61c1ff5ff9cccc19e6df36ec7289f Mon Sep 17 00:00:00 2001
From: icey-yu <119291641+icey-yu@users.noreply.github.com>
Date: Thu, 24 Oct 2024 16:47:06 +0800
Subject: [PATCH] feat: change push config (#2775)

---
 internal/push/offlinepush/offlinepusher.go | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/internal/push/offlinepush/offlinepusher.go b/internal/push/offlinepush/offlinepusher.go
index 9aa6625de..d655a924a 100644
--- a/internal/push/offlinepush/offlinepusher.go
+++ b/internal/push/offlinepush/offlinepusher.go
@@ -23,10 +23,13 @@ import (
 	"github.com/openimsdk/open-im-server/v3/internal/push/offlinepush/options"
 	"github.com/openimsdk/open-im-server/v3/pkg/common/config"
 	"github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache"
+	"github.com/openimsdk/tools/log"
+	"github.com/openimsdk/tools/mcontext"
+	"strings"
 )
 
 const (
-	geTUI    = "geTui"
+	geTUI    = "getui"
 	firebase = "fcm"
 	jPush    = "jpush"
 )
@@ -38,6 +41,7 @@ type OfflinePusher interface {
 
 func NewOfflinePusher(pushConf *config.Push, cache cache.ThirdCache, fcmConfigPath string) (OfflinePusher, error) {
 	var offlinePusher OfflinePusher
+	pushConf.Enable = strings.ToLower(pushConf.Enable)
 	switch pushConf.Enable {
 	case geTUI:
 		offlinePusher = getui.NewClient(pushConf, cache)
@@ -47,6 +51,7 @@ func NewOfflinePusher(pushConf *config.Push, cache cache.ThirdCache, fcmConfigPa
 		offlinePusher = jpush.NewClient(pushConf)
 	default:
 		offlinePusher = dummy.NewClient()
+		log.ZWarn(mcontext.WithMustInfoCtx([]string{"push start", "admin", "admin", ""}), "Unknown push config", nil)
 	}
 	return offlinePusher, nil
 }