mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-06-13 06:09:43 +00:00
(feat) flag/unflag messages
This commit is contained in:
committed by
Francis Lachapelle
parent
b16c17457e
commit
12c8207836
@@ -13,7 +13,13 @@
|
||||
</md-button>
|
||||
<header class="msg-header">
|
||||
<div class="msg-header-content">
|
||||
<h3 class="sg-md-title-msg" ng-bind="message.subject"><!-- subject --></h3>
|
||||
<div layout="row" layout-align="start center">
|
||||
<md-button class="iconButton" aria-label="flagged" ng-click="markAsFlaggedOrUnflagged()">
|
||||
<i ng-class="{'md-icon-star-outline' :
|
||||
!message.isflagged, 'md-icon-star': message.isflagged}"><!-- not flagged --></i>
|
||||
</md-button>
|
||||
<h3 class="sg-md-title-msg" ng-bind="message.subject"><!-- subject --></h3>
|
||||
</div>
|
||||
<div class="pseudo-input-container--compact">
|
||||
<label class="pseudo-input-label">
|
||||
<var:string label:value="From"/>
|
||||
|
||||
@@ -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