aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-send-recv.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2005-07-21 12:15:21 +0800
committerMichael Zucci <zucchi@src.gnome.org>2005-07-21 12:15:21 +0800
commit1b8003c1768fa6a0d33a91f0637fc99fe0801ae8 (patch)
tree68e39aba1aa97e5537332c83eace7ce682e5defa /mail/mail-send-recv.c
parenta86713990d993da394f11a4c22a34d1d7876267a (diff)
downloadgsoc2013-evolution-1b8003c1768fa6a0d33a91f0637fc99fe0801ae8.tar.gz
gsoc2013-evolution-1b8003c1768fa6a0d33a91f0637fc99fe0801ae8.tar.zst
gsoc2013-evolution-1b8003c1768fa6a0d33a91f0637fc99fe0801ae8.zip
if we get a null default, then set "" on the entry. (emae_option_entry):
2005-07-21 Not Zed <NotZed@Ximian.com> * em-account-editor.c (emae_option_entry): if we get a null default, then set "" on the entry. (emae_option_entry): set the default value on the url if it doesn't exist already. 2005-07-20 Not Zed <NotZed@Ximian.com> * mail-send-recv.c (refresh_folders_desc, refresh_folders_get) (refresh_folders_got, refresh_folders_free, get_folders) (receive_update_got_folderinfo, receive_update_got_store): refresh all the folders manually and directly. * mail-folder-cache.c (setup_folder): propagate even -1 unread counts, they get ignored later. * em-composer-utils.c (emu_handle_receipt_message) (em_utils_handle_receipt): use getmessagex too, so we can always clear any error. * em-folder-view.c (emfv_message_selected_timeout) (emfv_list_done_message_selected): use getmessagex and do something meaninful with the error. * mail-ops.c (mail_get_messagex): added new get message which returns an exception. 2005-07-19 Not Zed <NotZed@Ximian.com> * mail-tools.c (mail_tool_uri_to_folder): dont get the service connected, it will connect if it needs to. * mail-ops.c (get_folderinfo_get): * em-folder-utils.c (emft_copy_folders__copy) (emfu_delete_folders): * em-folder-tree.c (emft_get_folder_info__get): Always request subscribed folders, if the backend doesn't implement it it will ignore it. 2005-07-13 Not Zed <NotZed@Ximian.com> * mail-send-recv.c (mail_autoreceive_init, auto_online): listen to session online events, and if we are online, trigger an auto-receive of all auto-check accounts. 2005-07-11 Not Zed <NotZed@Ximian.com> * mail-send-recv.c (auto_account_commit): force an update immediately if we're setting up the timeout to start with. * em-folder-tree-model.c (em_folder_tree_model_set_unread_count): noop if the unread count < 0. (em_folder_tree_model_set_folder_info): only set the unread count if we actually have one. * em-folder-tree.c (emft_tree_row_expanded): get the folder list 'fast'. * mail-ops.c (get_folderinfo_get): get the folder list 'fast'. svn path=/trunk/; revision=29822
Diffstat (limited to 'mail/mail-send-recv.c')
-rw-r--r--mail/mail-send-recv.c113
1 files changed, 110 insertions, 3 deletions
diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c
index 71d8337357..708826226d 100644
--- a/mail/mail-send-recv.c
+++ b/mail/mail-send-recv.c
@@ -683,10 +683,97 @@ receive_get_folder(CamelFilterDriver *d, const char *uri, void *data, CamelExcep
return folder;
}
+/* ********************************************************************** */
+
+struct _refresh_folders_msg {
+ struct _mail_msg msg;
+
+ struct _send_info *info;
+ GPtrArray *folders;
+ CamelStore *store;
+};
+
+static char *
+refresh_folders_desc (struct _mail_msg *mm, int done)
+{
+ return g_strdup_printf(_("Checking for new mail"));
+}
+
+static void
+refresh_folders_get (struct _mail_msg *mm)
+{
+ struct _refresh_folders_msg *m = (struct _refresh_folders_msg *)mm;
+ int i;
+ CamelFolder *folder;
+
+ for (i=0;i<m->folders->len;i++) {
+ folder = mail_tool_uri_to_folder(m->folders->pdata[i], 0, NULL);
+ if (folder) {
+ camel_folder_refresh_info(folder, NULL);
+ camel_object_unref(folder);
+ }
+ if (camel_operation_cancel_check(m->info->cancel))
+ break;
+ }
+}
+
+static void
+refresh_folders_got (struct _mail_msg *mm)
+{
+ struct _refresh_folders_msg *m = (struct _refresh_folders_msg *)mm;
+
+ receive_done("", m->info);
+}
+
+static void
+refresh_folders_free (struct _mail_msg *mm)
+{
+ struct _refresh_folders_msg *m = (struct _refresh_folders_msg *)mm;
+ int i;
+
+ for (i=0;i<m->folders->len;i++)
+ g_free(m->folders->pdata[i]);
+ g_ptr_array_free(m->folders, TRUE);
+ camel_object_unref(m->store);
+}
+
+static struct _mail_msg_op refresh_folders_op = {
+ refresh_folders_desc,
+ refresh_folders_get,
+ refresh_folders_got,
+ refresh_folders_free,
+};
+
+static void
+get_folders(GPtrArray *folders, CamelFolderInfo *info)
+{
+ while (info) {
+ g_ptr_array_add(folders, g_strdup(info->uri));
+ get_folders(folders, info->child);
+ info = info->next;
+ }
+}
+
static void
-receive_update_got_folderinfo (CamelStore *store, CamelFolderInfo *info, void *data)
+receive_update_got_folderinfo(CamelStore *store, CamelFolderInfo *info, void *data)
{
- receive_done ("", data);
+ if (info) {
+ GPtrArray *folders = g_ptr_array_new();
+ struct _refresh_folders_msg *m;
+ struct _send_info *sinfo = data;
+
+ get_folders(folders, info);
+
+ m = mail_msg_new(&refresh_folders_op, NULL, sizeof(*m));
+ m->store = store;
+ camel_object_ref(store);
+ m->folders = folders;
+ m->info = sinfo;
+
+ e_thread_put(mail_thread_new, (EMsg *)m);
+ } else {
+ receive_done ("", data);
+ }
}
static void
@@ -697,7 +784,7 @@ receive_update_got_store (char *uri, CamelStore *store, void *data)
if (store) {
mail_note_store(store, info->cancel, receive_update_got_folderinfo, info);
} else {
- receive_done ("", info);
+ receive_done("", info);
}
}
@@ -849,6 +936,24 @@ auto_account_changed(EAccountList *eal, EAccount *ea, void *dummy)
auto_account_commit(info);
}
+static void
+auto_online(CamelObject *o, void *ed, void *d)
+{
+ EIterator *iter;
+ EAccountList *accounts;
+ struct _auto_data *info;
+
+ if (!GPOINTER_TO_INT(ed))
+ return;
+
+ accounts = mail_config_get_accounts ();
+ for (iter = e_list_get_iterator((EList *)accounts);e_iterator_is_valid(iter);e_iterator_next(iter)) {
+ info = g_object_get_data((GObject *)e_iterator_get(iter), "mail-autoreceive");
+ if (info && info->timeout_id)
+ auto_timeout(info);
+ }
+}
+
/* call to setup initial, and after changes are made to the config */
/* FIXME: Need a cleanup funciton for when object is deactivated */
void
@@ -869,6 +974,8 @@ mail_autoreceive_init(void)
for (iter = e_list_get_iterator((EList *)accounts);e_iterator_is_valid(iter);e_iterator_next(iter))
auto_account_added(accounts, (EAccount *)e_iterator_get(iter), NULL);
+
+ camel_object_hook_event(mail_component_peek_session(NULL), "online", auto_online, NULL);
}
/* we setup the download info's in a hashtable, if we later need to build the gui, we insert