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

Let the admin convert a forum into a private room #617

Draft
wants to merge 4 commits into
base: develop_tchap
Choose a base branch
from

Conversation

aulamber
Copy link
Contributor

@aulamber aulamber commented Jun 9, 2023

Cf. issue #363

To reproduce :

  1. Create a forum (you need to be an admin of your forum).
  2. Go to "Paramètres du salon" > "Général".
  3. A new button appears : "Convertir en salon privé". Click on it, it will change your public room into a private one.
Capture d’écran 2023-06-09 à 17 10 54

NB : I had trouble updating the list of rooms (outside of our component) so that the green forum icon of our newly turned private room would turn into a red lock icon. It is only a frontend problem, because I added a request to update the room status and it shows when I refresh the page. So my solution was to refresh the page with javascript. If you know of a better solution in the existing matrix code, please let me know :) In this component:

Capture d’écran 2023-06-09 à 16 54 07

NB : the way I check that the user is an admin of the room is by verifying their powerLevel (100 as an admin, 0 as a regular user).

@odelcroi odelcroi closed this Jun 13, 2023
@odelcroi odelcroi reopened this Jun 13, 2023
@odelcroi odelcroi closed this Jun 20, 2023
@odelcroi odelcroi reopened this Jun 20, 2023
return this.http.authedRequest(Method.Put, path, undefined, content);
}

+ /**
Copy link
Member

Choose a reason for hiding this comment

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

can it be outside of the matrix-js-sdk?

PosthogTrackers.trackInteraction("WebRoomSettingsLeaveButton", ev);
};

+ /* :TCHAP: Add button to change forum to private room if user is admin */
Copy link
Member

Choose a reason for hiding this comment

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

can it be outside of the matrix-react-sdk

@odelcroi odelcroi marked this pull request as draft June 29, 2023 13:26
@aulamber aulamber marked this pull request as ready for review July 3, 2023 10:46
@odelcroi odelcroi marked this pull request as draft August 28, 2023 17:54
@estellecomment
Copy link
Contributor

C'est tjs d'actualité ca ?

if (filter) {
params.filter = JSON.stringify(filter);
}
+
Copy link
Member

Choose a reason for hiding this comment

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

unecessary add line break

@odelcroi
Copy link
Member

odelcroi commented Nov 2, 2023

We need to double check the implementation and add tests BUT it is not a huge priority as this use case arose only once.

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.

3 participants