|
@@ -5,6 +5,7 @@ import (
|
|
"regexp"
|
|
"regexp"
|
|
"time"
|
|
"time"
|
|
"wechat-api/ent"
|
|
"wechat-api/ent"
|
|
|
|
+ "wechat-api/ent/contact"
|
|
"wechat-api/ent/custom_types"
|
|
"wechat-api/ent/custom_types"
|
|
"wechat-api/ent/labelrelationship"
|
|
"wechat-api/ent/labelrelationship"
|
|
"wechat-api/ent/messagerecords"
|
|
"wechat-api/ent/messagerecords"
|
|
@@ -140,13 +141,15 @@ func (l *CronTask) sendWxOnTimeout() {
|
|
if message.Meta != nil {
|
|
if message.Meta != nil {
|
|
meta.Filename = message.Meta.Filename
|
|
meta.Filename = message.Meta.Filename
|
|
}
|
|
}
|
|
|
|
+ contactInfo, _ := l.svcCtx.DB.Contact.Query().Where(contact.WxWxidEQ(s.BotWxid), contact.WxidEQ(s.ContactWxid)).First(l.ctx)
|
|
|
|
+ content := varReplace(message.Content, contactInfo)
|
|
_, _ = l.svcCtx.DB.MessageRecords.Create().
|
|
_, _ = l.svcCtx.DB.MessageRecords.Create().
|
|
SetBotWxid(s.BotWxid).
|
|
SetBotWxid(s.BotWxid).
|
|
SetContactID(0).
|
|
SetContactID(0).
|
|
SetContactType(0).
|
|
SetContactType(0).
|
|
SetContactWxid(forwardWxid).
|
|
SetContactWxid(forwardWxid).
|
|
SetContentType(message.Type).
|
|
SetContentType(message.Type).
|
|
- SetContent(message.Content).
|
|
|
|
|
|
+ SetContent(content).
|
|
SetMeta(meta).
|
|
SetMeta(meta).
|
|
SetSourceType(4).
|
|
SetSourceType(4).
|
|
SetSourceID(node.ID).
|
|
SetSourceID(node.ID).
|