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

Avoid ensure_joined for nonportal invite if possible #115

Open
maltee1 opened this issue Aug 25, 2022 · 2 comments
Open

Avoid ensure_joined for nonportal invite if possible #115

maltee1 opened this issue Aug 25, 2022 · 2 comments

Comments

@maltee1
Copy link
Contributor

maltee1 commented Aug 25, 2022

Currently, the first thing a ghost does when invited to a non-portal is to join. This allows to get a member list (to check if a bridge bot is there or to see how many users there are, to decide whether it's going to be a dm or not).

This causes some (in my view) undesired behavior. For example, on platforms where invitation is possible, all ghosts that were invited to the room before the portal was created will have membership join rather than invite. I also think that before a portal is created, Membership of ghosts should be invite, independent of the remote platform, because that's more accurate IMHO (albeit they haven't even been invited on the remote platform).

We can check whether the bridge bot is there by asking the bridge bot which rooms it is in. We should be able to obtain all other information (room name, whether it is a direct chat) without joining it. The only problem is checking the number of members, but that's only necessary if the room is marked as direct chat. We can still join the room in that case, it's a situation that wouldn't normally happen anyway, because rooms with several users aren't usually marked as direct.

If you think this is desirable, I can make a PR for it. This would be a breaking change but afaik should only affect signal and Telegram

@tulir
Copy link
Member

tulir commented Aug 25, 2022

That would also break group auto-create since it wouldn't be able to check the power levels 🤔

@maltee1
Copy link
Contributor Author

maltee1 commented Aug 25, 2022

If we have access to a double puppet, we have access to all room info. If we don't have access to a double puppet, group auto-create doesn't work anyway.

Group auto-create currently obtains power levels through the bridge bot after it has joined (Telegram) or through the double puppet (I just changed the PR on mautrix-signal to not get power levels twice). So it wouldn't break.

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

No branches or pull requests

2 participants