mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 19:17:38 +08:00
client: hoist highway input in uploading forward message
This commit is contained in:
parent
6e1792c6b1
commit
9b6c4ddf2f
@ -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()))
|
||||||
for i, ip := range rsp.Uint32UpIp {
|
bodyHash := md5.Sum(body)
|
||||||
addr := highway.Addr{IP: uint32(ip), Port: int(rsp.Uint32UpPort[i])}
|
|
||||||
hash := md5.Sum(body)
|
|
||||||
input := highway.Transaction{
|
input := highway.Transaction{
|
||||||
CommandID: 27,
|
CommandID: 27,
|
||||||
Ticket: rsp.MsgSig,
|
Ticket: rsp.MsgSig,
|
||||||
Body: bytes.NewReader(body),
|
Body: bytes.NewReader(body),
|
||||||
Sum: hash[:],
|
Sum: bodyHash[:],
|
||||||
Size: int64(len(body)),
|
Size: int64(len(body)),
|
||||||
}
|
}
|
||||||
|
for i, ip := range rsp.Uint32UpIp {
|
||||||
|
addr := highway.Addr{IP: uint32(ip), Port: int(rsp.Uint32UpPort[i])}
|
||||||
err := c.highwaySession.Upload(addr, input)
|
err := c.highwaySession.Upload(addr, input)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user