Skip to content

Commit

Permalink
Merge pull request #10123 from RocketChat/livechat-support-agents-pho…
Browse files Browse the repository at this point in the history
…ne-fields

[NEW] Support for agent's phone field
  • Loading branch information
rodrigok committed Mar 26, 2018
2 parents 79db195 + 06931ec commit 7bedc04
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/rocketchat-livechat/.app/client/views/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ Template.messages.helpers({
agentData.email = agent.emails[0].address;
}

if (agent.customFields && agent.customFields.phone) {
if (agent.phone && agent.phone.length > 0) {
agentData.phone = agent.phone[0].phoneNumber;
} else if (agent.customFields && agent.customFields.phone) {
agentData.phone = agent.customFields.phone;
}

Expand Down
1 change: 1 addition & 0 deletions packages/rocketchat-livechat/server/models/Users.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ RocketChat.models.Users.getAgentInfo = function(agentId) {
fields: {
name: 1,
username: 1,
phone: 1,
customFields: 1
}
};
Expand Down

0 comments on commit 7bedc04

Please sign in to comment.