Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Automatically invite/join new users to community #5243

Closed
AnwariasEu opened this issue May 23, 2019 · 5 comments
Closed

Automatically invite/join new users to community #5243

AnwariasEu opened this issue May 23, 2019 · 5 comments
Labels
z-feature (Deprecated Label) z-p2 (Deprecated Label)

Comments

@AnwariasEu
Copy link

Description:
Similar to what is proposed in #4762 I would propose to have an option to add/invite new registered users into a community.

Extending the feature auto_join_rooms by auto_invite_community and auto_add_community.
As a result a new user should be invited or directly be added to the supplied communities.

@neilisfragile neilisfragile added z-feature (Deprecated Label) z-p2 (Deprecated Label) communities labels May 23, 2019
@l-e-e-o
Copy link

l-e-e-o commented Nov 26, 2019

My workaround for now is a combination of cronjob, shell script and SQL statement that invites all new (real) users to a list of groups every five minutes - maybe that's useful to someone. But I, too, vote for this feature.

autoinvite_to_group.sh

#!/bin/sh

# Group Admin Access-Token
ACCESSTOKEN="<admin_access_token>"

for userid in $(sudo -iu postgres psql -A -t -d <db_name> < /path/to/users_to_invite_to_group.sql | perl -MURI::Escape -lne 'print uri_escape($_)')
do
    curl -X PUT -H "Authorization: Bearer $ACCESSTOKEN" -H "Content-Type: application/json" -d '{}' https://<host>/_matrix/client/r0/groups/%2B<group_localpart>%3A<server_name>/admin/users/invite/$userid
done

users_to_invite_to_group.sql

SELECT name AS user_id FROM users WHERE appservice_id IS NULL AND deactivated = 0 EXCEPT SELECT user_id FROM (SELECT user_id, group_id, NULL AS is_admin FROM group_invites UNION ALL SELECT user_id, group_id, is_admin FROM group_users) AS potential_group_users WHERE group_id = '+<group_localpart>:<server_name>';

cronjob

*/5 * * * * /path/to/autoinvite_to_group.sh

@vmario89
Copy link

vmario89 commented Jan 8, 2020

hi, that script works well but i deactivated it now, because it has some problems which occure in a good practical use: If you have a lot of system/bridge users, they get invited too (SmsMatrix, mautrix-whatsapp, mautrix-telegram, ...). So you would need to write some blacklist/whitelist to ignore them.

grafik

Becaue the problem is: If you remove the invitation of a user to community, the user gets invited to it again and again and again. So there needs to be added som kind of trigger: removing the invitation of specific users to community should put that user to some black-list or so.

@caglar1
Copy link

caglar1 commented Apr 18, 2020

hi, that script works well but i deactivated it now, because it has some problems which occure in a good practical use: If you have a lot of system/bridge users, they get invited too (SmsMatrix, mautrix-whatsapp, mautrix-telegram, ...). So you would need to write some blacklist/whitelist to ignore them.

grafik

Becaue the problem is: If you remove the invitation of a user to community, the user gets invited to it again and again and again. So there needs to be added som kind of trigger: removing the invitation of specific users to community should put that user to some black-list or so.

I agree, It will be useful this way that described above

@paulRbr
Copy link

paulRbr commented Mar 13, 2021

Will this be something possible with the new Spaces project? I guess Synapse will need some sort of auto_join_spaces configuration which would help to onboard new users on custom homeservers.

@clokep
Copy link
Member

clokep commented Apr 26, 2022

Communities/groups are being removed, see #11584.

@clokep clokep closed this as completed Apr 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
z-feature (Deprecated Label) z-p2 (Deprecated Label)
Projects
None yet
Development

No branches or pull requests

7 participants