mirror of
https://shylinux.com/x/icebergs
synced 2025-05-03 03:57:01 +08:00
opt chat
This commit is contained in:
parent
32670368ee
commit
975791294c
@ -92,8 +92,8 @@ func UserLogout(m *ice.Message) {
|
||||
m.Cmd(SESS, mdb.REMOVE, kit.Dict(mdb.HASH, m.Option(ice.MSG_SESSID)))
|
||||
}
|
||||
func SessAuth(m *ice.Message, value ice.Maps, arg ...string) {
|
||||
m.Option(ice.MSG_USERROLE, value[aaa.USERROLE])
|
||||
m.Option(ice.MSG_USERNAME, value[aaa.USERNAME])
|
||||
m.Option(ice.MSG_USERNICK, value[aaa.USERNICK])
|
||||
m.Auth(aaa.USERROLE, value[aaa.USERROLE], aaa.USERNAME, value[aaa.USERNAME], aaa.USERNICK, value[aaa.USERNICK], arg, logs.FileLineMeta(logs.FileLine(2, 3)))
|
||||
m.Option(ice.MSG_USERROLE, value[USERROLE])
|
||||
m.Option(ice.MSG_USERNAME, value[USERNAME])
|
||||
m.Option(ice.MSG_USERNICK, value[USERNICK])
|
||||
m.Auth(USERROLE, value[USERROLE], USERNAME, value[USERNAME], USERNICK, value[USERNICK], arg, logs.FileLineMeta(logs.FileLine(2, 3)))
|
||||
}
|
@ -61,6 +61,7 @@ func _action_share(m *ice.Message, arg ...string) {
|
||||
m.Push(TOPIC, msg.Append(TOPIC))
|
||||
m.Push(ctx.INDEX, msg.Append(mdb.NAME))
|
||||
m.Push(ctx.ARGS, msg.Append(mdb.TEXT))
|
||||
m.Cmdy(ctx.COMMAND, msg.Append(mdb.NAME))
|
||||
break
|
||||
}
|
||||
if arg[1] = msg.Append(mdb.NAME); m.Option(ice.MSG_UPLOAD) != "" {
|
||||
|
@ -8,14 +8,15 @@ footer.go
|
||||
river.go
|
||||
storm.go
|
||||
template.go
|
||||
topic.go
|
||||
grant.go
|
||||
iframe.go
|
||||
|
||||
sso.go
|
||||
pod.go
|
||||
cmd.go
|
||||
div.go
|
||||
website.go
|
||||
topic.go
|
||||
grant.go
|
||||
|
||||
room.go
|
||||
meet.go
|
||||
@ -25,7 +26,6 @@ media.go
|
||||
files.go
|
||||
trans.go
|
||||
|
||||
iframe.go
|
||||
keyboard.go
|
||||
location.go
|
||||
location.shy
|
||||
|
@ -15,18 +15,18 @@ const FOOTER = "footer"
|
||||
|
||||
func init() {
|
||||
Index.MergeCommands(ice.Commands{
|
||||
FOOTER: {Name: "footer", Help: "状态栏", Actions: ice.MergeActions(ice.Actions{
|
||||
web.P(FOOTER): {Name: "footer", Help: "状态栏", Actions: ice.MergeActions(ice.Actions{
|
||||
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmd(aaa.ROLE, aaa.WHITE, aaa.VOID, m.CommandKey())
|
||||
}},
|
||||
ice.RUN: {Name: "run", Help: "执行", Hand: func(m *ice.Message, arg ...string) {
|
||||
ice.RUN: {Hand: func(m *ice.Message, arg ...string) {
|
||||
if aaa.Right(m, arg) {
|
||||
if m.Cmdy(arg); m.IsErrNotFound() {
|
||||
m.SetResult().Cmdy(cli.SYSTEM, arg)
|
||||
}
|
||||
}
|
||||
}},
|
||||
}, ctx.CmdAction(EMAIL, `<a href="mailto:shylinuxc@gmail.com">shylinuxc@gmail.com</a>`), web.ApiAction(web.P(FOOTER))), Hand: func(m *ice.Message, arg ...string) {
|
||||
}, ctx.CmdAction(EMAIL, `<a href="mailto:shylinuxc@gmail.com">shylinuxc@gmail.com</a>`)), Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Result(m.Configv(EMAIL))
|
||||
}},
|
||||
})
|
||||
|
@ -79,7 +79,7 @@ func init() {
|
||||
}
|
||||
m.Warn(m.Option(ice.MSG_USERNAME) == "", ice.ErrNotLogin, arg)
|
||||
}},
|
||||
HEADER: {Name: "header", Help: "标题栏", Actions: ice.MergeActions(ice.Actions{
|
||||
web.P(HEADER): {Name: "/header", Help: "标题栏", Actions: ice.MergeActions(ice.Actions{
|
||||
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmd(aaa.ROLE, aaa.WHITE, aaa.VOID, m.CommandKey())
|
||||
}},
|
||||
@ -95,7 +95,7 @@ func init() {
|
||||
aaa.BACKGROUND: {Hand: func(m *ice.Message, arg ...string) { _header_users(m, arg...) }},
|
||||
aaa.AVATAR: {Hand: func(m *ice.Message, arg ...string) { _header_users(m, arg...) }},
|
||||
web.SHARE: {Hand: func(m *ice.Message, arg ...string) { _header_share(m, arg...) }},
|
||||
}, ctx.ConfAction(aaa.LOGIN, kit.List("密码登录", "扫码授权")), web.ApiAction(web.P(HEADER))), Hand: func(m *ice.Message, arg ...string) {
|
||||
}, ctx.ConfAction(aaa.LOGIN, kit.List("密码登录", "扫码授权"))), Hand: func(m *ice.Message, arg ...string) {
|
||||
if gdb.Event(m, HEADER_AGENT); !_header_check(m, arg...) {
|
||||
return
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ const IFRAME = "iframe"
|
||||
func init() {
|
||||
Index.MergeCommands(ice.Commands{
|
||||
IFRAME: {Name: "iframe hash auto", Help: "浏览器", Actions: ice.MergeActions(ice.Actions{
|
||||
mdb.CREATE: {Name: "create link name type", Help: "创建", Hand: func(m *ice.Message, arg ...string) {
|
||||
mdb.CREATE: {Name: "create link name type", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.OptionDefault(mdb.NAME, kit.ParseURL(m.Option(mdb.LINK)).Host, mdb.TYPE, mdb.LINK)
|
||||
mdb.HashCreate(m, m.OptionSimple("link,name,type"))
|
||||
}},
|
||||
|
@ -20,7 +20,7 @@ func _river_key(m *ice.Message, key ...ice.Any) string {
|
||||
func _river_list(m *ice.Message) {
|
||||
if m.Option(web.SHARE) != "" {
|
||||
switch msg := m.Cmd(web.SHARE, m.Option(web.SHARE)); msg.Append(mdb.TYPE) {
|
||||
case web.STORM, web.FIELD: // 共享应用
|
||||
case web.STORM, web.FIELD:
|
||||
m.Option(ice.MSG_RIVER, "_share")
|
||||
return
|
||||
}
|
||||
@ -39,12 +39,12 @@ const RIVER = "river"
|
||||
|
||||
func init() {
|
||||
Index.MergeCommands(ice.Commands{
|
||||
RIVER: {Name: "river hash auto create", Help: "群组", Actions: ice.MergeActions(ice.Actions{
|
||||
web.P(RIVER): {Name: "/river hash auto create", Help: "群组", Actions: ice.MergeActions(ice.Actions{
|
||||
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmd(aaa.ROLE, aaa.WHITE, aaa.VOID, m.CommandKey())
|
||||
m.Cmd(aaa.ROLE, aaa.BLACK, aaa.VOID, m.CommandKey(), ctx.ACTION)
|
||||
}},
|
||||
mdb.INPUTS: {Name: "inputs", Help: "补全", Hand: func(m *ice.Message, arg ...string) {
|
||||
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) {
|
||||
switch arg[0] {
|
||||
case nfs.TEMPLATE:
|
||||
m.Cmdy(TEMPLATE).CutTo(RIVER, arg[0])
|
||||
@ -52,7 +52,7 @@ func init() {
|
||||
mdb.HashInputs(m, arg)
|
||||
}
|
||||
}},
|
||||
mdb.CREATE: {Name: "create type=void,tech name=hi text=hello template=base", Help: "添加", Hand: func(m *ice.Message, arg ...string) {
|
||||
mdb.CREATE: {Name: "create type=void,tech name=hi text=hello template=base", Hand: func(m *ice.Message, arg ...string) {
|
||||
h := mdb.HashCreate(m, arg)
|
||||
defer m.Result(h)
|
||||
|
||||
@ -61,33 +61,33 @@ func init() {
|
||||
}
|
||||
gdb.Event(m, RIVER_CREATE, RIVER, m.Option(ice.MSG_RIVER, h), arg)
|
||||
}},
|
||||
RIVER_CREATE: {Name: "river.create", Help: "事件", Hand: func(m *ice.Message, arg ...string) {
|
||||
RIVER_CREATE: {Name: "river.create", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmd(mdb.EXPORT, m.Prefix(RIVER), "", mdb.HASH)
|
||||
m.Cmd(mdb.IMPORT, m.Prefix(RIVER), "", mdb.HASH)
|
||||
}},
|
||||
}, mdb.HashAction(mdb.FIELD, "time,hash,type,name,text,template"), web.ApiAction(web.P(RIVER))), Hand: func(m *ice.Message, arg ...string) {
|
||||
}, mdb.HashAction(mdb.FIELD, "time,hash,type,name,text,template")), Hand: func(m *ice.Message, arg ...string) {
|
||||
if m.Warn(m.Option(ice.MSG_USERNAME) == "", ice.ErrNotLogin) {
|
||||
m.RenderStatusUnauthorized()
|
||||
return // 没有登录
|
||||
return
|
||||
}
|
||||
if !aaa.Right(m, RIVER, arg) {
|
||||
m.RenderStatusForbidden()
|
||||
return // 没有授权
|
||||
return
|
||||
}
|
||||
if len(arg) == 0 {
|
||||
_river_list(m)
|
||||
return // 群组列表
|
||||
return
|
||||
}
|
||||
if len(arg) > 1 && arg[1] == STORM {
|
||||
m.Option(ice.MSG_RIVER, arg[0])
|
||||
m.Cmdy(arg[1], arg[2:])
|
||||
return // 应用列表
|
||||
return
|
||||
}
|
||||
if len(arg) > 2 && arg[2] == STORM {
|
||||
m.Option(ice.MSG_RIVER, arg[0])
|
||||
m.Option(ice.MSG_STORM, arg[1])
|
||||
m.Cmdy(arg[2], arg[3:])
|
||||
return // 应用操作
|
||||
return
|
||||
}
|
||||
}},
|
||||
})
|
||||
|
@ -17,17 +17,17 @@ const STORM = "storm"
|
||||
func init() {
|
||||
Index.MergeCommands(ice.Commands{
|
||||
STORM: {Name: "storm hash id auto insert create", Help: "应用", Actions: ice.Actions{
|
||||
mdb.INPUTS: {Name: "inputs", Help: "补全", Hand: func(m *ice.Message, arg ...string) {}},
|
||||
mdb.CREATE: {Name: "create name=hi text=hello", Help: "创建", Hand: func(m *ice.Message, arg ...string) {
|
||||
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) {}},
|
||||
mdb.CREATE: {Name: "create name=hi text=hello", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(mdb.INSERT, RIVER, _river_key(m), mdb.HASH, arg)
|
||||
}},
|
||||
mdb.REMOVE: {Name: "remove", Help: "删除", Hand: func(m *ice.Message, arg ...string) {
|
||||
mdb.REMOVE: {Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(mdb.DELETE, RIVER, _river_key(m), mdb.HASH, mdb.HASH, m.Option(ice.MSG_STORM))
|
||||
}},
|
||||
mdb.INSERT: {Name: "insert hash space index args style display", Help: "添加", Hand: func(m *ice.Message, arg ...string) {
|
||||
mdb.INSERT: {Name: "insert hash space index args style display", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(mdb.INSERT, RIVER, _storm_key(m), mdb.LIST, arg)
|
||||
}},
|
||||
mdb.MODIFY: {Name: "modify", Help: "编辑", Hand: func(m *ice.Message, arg ...string) {
|
||||
mdb.MODIFY: {Hand: func(m *ice.Message, arg ...string) {
|
||||
if len(arg) > 0 && arg[0] == mdb.ID {
|
||||
m.Cmdy(mdb.MODIFY, RIVER, _storm_key(m), mdb.LIST, arg)
|
||||
} else {
|
||||
|
@ -26,7 +26,7 @@ func init() {
|
||||
})
|
||||
}
|
||||
}},
|
||||
RIVER_CREATE: {Name: "river.create river template", Help: "建群", Hand: func(m *ice.Message, arg ...string) {
|
||||
RIVER_CREATE: {Name: "river.create river template", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmd("", m.Option(TEMPLATE), ice.OptionFields(STORM), func(value ice.Maps) {
|
||||
m.Option(ice.MSG_STORM, m.Cmdx(STORM, mdb.CREATE, mdb.NAME, value[STORM]))
|
||||
m.Cmd("", m.Option(TEMPLATE), value[STORM], ice.OptionFields(ctx.INDEX), func(value ice.Maps) {
|
||||
@ -34,16 +34,16 @@ func init() {
|
||||
})
|
||||
})
|
||||
}},
|
||||
mdb.CREATE: {Name: "create river", Help: "创建", Hand: func(m *ice.Message, arg ...string) {
|
||||
mdb.CREATE: {Name: "create river", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmd(mdb.INSERT, m.PrefixKey(), "", mdb.HASH, m.OptionSimple(RIVER), kit.Dict(mdb.SHORT, RIVER))
|
||||
}},
|
||||
mdb.INSERT: {Name: "insert river storm", Help: "添加", Hand: func(m *ice.Message, arg ...string) {
|
||||
mdb.INSERT: {Name: "insert river storm", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmd(mdb.INSERT, m.PrefixKey(), kit.KeyHash(m.Option(RIVER)), mdb.HASH, arg[2:], kit.Dict(mdb.SHORT, STORM))
|
||||
}},
|
||||
"add": {Name: "add river storm index", Help: "添加", Hand: func(m *ice.Message, arg ...string) {
|
||||
"add": {Name: "add river storm index", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmd(mdb.INSERT, m.PrefixKey(), kit.KeyHash(m.Option(RIVER), kit.KeyHash(m.Option(STORM))), mdb.LIST, arg[4:])
|
||||
}},
|
||||
mdb.REMOVE: {Name: "remove", Help: "删除", Hand: func(m *ice.Message, arg ...string) {
|
||||
mdb.REMOVE: {Name: "remove", Hand: func(m *ice.Message, arg ...string) {
|
||||
if m.Option(STORM) == "" {
|
||||
m.Cmd(mdb.DELETE, m.PrefixKey(), "", mdb.HASH, m.OptionSimple(RIVER))
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user