diff --git a/base/ssh/scripts.go b/base/ssh/scripts.go index b9647237..5e05a826 100644 --- a/base/ssh/scripts.go +++ b/base/ssh/scripts.go @@ -244,7 +244,7 @@ func (f *Frame) scan(m *ice.Message, h, line string, r io.Reader) *Frame { continue // 空行 } - m.Cmdx(mdb.INSERT, SOURCE, kit.Keys(kit.MDB_HASH, h), mdb.LIST, kit.MDB_TEXT, bio.Text()) + // m.Cmdx(mdb.INSERT, SOURCE, kit.Keys(kit.MDB_HASH, h), mdb.LIST, kit.MDB_TEXT, bio.Text()) f.count++ if len(bio.Text()) == 0 { diff --git a/base/web/dream.go b/base/web/dream.go index 78910117..eddd2215 100644 --- a/base/web/dream.go +++ b/base/web/dream.go @@ -44,7 +44,7 @@ func _dream_show(m *ice.Message, name string) { // 任务模板 if m.Option("template") != "" { - for _, file := range []string{"etc/miss.sh", "src/main.shy", "src/main.go", "go.mod"} { + for _, file := range []string{"etc/miss.sh", "src/main.shy", "src/main.go", "go.mod", "Makefile"} { if _, e := os.Stat(path.Join(p, file)); os.IsNotExist(e) { switch m.Cmdy(nfs.COPY, path.Join(p, file), path.Join(m.Option("template"), file)); file { case "go.mod": diff --git a/base/web/spide.go b/base/web/spide.go index 484e32de..081e14a5 100644 --- a/base/web/spide.go +++ b/base/web/spide.go @@ -320,7 +320,6 @@ func init() { m.Optionv("content_data", data) data = kit.KeyValue(map[string]interface{}{}, "", data) - m.Debug("res: %s", kit.Formats(data)) m.Push("", data) } }) diff --git a/core/chat/action.go b/core/chat/action.go index 39405bb6..a5c2c0cd 100644 --- a/core/chat/action.go +++ b/core/chat/action.go @@ -110,12 +110,14 @@ func init() { }}, }, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { if arg[0] == "_share" { - switch msg := m.Cmd(web.SHARE, arg[1]); msg.Append("type") { - case "storm": - m.Debug(msg.Format("meta")) - arg[0] = msg.Append("river") - arg[1] = msg.Append("storm") - m.Option("title", msg.Append("name")) + switch msg := m.Cmd(web.SHARE, arg[1]); msg.Append(kit.MDB_TYPE) { + case STORM: + m.Debug(msg.Format(kit.MDB_META)) + arg[0] = msg.Append(RIVER) + arg[1] = msg.Append(STORM) + m.Option(kit.MDB_TITLE, msg.Append(kit.MDB_NAME)) + default: + return } } else { if m.Warn(m.Option(ice.MSG_USERNAME) == "", ice.ErrNotLogin) { diff --git a/core/chat/river.go b/core/chat/river.go index 72e54185..465e14e1 100644 --- a/core/chat/river.go +++ b/core/chat/river.go @@ -12,16 +12,6 @@ import ( ) func _river_list(m *ice.Message) { - if m.Option(web.SHARE) != "" && m.Option(web.SHARE) != "" { - m.Option(ice.MSG_RIVER, m.Option(RIVER)) - if m.Cmd(m.Prefix(AUTH), m.Option(web.SHARE)).Append(kit.MDB_TYPE) == USER { - if m.Cmd(m.Prefix(USER), m.Option(ice.MSG_USERNAME)).Append(ice.MSG_USERNAME) == "" { - m.Cmd(m.Prefix(USER), mdb.INSERT, aaa.USERNAME, m.Option(ice.MSG_USERNAME)) - // 加入群组 - } - } - } - m.Set(ice.MSG_OPTION, kit.MDB_HASH) m.Set(ice.MSG_OPTION, kit.MDB_NAME) @@ -31,6 +21,27 @@ func _river_list(m *ice.Message) { }) }) } +func _river_share(m *ice.Message) { + if m.Option(web.SHARE) == "" || m.Option(RIVER) == "" { + return + } + + msg := m.Spawn() + msg.Option(mdb.FIELDS, "type,name,text,river,storm") + if res := msg.Cmd(web.SHARE, m.Option(web.SHARE)); res.Append(kit.MDB_TYPE) == RIVER { + msg.Option(ice.MSG_RIVER, res.Append(RIVER)) + } else { + if res := msg.Cmd(m.Prefix(AUTH), m.Option(web.SHARE)); res.Append(kit.MDB_TYPE) == USER { + } else { + return + } + } + + if msg.Cmd(m.Prefix(USER), m.Option(ice.MSG_USERNAME)).Append(aaa.USERNAME) == "" { + msg.Cmd(m.Prefix(USER), mdb.INSERT, aaa.USERNAME, m.Option(ice.MSG_USERNAME)) + // 加入群组 + } +} func _river_proxy(m *ice.Message, pod string) (proxy []string) { if p := kit.Select(m.Option(POD), pod); p != "" { proxy = append(proxy, web.SPACE, p) @@ -321,6 +332,7 @@ func init() { return // 没有登录 } if len(arg) == 0 { + _river_share(m) _river_list(m) return // 群组列表 }