Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/3.21' into 3.21
Browse files Browse the repository at this point in the history
  • Loading branch information
JRMaitre committed Sep 28, 2015
2 parents c34c448 + 4a61d68 commit 3c2d2b2
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions submodules/users/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -2382,6 +2382,10 @@ define(function(require){
userData.caller_id.internal.number = userData.presence_id + '';
}

if(userData.timezone === 'inherit') {
delete userData.timezone;
}

delete userData.include_directory;
delete userData.features;
delete userData.extra;
Expand Down Expand Up @@ -2739,7 +2743,6 @@ define(function(require){
var self = this,
fullName = data.user.first_name + ' ' + data.user.last_name,
callerIdName = fullName.substring(0, 15),
defaultTimezone = 'inherit',
formattedData = {
user: $.extend(true, {}, {
caller_id: {
Expand All @@ -2753,13 +2756,11 @@ define(function(require){
},
presence_id: data.callflow.extension,
email: data.extra.differentEmail ? data.extra.email : data.user.username,
priv_level: 'user',
timezone: defaultTimezone
priv_level: 'user'
}, data.user),
vmbox: {
mailbox: data.callflow.extension,
name: fullName + '\'s VMBox',
timezone: defaultTimezone
name: fullName + '\'s VMBox'
},
callflow: {
contact_list: {
Expand Down Expand Up @@ -3356,6 +3357,9 @@ define(function(require){
usersUpdateVMBox: function(vmData, callback) {
var self = this;

// VMboxes should not specify any timezone in order to use the user's default.
delete vmData.timezone;

self.callApi({
resource: 'voicemail.update',
data: {
Expand Down Expand Up @@ -3861,8 +3865,7 @@ define(function(require){
var vmbox = {
owner_id: user.id,
mailbox: user.presence_id || user.extra.vmbox.mailbox,
name: user.first_name + ' ' + user.last_name + '\'s VMBox',
timezone: user.timezone
name: user.first_name + ' ' + user.last_name + '\'s VMBox'
};

self.usersCreateVMBox(vmbox, function(vmbox) {
Expand Down

0 comments on commit 3c2d2b2

Please sign in to comment.