mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-09-21 21:28:33 +00:00
@@ -131,7 +131,7 @@
|
||||
return Account.$q.when(this.$mailboxes);
|
||||
}
|
||||
else {
|
||||
return Account.$Mailbox.$find(this).then(function(data) {
|
||||
return Account.$Mailbox.$find(this, options).then(function(data) {
|
||||
_this.$mailboxes = data;
|
||||
_this.$expanded = false;
|
||||
|
||||
|
||||
@@ -81,10 +81,10 @@
|
||||
* @return a promise of the HTTP operation
|
||||
* @see {@link Account.$getMailboxes}
|
||||
*/
|
||||
Mailbox.$find = function(account) {
|
||||
Mailbox.$find = function(account, options) {
|
||||
var path, futureMailboxData;
|
||||
|
||||
if (account.fetchAll)
|
||||
if (options && options.all)
|
||||
futureMailboxData = this.$$resource.fetch(account.id.toString(), 'viewAll');
|
||||
else
|
||||
futureMailboxData = this.$$resource.fetch(account.id.toString(), 'view');
|
||||
@@ -909,14 +909,14 @@
|
||||
};
|
||||
|
||||
/**
|
||||
* @function $toggleSubscribe
|
||||
* @function $updateSubscribe
|
||||
* @memberof Mailbox.prototype
|
||||
* @desc Subscribe or unsubscribe to a mailbox
|
||||
* @desc Update mailbox subscription state with server.
|
||||
*/
|
||||
Mailbox.prototype.$toggleSubscribe = function() {
|
||||
if (this.subscribed)
|
||||
return Mailbox.$$resource.post(this.id, 'subscribe');
|
||||
Mailbox.prototype.$updateSubscribe = function() {
|
||||
var action = this.subscribed? 'subscribe' : 'unsubscribe';
|
||||
|
||||
Mailbox.$$resource.post(this.id, action);
|
||||
};
|
||||
|
||||
return Mailbox.$$resource.post(this.id, 'unsubscribe');
|
||||
};
|
||||
})();
|
||||
|
||||
@@ -210,12 +210,10 @@
|
||||
});
|
||||
vm.close = close;
|
||||
|
||||
|
||||
vm.account.$getMailboxes().then(function() {
|
||||
vm.account.$getMailboxes({ reload: true, all: true }).then(function() {
|
||||
vm.loading = false;
|
||||
});
|
||||
|
||||
|
||||
function close() {
|
||||
$mdDialog.cancel();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user