mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-27 20:30:40 +08:00
notification
This commit is contained in:
parent
c3b16aa678
commit
e05d617893
@ -116,12 +116,14 @@ func (och *OnlineHistoryRedisConsumerHandler) getPushStorageMsgList(conversation
|
|||||||
}
|
}
|
||||||
for _, v := range totalMsgs {
|
for _, v := range totalMsgs {
|
||||||
options := utils.Options(v.message.Options)
|
options := utils.Options(v.message.Options)
|
||||||
if options.IsNotification() {
|
if !options.IsNotNotification() {
|
||||||
// 原通知
|
// 原通知
|
||||||
notificationMsg := proto.Clone(v.message).(*sdkws.MsgData)
|
notificationMsg := proto.Clone(v.message).(*sdkws.MsgData)
|
||||||
if options.IsSendMsg() {
|
if options.IsSendMsg() {
|
||||||
// 消息
|
// 消息
|
||||||
|
if v.message.Options != nil {
|
||||||
v.message.Options = utils.WithOptions(utils.Options(v.message.Options), utils.WithNotification(false), utils.WithSendMsg(false))
|
v.message.Options = utils.WithOptions(utils.Options(v.message.Options), utils.WithNotification(false), utils.WithSendMsg(false))
|
||||||
|
}
|
||||||
storageMsgList = append(storageMsgList, v.message)
|
storageMsgList = append(storageMsgList, v.message)
|
||||||
}
|
}
|
||||||
if isStorage(notificationMsg) {
|
if isStorage(notificationMsg) {
|
||||||
|
@ -112,7 +112,7 @@ func (o Options) Is(notification string) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o Options) IsNotification() bool {
|
func (o Options) IsNotNotification() bool {
|
||||||
return o.Is(constant.IsNotification)
|
return o.Is(constant.IsNotification)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,22 +176,22 @@ func GetConversationIDByMsg(msg *sdkws.MsgData) string {
|
|||||||
case constant.SingleChatType:
|
case constant.SingleChatType:
|
||||||
l := []string{msg.SendID, msg.RecvID}
|
l := []string{msg.SendID, msg.RecvID}
|
||||||
sort.Strings(l)
|
sort.Strings(l)
|
||||||
if options.IsNotification() {
|
if !options.IsNotNotification() {
|
||||||
return "n_" + strings.Join(l, "_")
|
return "n_" + strings.Join(l, "_")
|
||||||
}
|
}
|
||||||
return "si_" + strings.Join(l, "_") // single chat
|
return "si_" + strings.Join(l, "_") // single chat
|
||||||
case constant.GroupChatType:
|
case constant.GroupChatType:
|
||||||
if options.IsNotification() {
|
if !options.IsNotNotification() {
|
||||||
return "n_" + msg.GroupID // group chat
|
return "n_" + msg.GroupID // group chat
|
||||||
}
|
}
|
||||||
return "g_" + msg.GroupID // group chat
|
return "g_" + msg.GroupID // group chat
|
||||||
case constant.SuperGroupChatType:
|
case constant.SuperGroupChatType:
|
||||||
if options.IsNotification() {
|
if !options.IsNotNotification() {
|
||||||
return "n_" + msg.GroupID // super group chat
|
return "n_" + msg.GroupID // super group chat
|
||||||
}
|
}
|
||||||
return "sg_" + msg.GroupID // super group chat
|
return "sg_" + msg.GroupID // super group chat
|
||||||
case constant.NotificationChatType:
|
case constant.NotificationChatType:
|
||||||
if options.IsNotification() {
|
if !options.IsNotNotification() {
|
||||||
return "n_" + msg.SendID + "_" + msg.RecvID // super group chat
|
return "n_" + msg.SendID + "_" + msg.RecvID // super group chat
|
||||||
}
|
}
|
||||||
return "sn_" + msg.SendID + "_" + msg.RecvID // server notification chat
|
return "sn_" + msg.SendID + "_" + msg.RecvID // server notification chat
|
||||||
|
Loading…
x
Reference in New Issue
Block a user