GError *our_error = NULL;
gboolean rv = TRUE;
GTimeVal current_time;
- int results;
+ gint results;
__debug__ (G_STRFUNC);
g_return_val_if_fail (priv->service, FALSE);
g_free (xml);
/* Insert the entry on the server */
- new_entry = GDATA_ENTRY (gdata_contacts_service_insert_contact (GDATA_CONTACTS_SERVICE (priv->service), GDATA_CONTACTS_CONTACT (entry),
- NULL, &error));
+ new_entry = GDATA_ENTRY (
+ gdata_contacts_service_insert_contact (
+ GDATA_CONTACTS_SERVICE (priv->service),
+ GDATA_CONTACTS_CONTACT (entry),
+ NULL, &error));
g_object_unref (entry);
if (!new_entry) {
g_free (xml);
/* Update the contact on the server */
- new_entry = GDATA_ENTRY (gdata_contacts_service_update_contact (GDATA_CONTACTS_SERVICE (priv->service), GDATA_CONTACTS_CONTACT (entry),
- NULL, &error));
+ new_entry = GDATA_ENTRY (
+ gdata_contacts_service_update_contact (
+ GDATA_CONTACTS_SERVICE (priv->service),
+ GDATA_CONTACTS_CONTACT (entry),
+ NULL, &error));
g_object_unref (entry);
if (!new_entry) {
/* We just need to set the E_CONTACT_NAME field, and all the other name attribute values
* in the EContact will be populated automatically from that */
- name_struct.family = (gchar*) gdata_gd_name_get_family_name (name);
- name_struct.given = (gchar*) gdata_gd_name_get_given_name (name);
- name_struct.additional = (gchar*) gdata_gd_name_get_additional_name (name);
- name_struct.prefixes = (gchar*) gdata_gd_name_get_prefix (name);
- name_struct.suffixes = (gchar*) gdata_gd_name_get_suffix (name);
+ name_struct.family = (gchar *) gdata_gd_name_get_family_name (name);
+ name_struct.given = (gchar *) gdata_gd_name_get_given_name (name);
+ name_struct.additional = (gchar *) gdata_gd_name_get_additional_name (name);
+ name_struct.prefixes = (gchar *) gdata_gd_name_get_prefix (name);
+ name_struct.suffixes = (gchar *) gdata_gd_name_get_suffix (name);
e_contact_set (E_CONTACT (vcard), E_CONTACT_NAME, &name_struct);
}
g_free (rel);
__debug__ ("New %semail entry %s (%s/%s)",
- gdata_gd_email_address_is_primary (email) ? "primary " : "",
- gdata_gd_email_address_get_address (email),
- gdata_gd_email_address_get_relation_type (email),
- gdata_gd_email_address_get_label (email));
+ gdata_gd_email_address_is_primary (email) ? "primary " : "",
+ gdata_gd_email_address_get_address (email),
+ gdata_gd_email_address_get_relation_type (email),
+ gdata_gd_email_address_get_label (email));
}
return email;
g_free (protocol);
__debug__ ("New %s%s entry %s (%s/%s)",
- gdata_gd_im_address_is_primary (im) ? "primary " : "",
- gdata_gd_im_address_get_protocol (im),
- gdata_gd_im_address_get_address (im),
- gdata_gd_im_address_get_relation_type (im),
- gdata_gd_im_address_get_label (im));
+ gdata_gd_im_address_is_primary (im) ? "primary " : "",
+ gdata_gd_im_address_get_protocol (im),
+ gdata_gd_im_address_get_address (im),
+ gdata_gd_im_address_get_relation_type (im),
+ gdata_gd_im_address_get_label (im));
}
return im;
g_free (rel);
__debug__ ("New %sphone-number entry %s (%s/%s)",
- gdata_gd_phone_number_is_primary (number) ? "primary " : "",
- gdata_gd_phone_number_get_number (number),
- gdata_gd_phone_number_get_relation_type (number),
- gdata_gd_phone_number_get_label (number));
+ gdata_gd_phone_number_is_primary (number) ? "primary " : "",
+ gdata_gd_phone_number_get_number (number),
+ gdata_gd_phone_number_get_relation_type (number),
+ gdata_gd_phone_number_get_label (number));
}
return number;
g_free (rel);
__debug__ ("New %spostal address entry %s (%s/%s)",
- gdata_gd_postal_address_is_primary (address) ? "primary " : "",
- gdata_gd_postal_address_get_address (address),
- gdata_gd_postal_address_get_relation_type (address),
- gdata_gd_postal_address_get_label (address));
+ gdata_gd_postal_address_is_primary (address) ? "primary " : "",
+ gdata_gd_postal_address_get_address (address),
+ gdata_gd_postal_address_get_relation_type (address),
+ gdata_gd_postal_address_get_label (address));
/* Set the components of the address from the vCard's attribute values */
value = values;
if (!value)
return address;
- gdata_gd_postal_address_set_po_box (address, (*((gchar*) value->data) != '\0') ? value->data : NULL);
+ gdata_gd_postal_address_set_po_box (address, (*((gchar *) value->data) != '\0') ? value->data : NULL);
value = value->next;
if (!value)
return address;
- gdata_gd_postal_address_set_house_name (address, (*((gchar*) value->data) != '\0') ? value->data : NULL);
+ gdata_gd_postal_address_set_house_name (address, (*((gchar *) value->data) != '\0') ? value->data : NULL);
value = value->next;
if (!value)
return address;
- gdata_gd_postal_address_set_street (address, (*((gchar*) value->data) != '\0') ? value->data : NULL);
+ gdata_gd_postal_address_set_street (address, (*((gchar *) value->data) != '\0') ? value->data : NULL);
value = value->next;
if (!value)
return address;
- gdata_gd_postal_address_set_city (address, (*((gchar*) value->data) != '\0') ? value->data : NULL);
+ gdata_gd_postal_address_set_city (address, (*((gchar *) value->data) != '\0') ? value->data : NULL);
value = value->next;
if (!value)
return address;
- gdata_gd_postal_address_set_region (address, (*((gchar*) value->data) != '\0') ? value->data : NULL);
+ gdata_gd_postal_address_set_region (address, (*((gchar *) value->data) != '\0') ? value->data : NULL);
value = value->next;
if (!value)
return address;
- gdata_gd_postal_address_set_postcode (address, (*((gchar*) value->data) != '\0') ? value->data : NULL);
+ gdata_gd_postal_address_set_postcode (address, (*((gchar *) value->data) != '\0') ? value->data : NULL);
value = value->next;
if (!value)
return address;
- gdata_gd_postal_address_set_country (address, (*((gchar*) value->data) != '\0') ? value->data : NULL, NULL);
+ gdata_gd_postal_address_set_country (address, (*((gchar *) value->data) != '\0') ? value->data : NULL, NULL);
}
return address;
* @handle:
* Call this to update changes made to the calendar.
*
- * Returns: %TRUE if update is successful, %FALSE otherwise
+ * Returns: %TRUE if update is successful, %FALSE otherwise
**/
gpointer
e_cal_backend_google_utils_update (gpointer handle)
for (iter_list = entries_list; iter_list != NULL; iter_list = iter_list->next) {
const gchar *id;
id = gdata_entry_get_id (GDATA_ENTRY (iter_list->data));
- ids_list = g_list_prepend (ids_list, (gchar*) id);
+ ids_list = g_list_prepend (ids_list, (gchar *) id);
}
/* Find the Removed Item */
org->value = g_strconcat ("MAILTO:", gdata_gd_who_get_email_address (go_attendee), NULL);
if (gdata_gd_who_get_value_string (go_attendee))
org->cn = g_strdup (gdata_gd_who_get_value_string (go_attendee));
- }
+ }
}
-
- attendee_list = g_slist_prepend (attendee_list, attendee);
+
+ attendee_list = g_slist_prepend (attendee_list, attendee);
}
e_cal_component_set_attendee_list (comp, attendee_list);
{
icaltimetype itt;
icalproperty *prop;
- char *buf;
+ gchar *buf;
itt = icaltime_convert_to_zone (*(dt->value), default_zone);
dt->value = &itt;
ECalComponentText *t;
GSList *attendee_list = NULL, *l = NULL;
GString *recur_string;
- char *buf;
+ gchar *buf;
priv = cbgo->priv;
gchar *username;
gchar *password;
gchar *uri;
- gchar *local_attachments_store;
+ gchar *local_attachments_store;
gboolean read_only;
gboolean mode_changed;
entry = GDATA_ENTRY (e_gdata_event_from_cal_component (cbgo, comp));
if (!GDATA_IS_ENTRY (entry))
- return GNOME_Evolution_Calendar_InvalidObject;
+ return GNOME_Evolution_Calendar_InvalidObject;
updated_entry = gdata_service_insert_entry (GDATA_SERVICE (priv->service), priv->uri, entry, NULL, NULL);
g_object_unref (entry);
updated_entry = gdata_service_update_entry (GDATA_SERVICE (priv->service), entry, NULL, NULL);
if (updated_entry) {
- /* FIXME Response from server contains additional info about GDataEntry
+ /* FIXME Response from server contains additional info about GDataEntry
* Store and use them later
*/
g_object_unref (updated_entry);
GDataEntry *entry;
ECalBackendGooglePrivate *priv;
ECalComponent *comp = NULL;
- char *calobj = NULL;
+ gchar *calobj = NULL;
cbgo = E_CAL_BACKEND_GOOGLE (backend);
priv = cbgo->priv;
ECalBackendSyncStatus status;
icalcomponent *icalcomp;
ECalComponentId *id;
- char *comp_str;
+ gchar *comp_str;
GDataFeed *feed;
status = e_cal_backend_google_get_object (backend, cal, uid, rid, &calobj);
g_return_val_if_fail (E_IS_CAL_COMPONENT (comp), NULL);
e_cal_backend_groupwise_priv_lock (cbgw);
-
+
item = e_gw_item_new_empty ();
e_gw_item_set_container_id (item, container);
item = set_properties_from_cal_component (item, comp, cbgw);
}
static void
-sanitize_component (ECalComponent *comp, const gchar *server_uid, const char *container_id)
+sanitize_component (ECalComponent *comp, const gchar *server_uid, const gchar *container_id)
{
icalproperty *icalprop;
gint i;
EGwItemType item_type;
g_return_val_if_fail (E_IS_GW_ITEM (item), NULL);
-
+
e_cal_backend_groupwise_priv_lock (cbgw);
-
+
default_zone = e_cal_backend_groupwise_get_default_zone (cbgw);
categories_by_id = e_cal_backend_groupwise_get_categories_by_id (cbgw);
default_zone = e_cal_backend_groupwise_get_default_zone (cbgw);
cnc = e_cal_backend_groupwise_get_connection (cbgw);
-
+
g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_CONNECTION);
/* Perform startFreeBusySession */
GSList *attendee_list = NULL;
icalcomponent *icalcomp = NULL;
icaltimetype start_time, end_time;
-
+
e_cal_backend_groupwise_priv_lock (cbgw);
tmp = soup_soap_parameter_get_first_child_by_name (subparam, "email");
return cbgw->priv->default_zone;
}
-const char *
-e_cal_backend_groupwise_get_container_id (ECalBackendGroupwise *cbgw)
+const gchar *
+e_cal_backend_groupwise_get_container_id (ECalBackendGroupwise *cbgw)
{
return cbgw->priv->container_id;
}
kind = e_cal_backend_get_kind (E_CAL_BACKEND (cbgw));
total = priv->total_count;
-
type = get_element_type (kind);
/* Fetch the data with a bias to present, near past/future */
typedef struct
{
EGwItemCalId *calid;
- ECalBackendStore *store;
+ ECalBackendStore *store;
} CompareIdData;
static gint
CompareIdData *data = (CompareIdData *) b;
EGwItemCalId *calid = data->calid;
ECalBackendStore *store = data->store;
-
+
if (!calid->recur_key)
return g_strcmp0 (cache_id->uid, calid->ical_id);
else {
ECalComponent *comp;
gint ret = 1;
- const char *cache_item_id;
-
+ const gchar *cache_item_id;
+
if (strcmp (cache_id->uid, calid->recur_key))
return 1;
if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
status = e_gw_connection_get_items (cnc, priv->container_id, "attachments recipients message recipientStatus default peek", filter, &item_list);
-
g_object_unref (filter);
if (status != E_GW_CONNECTION_STATUS_OK) {
data.calid = calid;
data.store = store;
-
+
if (!(remove = g_slist_find_custom (cache_ids, &data, (GCompareFunc) compare_ids))) {
g_ptr_array_add (uid_array, g_strdup (calid->item_id));
needs_to_get = TRUE;
icaltimezone_set_component (zone, tz_comp);
PRIV_LOCK (priv);
-
+
if (priv->default_zone)
icaltimezone_free (priv->default_zone, 1);
const gchar *olson_string;
};
-static gchar*
-windows_timezone_string_to_olson(const gchar* windows_tz)
+static gchar *
+windows_timezone_string_to_olson(const gchar * windows_tz)
{
/* source: http://www.chronos-st.org/Windows-to-Olson.txt */
static const struct timezone_map_entry timezone_map[] = {
{ "W. Australia", "Australia/Perth" },
{ "W. Australia Standard Time", "Australia/Perth" },
{ "W. Central Africa Standard Time", "Africa/Luanda" },
- { "W. Europe", "Europe/Berlin" },
+ { "W. Europe", "Europe/Berlin" },
{ "W. Europe Standard Time", "Europe/Berlin" },
{ "Warsaw", "Europe/Warsaw" },
{ "West Asia", "Asia/Karachi" },
{ 0, 0 } // end marker
};
- int i;
+ gint i;
for (i=0; timezone_map[i].windows_string && windows_tz; i++) {
- int res = strcmp( timezone_map[i].windows_string, windows_tz);
+ gint res = strcmp( timezone_map[i].windows_string, windows_tz);
if (res > 0)
return NULL;
if (res == 0) {
return g_strdup(timezone_map[i].olson_string);
}
}
-
+
return NULL;
}
#else
gchar *windows_timezone_string = NULL;
gchar *olson_timezone_string = NULL;
-
+
if (!(windows_timezone_string = system_timezone_win32_query_registry ()))
return NULL;
olson_timezone_string = windows_timezone_string_to_olson (windows_timezone_string);
case insensitively (ascii, not utf8, same as 'LIKE' in SQLite3)
*/
static void
-cdb_match_func (sqlite3_context *ctx, int nArgs, sqlite3_value **values)
+cdb_match_func (sqlite3_context *ctx, gint nArgs, sqlite3_value **values)
{
gboolean matches = FALSE;
const gchar *what, *where;
gint i, j;
for (i = 0, j = 0; where[i] && !matches; i++) {
- char c = where[i];
+ gchar c = where[i];
if (c == ' ') {
word = TRUE;
/**
* CamelMIRecord:
* @uid:
- * Message UID
+ * Message UID
* @flags:
- * Camel Message info flags
+ * Camel Message info flags
* @msg_type:
* @dirty:
* @read:
- * boolean read status
+ * boolean read status
* @deleted:
- * boolean deleted status
+ * boolean deleted status
* @replied:
- * boolean replied status
+ * boolean replied status
* @important:
- * boolean important status
+ * boolean important status
* @junk:
- * boolean junk status
+ * boolean junk status
* @attachment:
- * boolean attachment status
+ * boolean attachment status
* @size:
- * size of the mail
+ * size of the mail
* @dsent:
- * date sent
+ * date sent
* @dreceived:
- * date received
+ * date received
* @subject:
- * subject of the mail
+ * subject of the mail
* @from:
- * sender
+ * sender
* @to:
- * recipient
+ * recipient
* @cc:
- * CC members
+ * CC members
* @mlist:
- * message list headers
+ * message list headers
* @followup_flag:
- * followup flag / also can be queried to see for followup or not
+ * followup flag / also can be queried to see for followup or not
* @followup_completed_on:
- * completed date, can be used to see if completed
+ * completed date, can be used to see if completed
* @followup_due_by:
- * to see the due by date
+ * to see the due by date
* @part:
- * part / references / thread id
+ * part / references / thread id
* @labels:
- * labels of mails also called as userflags
+ * labels of mails also called as userflags
* @usertags:
- * composite string of user tags
+ * composite string of user tags
* @cinfo:
- * content info string - composite string
+ * content info string - composite string
* @bdata:
- * provider specific data
+ * provider specific data
* @bodystructure:
*
* The extensive DB format, supporting basic searching and sorting.
report_status (driver, CAMEL_FILTER_STATUS_START, pc, _("Getting message %d of %d"), i+1,
uids->len);
- if (camel_folder_has_summary_capability (folder))
+ if (camel_folder_has_summary_capability (folder))
info = camel_folder_get_message_info (folder, uids->pdata[i]);
else
info = NULL;
camel_content_info_dump(((CamelMessageInfoBase *) mi)->content, 0);
}
-
/**
* camel_folder_summary_set_need_preview:
*
/**
* CamelMemPoolFlags:
* @CAMEL_MEMPOOL_ALIGN_STRUCT:
- * Allocate to native structure alignment
+ * Allocate to native structure alignment
* @CAMEL_MEMPOOL_ALIGN_WORD:
- * Allocate to words - 16 bit alignment
+ * Allocate to words - 16 bit alignment
* @CAMEL_MEMPOOL_ALIGN_BYTE:
- * Allocate to bytes - 8 bit alignment
+ * Allocate to bytes - 8 bit alignment
* @CAMEL_MEMPOOL_ALIGN_MASK:
- * Which bits determine the alignment information
+ * Which bits determine the alignment information
*
* Since: 3.0
**/
/**
* CamelStreamVFSOpenMethod:
* CAMEL_STREAM_VFS_CREATE:
- * Writable, creates new file or replaces old file.
+ * Writable, creates new file or replaces old file.
* CAMEL_STREAM_VFS_APPEND:
- * Writable, creates new file or appends at the end of the old file.
+ * Writable, creates new file or appends at the end of the old file.
* CAMEL_STREAM_VFS_READ:
- * Readable, opens existing file for reading.
+ * Readable, opens existing file for reading.
*
* Since: 2.24
**/
CamelMimeMessage *message,
const CamelMessageInfo *info,
gchar **appended_uid,
- CamelException *ex)
+ CamelException *ex)
{
camel_exception_setv (
ex, CAMEL_EXCEPTION_SYSTEM, "%s",
total = camel_folder_summary_count (folder->summary);
unread = folder->summary->unread_count;
-
+
if (si) {
si->unread = unread;
si->total = total;
camel_service_lock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK);
success = groupwise_sync_summary (folder, ex);
camel_service_unlock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK);
-
+
camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed", changes);
camel_folder_change_info_free (changes);
/************************ First populate summary *************************/
item_status = e_gw_item_get_item_status (item);
-
- /* skip the deleted items */
+
+ /* skip the deleted items */
if (item_status & E_GW_ITEM_STAT_DELETED && strcmp (full_name, "Trash")) {
i++;
continue;
}
-
+
mi = NULL;
pmi = NULL;
pmi = camel_folder_summary_uid (folder->summary, id);
camel_service_construct (service, service->session, service->provider, service->url, ex);
}
-
camel_service_lock (service, CAMEL_SERVICE_REC_CONNECT_LOCK);
if (priv->cnc) {
ifolder->search = camel_folder_search_new ();
ifolder->search_lock = g_mutex_new ();
ifolder->stream_lock = g_mutex_new ();
- ifolder->ignore_recent = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify) g_free, NULL);
+ ifolder->ignore_recent = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify) g_free, NULL);
ifolder->exists_on_server = 0;
ifolder->unread_on_server = 0;
if ((istore->rec_options & IMAPX_FILTER_INBOX))
folder->folder_flags |= CAMEL_FOLDER_FILTER_JUNK;
} else if ((istore->rec_options & (IMAPX_FILTER_JUNK | IMAPX_FILTER_JUNK_INBOX)) == IMAPX_FILTER_JUNK)
- folder->folder_flags |= CAMEL_FOLDER_FILTER_JUNK;
+ folder->folder_flags |= CAMEL_FOLDER_FILTER_JUNK;
g_free (summary_file);
if (!camel_exception_is_set (ex) && stream) {
msg = camel_mime_message_new();
-
+
g_mutex_lock (ifolder->stream_lock);
if (camel_data_wrapper_construct_from_stream((CamelDataWrapper *)msg, stream) == -1) {
g_object_unref (msg);
guint32 exists_on_server;
guint32 unread_on_server;
-
+
/* hash table of UIDs to ignore as recent when updating folder */
GHashTable *ignore_recent;
-
+
GMutex *search_lock;
GMutex *stream_lock;
};
{ CAMEL_PROVIDER_CONF_CHECKBOX, "check_lsub", NULL,
N_("Ch_eck for new messages in subscribed folders"), "0" },
{ CAMEL_PROVIDER_CONF_SECTION_END },
-#if 0
+#if 0
{ CAMEL_PROVIDER_CONF_SECTION_START, "cmdsection", NULL,
N_("Connection to Server") },
{ CAMEL_PROVIDER_CONF_CHECKBOX, "use_command", NULL,
N_("Folders") },
{ CAMEL_PROVIDER_CONF_CHECKBOX, "use_lsub", NULL,
N_("_Show only subscribed folders"), "1" },
-#if 0
+#if 0
{ CAMEL_PROVIDER_CONF_CHECKBOX, "override_namespace", NULL,
N_("O_verride server-supplied folder namespace"), "0" },
{ CAMEL_PROVIDER_CONF_ENTRY, "namespace", "override_namespace",
N_("Namespace:") },
-#endif
+#endif
{ CAMEL_PROVIDER_CONF_SECTION_END },
{ CAMEL_PROVIDER_CONF_SECTION_START, "general", NULL, N_("Options") },
{ CAMEL_PROVIDER_CONF_CHECKBOX, "filter", NULL,
const gchar *ofolder_name;
const gchar *nfolder_name;
} rename_folder;
-
+
const gchar *folder_name;
} u;
};
return;
}
}
-
+
c(printf("-- Checking job queue\n"));
count = 0;
ic = (CamelIMAPXCommand *)is->queue.head;
camel_dlist_remove((CamelDListNode *)ic);
imapx_command_start(is, ic);
count++;
- } else
+ } else
break;
ic = nc;
nc = nc->next;
if (!camel_folder_summary_check_uid (job->folder->summary, mi->uid)) {
CamelIMAPXFolder *ifolder = (CamelIMAPXFolder *)job->folder;
-
+
camel_folder_summary_add(job->folder->summary, mi);
imapx_set_message_info_flags_for_new_message (mi, server_flags, server_user_flags, job->folder);
camel_folder_change_info_add_uid (job->u.refresh_info.changes, mi->uid);
ic = camel_imapx_command_new ("STARTTLS", NULL, "STARTTLS");
imapx_command_run (is, ic);
-
+
if (camel_exception_is_set (ic->ex) || ic->status->result != IMAPX_OK) {
if (!camel_exception_is_set (ic->ex))
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, "%s", ic->status->text);
else
camel_exception_xfer (ex, ic->ex);
-
camel_imapx_command_free(ic);
goto exit;
}
e(printf("Unable to connect %d %s \n", ex->id, ex->desc));
g_object_unref (is->stream);
is->stream = NULL;
-
+
if (is->cinfo) {
imapx_free_capability(is->cinfo);
is->cinfo = NULL;
if (!(camel_exception_is_set (ic->ex) || ic->status->result != IMAPX_OK))
authenticated = TRUE;
else {
- /* If exception is set, it might be mostly due to cancellation and we would get an
+ /* If exception is set, it might be mostly due to cancellation and we would get an
io error, else re-prompt. If authentication fails for other reasons ic->status would be
set with the error message */
if (camel_exception_is_set (ic->ex)) {
camel_exception_clear (ex);
}
-
+
camel_imapx_command_free(ic);
}
-
+
/* After login we re-capa */
if (is->cinfo) {
imapx_free_capability(is->cinfo);
is->use_idle = TRUE;
else
is->use_idle = FALSE;
-
+
if (imapx_idle_supported (is))
imapx_init_idle (is);
exception:
imapx_disconnect (is);
-
+
if (is->cinfo) {
imapx_free_capability(is->cinfo);
is->cinfo = NULL;
/* TODO copy the summary and cached messages to the new folder. We might need a sorted insert to avoid refreshing the dest folder */
if (ic->status->condition == IMAPX_COPYUID) {
gint i;
-
+
for (i = 0; i < ic->status->u.copyuid.copied_uids->len; i++) {
guint32 uid = GPOINTER_TO_UINT(g_ptr_array_index (ic->status->u.copyuid.copied_uids, i));
gchar *str = g_strdup_printf ("%d",uid);
CamelIMAPXFolder *ifolder = (CamelIMAPXFolder *) job->u.copy_messages.dest;
-
+
g_hash_table_insert (ifolder->ignore_recent, str, GINT_TO_POINTER (1));
}
-
+
}
if (i < uids->len) {
}
/* ********************************************************************** */
-
static gchar *
imapx_encode_folder_name (CamelIMAPXStore *istore, const gchar *folder_name)
{
g_free (fname);
} else
encoded = camel_utf8_utf7 (folder_name);
-
+
return encoded;
}
CamelIMAPXCommand *ic;
const gchar *str = NULL;
gchar *encoded_fname = NULL;
-
-
+
if (job->u.manage_subscriptions.subscribe)
str = "SUBSCRIBE";
else
encoded_fname = imapx_encode_folder_name ((CamelIMAPXStore *) is->store, job->u.manage_subscriptions.folder_name);
ic = camel_imapx_command_new (str, NULL, "%s %s", str, encoded_fname);
-
+
ic->pri = job->pri;
ic->job = job;
ic->complete = imapx_command_subscription_done;
en_ofname = imapx_encode_folder_name ((CamelIMAPXStore *) is->store, job->u.rename_folder.ofolder_name);
en_nfname = imapx_encode_folder_name ((CamelIMAPXStore *) is->store, job->u.rename_folder.nfolder_name);
-
+
ic = camel_imapx_command_new ("RENAME", "INBOX", "RENAME %s %s", en_ofname, en_nfname);
ic->pri = job->pri;
ic->job = job;
if (is->cinfo) {
imapx_free_capability(is->cinfo);
- is->cinfo = NULL;
+ is->cinfo = NULL;
}
is->state = IMAPX_DISCONNECTED;
if ((job = imapx_is_job_in_queue (is, full_name, IMAPX_JOB_GET_MESSAGE, uid))) {
flag = g_hash_table_lookup (is->uid_eflags, uid);
-
+
if (pri > job->pri)
job->pri = pri;
-
+
QUEUE_UNLOCK (is);
e_flag_wait (flag);
-
+
stream = camel_data_cache_get (ifolder->cache, "cur", uid, NULL);
if (!stream)
camel_exception_set (ex, 1, "Could not retrieve the message");
if (registered)
imapx_run_job(is, job);
-
+
e_flag_set (flag);
if (!camel_exception_is_set (job->ex))
stream = job->u.get_message.stream;
-
+
g_free(job);
/* HACK FIXME just sleep for sometime so that the other waiting locks gets released by that time. Think of a
camel_imapx_server_manage_subscription (CamelIMAPXServer *is, const gchar *folder_name, gboolean subscribe, CamelException *ex)
{
CamelIMAPXJob *job;
-
+
job = g_malloc0(sizeof(*job));
job->type = IMAPX_JOB_MANAGE_SUBSCRIPTION;
job->start = imapx_job_manage_subscription_start;
job->ex = ex;
job->u.manage_subscriptions.subscribe = subscribe;
job->u.manage_subscriptions.folder_name = folder_name;
-
+
if (imapx_register_job (is, job))
imapx_run_job (is, job);
camel_imapx_server_create_folder (CamelIMAPXServer *is, const gchar *folder_name, CamelException *ex)
{
CamelIMAPXJob *job;
-
+
job = g_malloc0(sizeof(*job));
job->type = IMAPX_JOB_CREATE_FOLDER;
job->start = imapx_job_create_folder_start;
camel_imapx_server_delete_folder (CamelIMAPXServer *is, const gchar *folder_name, CamelException *ex)
{
CamelIMAPXJob *job;
-
+
job = g_malloc0(sizeof(*job));
job->type = IMAPX_JOB_DELETE_FOLDER;
job->start = imapx_job_delete_folder_start;
camel_imapx_server_rename_folder (CamelIMAPXServer *is, const gchar *old_name, const gchar *new_name, CamelException *ex)
{
CamelIMAPXJob *job;
-
+
job = g_malloc0(sizeof(*job));
job->type = IMAPX_JOB_RENAME_FOLDER;
job->start = imapx_job_rename_folder_start;
CamelServiceAuthType *authtype;
GList *sasl_types, *t, *next;
gboolean connected;
-
+
if (CAMEL_OFFLINE_STORE (istore)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) {
camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
_("You must be working online to complete this operation"));
}
camel_service_lock (service, CAMEL_SERVICE_REC_CONNECT_LOCK);
-
+
if (istore->server == NULL)
istore->server = camel_imapx_server_new((CamelStore *)istore, service->url);
-
+
connected = istore->server->stream != NULL;
if (!connected)
connected = imapx_connect_to_server (istore->server, ex);
}
camel_store_summary_info_free((CamelStoreSummary *)istore->summary, si);
}
-
+
if (emit_signal) {
CamelFolderInfo *fi;
if (istore->server && camel_imapx_server_connect (istore->server, TRUE, ex))
camel_imapx_server_manage_subscription (istore->server, folder_name, FALSE, ex);
-
+
if (!camel_exception_is_set (ex)) {
imapx_unmark_folder_subscribed (istore, folder_name, emit_signal, ex);
return TRUE;
imapx_store_unsubscribe_folder (CamelStore *store, const gchar *folder_name, CamelException *ex)
{
CamelException eex = CAMEL_EXCEPTION_INITIALISER;
-
+
if (!ex)
ex = &eex;
return TRUE;
}
-
static void
rename_folder_info (CamelIMAPXStore *istore, const gchar *old_name, const gchar *new_name, CamelException *ex)
{
CamelIMAPXStore *istore = (CamelIMAPXStore *) store;
gchar *oldpath, *newpath, *storage_path;
-
if (CAMEL_OFFLINE_STORE (store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) {
camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
_("You must be working online to complete this operation"));
static CamelFolderInfo *
imapx_create_folder (CamelStore *store, const gchar *parent_name, const gchar *folder_name, CamelException *ex)
-{
+{
const gchar *c;
CamelStoreInfo *si;
CamelIMAPXStoreNamespace *ns;
gchar *real_name, *full_name, *parent_real;
CamelFolderInfo *fi = NULL;
gchar dir_sep;
-
+
if (CAMEL_OFFLINE_STORE (store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) {
camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
_("You must be working online to complete this operation"));
return NULL;
}
-
+
if (!(istore->server && camel_imapx_server_connect (istore->server, TRUE, ex)))
return NULL;
folder_name, *c);
return NULL;
}
-
+
parent_real = camel_imapx_store_summary_full_from_path(istore->summary, parent_name);
if (parent_real == NULL) {
camel_exception_setv(ex, CAMEL_EXCEPTION_FOLDER_INVALID_STATE,
camel_object_trigger_event (CAMEL_OBJECT (store), "folder_created", fi);
}
-
g_free (full_name);
g_free(parent_real);
return fi;
}
-
static CamelFolderInfo *
get_folder_info_offline (CamelStore *store, const gchar *top,
guint32 flags, CamelException *ex)
camel_exception_init (&eex);
imapx_unmark_folder_subscribed (istore,dup_folder_name, TRUE, &eex);
imapx_delete_folder_from_cache (istore, dup_folder_name, &eex);
-
+
g_free (dup_folder_name);
camel_exception_clear (&eex);
} else {
{
CamelStoreInfo *si;
CamelIMAPXStore *istore = (CamelIMAPXStore *)store;
-
+
si = camel_store_summary_path((CamelStoreSummary *) istore->summary, "INBOX");
if (si == NULL || (si->flags & CAMEL_FOLDER_SUBSCRIBED) == 0) {
imapx_subscribe_folder (store, "INBOX", FALSE, ex);
-
+
if (!camel_exception_is_set(ex) && !si)
sync_folders (istore, "INBOX", TRUE, ex);
-
+
if (si)
camel_store_summary_info_free((CamelStoreSummary *) istore->summary, si);
}
if (CAMEL_OFFLINE_STORE(store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) {
fi = get_folder_info_offline (store, top, flags, ex);
-
+
g_mutex_unlock (istore->get_finfo_lock);
return fi;
}
if (now - istore->last_refresh_time > FINFO_REFRESH_INTERVAL) {
struct _imapx_refresh_msg *m;
-
+
istore->last_refresh_time = time (NULL);
m = camel_session_thread_msg_new(((CamelService *)store)->session, &imapx_refresh_ops, sizeof(*m));
m->store = store;
camel_exception_init(&m->ex);
camel_session_thread_queue(((CamelService *)store)->session, &m->msg, 0);
}
-
+
fi = get_folder_info_offline (store, top, flags, ex);
g_mutex_unlock (istore->get_finfo_lock);
return fi;
}
-
+
if (!camel_service_connect((CamelService *)store, ex)) {
g_mutex_unlock (istore->get_finfo_lock);
return NULL;
guint32 rec_options;
- /* Used for syncronizing get_folder_info. Check for re-use of any other lock. At the
+ /* Used for syncronizing get_folder_info. Check for re-use of any other lock. At the
moment, could not find anything suitable for this */
GMutex *get_finfo_lock;
time_t last_refresh_time;
-
+
/* hash table of UIDs to ignore as recent when updating folder */
GHashTable *ignore_recent;
#line 3 "camel-imapx-tokens.txt"
struct _imapx_keyword {const gchar *name; camel_imapx_id_t id; };
-struct _imapx_keyword *imapx_tokenise_struct (register const char *str, register unsigned int len);
+struct _imapx_keyword *imapx_tokenise_struct (register const gchar *str, register guint len);
#define TOTAL_KEYWORDS 36
#define MIN_WORD_LENGTH 2
inline
#endif
#endif
-static unsigned int
-imapx_hash (register const char *str, register unsigned int len)
+static guint
+imapx_hash (register const gchar *str, register guint len)
{
- static unsigned char asso_values[] =
+ static guchar asso_values[] =
{
57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
57, 57, 57, 57, 57, 57
};
- return len + asso_values[(unsigned char)str[len - 1]] + asso_values[(unsigned char)str[0]];
+ return len + asso_values[(guchar)str[len - 1]] + asso_values[(guchar)str[0]];
}
#ifdef __GNUC__
#endif
#endif
struct _imapx_keyword *
-imapx_tokenise_struct (register const char *str, register unsigned int len)
+imapx_tokenise_struct (register const gchar *str, register guint len)
{
static struct _imapx_keyword wordlist[] =
{
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
{
- register int key = imapx_hash (str, len);
+ register gint key = imapx_hash (str, len);
if (key <= MAX_HASH_VALUE && key >= 0)
{
- register const char *s = wordlist[key].name;
+ register const gchar *s = wordlist[key].name;
if (*str == *s && !strcmp (str + 1, s + 1))
return &wordlist[key];
if (!g_ascii_strncasecmp (node->path, "INBOX", 5) &&
(node->path [6] == '\0' || node->path [6] == node->sep ))
memcpy (node->path, "INBOX", 5);
-
+
/* TODO remove full_name later. not required */
node->full_name = g_strdup (node->path);
goto exit;
filename = build_categories_filename ();
-
+
g_debug ("Saving categories to \"%s\"", filename);
/* build the file contents */
g_mkdir_with_parents (pathname, 0700);
g_file_set_contents (filename, contents, length, &error);
}
-
+
g_free (pathname);
if (error != NULL) {