jsxc / xmpp-cloud-auth

:key: Authentication hub for Nextcloud+JSXC→Prosody, ejabberd, saslauthd, Postfix
https://www.jsxc.org
MIT License
60 stars 18 forks source link

Excluding group from shared roster of ejabberd? #73

Closed poVoq closed 5 years ago

poVoq commented 5 years ago

Is it somehow possible to exclude a Nextcloud group from the shared roster feature?

I have one huge group with nearly all users that I do not want to show up in XMPP clients, while the smaller ones like admin would be nice to have.

Thanks for any tips how to set this up.

MarcelWaldvogel commented 5 years ago

There is currently no way to do this, but you are pointing out an important point here.

We do have three options for the shared roster:

For the latter, a separate repository is responsible.

I see three options for solving this right now:

  1. Any group with a recognizable character sequence in their name is excluded. (E.g., the name ending in a zero-width space, U+200B.)
    This is trivial to implement and requires no changes to the UI, but is not really user friendly.
  2. Providing a UI to select groups to include/exclude.
    Major UI change.
  3. Providing a variable to limit group size in the UI ("Only provide rosters for groups smaller than ____").
    This is not very flexible, but easy to understand.

I would suggest implementing #​3 for the general audience (input and filtering done in jsxc.nextcloud) and — for rare exceptions — filter #​1 in the backend.

What are your suggestions?

poVoq commented 5 years ago
  1. would be a per user setting or a admin setting? Might be a bit hard for a user to tell how big the group is...

For me personally 1. i.e. setting a group name in the backend to be excluded would be sufficient, but I get your point that it would be nice to also have some option for that in the front-end.

By the way, what about Circles? Given the dynamic nature of chats, Circles from the official Circles App might be actually also well suited for roster groups.

MarcelWaldvogel commented 5 years ago

I am working on 1. It would have been ready by now, if I did not find a possible problem in the roster management which I am trying to hunt down first. (If it does work as intended, it is only a two-line change to the code.)

3 would definitely be an admin setting. Not only would it be hard for the user, the groups also need to be consistent (a user needs to be in a roster group or not, this cannot depend on the user's view).

Circles have been discussed in jsxc/jsxc#605. You might continue there.

MarcelWaldvogel commented 5 years ago

Group hiding by appending U+200B to a group name has been added in f4e4be99b2dde.

poVoq commented 5 years ago

So how does one actually add this? Is there a keyboard short-cut?

MarcelWaldvogel commented 5 years ago

On Unix, it is Ctrl-Shift-U 2 0 0 B Return; see https://www.jsxc.org/blog/2018/10/14/xcauth-v2.0.3-released.html for this (and soon, more information).

poVoq commented 5 years ago

Hmm, ok. Actually now thinking about it: what if you can not change the user-group's name as it comes from LDAP or another external user source? I know that you could try to link Ejabberd to LDAP directly, but in my case it is via the user_sql plugin to get the users from a php CMS.

MarcelWaldvogel commented 5 years ago

Then you are out of luck. That's why I chose a character like this, which should not have a visual impact, so it could even be added in the original source (LDAP, CMS, …).

But I heard rumors that @sualko is considering implementing in in JSXC for Nextcloud (nextcloud/jsxc.nextcloud#112)

(Of course, there is the option of modifying the source code to look for a different character or an entire specific name. This would be the place to change the code.