mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
Merge branch 'v2.3.0release' of github.com:OpenIMSDK/Open-IM-Server into v2.3.0release
This commit is contained in:
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 {
|
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}
|
callbackResp := cbApi.CommonCallbackResp{OperationID: operationID}
|
||||||
if !config.Config.Callback.CallbackBeforeSuperGroupOnlinePush.Enable {
|
if !config.Config.Callback.CallbackBeforeSuperGroupOnlinePush.Enable {
|
||||||
return callbackResp
|
return callbackResp
|
||||||
|
@ -156,7 +156,7 @@ func MsgToUser(pushMsg *pbPush.PushMsgReq) {
|
|||||||
func MsgToSuperGroupUser(pushMsg *pbPush.PushMsgReq) {
|
func MsgToSuperGroupUser(pushMsg *pbPush.PushMsgReq) {
|
||||||
var wsResult []*pbRelay.SingelMsgToUserResultList
|
var wsResult []*pbRelay.SingelMsgToUserResultList
|
||||||
isOfflinePush := utils.GetSwitchFromOptions(pushMsg.MsgData.Options, constant.IsOfflinePush)
|
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
|
var pushToUserIDList []string
|
||||||
if config.Config.Callback.CallbackBeforeSuperGroupOnlinePush.Enable {
|
if config.Config.Callback.CallbackBeforeSuperGroupOnlinePush.Enable {
|
||||||
callbackResp := callbackBeforeSuperGroupOnlinePush(pushMsg.OperationID, pushMsg.PushToUserID, pushMsg.MsgData, &pushToUserIDList)
|
callbackResp := callbackBeforeSuperGroupOnlinePush(pushMsg.OperationID, pushMsg.PushToUserID, pushMsg.MsgData, &pushToUserIDList)
|
||||||
|
@ -512,11 +512,21 @@ type PDefaultTips struct {
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cfgName := os.Getenv("CONFIG_NAME")
|
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 {
|
if len(cfgName) != 0 {
|
||||||
|
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
|
Root = cfgName
|
||||||
}
|
}
|
||||||
|
if err = yaml.Unmarshal(bytes, &Config); err != nil {
|
||||||
|
panic(err.Error())
|
||||||
|
}
|
||||||
|
} else {
|
||||||
bytes, err := ioutil.ReadFile(filepath.Join(Root, "config", "config.yaml"))
|
bytes, err := ioutil.ReadFile(filepath.Join(Root, "config", "config.yaml"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err.Error())
|
panic(err.Error())
|
||||||
@ -525,3 +535,5 @@ func init() {
|
|||||||
panic(err.Error())
|
panic(err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user