Merge branch 'v2.3.0release' of github.com:OpenIMSDK/Open-IM-Server into v2.3.0release

pull/261/head
wangchuxiao 2 years ago
commit b32463df53

@ -92,6 +92,7 @@ func callbackOnlinePush(operationID string, userIDList []string, msg *commonPb.M
}
func callbackBeforeSuperGroupOnlinePush(operationID string, groupID string, msg *commonPb.MsgData, pushToUserList *[]string) cbApi.CommonCallbackResp {
log.Debug(operationID, utils.GetSelfFuncName(), groupID, msg.String(), pushToUserList)
callbackResp := cbApi.CommonCallbackResp{OperationID: operationID}
if !config.Config.Callback.CallbackBeforeSuperGroupOnlinePush.Enable {
return callbackResp

@ -156,7 +156,7 @@ func MsgToUser(pushMsg *pbPush.PushMsgReq) {
func MsgToSuperGroupUser(pushMsg *pbPush.PushMsgReq) {
var wsResult []*pbRelay.SingelMsgToUserResultList
isOfflinePush := utils.GetSwitchFromOptions(pushMsg.MsgData.Options, constant.IsOfflinePush)
log.Debug(pushMsg.OperationID, "Get super group msg from msg_transfer And push msg", pushMsg.String())
log.Debug(pushMsg.OperationID, "Get super group msg from msg_transfer And push msg", pushMsg.String(), config.Config.Callback.CallbackBeforeSuperGroupOnlinePush.Enable)
var pushToUserIDList []string
if config.Config.Callback.CallbackBeforeSuperGroupOnlinePush.Enable {
callbackResp := callbackBeforeSuperGroupOnlinePush(pushMsg.OperationID, pushMsg.PushToUserID, pushMsg.MsgData, &pushToUserIDList)

@ -512,16 +512,28 @@ type PDefaultTips struct {
func init() {
cfgName := os.Getenv("CONFIG_NAME")
fmt.Println("GET IM DEFAULT CONFIG PATH :", Root, "ENV PATH:", cfgName, b, filepath.Dir(b))
fmt.Println("GET IM DEFAULT CONFIG PATH :", Root, "ENV PATH:", cfgName)
if len(cfgName) != 0 {
Root = cfgName
bytes, err := ioutil.ReadFile(filepath.Join(cfgName, "config", "config.yaml"))
if err != nil {
bytes, err = ioutil.ReadFile(filepath.Join(Root, "config", "config.yaml"))
if err != nil {
panic(err.Error())
}
} else {
Root = cfgName
}
if err = yaml.Unmarshal(bytes, &Config); err != nil {
panic(err.Error())
}
} else {
bytes, err := ioutil.ReadFile(filepath.Join(Root, "config", "config.yaml"))
if err != nil {
panic(err.Error())
}
if err = yaml.Unmarshal(bytes, &Config); err != nil {
panic(err.Error())
}
}
bytes, err := ioutil.ReadFile(filepath.Join(Root, "config", "config.yaml"))
if err != nil {
panic(err.Error())
}
if err = yaml.Unmarshal(bytes, &Config); err != nil {
panic(err.Error())
}
}

Loading…
Cancel
Save