[evolution-patches] patch for junk-api implementation (eds/servers/groupwise)



Hi,

This patch adds some methods to e-gw-connection.c that implement the
junk handling APIs for groupwise. 

Thanks,
Vivek Jain
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/groupwise/ChangeLog,v
retrieving revision 1.141
diff -u -p -r1.141 ChangeLog
--- ChangeLog	8 Jun 2005 05:42:43 -0000	1.141
+++ ChangeLog	21 Jun 2005 06:46:53 -0000
@@ -1,3 +1,12 @@
+2005-06-08  Vivek Jain <jvivek novell com>
+	
+	* e-gw-connection.[ch]: added functions
+	(e_gw_connection_modify_junk_mail_settings):to set/modify junk mail
+	settings
+	(e_gw_connection_create_junk_entry): to create a junk entry 
+	(e_gw_connection_get_junk_entries) : to get junk entries stored at
+	server
+
 2005-06-08  Srinivasa Ragavan <sragavan novell com>
 
 	* e-gw-connection.[ch] :Added function to retrive deltainfo and delta
Index: e-gw-connection.h
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/groupwise/e-gw-connection.h,v
retrieving revision 1.59
diff -u -p -r1.59 e-gw-connection.h
--- e-gw-connection.h	8 Jun 2005 05:42:43 -0000	1.59
+++ e-gw-connection.h	21 Jun 2005 06:46:54 -0000
@@ -147,6 +147,9 @@ EGwConnectionStatus e_gw_connection_purg
 EGwConnectionStatus e_gw_connection_mark_read(EGwConnection *cnc, GList *item_ids) ;
 EGwConnectionStatus e_gw_connection_mark_unread(EGwConnection *cnc, GList *item_ids) ;
 EGwConnectionStatus e_gw_connection_reply_item (EGwConnection *cnc, const char *id, const char *view, EGwItem **item) ;
+EGwConnectionStatus e_gw_connection_create_junk_entry (EGwConnection *cnc, const char *email);
+EGwConnectionStatus e_gw_connection_modify_junk_settings (EGwConnection *cnc, int value);
+EGwConnectionStatus e_gw_connection_get_junk_entries (EGwConnection *cnc);
 G_END_DECLS
 
 #endif
Index: e-gw-connection.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/groupwise/e-gw-connection.c,v
retrieving revision 1.118
diff -u -p -r1.118 e-gw-connection.c
--- e-gw-connection.c	8 Jun 2005 05:42:43 -0000	1.118
+++ e-gw-connection.c	21 Jun 2005 06:46:54 -0000
@@ -2901,3 +2901,124 @@ e_gw_connection_reply_item (EGwConnectio
 
         return E_GW_CONNECTION_STATUS_OK;
 }
+
+EGwConnectionStatus
+e_gw_connection_create_junk_entry (EGwConnection *cnc, const char *email)
+{
+	SoupSoapMessage *msg;
+        SoupSoapResponse *response;
+        EGwConnectionStatus status;
+        SoupSoapParameter *param;
+        
+	g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
+	
+	/* build the SOAP message */
+        msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "createJunkEntryRequest");
+        if (!msg) {
+                g_warning (G_STRLOC ": Could not build SOAP message");
+                return E_GW_CONNECTION_STATUS_UNKNOWN;
+        }
+	soup_soap_message_start_element (msg, "entry", NULL, NULL);
+	e_gw_message_write_string_parameter (msg, "match", NULL, email);
+	e_gw_message_write_string_parameter (msg, "matchType", NULL, "email");
+	e_gw_message_write_string_parameter (msg, "listType", NULL, "junk");
+	soup_soap_message_end_element (msg);
+	e_gw_message_write_footer (msg);
+	response =  e_gw_connection_send_message (cnc, msg);
+	
+	if (!response) {
+		g_object_unref (msg);
+		return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
+	}
+
+	status = e_gw_connection_parse_response_status (response);
+	if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
+		reauthenticate (cnc);
+	/* free memory */
+	g_object_unref (response);
+	g_object_unref (msg);
+
+	return status;
+}
+
+EGwConnectionStatus
+e_gw_connection_modify_junk_settings (EGwConnection *cnc, int value)
+{
+	SoupSoapMessage *msg;
+        SoupSoapResponse *response;
+        EGwConnectionStatus status;
+        SoupSoapParameter *param;
+        
+	g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
+	
+	/* build the SOAP message */
+        msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "modifyJunkMailSettingsRequest");
+        if (!msg) {
+                g_warning (G_STRLOC ": Could not build SOAP message");
+                return E_GW_CONNECTION_STATUS_UNKNOWN;
+        }
+	
+	soup_soap_message_start_element (msg, "settings", NULL, NULL);
+	soup_soap_message_start_element (msg, "setting", NULL, NULL);
+	e_gw_message_write_string_parameter (msg, "field", NULL, "useJunkList");
+	e_gw_message_write_int_parameter (msg, "value", NULL, value);
+	soup_soap_message_end_element (msg);
+	soup_soap_message_start_element (msg, "setting", NULL, NULL);
+	e_gw_message_write_string_parameter (msg, "field", NULL, "persistence");
+	
+	/*XXX: persistence, for now putting the default value*/
+	  
+	e_gw_message_write_int_parameter (msg, "value", NULL, 14);
+	soup_soap_message_end_element (msg);
+	soup_soap_message_end_element (msg);
+	e_gw_message_write_footer (msg);
+	response =  e_gw_connection_send_message (cnc, msg);
+	
+	if (!response) {
+		g_object_unref (msg);
+		return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
+	}
+
+	status = e_gw_connection_parse_response_status (response);
+	if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
+		reauthenticate (cnc);
+	/* free memory */
+	g_object_unref (response);
+	g_object_unref (msg);
+
+	return status;
+}
+
+EGwConnectionStatus
+e_gw_connection_get_junk_entries (EGwConnection *cnc)
+{
+	SoupSoapMessage *msg;
+        SoupSoapResponse *response;
+        EGwConnectionStatus status;
+        SoupSoapParameter *param;
+        
+	g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
+	
+	/* build the SOAP message */
+        msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "getJunkEntriesRequest");
+        if (!msg) {
+                g_warning (G_STRLOC ": Could not build SOAP message");
+                return E_GW_CONNECTION_STATUS_UNKNOWN;
+        }
+	e_gw_message_write_footer (msg);
+	response =  e_gw_connection_send_message (cnc, msg);
+	
+	if (!response) {
+		g_object_unref (msg);
+		return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
+	}
+
+	status = e_gw_connection_parse_response_status (response);
+	if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
+		reauthenticate (cnc);
+	/* free memory */
+	g_object_unref (response);
+	g_object_unref (msg);
+
+	return status;
+}


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