Re: Patch: add camel folder reasons to sentbox and outbox while send queue is processed



Philip Van Hoof escribiu:
> No, not approved. In TnyCamelSendQueue you must first check whether the
> TnyFolder are a TNY_IS_CAMEL_FOLDER, before doing this.

Done on behalf of Dape :-)
Index: libtinymail-camel/tny-camel-send-queue.c
===================================================================
--- libtinymail-camel/tny-camel-send-queue.c	(revision 3651)
+++ libtinymail-camel/tny-camel-send-queue.c	(working copy)
@@ -613,6 +613,15 @@
 	if (info->sentbox_account)
 		g_object_unref (info->sentbox_account);
 
+	if (TNY_IS_CAMEL_FOLDER (info->outbox)) {
+		TnyCamelFolderPriv *outbox_priv = TNY_CAMEL_FOLDER_GET_PRIVATE (info->outbox);
+		_tny_camel_folder_unreason (outbox_priv);
+	}
+	if (TNY_IS_CAMEL_FOLDER (info->sentbox)) {
+		TnyCamelFolderPriv *sentbox_priv = TNY_CAMEL_FOLDER_GET_PRIVATE (info->sentbox);
+		_tny_camel_folder_unreason (sentbox_priv);
+	}
+
 	g_object_unref (info->outbox);
 	g_object_unref (info->sentbox);
 	g_object_unref (info->trans_account);
@@ -646,7 +655,14 @@
 
 			info->outbox = tny_send_queue_get_outbox (self);
 			info->sentbox = get_sentbox (self);
-
+		        if (TNY_IS_CAMEL_FOLDER (info->outbox)) {
+		                TnyCamelFolderPriv *outbox_priv = TNY_CAMEL_FOLDER_GET_PRIVATE (info->outbox);
+			        _tny_camel_folder_reason (outbox_priv);
+		        }
+		        if (TNY_IS_CAMEL_FOLDER (info->sentbox)) {
+		                TnyCamelFolderPriv *sentbox_priv = TNY_CAMEL_FOLDER_GET_PRIVATE (info->sentbox);
+		                _tny_camel_folder_reason (sentbox_priv);
+		        }			
 			if (!info->outbox || !info->sentbox) {
 
 				g_set_error (err, TNY_SERVICE_ERROR, 
@@ -672,8 +688,17 @@
 
 			priv->thread = g_thread_create (thread_main, info, FALSE, NULL);
 
-			if (priv->thread == NULL)
+			if (priv->thread == NULL) {
 				emit_queue_control_signals (self, TNY_SEND_QUEUE_STOP);
+			        if (TNY_IS_CAMEL_FOLDER (info->outbox)) {
+		        	        TnyCamelFolderPriv *outbox_priv = TNY_CAMEL_FOLDER_GET_PRIVATE (info->outbox);
+					_tny_camel_folder_unreason (outbox_priv);
+				}
+			        if (TNY_IS_CAMEL_FOLDER (info->sentbox)) {
+			                TnyCamelFolderPriv *sentbox_priv = TNY_CAMEL_FOLDER_GET_PRIVATE (info->sentbox);
+			                _tny_camel_folder_unreason (sentbox_priv);
+			        }
+			}
 		}
 	}
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]