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

Create Room #52

Merged
merged 40 commits into from
Apr 25, 2022
Merged

Create Room #52

merged 40 commits into from
Apr 25, 2022

Conversation

odelcroi
Copy link
Member

@odelcroi odelcroi commented Apr 15, 2022

#46

Comment on lines 34 to 37
createRoomOpts.accessRule = TchapRoomAccessRule.Restricted;
createRoomOpts.visibility = matrixJsSdk.Visibility.Public;
createRoomOpts.preset = matrixJsSdk.Preset.PublicChat;
opts.joinRule = matrixJsSdk.JoinRule.Public;
Copy link
Contributor

Choose a reason for hiding this comment

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

Quel est l'intéret de modifier createRoomOpts sachant que ça ne sera pas utilisé de ce que je vois (ni return ni assign, seul opts est retourné) ?

Copy link
Contributor

Choose a reason for hiding this comment

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

ha, je me suis posé la meme question !
En lisant de pres, un peu plus haut, tu as

    const createRoomOpts: ITchapCreateRoomOpts = {};
    opts.createOpts = createRoomOpts;

Et tout à la fin return opts;, du coup on a return createRoomOpts indirectement.

* @returns rooms options
*/
export default function roomCreateOptions(name: string, tchapRoomType: TchapRoomType, federate?: boolean): IOpts {
federate = (federate != undefined) ? federate : DEFAULT_FEDERATE_VALUE;
Copy link
Contributor

Choose a reason for hiding this comment

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

Qu'est ce que vous pensez de federate = federate ?? DEFAULT_FEDERATE_VALUE; ou même dans le constructeur federate: boolean = DEFAULT_FEDERATE_VALUE

Copy link
Contributor

Choose a reason for hiding this comment

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

bonne idee ! Je met un default pour l'argument de la fonction.

Comment on lines 8 to 12
/**
* Return a short value for getDomain().
* @returns {string} The shortened value of getDomain().
*/
static getShortDomain() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Je propose d'utiliser le typing TS plutôt que JSdoc pour typer les fonctions. Le commentaire n'apporte pas grand chose en prime

Copy link
Contributor

Choose a reason for hiding this comment

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

Bonne remarque, done

Comment on lines 10 to 26
expect(roomCreateOptions("testName", TchapRoomType.Private)).toStrictEqual(
{
createOpts: {
name: "testName",
creation_content: {
"m.federate": true,
},
accessRule: "restricted",
visibility: "private",
preset: "private_chat",
},
guestAccess: false,
joinRule: "invite",
encryption: true,
historyVisibility: "joined",
}
)
Copy link
Contributor

Choose a reason for hiding this comment

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

En refacto possible, il serait sympa d'extraire le resultat attendu dans une variable ie. privateRoomExpectedSettings, ça permet de faire des expects plus courts et lisibles, et en prime, l'expected value est réutilisable

Copy link
Contributor

Choose a reason for hiding this comment

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

allez, ca sera joli, vendu :)

@@ -36,6 +36,7 @@ function getActiveThemes() {
// Default to `light` theme when the MATRIX_THEMES environment variable is not defined.
const theme = process.env.MATRIX_THEMES ?? 'light';
const themes = theme.split(',').filter(x => x).map(x => x.trim()).filter(x => x);
console.log("Active themes : ", themes)
Copy link
Contributor

Choose a reason for hiding this comment

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

A supprimer ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ben chepa vraiment, @odelcroi t'avais l'intention de le garder ? Ya pas trop de rapport avec le sujet de la PR. C'est utile ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Je supprime pour le moment, on le remettra si c'est utile.

@estellecomment
Copy link
Contributor

Bon, fin du sprint, je merge ! Ya encore du travail, donc je vais mettre des todo dans l'issue correspondante.

@estellecomment estellecomment marked this pull request as ready for review April 25, 2022 15:54
@estellecomment estellecomment merged commit 5ed99d7 into develop_tchap Apr 25, 2022
@odelcroi odelcroi deleted the feat/46_create_room branch March 31, 2023 15:53
MarcWadai pushed a commit that referenced this pull request Dec 2, 2024
Co-authored-by: dbkr <986903+dbkr@users.noreply.github.com>
(cherry picked from commit 3256499d4bacbf8cb527c1261c65f805de346c53)
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