1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-26 17:44:05 +08:00
icebergs/core/chat/macos/notifications.go
2023-05-03 23:23:49 +08:00

23 lines
684 B
Go

package macos
import (
ice "shylinux.com/x/icebergs"
"shylinux.com/x/icebergs/base/mdb"
kit "shylinux.com/x/toolkits"
)
const NOTIFICATIONS = "notifications"
func init() {
Index.MergeCommands(ice.Commands{NOTIFICATIONS: {Name: "notifications list", Actions: ice.MergeActions(ice.Actions{
mdb.PRUNES: {Name: "prunes", Hand: func(m *ice.Message, arg ...string) {
m.Conf("", kit.Keys(mdb.HASH), "")
}},
}, CmdHashAction()), Hand: func(m *ice.Message, arg ...string) {
mdb.HashSelect(m, arg...).SortStrR(mdb.TIME).Display("")
}}})
}
func Notify(m *ice.Message, name, text string, arg ...string) {
m.Cmd(NOTIFICATIONS, mdb.CREATE, mdb.NAME, name, mdb.TEXT, text, arg)
}