aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-transport.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2002-03-29 07:20:09 +0800
committerDan Winship <danw@src.gnome.org>2002-03-29 07:20:09 +0800
commit93c35349cf39a820d6a41b2da99c2ac19c00ef93 (patch)
tree67914ba24cad1e21435730942e8e79952d55d885 /camel/camel-transport.c
parentf2724282525af3eae2f52badf8ecddd31a24db70 (diff)
downloadgsoc2013-evolution-93c35349cf39a820d6a41b2da99c2ac19c00ef93.tar
gsoc2013-evolution-93c35349cf39a820d6a41b2da99c2ac19c00ef93.tar.gz
gsoc2013-evolution-93c35349cf39a820d6a41b2da99c2ac19c00ef93.tar.bz2
gsoc2013-evolution-93c35349cf39a820d6a41b2da99c2ac19c00ef93.tar.lz
gsoc2013-evolution-93c35349cf39a820d6a41b2da99c2ac19c00ef93.tar.xz
gsoc2013-evolution-93c35349cf39a820d6a41b2da99c2ac19c00ef93.tar.zst
gsoc2013-evolution-93c35349cf39a820d6a41b2da99c2ac19c00ef93.zip
Change the message arg to a CamelMimeMessage instead of a CamelMedium.
* camel-transport.c (camel_transport_send_to): Change the message arg to a CamelMimeMessage instead of a CamelMedium. Even the NNTP provider returns CamelMimeMessages, and we're never going to support anything more exotic than that. Also do a few more g_return_if_fails here instead of in the providers. (camel_transport_can_send): No longer needed. (camel_transport_send): Remove this too. It wasn't being used any more, and it doesn't behave exactly the same in sendmail and smtp. * providers/smtp/camel-smtp-transport.c (smtp_send, smtp_can_send): Gone. (smtp_send_to): Update for arg change. (smtp_data): Make this take a CamelMimeMessage too. * providers/sendmail/camel-sendmail-transport.c (sendmail_send, sendmail_can_send): Gone. (sendmail_send_to): Update for arg change, and merge in the part that used to be shared with sendmail_send. svn path=/trunk/; revision=16278
Diffstat (limited to 'camel/camel-transport.c')
-rw-r--r--camel/camel-transport.c57
1 files changed, 10 insertions, 47 deletions
diff --git a/camel/camel-transport.c b/camel/camel-transport.c
index 513a28b30e..dc402750c7 100644
--- a/camel/camel-transport.c
+++ b/camel/camel-transport.c
@@ -28,7 +28,8 @@
#endif
#include "camel-transport.h"
-#include "camel-exception.h"
+#include "camel-address.h"
+#include "camel-mime-message.h"
#include "camel-private.h"
/* Returns the class for a CamelTransport */
@@ -77,68 +78,30 @@ camel_transport_get_type (void)
/**
- * camel_transport_can_send: Determine if a message is send-able on a transport
- * @transport: the transport
- * @message: the message
- *
- * Determines if a CamelMedium is of an appropriate subclass to send
- * via the given @transport. (Mail transports are not able to send
- * netnews articles, and vice versa.)
- *
- * Return value: TRUE or FALSE
- **/
-gboolean
-camel_transport_can_send (CamelTransport *transport, CamelMedium *message)
-{
- return CT_CLASS (transport)->can_send (transport, message);
-}
-
-/**
- * camel_transport_send: Send a message via a transport
- * @transport: the transport
- * @message: the message
- * @ex: a CamelException
- *
- * Sends the message to the recipients indicated in the message.
- *
- * Return value: success or failure.
- **/
-gboolean
-camel_transport_send (CamelTransport *transport, CamelMedium *message,
- CamelException *ex)
-{
- gboolean sent;
-
- g_return_val_if_fail (CAMEL_IS_TRANSPORT (transport), FALSE);
-
- CAMEL_TRANSPORT_LOCK (transport, send_lock);
- sent = CT_CLASS (transport)->send (transport, message, ex);
- CAMEL_TRANSPORT_UNLOCK (transport, send_lock);
-
- return sent;
-}
-
-/**
- * camel_transport_send_to: Send a message non-standard recipients
+ * camel_transport_send_to:
* @transport: the transport
* @message: the message
* @from: from address
* @recipients: the recipients
* @ex: a CamelException
*
- * Sends the message to the given recipients, rather than to the
- * recipients indicated in the message.
+ * Sends the message to the given recipients, regardless of the contents
+ * of @message. If the message contains a "Bcc" header, the transport
+ * is responsible for stripping it.
*
* Return value: success or failure.
**/
gboolean
-camel_transport_send_to (CamelTransport *transport, CamelMedium *message,
+camel_transport_send_to (CamelTransport *transport, CamelMimeMessage *message,
CamelAddress *from, CamelAddress *recipients,
CamelException *ex)
{
gboolean sent;
g_return_val_if_fail (CAMEL_IS_TRANSPORT (transport), FALSE);
+ g_return_val_if_fail (CAMEL_IS_MIME_MESSAGE (message), FALSE);
+ g_return_val_if_fail (CAMEL_IS_ADDRESS (from), FALSE);
+ g_return_val_if_fail (CAMEL_IS_ADDRESS (recipients), FALSE);
CAMEL_TRANSPORT_LOCK (transport, send_lock);
sent = CT_CLASS (transport)->send_to (transport, message,