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

ChatMemberUpdated.invite_link missing when joining public groups #428

Open
Bibo-Joshi opened this issue Jun 29, 2023 · 7 comments
Open

ChatMemberUpdated.invite_link missing when joining public groups #428

Bibo-Joshi opened this issue Jun 29, 2023 · 7 comments

Comments

@Bibo-Joshi
Copy link

Hi. I did some testing and it looks like the invite_link field of the ChatMemberUpdated class is present only when joining private groups. For public groups, the field is missing even when the user does join via a link and not via the username of the group.
I expect that the added value of the invite link is smaller for public groups as they can be found by anyone, but this behavior is was unexpected as the documentation does not suggest it. If you could document this behavior or if the behavior could be updated, I'd be grateful.

@Poolitzer
Copy link

It works however when people join when pressing on a chat folder invite link.

@Bibo-Joshi
Copy link
Author

Apparently in case of folder-join the groups primary link is used and the via_chat_folder_invite_link attribute is set to True. IMO the invite_link still being set is a bit surprising as the user didn't actively use the link. While it's understandable that the joining has to be established somehow, I would prefer for either the attribute to be or this behavior to be documented.

@Bibo-Joshi
Copy link
Author

Another insight: Apparently the link is there for groups that are newly created today …

@levlam
Copy link
Contributor

levlam commented Jun 29, 2023

For public groups, the field is missing even when the user does join via a link and not via the username of the group.

This is not true. If the user joins the group via an invite link, the field invite_link is present. If the group is public, then users are free to join it directly, even the group was opened via an invite link. And this is exactly the behavior of most apps when user press "Join" button on the chat history screen.

@Bibo-Joshi
Copy link
Author

Bibo-Joshi commented Jun 30, 2023

Thanks for the quick reply! Your explanation about the "Join" button hiding away the invite_link does sound understandable. However, joining a newly created group via invite link + join button does give the invite_link attribute (just double checked again on TG desktop windows and webk). So it seems to me that either the behavior is different for groups greated after some date or it is just inconsistent :/

@levlam
Copy link
Contributor

levlam commented Jun 30, 2023

The behavior depends on the used app. The official Android app is known to use direct join instead of invite link for public chats.

@Poolitzer
Copy link

I do not believe it is an app issue only.

I can use Telethon to join a chat with the same invite link with different accounts, in one chat member update it has the link, one doesn't

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

3 participants