gdbus_cal_closed_cb (connection, TRUE, NULL, user_data);
}
-
static void
gdbus_cal_disconnect (ECal *ecal)
{
void camel_cipher_validity_free (CamelCipherValidity *validity);
/* utility functions */
-gint camel_cipher_canonical_to_stream(CamelMimePart *part,
+gint camel_cipher_canonical_to_stream
+ (CamelMimePart *part,
guint32 flags,
CamelStream *ostream,
GCancellable *cancellable,
if (match_words_message (
search->folder, uid, words,
cancellable, error))
- g_ptr_array_add(matches, (gchar *)uid);
+ g_ptr_array_add (matches, (gchar *)uid);
}
g_ptr_array_free (indexed, TRUE);
if (match_words_message (
search->folder, uid, words,
cancellable, error))
- g_ptr_array_add(matches, (gchar *)uid);
+ g_ptr_array_add (matches, (gchar *)uid);
}
}
} else {
/* TODO: cache current message incase of multiple body search terms */
/* FIXME Pass a GCancellable */
- truth = match_words_message(search->folder, camel_message_info_uid(search->current), words, NULL, error);
+ truth = match_words_message (search->folder, camel_message_info_uid (search->current), words, NULL, error);
}
camel_search_words_free (words);
}
matches = match_words_index (search, words, error);
} else {
/* FIXME Pass a GCancellable */
- matches = match_words_messages(search, words, NULL, error);
+ matches = match_words_messages (search, words, NULL, error);
}
for (j=0;j<matches->len;j++) {
g_hash_table_insert (ht, matches->pdata[j], matches->pdata[j]);
"Learning new spam messages in '%s'",
m->junk->len), full_name);
- for (i = 0; i < m->junk->len; i ++) {
+ for (i = 0; i < m->junk->len; i++) {
/* FIXME Pass a GCancellable */
CamelMimeMessage *msg = camel_folder_get_message_sync (
m->folder, m->junk->pdata[i], NULL, NULL);
"Learning new ham message in '%s'",
"Learning new ham messages in '%s'",
m->notjunk->len), full_name);
- for (i = 0; i < m->notjunk->len; i ++) {
+ for (i = 0; i < m->notjunk->len; i++) {
/* FIXME Pass a GCancellable */
CamelMimeMessage *msg = camel_folder_get_message_sync (
m->folder, m->notjunk->pdata[i], NULL, NULL);
}
/* reset junk learn flag so that we don't process it again*/
camel_folder_set_message_flags (
- folder, info->uid_changed->pdata [i],
+ folder, info->uid_changed->pdata[i],
CAMEL_MESSAGE_JUNK_LEARN, 0);
}
}
if ((polls[5].revents & G_IO_IN) &&
g_cancellable_set_error_if_cancelled (cancellable, error)) {
- gpg_ctx_op_cancel(gpg);
+ gpg_ctx_op_cancel (gpg);
return -1;
}
goto fail;
/* FIXME: move this to a common routine */
- while (!gpg_ctx_op_complete(gpg)) {
+ while (!gpg_ctx_op_complete (gpg)) {
if (gpg_ctx_op_step (gpg, cancellable, error) == -1) {
gpg_ctx_op_cancel (gpg);
goto fail;
CamelVeeFolder *vfolder;
if ((store->flags & CAMEL_STORE_VTRASH)
- && (vfolder = camel_object_bag_get(store->folders, CAMEL_VTRASH_NAME))) {
+ && (vfolder = camel_object_bag_get (store->folders, CAMEL_VTRASH_NAME))) {
camel_vee_folder_remove_folder (vfolder, folder);
g_object_unref (vfolder);
}
if ((store->flags & CAMEL_STORE_VJUNK)
- && (vfolder = camel_object_bag_get(store->folders, CAMEL_VJUNK_NAME))) {
- camel_vee_folder_remove_folder(vfolder, folder);
+ && (vfolder = camel_object_bag_get (store->folders, CAMEL_VJUNK_NAME))) {
+ camel_vee_folder_remove_folder (vfolder, folder);
g_object_unref (vfolder);
}
}
}
- if ((store->flags & CAMEL_STORE_VTRASH) && strcmp(folder_name, CAMEL_VTRASH_NAME) == 0) {
+ if ((store->flags & CAMEL_STORE_VTRASH) && strcmp (folder_name, CAMEL_VTRASH_NAME) == 0) {
folder = class->get_trash_folder_sync (store, cancellable, error);
CAMEL_CHECK_GERROR (store, get_trash_folder_sync, folder != NULL, error);
- } else if ((store->flags & CAMEL_STORE_VJUNK) && strcmp(folder_name, CAMEL_VJUNK_NAME) == 0) {
+ } else if ((store->flags & CAMEL_STORE_VJUNK) && strcmp (folder_name, CAMEL_VJUNK_NAME) == 0) {
folder = class->get_junk_folder_sync (store, cancellable, error);
CAMEL_CHECK_GERROR (store, get_junk_folder_sync, folder != NULL, error);
} else {
g_clear_error (&local_error);
if (local_error == NULL)
- cs_delete_cached_folder(store, folder_name);
+ cs_delete_cached_folder (store, folder_name);
else
g_propagate_error (error, local_error);
if (hacked_unread_folder)
camel_vee_folder_mask_event_folder_changed ((CamelVeeFolder *)mi->summary->folder, rmi->summary->folder);
- camel_folder_freeze(rmi->summary->folder);
- res = camel_message_info_set_flags(rmi, flags, set);
+ camel_folder_freeze (rmi->summary->folder);
+ res = camel_message_info_set_flags (rmi, flags, set);
((CamelVeeMessageInfo *) mi)->old_flags = camel_message_info_flags (rmi);
- camel_folder_thaw(rmi->summary->folder);
+ camel_folder_thaw (rmi->summary->folder);
if (hacked_unread_folder)
camel_vee_folder_unmask_event_folder_changed ((CamelVeeFolder *)mi->summary->folder, rmi->summary->folder);
batch = g_hash_table_new (NULL, NULL);
md = g_hash_table_lookup (batch, mi->summary->folder);
if (md == NULL) {
- md = g_malloc0(sizeof(*md));
+ md = g_malloc0 (sizeof (*md));
md->cancellable = cancellable;
md->folder = g_object_ref (mi->summary->folder);
md->uids = g_ptr_array_new ();
md->dest = dest;
if (cancellable != NULL)
g_object_ref (cancellable);
- g_hash_table_insert(batch, mi->summary->folder, md);
+ g_hash_table_insert (batch, mi->summary->folder, md);
}
tuid = uids->pdata[i];
void camel_imap_journal_uidmap_add (CamelIMAPJournal *journal,
const gchar *old_uid,
const gchar *n_uid);
-const gchar * camel_imap_journal_uidmap_lookup(CamelIMAPJournal *journal,
+const gchar * camel_imap_journal_uidmap_lookup
+ (CamelIMAPJournal *journal,
const gchar *uid);
-void camel_imap_journal_close_folders(CamelIMAPJournal *journal);
+void camel_imap_journal_close_folders
+ (CamelIMAPJournal *journal);
G_END_DECLS
imap_store->parameters |= IMAP_PARAM_SUBSCRIPTIONS;
if (camel_url_get_param (url, "override_namespace") && camel_url_get_param (url, "namespace")) {
imap_store->parameters |= IMAP_PARAM_OVERRIDE_NAMESPACE;
- g_free(imap_store->users_namespace);
+ g_free (imap_store->users_namespace);
imap_store->users_namespace = g_strdup (camel_url_get_param (url, "namespace"));
}
if (camel_url_get_param (url, "check_all"))
}
/* setup/load the store summary */
- tmp = alloca(strlen(imap_store->storage_path)+32);
+ tmp = alloca (strlen (imap_store->storage_path)+32);
sprintf(tmp, "%s/.ev-store-summary", imap_store->storage_path);
- imap_store->summary = camel_imap_store_summary_new();
- camel_store_summary_set_filename((CamelStoreSummary *)imap_store->summary, tmp);
- summary_url = camel_url_new(imap_store->base_url, NULL);
- camel_store_summary_set_uri_base((CamelStoreSummary *)imap_store->summary, summary_url);
- camel_url_free(summary_url);
- if (camel_store_summary_load((CamelStoreSummary *)imap_store->summary) == 0) {
+ imap_store->summary = camel_imap_store_summary_new ();
+ camel_store_summary_set_filename ((CamelStoreSummary *)imap_store->summary, tmp);
+ summary_url = camel_url_new (imap_store->base_url, NULL);
+ camel_store_summary_set_uri_base ((CamelStoreSummary *)imap_store->summary, summary_url);
+ camel_url_free (summary_url);
+ if (camel_store_summary_load ((CamelStoreSummary *)imap_store->summary) == 0) {
CamelImapStoreSummary *is = imap_store->summary;
if (is->namespace) {
/* if namespace has changed, clear folder list */
- if (imap_store->users_namespace && strcmp(imap_store->users_namespace, is->namespace->full_name) != 0) {
- camel_store_summary_clear((CamelStoreSummary *)is);
+ if (imap_store->users_namespace && strcmp (imap_store->users_namespace, is->namespace->full_name) != 0) {
+ camel_store_summary_clear ((CamelStoreSummary *)is);
}
}
imap_store->capabilities = is->capabilities;
- imap_set_server_level(imap_store);
+ imap_set_server_level (imap_store);
}
return TRUE;
/* folder_name is path name */
static CamelFolderInfo *
-imap_build_folder_info(CamelImapStore *imap_store, const gchar *folder_name)
+imap_build_folder_info (CamelImapStore *imap_store, const gchar *folder_name)
{
CamelURL *url;
const gchar *name;
CamelFolderInfo *fi;
fi = camel_folder_info_new ();
- fi->full_name = g_strdup(folder_name);
+ fi->full_name = g_strdup (folder_name);
fi->unread = -1;
fi->total = -1;
g_free (url->path);
url->path = g_strdup_printf ("/%s", folder_name);
fi->uri = camel_url_to_string (url, CAMEL_URL_HIDE_ALL);
- camel_url_free(url);
+ camel_url_free (url);
name = strrchr (fi->full_name, '/');
if (name == NULL)
name = fi->full_name;
CamelFolderInfo *fi;
CamelStoreInfo *si;
- si = camel_store_summary_path((CamelStoreSummary *)imap_store->summary, folder_name);
+ si = camel_store_summary_path ((CamelStoreSummary *)imap_store->summary, folder_name);
if (si) {
if (si->flags & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED) {
si->flags &= ~CAMEL_STORE_INFO_FOLDER_SUBSCRIBED;
- camel_store_summary_touch((CamelStoreSummary *)imap_store->summary);
- camel_store_summary_save((CamelStoreSummary *)imap_store->summary);
+ camel_store_summary_touch ((CamelStoreSummary *)imap_store->summary);
+ camel_store_summary_save ((CamelStoreSummary *)imap_store->summary);
}
- camel_store_summary_info_free((CamelStoreSummary *)imap_store->summary, si);
+ camel_store_summary_info_free ((CamelStoreSummary *)imap_store->summary, si);
}
if (imap_store->renaming) {
}
- fi = imap_build_folder_info(imap_store, folder_name);
+ fi = imap_build_folder_info (imap_store, folder_name);
camel_store_folder_unsubscribed (CAMEL_STORE (imap_store), fi);
camel_folder_info_free (fi);
camel_imap_message_cache_delete (folder_dir, NULL);
state_file = g_strdup_printf("%s/subfolders", folder_dir);
- g_rmdir(state_file);
- g_free(state_file);
+ g_rmdir (state_file);
+ g_free (state_file);
g_rmdir (folder_dir);
g_free (folder_dir);
event:
- camel_store_summary_remove_path((CamelStoreSummary *)imap_store->summary, folder_name);
- camel_store_summary_save((CamelStoreSummary *)imap_store->summary);
+ camel_store_summary_remove_path ((CamelStoreSummary *)imap_store->summary, folder_name);
+ camel_store_summary_save ((CamelStoreSummary *)imap_store->summary);
- fi = imap_build_folder_info(imap_store, folder_name);
+ fi = imap_build_folder_info (imap_store, folder_name);
camel_store_folder_deleted (CAMEL_STORE (imap_store), fi);
camel_folder_info_free (fi);
}
}
}
- if (camel_debug_flag(conman))
+ if (camel_debug_flag (conman))
g_assert (!(con_man->priv->n_connections == g_slist_length (con_man->priv->connections) && !conn));
CON_UNLOCK (con_man);
gint imapx_uidset_done (struct _uidset_state *ss, struct _CamelIMAPXCommand *ic);
gint imapx_uidset_add (struct _uidset_state *ss, struct _CamelIMAPXCommand *ic, const gchar *uid);
static gboolean imapx_command_idle_stop (CamelIMAPXServer *is, GError **error);
-static gint imapx_continuation(CamelIMAPXServer *imap, gboolean litplus, GCancellable *cancellable, GError **error);
+static gint imapx_continuation (CamelIMAPXServer *imap, gboolean litplus, GCancellable *cancellable, GError **error);
static gboolean imapx_disconnect (CamelIMAPXServer *is);
static gint imapx_uid_cmp (gconstpointer ap, gconstpointer bp, gpointer data);
struct _CamelIMAPXJob *job;
};
-CamelIMAPXCommand *camel_imapx_command_new(CamelIMAPXServer *is, const gchar *name, CamelFolder *select, GCancellable *cancellable, const gchar *fmt, ...);
-void camel_imapx_command_add(CamelIMAPXCommand *ic, const gchar *fmt, ...);
-void camel_imapx_command_free(CamelIMAPXCommand *ic);
-void camel_imapx_command_close(CamelIMAPXCommand *ic);
+CamelIMAPXCommand *camel_imapx_command_new (CamelIMAPXServer *is, const gchar *name, CamelFolder *select, GCancellable *cancellable, const gchar *fmt, ...);
+void camel_imapx_command_add (CamelIMAPXCommand *ic, const gchar *fmt, ...);
+void camel_imapx_command_free (CamelIMAPXCommand *ic);
+void camel_imapx_command_close (CamelIMAPXCommand *ic);
static gboolean imapx_is_command_queue_empty (CamelIMAPXServer *is);
/* states for the connection? */
static void imapx_command_copy_messages_step_done (CamelIMAPXServer *is, CamelIMAPXCommand *ic);
static gint imapx_refresh_info_uid_cmp (gconstpointer ap, gconstpointer bp);
static gint imapx_uids_array_cmp (gconstpointer ap, gconstpointer bp);
-static gboolean imapx_server_sync_changes(CamelIMAPXServer *is, CamelFolder *folder, gint pri, GCancellable *cancellable, GError **error);
+static gboolean imapx_server_sync_changes (CamelIMAPXServer *is, CamelFolder *folder, gint pri, GCancellable *cancellable, GError **error);
enum _idle_state {
IMAPX_IDLE_OFF,
#define SSL_PORT_FLAGS (CAMEL_TCP_STREAM_SSL_ENABLE_SSL2 | CAMEL_TCP_STREAM_SSL_ENABLE_SSL3)
#define STARTTLS_FLAGS (CAMEL_TCP_STREAM_SSL_ENABLE_TLS)
-static gboolean imapx_select(CamelIMAPXServer *is, CamelFolder *folder, gboolean force, GCancellable *cancellable, GError **error);
+static gboolean imapx_select (CamelIMAPXServer *is, CamelFolder *folder, gboolean force, GCancellable *cancellable, GError **error);
G_DEFINE_TYPE (CamelIMAPXServer, camel_imapx_server, CAMEL_TYPE_OBJECT)
if (cancellable != NULL)
g_object_ref (cancellable);
- ic = g_malloc0(sizeof(*ic));
+ ic = g_malloc0 (sizeof (*ic));
ic->tag = tag++;
ic->name = name;
ic->mem = (CamelStreamMem *)camel_stream_mem_new ();
while (imap->literal == ic &&
ic->current->type & CAMEL_IMAPX_COMMAND_LITERAL_PLUS) {
/* Sent LITERAL+ continuation immediately */
- if (!imapx_continuation(imap, TRUE, ic->cancellable, &ic->error))
+ if (!imapx_continuation (imap, TRUE, ic->cancellable, &ic->error))
goto err;
}
we were waiting for this continuation. Send DONE
immediately. */
if (!imapx_command_idle_stop (imap, error)) {
- IDLE_UNLOCK(imap->idle);
+ IDLE_UNLOCK (imap->idle);
return -1;
}
imap->idle->state = IMAPX_IDLE_OFF;
QUEUE_LOCK (imap);
imap->literal = NULL;
imapx_command_start_next (imap, cancellable, error);
- QUEUE_UNLOCK(imap);
+ QUEUE_UNLOCK (imap);
return 1;
}
if (camel_imapx_stream_text (imap->stream, &token, cancellable, error))
return -1;
-
+
resp = camel_sasl_challenge_base64_sync (
(CamelSasl *) cp->ob, (const gchar *) token,
cancellable, error);
- g_free(token);
+ g_free (token);
if (resp == NULL)
return -1;
c(imap->tagprefix, "got auth continuation, feeding token '%s' back to auth mech\n", resp);
imap->literal = newliteral;
if (!litplus)
- imapx_command_start_next(imap, cancellable, error);
- QUEUE_UNLOCK(imap);
+ imapx_command_start_next (imap, cancellable, error);
+ QUEUE_UNLOCK (imap);
return 1;
}
if (ic->complete)
ic->complete (imap, ic);
- QUEUE_LOCK(imap);
- imapx_command_start_next(imap, cancellable, error);
- QUEUE_UNLOCK(imap);
+ QUEUE_LOCK (imap);
+ imapx_command_start_next (imap, cancellable, error);
+ QUEUE_UNLOCK (imap);
return 1;
}
ic = camel_imapx_command_new (
is, "CAPABILITY", NULL,
cancellable, "CAPABILITY");
- imapx_command_run(is, ic);
+ imapx_command_run (is, ic);
if (ic->error != NULL || ic->status->result != IMAPX_OK) {
if (ic->error == NULL)
ic = camel_imapx_command_new (
is, "FETCH", job->folder, job->cancellable,
"UID FETCH %s:* (UID FLAGS)", uid);
- imapx_uidset_init(&job->u.refresh_info.uidset, BATCH_FETCH_COUNT, 0);
- job->u.refresh_info.infos = g_array_new (0, 0, sizeof(struct _refresh_info));
+ imapx_uidset_init (&job->u.refresh_info.uidset, BATCH_FETCH_COUNT, 0);
+ job->u.refresh_info.infos = g_array_new (0, 0, sizeof (struct _refresh_info));
ic->pri = job->pri;
ic->complete = imapx_command_step_fetch_done;
} else {
goto done;
} else {
/* Or maybe just NOOP, unless we're in IDLE in which case do nothing */
- if (!imapx_idle_supported(is) || !imapx_in_idle(is)) {
+ if (!imapx_idle_supported (is) || !imapx_in_idle (is)) {
if (!camel_imapx_server_noop (is, folder, job->cancellable, &job->error))
goto done;
}
ic = camel_imapx_command_new (
is, "STATUS", NULL, job->cancellable,
"STATUS %f (MESSAGES UNSEEN UIDVALIDITY UIDNEXT)", folder);
-
+
ic->job = job;
ic->pri = job->pri;
job->type = IMAPX_JOB_REFRESH_INFO;
job->start = imapx_job_refresh_info_start;
job->folder = folder;
- job->u.refresh_info.changes = camel_folder_change_info_new();
+ job->u.refresh_info.changes = camel_folder_change_info_new ();
job->pri = IMAPX_PRIORITY_REFRESH_INFO;
if (g_ascii_strcasecmp(full_name, "INBOX") == 0)
{
CamelIMAPXServer *server = NULL;
- if (camel_operation_cancel_check(NULL)) {
+ if (camel_operation_cancel_check (NULL)) {
g_set_error (error, G_IO_ERROR, G_IO_ERROR_CANCELLED,
_("Cancelled"));
return NULL;
success = camel_imapx_server_manage_subscription (
server, folder_name, TRUE, cancellable, error);
- g_object_unref(server);
+ g_object_unref (server);
if (success)
imapx_mark_folder_subscribed (istore, folder_name, emit_signal);
success = camel_imapx_server_manage_subscription (
server, folder_name, FALSE, cancellable, error);
- g_object_unref(server);
+ g_object_unref (server);
if (success)
imapx_unmark_folder_subscribed (istore, folder_name, emit_signal);
istore->last_refresh_time = time (NULL);
m = camel_session_thread_msg_new (((CamelService *)store)->session, &imapx_refresh_ops, sizeof (*m));
m->store = g_object_ref (store);
- camel_session_thread_queue(((CamelService *)store)->session, &m->msg, 0);
+ camel_session_thread_queue (((CamelService *)store)->session, &m->msg, 0);
}
fi = get_folder_info_offline (store, top, flags, error);
CamelStream parent;
CamelStream *source;
- char tagprefix; /* For debugging output */
+ gchar tagprefix; /* For debugging output */
/*int state;*/
guchar *buf, *ptr, *end;
/*
capability_data ::= "CAPABILITY" SPACE [1#capability SPACE] "IMAP4rev1"
- [SPACE 1#capability]
+ [SPACE 1#capability]
;; IMAP4rev1 servers which offer RFC 1730
;; compatibility MUST list "IMAP4" as the first
;; capability.
;; revisions of this specification.
body_ext_1part ::= body_fld_md5[SPACE body_fld_dsp
- [SPACE body_fld_lang
- [SPACE 1#body_extension]]]
+ [SPACE body_fld_lang
+ [SPACE 1#body_extension]]]
;; MUST NOT be returned on non-extensible
;; "BODY" fetch
body_ext_mpart ::= body_fld_param
- [SPACE body_fld_dsp SPACE body_fld_lang
- [SPACE 1#body_extension]]
+ [SPACE body_fld_dsp SPACE body_fld_lang
+ [SPACE 1#body_extension]]
;; MUST NOT be returned on non-extensible
;; "BODY" fetch
body_fld_param ::= "(" 1#(string SPACE string) ")" / nil
body_type_1part ::= (body_type_basic / body_type_msg / body_type_text)
- [SPACE body_ext_1part]
+ [SPACE body_ext_1part]
body_type_basic ::= media_basic SPACE body_fields
;; MESSAGE subtype MUST NOT be "RFC822"
body_type_mpart ::= 1*body SPACE media_subtype
- [SPACE body_ext_mpart]
+ [SPACE body_ext_mpart]
body_type_msg ::= media_message SPACE body_fields SPACE envelope
SPACE body SPACE body_fld_lines
;; Defined in[MIME-IMT]
( "type" "subtype" body_fields [envelope body body_fld_lines]
- [body_fld_lines]
+ [body_fld_lines]
(("TEXT" "PLAIN" ("CHARSET"
"US-ASCII") NIL NIL "7BIT" 1152 23)("TEXT" "PLAIN"
/* although the grammars are different, they can be parsed the same way */
/* body_ext_1part ::= body_fld_md5 [SPACE body_fld_dsp
- [SPACE body_fld_lang
- [SPACE 1#body_extension]]]
+ [SPACE body_fld_lang
+ [SPACE 1#body_extension]]]
;; MUST NOT be returned on non-extensible
;; "BODY" fetch */
/* body_ext_mpart ::= body_fld_param
- [SPACE body_fld_dsp SPACE body_fld_lang
- [SPACE 1#body_extension]]
+ [SPACE body_fld_dsp SPACE body_fld_lang
+ [SPACE 1#body_extension]]
;; MUST NOT be returned on non-extensible
;; "BODY" fetch */
camel_imapx_stream_ungettoken (is, tok, token, len);
if (tok == '(') {
/* body_type_mpart ::= 1*body SPACE media_subtype
- [SPACE body_ext_mpart] */
+ [SPACE body_ext_mpart] */
cinfo = g_malloc0 (sizeof (*cinfo));
last = (struct _CamelMessageContentInfo *)&cinfo->childs;
cinfo->type = camel_content_type_new("multipart", (gchar *) token);
/* body_ext_mpart ::= body_fld_param
- [SPACE body_fld_dsp SPACE body_fld_lang
- [SPACE 1#body_extension]]
+ [SPACE body_fld_dsp SPACE body_fld_lang
+ [SPACE 1#body_extension]]
;; MUST NOT be returned on non-extensible
;; "BODY" fetch */
}
} else {
/* body_type_1part ::= (body_type_basic / body_type_msg / body_type_text)
- [SPACE body_ext_1part]
+ [SPACE body_ext_1part]
body_type_basic ::= media_basic SPACE body_fields
body_type_text ::= media_text SPACE body_fields SPACE body_fld_lines
camel_imapx_stream_ungettoken (is, tok, token, len);
/* body_ext_1part ::= body_fld_md5 [SPACE body_fld_dsp
- [SPACE body_fld_lang
- [SPACE 1#body_extension]]]
+ [SPACE body_fld_lang
+ [SPACE 1#body_extension]]]
;; MUST NOT be returned on non-extensible
;; "BODY" fetch */
#define camel_debug_flag(type) (camel_imapx_debug_flags & CAMEL_IMAPX_DEBUG_ALL & CAMEL_IMAPX_DEBUG_ ## type)
#define camel_imapx_debug(type, tagprefix, fmt, ...) do { \
- if (camel_debug_flag(type)) \
+ if (camel_debug_flag (type)) \
printf("[imapx:%c] " fmt, tagprefix , ##__VA_ARGS__); \
} while (0)
CamelPOP3Folder *folder = data;
do {
- ret = camel_pop3_stream_line(stream, &line, &len);
+ ret = camel_pop3_stream_line (stream, &line, &len);
if (ret>=0) {
- if (strlen((gchar *) line) > 1024)
+ if (strlen ((gchar *) line) > 1024)
line[1024] = 0;
if (sscanf((gchar *) line, "%u %s", &id, uid) == 2) {
- fi = g_hash_table_lookup(folder->uids_id, GINT_TO_POINTER(id));
+ fi = g_hash_table_lookup (folder->uids_id, GINT_TO_POINTER (id));
if (fi) {
camel_operation_progress (NULL, (fi->index+1) * 100 / folder->uids->len);
- fi->uid = g_strdup(uid);
- g_hash_table_insert(folder->uids_uid, fi->uid, fi);
+ fi->uid = g_strdup (uid);
+ g_hash_table_insert (folder->uids_uid, fi->uid, fi);
} else {
g_warning("ID %u (uid: %s) not in previous LIST output", id, uid);
}
if ((n = camel_stream_write (fi->stream, "*", 1, NULL, NULL)) == -1)
goto done;
- while ((n = camel_stream_read((CamelStream *)stream, buffer, sizeof(buffer), NULL, NULL)) > 0) {
- n = camel_stream_write(fi->stream, buffer, n, NULL, NULL);
+ while ((n = camel_stream_read ((CamelStream *)stream, buffer, sizeof (buffer), NULL, NULL)) > 0) {
+ n = camel_stream_write (fi->stream, buffer, n, NULL, NULL);
if (n == -1)
break;
if (w > fi->size)
w = fi->size;
if (fi->size != 0)
- camel_operation_progress(NULL, (w * 100) / fi->size);
+ camel_operation_progress (NULL, (w * 100) / fi->size);
}
/* it all worked, output a '#' to say we're a-ok */
if (n != -1) {
- camel_stream_reset(fi->stream, NULL);
+ camel_stream_reset (fi->stream, NULL);
n = camel_stream_write(fi->stream, "#", 1, NULL, NULL);
}
done:
pop3_folder_get_uids (CamelFolder *folder)
{
CamelPOP3Folder *pop3_folder = CAMEL_POP3_FOLDER (folder);
- GPtrArray *uids = g_ptr_array_new();
+ GPtrArray *uids = g_ptr_array_new ();
CamelPOP3FolderInfo **fi = (CamelPOP3FolderInfo **)pop3_folder->uids->pdata;
gint i;
for (i=0;i<pop3_folder->uids->len;i++,fi++) {
if (fi[0]->uid)
- g_ptr_array_add(uids, fi[0]->uid);
+ g_ptr_array_add (uids, fi[0]->uid);
}
return uids;
pop3_folder = CAMEL_POP3_FOLDER (folder);
pop3_store = CAMEL_POP3_STORE (parent_store);
- fi = g_hash_table_lookup(pop3_folder->uids_uid, uid);
+ fi = g_hash_table_lookup (pop3_folder->uids_uid, uid);
if (fi == NULL) {
g_set_error (
error, CAMEL_FOLDER_ERROR,
pop3_folder = CAMEL_POP3_FOLDER (folder);
pop3_store = CAMEL_POP3_STORE (parent_store);
- temp = time(&temp);
+ temp = time (&temp);
d(printf("%s(%d): pop3_folder->uids->len=[%d]\n", __FILE__, __LINE__, pop3_folder->uids->len));
for (i = 0; i < pop3_folder->uids->len; i++) {
}
if (message_time) {
- gdouble time_diff = difftime(temp,message_time);
+ gdouble time_diff = difftime (temp,message_time);
gint day_lag = time_diff/(60*60*24);
d(printf("%s(%d): message_time= [%ld]\n", __FILE__, __LINE__, message_time));
if (day_lag > days_to_delete) {
if (fi->cmd) {
- while (camel_pop3_engine_iterate(pop3_store->engine, fi->cmd) > 0) {
+ while (camel_pop3_engine_iterate (pop3_store->engine, fi->cmd) > 0) {
; /* do nothing - iterating until end */
}
- camel_pop3_engine_command_free(pop3_store->engine, fi->cmd);
+ camel_pop3_engine_command_free (pop3_store->engine, fi->cmd);
fi->cmd = NULL;
}
d(printf("%s(%d): Deleting old messages\n", __FILE__, __LINE__));
- fi->cmd = camel_pop3_engine_command_new(pop3_store->engine,
+ fi->cmd = camel_pop3_engine_command_new (pop3_store->engine,
0,
NULL,
NULL,
fi = pop3_folder->uids->pdata[i];
/* wait for delete commands to finish */
if (fi->cmd) {
- while (camel_pop3_engine_iterate(pop3_store->engine, fi->cmd) > 0)
+ while (camel_pop3_engine_iterate (pop3_store->engine, fi->cmd) > 0)
;
- camel_pop3_engine_command_free(pop3_store->engine, fi->cmd);
+ camel_pop3_engine_command_free (pop3_store->engine, fi->cmd);
fi->cmd = NULL;
}
camel_operation_progress (
/* If we dont get continuation, or the sasl object's run out of work, or we dont get a challenge,
its a protocol error, so fail, and try reset the server */
if (strncmp((gchar *) line, "+ ", 2) != 0
- || camel_sasl_get_authenticated(sasl)
+ || camel_sasl_get_authenticated (sasl)
|| (resp = (guchar *) camel_sasl_challenge_base64_sync (sasl, (const gchar *) line+2, cancellable, NULL)) == NULL) {
camel_stream_printf((CamelStream *)stream, "*\r\n");
camel_pop3_stream_line (stream, &line, &len);
l = store->engine->auth;
while (l) {
auth = l->data;
- if (strcmp(auth->authproto, service->url->authmech) == 0)
+ if (strcmp (auth->authproto, service->url->authmech) == 0)
return try_sasl (
store, service->url->authmech,
cancellable, error);
* Author: Federico Mena-Quintero <federico@novell.com>
*/
-
#ifndef E_DEBUG_LOG_H
#define E_DEBUG_LOG_H