feat: add a field to specify whether to send a notification message w… (#3163)

* feat: add a field to specify whether to send a notification message when creating a group.

* feat: add a field to specify whether to send a notification message when creating a group.

---------

Co-authored-by: Monet Lee <monet_lee@163.com>
This commit is contained in:
OpenIM-Gordon
2025-02-28 16:38:57 +08:00
committed by GitHub
parent b7f88138bd
commit 4d2fce0e52
12 changed files with 61 additions and 46 deletions
+6 -2
View File
@@ -18,11 +18,12 @@ import (
"os"
"path/filepath"
"gopkg.in/yaml.v3"
"github.com/openimsdk/open-im-server/v3/pkg/msgprocessor"
"github.com/openimsdk/protocol/constant"
"github.com/openimsdk/tools/errs"
"github.com/openimsdk/tools/field"
"gopkg.in/yaml.v3"
)
const (
@@ -56,9 +57,12 @@ func GetProjectRoot() (string, error) {
return projectRoot, nil
}
func GetOptionsByNotification(cfg NotificationConfig) msgprocessor.Options {
func GetOptionsByNotification(cfg NotificationConfig, sendNotification *bool) msgprocessor.Options {
opts := msgprocessor.NewOptions()
if sendNotification != nil {
cfg.IsSendMsg = *sendNotification
}
if cfg.IsSendMsg {
opts = msgprocessor.WithOptions(opts, msgprocessor.WithUnreadCount(true))
}