fix(Mail): correctly update quota when refreshing

This commit is contained in:
Hivert Quentin
2026-02-05 10:51:41 +01:00
parent 71d865b86a
commit af984f58c0
2 changed files with 14 additions and 1 deletions

View File

@@ -1034,6 +1034,8 @@
SOGoMailFolder *folder;
WORequest *request;
WOResponse *response;
SOGoMailAccount *account;
id quota;
int i, max;
request = [context request];
@@ -1078,13 +1080,20 @@
headers = [self getHeadersForUIDs: [changedUids subarrayWithRange: r]
inFolder: folder];
data = [NSDictionary dictionaryWithObjectsAndKeys:
data = [NSMutableDictionary dictionaryWithObjectsAndKeys:
changedUids, @"changed",
deletedUids, @"deleted",
headers, @"headers",
newSyncToken, @"syncToken",
[NSNumber numberWithUnsignedInt: [folder unseenCount]], @"unseenCount",
nil];
// We also return the inbox quota
account = [folder mailAccountFolder];
quota = [account getInboxQuota];
if (quota != nil)
[data setObject: quota forKey: @"quotas"];
response = [self responseWithStatus: 200 andJSONRepresentation: data];
}
}

View File

@@ -1234,6 +1234,10 @@
_this.updateVisibleMessages();
}
if (data.quotas) {
_this.$account.updateQuota(data.quotas);
}
Mailbox.$log.debug('mailbox ' + _this.id + ' ready');
_this.$isLoading = false;
Mailbox.$rootScope.$broadcast('listRefreshed');