mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-26 03:26:57 +08:00
options add value
This commit is contained in:
parent
424f854145
commit
3433d211a5
@ -48,9 +48,8 @@ func newUserSendMsgReq(params *ManagementSendMsgReq) *pbChat.SendMsgReq {
|
|||||||
newContent = params.Content["revokeMsgClientID"].(string)
|
newContent = params.Content["revokeMsgClientID"].(string)
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
var options map[string]bool
|
options := make(map[string]bool, 5)
|
||||||
if params.IsOnlineOnly {
|
if params.IsOnlineOnly {
|
||||||
options = make(map[string]bool, 5)
|
|
||||||
utils.SetSwitchFromOptions(options, constant.IsOfflinePush, false)
|
utils.SetSwitchFromOptions(options, constant.IsOfflinePush, false)
|
||||||
utils.SetSwitchFromOptions(options, constant.IsHistory, false)
|
utils.SetSwitchFromOptions(options, constant.IsHistory, false)
|
||||||
utils.SetSwitchFromOptions(options, constant.IsPersistent, false)
|
utils.SetSwitchFromOptions(options, constant.IsPersistent, false)
|
||||||
|
@ -116,6 +116,9 @@ func JsonStringToMap(str string) (tempMap map[string]int32) {
|
|||||||
return tempMap
|
return tempMap
|
||||||
}
|
}
|
||||||
func GetSwitchFromOptions(Options map[string]bool, key string) (result bool) {
|
func GetSwitchFromOptions(Options map[string]bool, key string) (result bool) {
|
||||||
|
if Options == nil {
|
||||||
|
return true
|
||||||
|
}
|
||||||
if flag, ok := Options[key]; !ok || flag {
|
if flag, ok := Options[key]; !ok || flag {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user