🚸 IP 变更提醒增强

This commit is contained in:
naiba
2021-06-22 14:05:36 +08:00
parent d59acfa824
commit 365148e0ac
6 changed files with 53 additions and 22 deletions

View File

@@ -13,7 +13,7 @@ import (
pb "github.com/naiba/nezha/proto"
)
var Version = "v0.8.2" // !!记得修改 README 中的 badge 版本!!
var Version = "v0.8.3" // !!记得修改 README 中的 badge 版本!!
const (
SnapshotDelay = 3

View File

@@ -86,7 +86,8 @@ func (s *NezhaHandler) ReportSystemInfo(c context.Context, r *pb.Host) (*pb.Rece
dao.ServerLock.RLock()
defer dao.ServerLock.RUnlock()
if dao.Conf.EnableIPChangeNotification &&
dao.Conf.IgnoredIPNotificationServerIDs[clientID] != struct{}{} &&
((dao.Conf.Cover == model.ConfigCoverAll && !dao.Conf.IgnoredIPNotificationServerIDs[clientID]) ||
(dao.Conf.Cover == model.ConfigCoverIgnoreAll && dao.Conf.IgnoredIPNotificationServerIDs[clientID])) &&
dao.ServerList[clientID].Host != nil &&
dao.ServerList[clientID].Host.IP != "" &&
host.IP != "" &&