@@ -471,30 +471,20 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
|
||||
refresh: function (callback) {
|
||||
callback = typeof callback === 'function' ? callback : function (error) { if (error) return console.error(error); };
|
||||
|
||||
Client.getMailboxes($scope.domain.domain, $scope.mailboxes.search, $scope.mailboxes.currentPage, $scope.mailboxes.perPage, function (error, mailboxes) {
|
||||
Client.listMailboxes($scope.domain.domain, $scope.mailboxes.search, $scope.mailboxes.currentPage, $scope.mailboxes.perPage, function (error, mailboxes) {
|
||||
if (error) return callback(error);
|
||||
|
||||
mailboxes.forEach(function (m) {
|
||||
m.owner = $scope.owners.find(function (o) { return o.id === m.ownerId; }); // owner may not exist
|
||||
m.ownerDisplayName = m.owner ? m.owner.display : ''; // this meta property is set when we get the user list
|
||||
|
||||
var u = $scope.diskUsage[m.name + '@' + m.domain]; // this is unset when no emails have been received yet
|
||||
m.usage = (u && u.size) || 0;
|
||||
});
|
||||
|
||||
$scope.mailboxes.mailboxes = mailboxes;
|
||||
|
||||
async.eachSeries(mailboxes, function (m, iteratorCallback) {
|
||||
Client.getAliases(m.name, m.domain, function (error, aliases) {
|
||||
if (error) return iteratorCallback(error);
|
||||
|
||||
m.aliases = aliases;
|
||||
m.owner = $scope.owners.find(function (o) { return o.id === m.ownerId; }); // owner may not exist
|
||||
m.ownerDisplayName = m.owner ? m.owner.display : ''; // this meta property is set when we get the user list
|
||||
iteratorCallback();
|
||||
});
|
||||
}, function iteratorDone(error) {
|
||||
if (error) return callback(error);
|
||||
|
||||
$scope.mailboxes.mailboxes.forEach(function (m) {
|
||||
var u = $scope.diskUsage[m.name + '@' + m.domain]; // this is unset when no emails have been received yet
|
||||
m.usage = (u && u.size) || 0;
|
||||
});
|
||||
|
||||
callback();
|
||||
});
|
||||
callback();
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user