status = e_gw_connection_get_attachment (cnc,
e_gw_item_get_msg_body_id (item), 0, -1,
(const char **)&temp_body, &len);
+ if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
+ status = e_gw_connection_get_attachment (cnc,
+ e_gw_item_get_msg_body_id (item), 0, -1,
+ (const char **)&temp_body, &len);
if (status != E_GW_CONNECTION_STATUS_OK) {
g_warning ("Could not get Messagebody\n");
}
CamelGroupwiseStore *gw_store= CAMEL_GROUPWISE_STORE(store);
CamelGroupwiseStorePrivate *priv = gw_store->priv;
EGwConnection *cnc = cnc_lookup (priv);
+ EGwConnectionStatus status;
if (!(from = g_strdup (camel_message_info_from (info))))
goto error;
if (!email || !email[index])
goto error;
- if (flag == ADD_JUNK_ENTRY)
- e_gw_connection_create_junk_entry (cnc, email[index], "email", "junk");
- else if (flag == REMOVE_JUNK_ENTRY) {
+ if (flag == ADD_JUNK_ENTRY) {
+ status = e_gw_connection_create_junk_entry (cnc, email[index], "email", "junk");
+ if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
+ status = e_gw_connection_create_junk_entry (cnc, email[index], "email", "junk");
+
+ } else if (flag == REMOVE_JUNK_ENTRY) {
GList *list = NULL;
EGwJunkEntry *entry;
- if (e_gw_connection_get_junk_entries (cnc, &list)== E_GW_CONNECTION_STATUS_OK){
+ status = e_gw_connection_get_junk_entries (cnc, &list);
+ if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
+ status = e_gw_connection_get_junk_entries (cnc, &list);
+
+ if (status == E_GW_CONNECTION_STATUS_OK){
while (list) {
entry = list->data;
if (!g_ascii_strcasecmp (entry->match, email[index])) {
camel_operation_start (NULL, _("Checking for deleted messages %s"), m->folder->name);
status = e_gw_connection_create_cursor (m->cnc, m->container_id, "id", NULL, &cursor);
+ if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
+ status = e_gw_connection_create_cursor (m->cnc, m->container_id, "id", NULL, &cursor);
if (status != E_GW_CONNECTION_STATUS_OK) {
g_warning ("ERROR update update\n");
goto end1;
status = e_gw_connection_get_quick_messages (cnc, container_id,
"peek id",
&t_str, "New", NULL, source, -1, &slist);
+ if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
+ status = e_gw_connection_get_quick_messages (cnc, container_id,
+ "peek id",
+ &t_str, "New", NULL, source, -1, &slist);
if (status != E_GW_CONNECTION_STATUS_OK) {
camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_INVALID, _("Authentication failed"));
goto end2;
status = e_gw_connection_get_quick_messages (cnc, container_id,
"peek id",
&t_str, "Modified", NULL, source, -1, &slist);
-
+ if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
+ status = e_gw_connection_get_quick_messages (cnc, container_id,
+ "peek id",
+ &t_str, "Modified", NULL, source, -1, &slist);
if (status != E_GW_CONNECTION_STATUS_OK) {
camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_INVALID, _("Authentication failed"));
goto end3;
CREATE_CURSOR_VIEW,
NULL,
&cursor);
+ if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
+ status = e_gw_connection_create_cursor (priv->cnc, container_id,
+ CREATE_CURSOR_VIEW,
+ NULL,
+ &cursor);
+
if (status != E_GW_CONNECTION_STATUS_OK) {
CAMEL_SERVICE_REC_UNLOCK (gw_store, connect_lock);
g_free (container_id);
CREATE_CURSOR_VIEW,
NULL,
&cursor);
+ if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
+ status = e_gw_connection_create_cursor (priv->cnc, container_id,
+ CREATE_CURSOR_VIEW,
+ NULL,
+ &cursor);
if (status != E_GW_CONNECTION_STATUS_OK) {
CAMEL_SERVICE_REC_UNLOCK (gw_store, connect_lock);
g_free (container_id);
}
status = e_gw_connection_get_container_list (priv->cnc, "folders", &folder_list);
+ if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
+ status = e_gw_connection_get_container_list (priv->cnc, "folders", &folder_list);
if (status != E_GW_CONNECTION_STATUS_OK) {
g_warning ("Could not get folder list..\n");
return;
CAMEL_SERVICE_REC_LOCK (store, connect_lock);
status = e_gw_connection_modify_junk_settings (priv->cnc, JUNK_ENABLE, 0, 0, JUNK_PERSISTENCE);
+ if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
+ status = e_gw_connection_modify_junk_settings (priv->cnc, JUNK_ENABLE, 0, 0, JUNK_PERSISTENCE);
if (status == E_GW_CONNECTION_STATUS_OK) {
root = groupwise_build_folder_info(groupwise_store, parent_name, folder_name);
camel_store_summary_save((CamelStoreSummary *)groupwise_store->summary);
}
CAMEL_SERVICE_REC_LOCK (store, connect_lock);
status = e_gw_connection_create_folder(priv->cnc,parent_id,folder_name, &child_container_id);
+ if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
+ status = e_gw_connection_create_folder(priv->cnc,parent_id,folder_name, &child_container_id);
if (status == E_GW_CONNECTION_STATUS_OK) {
root = groupwise_build_folder_info(groupwise_store, parent_name,folder_name);
camel_store_summary_save((CamelStoreSummary *)groupwise_store->summary);
container = g_hash_table_lookup (priv->name_hash, folder_name);
status = e_gw_connection_remove_item (priv->cnc, container, container);
+ if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
+ status = e_gw_connection_remove_item (priv->cnc, container, container);
if (status == E_GW_CONNECTION_STATUS_OK) {
groupwise_store_set_current_folder (groupwise_store, NULL);