Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions wechaty-puppet/puppet.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ package wechatypuppet
import (
"errors"
"fmt"

lru "github.com/hashicorp/golang-lru"

"github.com/wechaty/go-wechaty/wechaty-puppet/events"
"github.com/wechaty/go-wechaty/wechaty-puppet/filebox"
"github.com/wechaty/go-wechaty/wechaty-puppet/helper"
Expand Down
13 changes: 13 additions & 0 deletions wechaty-puppet/schemas/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,19 @@ type MessagePayloadBase struct {

// 小程序有些消息类型,wechaty服务端解析不处理,框架端解析。 xml type 36 是小程序
FixMiniApp bool

ReferMessage *ReferMessagePayload
}

// ReferMessagePayload refer message payload
type ReferMessagePayload struct {
Type MessageType // TODO: 确认是否和 MessageType 一致
SourceMsgID string
TalkerId string
RoomId string
DisplayName string
Content string
Timestamp time.Time
}

type MessagePayloadRoom struct {
Expand Down
10 changes: 10 additions & 0 deletions wechaty/user/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,16 @@ func (m *Message) Date() time.Time {
return m.payload.Timestamp
}

// ReferMessage get the refer message
func (m *Message) ReferMessage() *schemas.ReferMessagePayload {
if m.payload.ReferMessage == nil {
return nil
}

copy := *m.payload.ReferMessage
return &copy
}

// Say reply a Text or Media File message to the sender.
// Support msg:
// string
Expand Down