mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-18 06:34:53 +00:00
(feat) flag/unflag messages
This commit is contained in:
committed by
Francis Lachapelle
parent
b16c17457e
commit
12c8207836
@@ -209,6 +209,12 @@
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
/**
|
||||
* @function $addOrRemoveTag
|
||||
* @memberof Message.prototype
|
||||
* @desc Add or remove a mail tag on the current message.
|
||||
* @returns a promise of the HTTP operation
|
||||
*/
|
||||
Message.prototype.$addOrRemoveTag = function(operation, tag) {
|
||||
var data = {};
|
||||
|
||||
@@ -219,6 +225,22 @@
|
||||
return Message.$$resource.post(this.$mailbox.$id(), 'addOrRemoveLabel', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @function $markAsFlaggedOrUnflagged
|
||||
* @memberof Message.prototype
|
||||
* @desc Add or remove a the \\Flagged flag on the current message.
|
||||
* @returns a promise of the HTTP operation
|
||||
*/
|
||||
Message.prototype.$markAsFlaggedOrUnflagged = function(operation) {
|
||||
var data = {};
|
||||
|
||||
if (operation == 'add') {
|
||||
return Message.$$resource.post(this.id, 'markMessageFlagged', data);
|
||||
}
|
||||
|
||||
return Message.$$resource.post(this.id, 'markMessageUnflagged', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @function $reload
|
||||
* @memberof Message.prototype
|
||||
|
||||
@@ -245,6 +245,12 @@
|
||||
stateMessage.$addOrRemoveTag(operation, tag);
|
||||
}
|
||||
};
|
||||
$scope.markAsFlaggedOrUnflagged = function() {
|
||||
var operation = (stateMessage.isflagged ? 'remove' : 'add');
|
||||
stateMessage.$markAsFlaggedOrUnflagged(operation).then(function() {
|
||||
stateMessage.isflagged = !stateMessage.isflagged;
|
||||
});
|
||||
};
|
||||
$scope.doDelete = function() {
|
||||
stateMailbox.$deleteMessages([stateMessage.uid]).then(function() {
|
||||
// Remove card from list of addressbook
|
||||
|
||||
Reference in New Issue
Block a user