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

[FIX] Changing Room name updates the webhook #13672

Merged
merged 3 commits into from
Mar 14, 2019

Conversation

knrt10
Copy link
Contributor

@knrt10 knrt10 commented Mar 11, 2019

Closes #8477

@MartinSchoeler @ggazzo would you please review.

@ggazzo
Copy link
Member

ggazzo commented Mar 12, 2019

@knrt10 I made a few changes, we usually create a file for each method... and its not a client concern update webhooks... please check if you agree

@ggazzo ggazzo added this to the 1.0.0 milestone Mar 12, 2019
@ggazzo ggazzo changed the title [BUG] Changing Room name updates the webhook too [FIX] Changing Room name updates the webhook too Mar 12, 2019
@ggazzo ggazzo changed the title [FIX] Changing Room name updates the webhook too [FIX] Changing Room name updates the webhook Mar 12, 2019
@knrt10
Copy link
Contributor Author

knrt10 commented Mar 12, 2019

@ggazzo totally agree with you. It would have been on server side. Looks good, intially I created method only but nothing happened, it maybe because I didn’t restart the server again. Checked after restarting, working now. 👍

@rodrigok
Copy link
Member

@knrt10 can you fix the conflicts please?

@knrt10
Copy link
Contributor Author

knrt10 commented Mar 13, 2019

Yes let me update it

@knrt10 knrt10 force-pushed the issue8477 branch 2 times, most recently from ad41520 to 0a4f607 Compare March 13, 2019 17:46
@knrt10
Copy link
Contributor Author

knrt10 commented Mar 13, 2019

@rodrigok rebased

rodrigok
rodrigok previously approved these changes Mar 13, 2019
Copy link
Member

@sampaiodiego sampaiodiego left a comment

Choose a reason for hiding this comment

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

current code is not working, that's why tests are failing on renaming channels.

please see suggested changes.

updateRoomName(oldRoomName, newRoomName) {
const hashedOldRoomName = `#${ oldRoomName }`;
const hashedNewRoomName = `#${ newRoomName }`;
const changedNumber = Integrations.update({ channel: hashedOldRoomName }, { $set: { 'channel.$': hashedNewRoomName } }, { multi: true });
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const changedNumber = Integrations.update({ channel: hashedOldRoomName }, { $set: { 'channel.$': hashedNewRoomName } }, { multi: true });
return this.update({ channel: hashedOldRoomName }, { $set: { 'channel.$': hashedNewRoomName } }, { multi: true });

const hashedOldRoomName = `#${ oldRoomName }`;
const hashedNewRoomName = `#${ newRoomName }`;
const changedNumber = Integrations.update({ channel: hashedOldRoomName }, { $set: { 'channel.$': hashedNewRoomName } }, { multi: true });
return changedNumber;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return changedNumber;

@knrt10
Copy link
Contributor Author

knrt10 commented Mar 14, 2019

@sampaiodiego updated

@sampaiodiego sampaiodiego merged commit d33d3cd into RocketChat:develop Mar 14, 2019
bhardwajaditya pushed a commit to bhardwajaditya/Rocket.Chat that referenced this pull request Mar 14, 2019
@rodrigok rodrigok mentioned this pull request Apr 28, 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.

None yet

4 participants