提交 6011c965 编写于 作者: yanghye's avatar yanghye

v2.3.61 notice

上级 76d103b9
......@@ -62,3 +62,7 @@ func UniqueID() string {
uniqueID = "energy-id-" + strconv.FormatInt(time.Now().Unix(), 10) // This is a fake unique - it just has to not be reused...
return uniqueID
}
func SetUniqueID(v string) {
uniqueID = v
}
......@@ -29,7 +29,7 @@ func SendNotification(n *Notification) {
if n.Icon != nil && len(n.Icon) > 0 {
bh := md5.Sum(n.Icon)
dataHash := hex.EncodeToString(bh[:])
fileName := fmt.Sprintf("notice-%s-%s%s", appName, dataHash, n.iconExt)
fileName := fmt.Sprintf("notice-%s-%s", dataHash, n.iconExt)
appIcon = filepath.Join(os.TempDir(), fileName)
if _, err := os.Stat(appIcon); os.IsNotExist(err) {
err = ioutil.WriteFile(appIcon, n.Icon, 0600)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册