Refactor code

This commit is contained in:
wenxu12345 2022-01-18 09:40:08 +08:00
parent d12d571c2b
commit bf208485f8
3 changed files with 20 additions and 20 deletions

View File

@ -367,7 +367,7 @@ notification:
tips: "Deleted a friend" # tips: "Deleted a friend" #
friendInfoChanged: friendRemarkSet:
conversation: conversation:
reliabilityLevel: 2 reliabilityLevel: 2
unreadCount: false unreadCount: false

View File

@ -259,7 +259,7 @@ func Notification(n *NotificationMsg) {
msg.RecvID = "" msg.RecvID = ""
msg.GroupID = n.RecvID msg.GroupID = n.RecvID
} }
if onlineUserOnly { if true {
msg.Options = make(map[string]bool, 10) msg.Options = make(map[string]bool, 10)
//utils.SetSwitchFromOptions(msg.Options, constant.IsOfflinePush, false) //utils.SetSwitchFromOptions(msg.Options, constant.IsOfflinePush, false)
utils.SetSwitchFromOptions(msg.Options, constant.IsHistory, false) utils.SetSwitchFromOptions(msg.Options, constant.IsHistory, false)
@ -267,23 +267,23 @@ func Notification(n *NotificationMsg) {
} }
offlineInfo.IOSBadgeCount = config.Config.IOSPush.BadgeCount offlineInfo.IOSBadgeCount = config.Config.IOSPush.BadgeCount
offlineInfo.IOSPushSound = config.Config.IOSPush.PushSound offlineInfo.IOSPushSound = config.Config.IOSPush.PushSound
switch msg.ContentType { //switch msg.ContentType {
case constant.GroupCreatedNotification: //case constant.GroupCreatedNotification:
pushSwitch = config.Config.Notification.GroupCreated.OfflinePush.PushSwitch // pushSwitch = config.Config.Notification.GroupCreated.OfflinePush.PushSwitch
title = config.Config.Notification.GroupCreated.OfflinePush.Title // title = config.Config.Notification.GroupCreated.OfflinePush.Title
desc = config.Config.Notification.GroupCreated.OfflinePush.Desc // desc = config.Config.Notification.GroupCreated.OfflinePush.Desc
ex = config.Config.Notification.GroupCreated.OfflinePush.Ext // ex = config.Config.Notification.GroupCreated.OfflinePush.Ext
case constant.GroupInfoChangedNotification: //case constant.GroupInfoChangedNotification:
pushSwitch = config.Config.Notification.GroupInfoChanged.OfflinePush.PushSwitch // pushSwitch = config.Config.Notification.GroupInfoChanged.OfflinePush.PushSwitch
title = config.Config.Notification.GroupInfoChanged.OfflinePush.Title // title = config.Config.Notification.GroupInfoChanged.OfflinePush.Title
desc = config.Config.Notification.GroupInfoChanged.OfflinePush.Desc // desc = config.Config.Notification.GroupInfoChanged.OfflinePush.Desc
ex = config.Config.Notification.GroupInfoChanged.OfflinePush.Ext // ex = config.Config.Notification.GroupInfoChanged.OfflinePush.Ext
case constant.JoinApplicationNotification: //case constant.JoinApplicationNotification:
pushSwitch = config.Config.Notification.ApplyJoinGroup.OfflinePush.PushSwitch // pushSwitch = config.Config.Notification.ApplyJoinGroup.OfflinePush.PushSwitch
title = config.Config.Notification.ApplyJoinGroup.OfflinePush.Title // title = config.Config.Notification.ApplyJoinGroup.OfflinePush.Title
desc = config.Config.Notification.ApplyJoinGroup.OfflinePush.Desc // desc = config.Config.Notification.ApplyJoinGroup.OfflinePush.Desc
ex = config.Config.Notification.ApplyJoinGroup.OfflinePush.Ext // ex = config.Config.Notification.ApplyJoinGroup.OfflinePush.Ext
} //}
utils.SetSwitchFromOptions(msg.Options, constant.IsOfflinePush, pushSwitch) utils.SetSwitchFromOptions(msg.Options, constant.IsOfflinePush, pushSwitch)
offlineInfo.Title = title offlineInfo.Title = title
offlineInfo.Desc = desc offlineInfo.Desc = desc

View File

@ -260,7 +260,7 @@ type config struct {
OfflinePush POfflinePush `yaml:"offlinePush"` OfflinePush POfflinePush `yaml:"offlinePush"`
DefaultTips PDefaultTips `yaml:"defaultTips"` DefaultTips PDefaultTips `yaml:"defaultTips"`
} }
FriendInfoChanged struct { FriendRemarkSet struct {
Conversation PConversation `yaml:"conversation"` Conversation PConversation `yaml:"conversation"`
OfflinePush POfflinePush `yaml:"offlinePush"` OfflinePush POfflinePush `yaml:"offlinePush"`
DefaultTips PDefaultTips `yaml:"defaultTips"` DefaultTips PDefaultTips `yaml:"defaultTips"`