MCPcopy Create free account
hub / github.com/MailCore/mailcore2 / getQuota

Method getQuota

src/core/imap/MCIMAPSession.cpp:3512–3542  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3510}
3511
3512void IMAPSession::getQuota(uint32_t *usage, uint32_t *limit, ErrorCode * pError)
3513{
3514 mailimap_quota_complete_data *quota_data;
3515
3516 int r = mailimap_quota_getquotaroot(mImap, "INBOX", &quota_data);
3517 if (r == MAILIMAP_ERROR_STREAM) {
3518 mShouldDisconnect = true;
3519 * pError = ErrorConnection;
3520 return;
3521 }
3522 else if (r == MAILIMAP_ERROR_PARSE) {
3523 mShouldDisconnect = true;
3524 * pError = ErrorParse;
3525 return;
3526 }
3527 else if (hasError(r)) {
3528 * pError = ErrorFetch;
3529 return;
3530 }
3531 for(clistiter * cur = clist_begin(quota_data->quota_list); cur != NULL; cur = clist_next(cur)) {
3532 mailimap_quota_quota_data *quota = (mailimap_quota_quota_data*)clist_content(cur);
3533 for (clistiter *cur2 = clist_begin(quota->quota_list); cur2 != NULL; cur2 = clist_next(cur2)) {
3534 mailimap_quota_quota_resource *res = (mailimap_quota_quota_resource*)clist_content(cur2);
3535 if (!strcasecmp("STORAGE", res->resource_name)) {
3536 *usage = res->usage;
3537 *limit = res->limit;
3538 }
3539 }
3540 }
3541 mailimap_quota_complete_data_free(quota_data);
3542}
3543
3544bool IMAPSession::setupIdle()
3545{

Callers 1

mainMethod · 0.80

Calls 1

hasErrorFunction · 0.85

Tested by

no test coverage detected