Skip to content

Commit

Permalink
client: hoist highway input in uploading forward message
Browse files Browse the repository at this point in the history
  • Loading branch information
wdvxdr1123 committed Jun 18, 2022
1 parent 6e1792c commit 9b6c4dd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions client/multimsg.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,16 +293,16 @@ func (builder *ForwardMessageBuilder) Main(m *message.ForwardMessage) *message.F
return nil
}
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 {
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)
if err != nil {
continue
Expand Down
2 changes: 1 addition & 1 deletion internal/proto/wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

// TODO: move to a new package
const debug = true
const debug = false

type Message = any

Expand Down

0 comments on commit 9b6c4dd

Please sign in to comment.