1
0
forked from x/icebergs
This commit is contained in:
shylinux 2020-07-29 11:39:50 +08:00
parent 8db22f281c
commit b51e99983d
2 changed files with 7 additions and 4 deletions

View File

@ -3,7 +3,6 @@ package chat
import ( import (
ice "github.com/shylinux/icebergs" ice "github.com/shylinux/icebergs"
"github.com/shylinux/icebergs/base/mdb" "github.com/shylinux/icebergs/base/mdb"
"github.com/shylinux/icebergs/base/web"
kit "github.com/shylinux/toolkits" kit "github.com/shylinux/toolkits"
"strings" "strings"
@ -79,12 +78,14 @@ func init() {
if strings.Contains(m.Option(ice.MSG_USERUA), "MicroMessenger") { if strings.Contains(m.Option(ice.MSG_USERUA), "MicroMessenger") {
return return
} }
m.Push("action", m.Cmdx(mdb.RENDER, web.RENDER.Button, "删除"))
return return
} }
m.Push("detail", value) m.Push("detail", value)
}) })
m.Sort("time", "time_r") if len(arg) == 0 {
m.PushAction("复制", "删除")
m.Sort("time", "time_r")
}
}}, }},
}, },
}, nil) }, nil)

View File

@ -59,9 +59,11 @@ func (m *Message) AddCmd(cmd *Command) string {
func (m *Message) PushAction(list ...interface{}) { func (m *Message) PushAction(list ...interface{}) {
m.Table(func(index int, value map[string]string, head []string) { m.Table(func(index int, value map[string]string, head []string) {
action := []string{}
for _, k := range kit.Simple(list...) { for _, k := range kit.Simple(list...) {
m.Push(k, m.Cmdx("render", "button", k)) action = append(action, m.Cmdx("render", "button", k))
} }
m.Push("操作", strings.Join(action, ""))
}) })
} }
func (m *Message) PushDetail(value interface{}, arg ...interface{}) *Message { func (m *Message) PushDetail(value interface{}, arg ...interface{}) *Message {