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

Implement server-wide open group user bans and unbans. #2653

Open
wants to merge 4 commits into
base: unstable
Choose a base branch
from

Conversation

ianmacd
Copy link

@ianmacd ianmacd commented Jan 22, 2023

This adds to Session the ability to ban a user not just from a single group, but from an entire SOGS.

To successfully ban (or unban) a user across a whole server, the executor must be a global moderator of the SOGS instance.

When banning a user, the global moderator may opt to also remove all of the user's messages from the server. This requires PySOGS > 0.3.7 to allow the simultaneous deletion of messages from multiple groups. See oxen-io/session-pysogs@2c8e4f1.

This has been tested with Session 1.10.4 in combination with open.getsession.org and sog.caliban.org, both of which have been updated to support server-wide banning.

image
image
image

Contributor checklist:

@KeeJef
Copy link
Collaborator

KeeJef commented Jan 24, 2023

This will be very useful, so definitely want to merge, but a few things i think we need to update before this

  • Currently on Session Desktop i don't think we are identifying global moderators or admins, which means we wont know who to show this option to, if we show it to regular admins or mods the banning will fail.
  • We will need to push an update on the SOGS side to allow arbitrary SOGS operators to support this functionality.
  • I think we might need to put this behind the SOGS capabilities endpoint, so that in the client we don't display this function if its not supported on the SOGS we are connected to?
  • We should support these options on other platforms (not required to merge, but we should do)

Thanks

@ianmacd
Copy link
Author

ianmacd commented Jan 24, 2023

  • Currently on Session Desktop i don't think we are identifying global moderators or admins, which means we wont know who to show this option to, if we show it to regular admins or mods the banning will fail.

Yes, desktop makes no distinction between global and local superusers. Nor does it even distinguish between moderators and admins, which is a problem in itself, because server operators looking to use the client to create moderators for their groups instead create admins with too much power.

You are correct that banning will fail when the moderator or admin does not have global scope, but this failure is at least reported, albeit it not specifically.

  • We will need to push an update on the SOGS side to allow arbitrary SOGS operators to support this functionality.

Server-wide bans are already supported by SOGS.

The SOGS code to enable cross-group message deletion has already been submitted and merged, and will presumably make it into the 0.3.8 release (or whichever is the next version released).

  • I think we might need to put this behind the SOGS capabilities endpoint, so that in the client we don't display this function if its not supported on the SOGS we are connected to?

PySOGS has always had support for server bans, but Session did not call that endpoint until now.

  • We should support these options on other platforms (not required to merge, but we should do)

I agree.

@ianmacd
Copy link
Author

ianmacd commented Jan 24, 2023

I should note that #2639 also applies to this PR. When the moderator/admin chooses to Delete All, the target user's messages are removed but any emoji reactions placed by him are not.

This adds to Session the ability to ban a user not just from a single
group, but from an entire SOGS.

To successfully ban (or unban) a user across a whole server, the
executor must be a global moderator of the SOGS instance.

When banning a user, the global moderator may opt to also remove all of
the user's messages from the server. This requires PySOGS > 0.3.7 to
allow the simultaneous deletion of messages from multiple groups. See
oxen-io/session-pysogs@2c8e4f1.

This has been tested with Session 1.10.4 in combination with
`open.getsession.org` and `sog.caliban.org`, both of which have been
updated to support server-wide banning.
This expands on oxen-io#2653 and ensures that when a user is banned from a room
or an entire server, and **Delete All** has been selected, not just his
messages but also his emoji reactions will be removed.

This pull-request depends on oxen-io/session-pysogs#169.

Verified working on `sog.caliban.org`.
@ianmacd
Copy link
Author

ianmacd commented Feb 3, 2023

I've added code that will also remove a user's emoji reactions when clearing up following a ban.

That part of the code is still pending a PR to PySOGS, namely oxen-io/session-pysogs#169.

ianmacd added a commit to ianmacd/session-desktop that referenced this pull request Aug 9, 2023
This expands on oxen-io#2653 and ensures that when a user is banned from a room
or an entire server, and **Delete All** has been selected, not just his
messages but also his emoji reactions will be removed.

This pull-request depends on oxen-io/session-pysogs#169.

Verified working on `sog.caliban.org`.
@Bilb Bilb changed the base branch from clearnet to unstable September 30, 2024 04:10
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.

2 participants