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

external_reply.origin.sender_user does not show the correct user (replying to a forward) #659

Open
wiz0u opened this issue Nov 4, 2024 · 11 comments

Comments

@wiz0u
Copy link

wiz0u commented Nov 4, 2024

When replying to a message from another chat which was a forward, the sender_user seems to be filled with information from the initially forwarded user, rather than information about the message sender in the other chat:

in the below example, replying to https://t.me/iamnotstalin2Chat/665,
we would expect sender_user to identify Андрей rather than НЕ СТАЛИН

image

{
  "update_id": 144536348,
  "message": {
    "message_id": 1388580,
    "from": {
      "id": 301455566,
      "is_bot": false,
      "first_name": "Wizou",
      "username": "Wiz0u",
      "language_code": "fr",
      "is_premium": true
    },
    "chat": {
      "id": 301455566,
      "first_name": "Wizou",
      "username": "Wiz0u",
      "type": "private"
    },
    "date": 1730741106,
    "external_reply": {
      "origin": {
        "type": "user",
        "sender_user": {
          "id": 6802950856,
          "is_bot": false,
          "first_name": "НЕ СТАЛИН",
          "username": "iamnotstalin_person"
        },
        "date": 1730736974
      },
      "chat": {
        "id": -1002118288285,
        "title": "Вспомогательный чат 2",
        "username": "iamnotstalin2Chat",
        "type": "supergroup"
      },
      "message_id": 665,
      "sticker": {
        "width": 512,
        "height": 512,
        "emoji": "😍",
        "is_animated": true,
        "is_video": false,
        "type": "regular",
        "thumbnail": {
          "file_id": "AAMCAgADGQEAARUwJGcpA3KFuMKLCvxuKbniUEU3cKkPAAJ7AAPBnGAM2xofth1UNogBAAdtAAM2BA",
          "file_unique_id": "AQADewADwZxgDHI",
          "file_size": 4580,
          "width": 128,
          "height": 128
        },
        "thumb": {
          "file_id": "AAMCAgADGQEAARUwJGcpA3KFuMKLCvxuKbniUEU3cKkPAAJ7AAPBnGAM2xofth1UNogBAAdtAAM2BA",
          "file_unique_id": "AQADewADwZxgDHI",
          "file_size": 4580,
          "width": 128,
          "height": 128
        },
        "file_id": "CAACAgIAAxkBAAEVMCRnKQNyhbjCiwr8bim54lBFN3CpDwACewADwZxgDNsaH7YdVDaINgQ",
        "file_unique_id": "AgADewADwZxgDA",
        "file_size": 37975
      }
    },
    "text": "dump"
  }
}
@wiz0u
Copy link
Author

wiz0u commented Nov 4, 2024

maybe ExternalReplyInfo structure should have both a origin (or from?) field AND a forward_origin field, to differenciate the message sender and the forwarded user

@wiz0u wiz0u changed the title external_reply.origin.sender_user does not show the correct user external_reply.origin.sender_user does not show the correct user (replying to a forward) Nov 4, 2024
@levlam
Copy link
Contributor

levlam commented Nov 4, 2024

This is intended. MessageOrigin always represents the initial sender of the message both in forwards and ExternalReplyInfo.

Actual source of the forward is available only in Saved Messages, the Replies chat, which aren't relevant for bots.

If you want Telegram to provide the latter for all chats, then you need to create a card at https://suggestions.telegram.org, unless one already exists.

@wiz0u
Copy link
Author

wiz0u commented Nov 4, 2024

why not add a from (User) field to ExternalReplyInfo ?

seeing the screenshot above (taken in chat with bot), one would expect that information to be available (to bots too)

@levlam
Copy link
Contributor

levlam commented Nov 4, 2024

why not add a from (User) field to ExternalReplyInfo ?

Because there is no such information as I explained.

seeing the screenshot above (taken in chat with bot), one would expect that information to be available (to bots too)

Is it Telegram Desktop? You must restart it to see the actual message.

@wiz0u
Copy link
Author

wiz0u commented Nov 4, 2024

Is it Telegram Desktop? You must restart it to see the actual message.

yes. I just restarted Telegram Desktop and went straight to my chat with @JsonDumpBot,
the message still appeared the same with all information about real sender.

note: I'm not even a member of https://t.me/iamnotstalin2Chat so Telegram Desktop did not fetch the origin message from my chats.

@wiz0u
Copy link
Author

wiz0u commented Nov 4, 2024

I just opened Telegram Android, the message appear as you said, with only НЕ СТАЛИН

@levlam
Copy link
Contributor

levlam commented Nov 4, 2024

I just restarted Telegram Desktop and went straight to my chat with @JsonDumpBot,

You didn't restart it. You closed the window and minimized the app to tray. You can close it from there.

@wiz0u
Copy link
Author

wiz0u commented Nov 4, 2024

Trust me, i closed it. (retried again now, same, even checked Process Explorer )
I disabled minimize to tray

@levlam
Copy link
Contributor

levlam commented Nov 4, 2024

There is no way Telegram Desktop can keep this state of the message if closed.

@wiz0u
Copy link
Author

wiz0u commented Nov 4, 2024

🤷🏻‍♂️ maybe it auto-fetches the replied message to get & display more info?
https://t.me/iamnotstalin2Chat is a public chat after all

@levlam
Copy link
Contributor

levlam commented Nov 4, 2024

It can't. The message contains no information about the place from which it was forwarded last time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants