Automatically mark msg as read in Mail module
This avoids an extra XHR to the server.
This commit is contained in:
parent
fcd61abc41
commit
0c9a301f25
|
@ -278,6 +278,9 @@ static NSString *mailETag = nil;
|
||||||
andJSONRepresentation: data];
|
andJSONRepresentation: data];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Mark message as read
|
||||||
|
[co addFlags: @"seen"];
|
||||||
|
|
||||||
data = [NSMutableDictionary dictionaryWithObjectsAndKeys:
|
data = [NSMutableDictionary dictionaryWithObjectsAndKeys:
|
||||||
[self attachmentAttrs], @"attachmentAttrs",
|
[self attachmentAttrs], @"attachmentAttrs",
|
||||||
[self shouldAskReceipt], @"shouldAskReceipt",
|
[self shouldAskReceipt], @"shouldAskReceipt",
|
||||||
|
|
|
@ -672,12 +672,8 @@
|
||||||
this.$futureMessageData = futureMessageData.then(function(data) {
|
this.$futureMessageData = futureMessageData.then(function(data) {
|
||||||
// Calling $timeout will force Angular to refresh the view
|
// Calling $timeout will force Angular to refresh the view
|
||||||
if (_this.isread === 0) {
|
if (_this.isread === 0) {
|
||||||
Message.$$resource.fetch(_this.$absolutePath(), 'markMessageRead').then(function() {
|
_this.isread = true;
|
||||||
Message.$timeout(function() {
|
_this.$mailbox.unseenCount--;
|
||||||
_this.isread = true;
|
|
||||||
_this.$mailbox.unseenCount--;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
return Message.$timeout(function() {
|
return Message.$timeout(function() {
|
||||||
angular.extend(_this, data);
|
angular.extend(_this, data);
|
||||||
|
|
Loading…
Reference in a new issue