msg split

This commit is contained in:
wangchuxiao
2023-05-17 18:44:55 +08:00
parent dacf6cca31
commit eb0bd2f4dd
4 changed files with 31 additions and 17 deletions
+10 -4
View File
@@ -25,6 +25,12 @@ func NewOptions(opts ...OptionsOpt) Options {
return options
}
func NewMsgOptions() Options {
options := make(map[string]bool, 11)
options[constant.IsOfflinePush] = false
return make(map[string]bool)
}
func WithOptions(options Options, opts ...OptionsOpt) Options {
for _, opt := range opts {
opt(options)
@@ -56,15 +62,15 @@ func WithPersistent() OptionsOpt {
}
}
func WithOfflinePush() OptionsOpt {
func WithOfflinePush(b bool) OptionsOpt {
return func(options Options) {
options[constant.IsOfflinePush] = true
options[constant.IsOfflinePush] = b
}
}
func WithUnreadCount() OptionsOpt {
func WithUnreadCount(b bool) OptionsOpt {
return func(options Options) {
options[constant.IsUnreadCount] = true
options[constant.IsUnreadCount] = b
}
}