Skip to content

Commit

Permalink
fix(forwarder): send random message ids
Browse files Browse the repository at this point in the history
  • Loading branch information
iyear committed Feb 9, 2024
1 parent 146cf75 commit 7570110
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/forwarder/forwarder.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,11 @@ func (f *Forwarder) forwardMessage(ctx context.Context, elem Elem, grouped ...*t
// it can be forwarded via API
if !protectedDialog(elem.From()) && !protectedMessage(elem.Msg()) {
directForward := func(ids ...int) error {
randIDs := make([]int64, 0, len(ids))
for range ids {
randIDs = append(randIDs, f.rand.Int63())
}

req := &tg.MessagesForwardMessagesRequest{
Silent: elem.AsSilent(),
Background: false,
Expand All @@ -261,7 +266,7 @@ func (f *Forwarder) forwardMessage(ctx context.Context, elem Elem, grouped ...*t
Noforwards: false,
FromPeer: elem.From().InputPeer(),
ID: ids,
RandomID: nil,
RandomID: randIDs,
ToPeer: elem.To().InputPeer(),
TopMsgID: elem.Thread(),
ScheduleDate: 0,
Expand Down

0 comments on commit 7570110

Please sign in to comment.