Eyre-S / Coeur-Morny-Cono

属于安妮的花宫侍从小鼠
https://book.sukazyo.cc/morny
4 stars 0 forks source link

User not in chat and enabled deny to reference will not be referenced by id. #45

Open Eyre-S opened 9 months ago

Eyre-S commented 9 months ago

While one user is not in the chat (maybe already exited, or send message from linked channel but not join linked group), and they set the Forwarded Message permission to false(Nobody or Contacts Only). Morny will fail to reference them by id.

This is probably because Telegram Bot API will parse Markdown/HTML link with <a href="tg://user?id=1000">User</a> format to a text_mention message entity, which is not allowed when user set Forwarded Message permission to deny.

By changing the Markdown/HTML link to raw message entity of link with the tg://user?id=1000 can fix this —— the link entity will always sent with no permission check while the text_mention entity will check permission and will be ereased when denied.

Eyre-S commented 9 months ago

But due to the permission is just not allowed to reference the user, doing this is actually bypass the permission check and may be a illegal hacking.

Will this issue should be 'fixed'?