Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix forwardmessages #93

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions ext/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,16 @@
ID: request.ID,
FromPeer: fromPeer,
ToPeer: toPeer,
DropAuthor: request.DropAuthor,
Silent: request.Silent,
Background: request.Background,
WithMyScore: request.WithMyScore,
DropMediaCaptions: request.DropMediaCaptions,
Noforwards: request.Noforwards,
TopMsgID: request.TopMsgID,
ScheduleDate: request.ScheduleDate,
SendAs: request.SendAs,
QuickReplyShortcut: request.QuickReplyShortcut,
})
}

Expand Down Expand Up @@ -683,7 +693,7 @@
functions.SavePeersFromClassArray(ctx.PeerStorage, p.Chats, p.Users)
switch p.Peer.(type) {
case *tg.PeerChannel:
if p.Chats == nil || len(p.Chats) == 0 {

Check failure on line 696 in ext/context.go

View workflow job for this annotation

GitHub Actions / lint (amd64)

S1009: should omit nil check; len() for []github.com/gotd/td/tg.ChatClass is defined as zero (gosimple)

Check failure on line 696 in ext/context.go

View workflow job for this annotation

GitHub Actions / lint (386)

S1009: should omit nil check; len() for []github.com/gotd/td/tg.ChatClass is defined as zero (gosimple)
return &types.EmptyUC{}, errors.New("peer info not found in the resolved Chats")
}
switch chat := p.Chats[0].(type) {
Expand All @@ -694,7 +704,7 @@
return &types.EmptyUC{}, errors.New("peer could not be resolved because Channel Forbidden")
}
case *tg.PeerUser:
if p.Users == nil || len(p.Users) == 0 {

Check failure on line 707 in ext/context.go

View workflow job for this annotation

GitHub Actions / lint (amd64)

S1009: should omit nil check; len() for []github.com/gotd/td/tg.UserClass is defined as zero (gosimple)

Check failure on line 707 in ext/context.go

View workflow job for this annotation

GitHub Actions / lint (386)

S1009: should omit nil check; len() for []github.com/gotd/td/tg.UserClass is defined as zero (gosimple)
return &types.EmptyUC{}, errors.New("peer info not found in the resolved Chats")
}
switch user := p.Users[0].(type) {
Expand Down
Loading