Skip to content

Commit

Permalink
fixed IsForwarded()
Browse files Browse the repository at this point in the history
reverts a tiny change from dbc2cd7, we need to check both fields because:
- m.OriginalChat is nil when message is not forwarded from a channel
- m.OriginalSender can be nil if the message is forwarded from a channel
(doc: https://core.telegram.org/bots/api#message)
  • Loading branch information
irgendwr authored Dec 25, 2017
1 parent 62ac17d commit 933b28f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion message.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func (m *Message) LastEdited() time.Time {
// IsForwarded says whether message is forwarded copy of another
// message or not.
func (m *Message) IsForwarded() bool {
return m.OriginalChat != nil
return m.OriginalSender != nil || m.OriginalChat != nil
}

// IsReply says whether message is a reply to another message.
Expand Down

0 comments on commit 933b28f

Please sign in to comment.