aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-ops.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r--mail/mail-ops.c38
1 files changed, 10 insertions, 28 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index 340890c8eb..0526084016 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -1688,37 +1688,16 @@ mail_refresh_folder (CamelFolder *folder, void (*done) (CamelFolder *folder, gpo
/* ******************************************************************************** */
static gboolean
-folder_is_from_source_url (CamelFolder *folder, const gchar *source_url)
+folder_is_from_source_uid (CamelFolder *folder,
+ const gchar *source_uid)
{
CamelStore *store;
- CamelService *service;
- CamelProvider *provider;
- CamelURL *service_url;
- CamelURL *url;
- gboolean res = FALSE;
-
- g_return_val_if_fail (folder != NULL, FALSE);
- g_return_val_if_fail (source_url != NULL, FALSE);
+ const gchar *uid;
store = camel_folder_get_parent_store (folder);
- g_return_val_if_fail (store != NULL, FALSE);
-
- service = CAMEL_SERVICE (store);
- g_return_val_if_fail (service != NULL, FALSE);
+ uid = camel_service_get_uid (CAMEL_SERVICE (store));
- provider = camel_service_get_provider (service);
- g_return_val_if_fail (provider != NULL, FALSE);
- g_return_val_if_fail (provider->url_equal != NULL, FALSE);
-
- url = camel_url_new (source_url, NULL);
- g_return_val_if_fail (url != NULL, FALSE);
-
- service_url = camel_service_get_camel_url (service);
- res = provider->url_equal (service_url, url);
-
- camel_url_free (url);
-
- return res;
+ return (g_strcmp0 (uid, source_uid) == 0);
}
/* This is because pop3 accounts are hidden under local Inbox, thus whenever an expunge
@@ -1795,8 +1774,11 @@ expunge_pop3_stores (CamelFolder *expunging, EMailSession *session, GCancellable
if (uids) {
for (i = 0; i < uids->len; i++) {
/* ensure the ID is from this account, as it's generated by evolution */
- const gchar *source_url = g_hash_table_lookup (expunging_uids, uids->pdata[i]);
- if (source_url && folder_is_from_source_url (folder, source_url)) {
+ const gchar *source_uid;
+
+ source_uid = g_hash_table_lookup (
+ expunging_uids, uids->pdata[i]);
+ if (folder_is_from_source_uid (folder, source_uid)) {
any_found = TRUE;
camel_folder_delete_message (folder, uids->pdata[i]);
}