1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 11:07:40 +08:00

client: hoist highway input in uploading forward message

This commit is contained in:
wdvxdr 2022-06-18 23:53:35 +08:00
parent 6e1792c6b1
commit 9b6c4ddf2f
No known key found for this signature in database
GPG Key ID: 703F8C071DE7A1B6
2 changed files with 9 additions and 9 deletions

View File

@ -293,16 +293,16 @@ func (builder *ForwardMessageBuilder) Main(m *message.ForwardMessage) *message.F
return nil return nil
} }
content := forwardDisplay(rsp.MsgResid, utils.RandomString(32), m.Preview(), fmt.Sprintf("查看 %d 条转发消息", m.Length())) content := forwardDisplay(rsp.MsgResid, utils.RandomString(32), m.Preview(), fmt.Sprintf("查看 %d 条转发消息", m.Length()))
bodyHash := md5.Sum(body)
input := highway.Transaction{
CommandID: 27,
Ticket: rsp.MsgSig,
Body: bytes.NewReader(body),
Sum: bodyHash[:],
Size: int64(len(body)),
}
for i, ip := range rsp.Uint32UpIp { for i, ip := range rsp.Uint32UpIp {
addr := highway.Addr{IP: uint32(ip), Port: int(rsp.Uint32UpPort[i])} addr := highway.Addr{IP: uint32(ip), Port: int(rsp.Uint32UpPort[i])}
hash := md5.Sum(body)
input := highway.Transaction{
CommandID: 27,
Ticket: rsp.MsgSig,
Body: bytes.NewReader(body),
Sum: hash[:],
Size: int64(len(body)),
}
err := c.highwaySession.Upload(addr, input) err := c.highwaySession.Upload(addr, input)
if err != nil { if err != nil {
continue continue

View File

@ -7,7 +7,7 @@ import (
) )
// TODO: move to a new package // TODO: move to a new package
const debug = true const debug = false
type Message = any type Message = any