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

Limit chatting to users in your group and allow to exclude certain groups #57

Merged
merged 15 commits into from
Feb 10, 2018

Conversation

LEDfan
Copy link
Member

@LEDfan LEDfan commented Aug 14, 2017

This PR integrates the changes provided in nextcloud/server#5585 so an admin can limit Chatting in the following two ways, using the Sharing settings in core:

  • Exclude certain groups from chatting:
    afbeelding
  • Restrict sharing to own groups:
    afbeelding

This needs the upstream PR + another (not yet made) PR to make the ContactsStore a public API in Nextcloud, therefore the tests should and will fail on stable12 and master. (https://gist.github.com/LEDfan/6baa61a6d23ed5dff2fac877bc9e2895)

TODO:

Fixes jsxc/jsxc#306

lib/hooks.php Outdated

public function onRemoveUserFromGroup(IGroup $group, IUser $user)
{
$this->rosterPush->removeRosterItemForUsersInGroup($group, $user->getUID());
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO this must only be done when one of the privacy options is enabled and when running on version > 12.0.3

@LEDfan
Copy link
Member Author

LEDfan commented Aug 18, 2017

@sualko FYI this is something not for 3.3, it needs to much changes upstream.

@sualko
Copy link
Member

sualko commented Aug 18, 2017

Thanks for the information 👍

@codecov
Copy link

codecov bot commented Oct 1, 2017

Codecov Report

Merging #57 into master will increase coverage by 2.04%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #57      +/-   ##
============================================
+ Coverage     81.17%   83.22%   +2.04%     
+ Complexity      274      272       -2     
============================================
  Files            29       31       +2     
  Lines           951     1067     +116     
============================================
+ Hits            772      888     +116     
  Misses          179      179
Impacted Files Coverage Δ Complexity Δ
lib/stanzahandlers/presence.php 100% <ø> (ø) 4 <0> (ø) ⬇️
lib/ContactsStoreUserProvider.php 100% <100%> (ø) 0 <0> (?)
lib/stanzahandlers/message.php 100% <100%> (ø) 4 <1> (+1) ⬆️
lib/Controller/HttpBindController.php 100% <100%> (ø) 26 <1> (+1) ⬆️
lib/rosterpush.php 100% <100%> (ø) 0 <0> (-11) ⬇️
lib/http/xmppresponse.php 100% <100%> (ø) 5 <1> (+1) ⬆️
lib/User.php 100% <100%> (ø) 0 <0> (?)
lib/hooks.php 100% <100%> (ø) 12 <3> (+3) ⬆️
lib/stanzahandlers/iq.php 100% <100%> (ø) 9 <1> (+2) ⬆️
lib/db/presencemapper.php 100% <100%> (ø) 16 <1> (+1) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 104cd91...6ee3ea7. Read the comment docs.

@Schmuuu
Copy link

Schmuuu commented Jan 10, 2018

Hi,

I pretty urgent need the feature "Restrict sharing to own groups". Is there an eta when this feature will be released or in which version this will come?
I'm no coder unfortunately but can I provide some help in a different way? I'm willing to test of course if you need help there.

And thanks for the very good work so far with this great app!

@LEDfan
Copy link
Member Author

LEDfan commented Jan 15, 2018

@Schmuuu I'm currently having exams again, I'll finish this PR in approx 3 weeks.

@MarcelWaldvogel
Copy link
Contributor

@Schmuuu Should only a limited group have access to the chat feature, or should they only be able to communicate within the group?

The latter can be achieved by setting up an external XMPP server and creating appropriate rules.

However, for both cases I do not see a real reason to have this; users can communicate anyway, outside of JSXC (and possible with more side-effects and information leakage).

@Schmuuu
Copy link

Schmuuu commented Jan 15, 2018

Hi @MarcelWaldvogel

or should they only be able to communicate within the group?

Yes, that is what I would like to have.

I configured the sharing with:
"Restrict users to only share with users in their groups"

It would just be consistent if I can either configure the chat manually or if the app uses the sharing setting automatically and restricts users to chat with other users in their group only.

I have the following situation:

  • the users in different groups don't know each other and don't want to know each other
  • in return users in different groups don't want to chat with each other
  • users in different groups can't share files anyway (and don't want to)

What I would like to achieve:

  • provide the users a clean user list (in chat bar) of online/ offline users (not a list of 30+ users where 80% of the listed users is not of any interest)
  • don't want to show everyone who is using the server
  • create a test user for friends to show them the nice features of nextcloud and not(!) automatically show them the full user list
  • show the chat feature to that test user and allow these test users to chat with me (because my user is in that test group as well)

I hope you agree, that there are just some use cases, where it is just perfect to have the chance to limit chats within a group only.

While I'm trying to convince my company to use a full-featured Nextcloud, this would be critical as well. Providing customers the chat feature would be nice, but we would need to hide all the customers from each other, meaning only the users of one customer (one company) can chat with us and each other, but not the users of different customers with each other.

@LEDfan LEDfan force-pushed the enhancy_privacy branch 2 times, most recently from c3bfb9f to 8bd8215 Compare February 9, 2018 07:33
Signed-off-by: Tobia De Koninck <tobia@ledfan.be>
…t user containing/removing all users in that group

Signed-off-by: Tobia De Koninck <tobia@ledfan.be>
Signed-off-by: Tobia De Koninck <tobia@ledfan.be>
Signed-off-by: Tobia De Koninck <tobia@ledfan.be>
@LEDfan LEDfan removed the WIP label Feb 10, 2018
@LEDfan LEDfan changed the title [WIP] Limit chatting to users in your group and allow to exclude certain groups Limit chatting to users in your group and allow to exclude certain groups Feb 10, 2018
@LEDfan LEDfan merged commit 3902e6b into master Feb 10, 2018
@LEDfan LEDfan deleted the enhancy_privacy branch February 10, 2018 10:27
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

Successfully merging this pull request may close these issues.

4 participants