Skip to content

[IMPROVE] Add possibility of renaming a discussion - #15122

Merged
sampaiodiego merged 3 commits into
developfrom
renaming-discussions
Sep 13, 2019
Merged

sampaiodiego merged 3 commits into
developfrom
renaming-discussions

Conversation

@MarcosSpessatto

Copy link
Copy Markdown
Contributor

Closes #14767
Closes #15032

@MarcosSpessatto MarcosSpessatto added this to the 1.4.0 milestone Aug 7, 2019

@ggazzo ggazzo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please check my review ;)

return this.update(query, update, { multi: true });
}

updateFnameByRoomId(roomId, fname) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
updateFnameByRoomId(roomId, fname) {
updateFnameByRoomId(rid, fname) {

}

updateFnameByRoomId(roomId, fname) {
const query = { rid: roomId };

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
const query = { rid: roomId };
const query = { rid };

if (settings.get('UI_Allow_room_names_with_special_chars')) {
return room.fname || room.name;
}
if (room.prid) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure, but I think this if should be the first dont you think?

const update = Rooms.setNameById(rid, slugifiedRoomName, displayName) && Subscriptions.updateNameAndAlertByRoomId(rid, slugifiedRoomName, displayName);

const itsADiscussion = Boolean(room && room.prid);
let update;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I dont like to use let, what do you think about create a function to do that?

@ggazzo ggazzo modified the milestones: 2.0.0, 2.1.0 Aug 22, 2019
@sampaiodiego sampaiodiego changed the title [FIX] Add possibility of renaming the discussion [IMPROVE] Add possibility of renaming the discussion Sep 13, 2019
@sampaiodiego
sampaiodiego merged commit bc6a399 into develop Sep 13, 2019
@sampaiodiego sampaiodiego changed the title [IMPROVE] Add possibility of renaming the discussion [IMPROVE] Add possibility of renaming a discussion Sep 13, 2019
@sampaiodiego
sampaiodiego deleted the renaming-discussions branch September 13, 2019 15:14
@sampaiodiego sampaiodiego mentioned this pull request Sep 27, 2019
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.

Renaming discussions not possible through UI (yields name instead of fname) [IMPROVE] Rename discussion

3 participants