forked from x/icebergs
add relay
This commit is contained in:
parent
35007a3e6e
commit
ec7f5eba8e
@ -11,7 +11,12 @@ const CMD = "cmd"
|
|||||||
func init() {
|
func init() {
|
||||||
Index.MergeCommands(ice.Commands{
|
Index.MergeCommands(ice.Commands{
|
||||||
CMD: {Help: "命令", Actions: web.ApiWhiteAction(), Hand: func(m *ice.Message, arg ...string) {
|
CMD: {Help: "命令", Actions: web.ApiWhiteAction(), Hand: func(m *ice.Message, arg ...string) {
|
||||||
web.RenderCmd(m, kit.Select(web.WIKI_WORD, arg, 0), kit.Slice(arg, 1))
|
switch cmd := kit.Select(web.WIKI_WORD, arg, 0); cmd {
|
||||||
|
case web.CHAT_PORTAL:
|
||||||
|
web.RenderMain(m)
|
||||||
|
default:
|
||||||
|
web.RenderCmd(m, cmd, kit.Slice(arg, 1))
|
||||||
|
}
|
||||||
}},
|
}},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -66,18 +66,18 @@ func init() {
|
|||||||
}},
|
}},
|
||||||
}, FavorAction(), mdb.HashAction(mdb.SHORT, web.LINK, mdb.FIELD, "time,hash,type,name,link")), Hand: func(m *ice.Message, arg ...string) {
|
}, FavorAction(), mdb.HashAction(mdb.SHORT, web.LINK, mdb.FIELD, "time,hash,type,name,link")), Hand: func(m *ice.Message, arg ...string) {
|
||||||
list := []string{m.MergePodCmd("", web.WIKI_PORTAL, log.DEBUG, m.Option(log.DEBUG))}
|
list := []string{m.MergePodCmd("", web.WIKI_PORTAL, log.DEBUG, m.Option(log.DEBUG))}
|
||||||
list = append(list, web.MergeLink(m, "/chat/portal/", ice.POD, m.Option(ice.MSG_USERPOD), log.DEBUG, m.Option(log.DEBUG)))
|
list = append(list, web.MergeLink(m, web.CHAT_PORTAL, ice.POD, m.Option(ice.MSG_USERPOD), log.DEBUG, m.Option(log.DEBUG)))
|
||||||
if mdb.HashSelect(m, arg...); len(arg) == 0 {
|
if mdb.HashSelect(m, arg...); len(arg) == 0 {
|
||||||
for _, link := range list {
|
for _, link := range list {
|
||||||
if u := kit.ParseURL(link); u != nil {
|
if u := kit.ParseURL(link); u != nil {
|
||||||
m.Push("", kit.Dict(mdb.TIME, m.Time(), mdb.HASH, kit.Hashs(link), mdb.TYPE, web.LINK, mdb.NAME, u.Path, web.LINK, link))
|
m.Push("", kit.Dict(mdb.TIME, m.Time(), mdb.HASH, kit.Hashs(link), mdb.TYPE, web.LINK, mdb.NAME, u.Path, web.LINK, link))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if m.Length() == 0 {
|
m.PushAction(web.OPEN, mdb.REMOVE)
|
||||||
m.Action(mdb.CREATE, ice.APP)
|
list := kit.List(mdb.CREATE)
|
||||||
} else {
|
kit.If(m.Length() > 0, func() { list = append(list, mdb.PRUNES) })
|
||||||
m.PushAction(web.OPEN, mdb.REMOVE).Action(mdb.CREATE, mdb.PRUNES, ice.APP)
|
kit.If(web.IsLocalHost(m), func() { list = append(list, ice.APP) })
|
||||||
}
|
m.Action(list...)
|
||||||
} else {
|
} else {
|
||||||
kit.If(m.Length() == 0, func() {
|
kit.If(m.Length() == 0, func() {
|
||||||
for _, link := range list {
|
for _, link := range list {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user