Skip to content

Conversation

@renatobecker-zz
Copy link

@RocketChat/core

Closes #2115

When a user's username has changed and that user is an Livechat agent, it's necessary to rename their username in Livechat departments.

RocketChat.models.Rooms.replaceUsernameOfUserByUserId(user._id, username);
RocketChat.models.Subscriptions.setUserUsernameByUserId(user._id, username);
RocketChat.models.Subscriptions.setNameForDirectRoomsWithOldName(previousUsername, username);
RocketChat.models.LivechatDepartmentAgents.replaceUsernameOfAgentByUserId(user._id, username);
Copy link
Member

Choose a reason for hiding this comment

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

unfortunate there is no afterSetUsername callback, which would fit best for this purpose. 😞

@sampaiodiego sampaiodiego merged commit 34e607c into develop Apr 16, 2018
@sampaiodiego sampaiodiego deleted the fix-rename-agent-username-within-livechat-departments branch April 16, 2018 23:33
@sampaiodiego sampaiodiego added this to the 0.64.0 milestone Apr 16, 2018
@rodrigok rodrigok mentioned this pull request Apr 28, 2018
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.

5 participants