mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-07 02:26:00 +08:00
delete notification
This commit is contained in:
@@ -52,6 +52,8 @@ func newContentTypeConf() map[int32]config.NotificationConf {
|
||||
constant.ConversationChangeNotification: config.Config.Notification.ConversationChanged,
|
||||
constant.ConversationUnreadNotification: config.Config.Notification.ConversationChanged,
|
||||
constant.ConversationPrivateChatNotification: config.Config.Notification.ConversationSetPrivate,
|
||||
// msg
|
||||
constant.MsgRevokeNotification: {IsSendMsg: false, ReliabilityLevel: constant.ReliableNotificationNoMsg},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,7 +160,7 @@ func NewNotificationSender(opts ...NewNotificationSenderOptions) *NotificationSe
|
||||
return notificationSender
|
||||
}
|
||||
|
||||
func (s *NotificationSender) Notification(ctx context.Context, sendID, recvID string, contentType int32, m proto.Message, opts ...utils.OptionsOpt) error {
|
||||
func (s *NotificationSender) NotificationWithSesstionType(ctx context.Context, sendID, recvID string, contentType, sesstionType int32, m proto.Message, opts ...utils.OptionsOpt) (err error) {
|
||||
n := sdkws.NotificationElem{Detail: utils.StructToJsonString(m)}
|
||||
content, err := json.Marshal(&n)
|
||||
if err != nil {
|
||||
@@ -196,3 +198,7 @@ func (s *NotificationSender) Notification(ctx context.Context, sendID, recvID st
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *NotificationSender) Notification(ctx context.Context, sendID, recvID string, contentType int32, m proto.Message, opts ...utils.OptionsOpt) error {
|
||||
return s.NotificationWithSesstionType(ctx, sendID, recvID, contentType, s.sessionTypeConf[contentType], m, opts...)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user