Changeset 1347
- Timestamp:
- 12/26/06 11:27:52
- Files:
-
- trunk/ChangeLog (modified) (1 diff)
- trunk/libtinymail-camel/Makefile.am (modified) (3 diffs)
- trunk/libtinymail-camel/tny-camel-mem-stream.c (added)
- trunk/libtinymail-camel/tny-camel-mem-stream.h (added)
- trunk/libtinymail-camel/tny-camel-msg.c (modified) (3 diffs)
- trunk/libtinymail-camel/tny-camel-stream-priv.h (added)
- trunk/libtinymail-camel/tny-camel-stream.c (modified) (1 diff)
- trunk/tests/functional (modified) (1 prop)
- trunk/tests/functional/.svnignore (modified) (1 diff)
- trunk/tests/functional/Makefile.am (modified) (1 diff)
- trunk/tests/functional/folder-lister-async.c (modified) (1 diff)
- trunk/tests/functional/msg-sender.c (added)
- trunk/tests/shared/account-store.c (modified) (1 diff)
- trunk/tests/shared/platfact.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r1340 r1347 1 2006-12-25 Philip Van Hoof <pvanhoof@gnome.org> 2 3 * Various fixes about creating and sending E-mails 4 * Added a TnyCamelMemStream type 5 * Added a msg-send test 6 1 7 2006-12-25 Philip Van Hoof <pvanhoof@gnome.org> 2 8 trunk/libtinymail-camel/Makefile.am
r1176 r1347 27 27 tny-camel-shared.h \ 28 28 tny-camel-send-queue.h \ 29 tny-camel-mem-stream.h \ 29 30 tny-session-camel.h 30 31 … … 40 41 tny-camel-header-priv.h \ 41 42 tny-camel-send-queue-priv.h \ 42 tny-camel-folder-priv.h 43 tny-camel-folder-priv.h \ 44 tny-camel-stream-priv.h 43 45 44 46 libtinymail_camel_1_0_la_SOURCES = \ … … 62 64 tny-stream-camel.c \ 63 65 tny-camel-send-queue.c \ 66 tny-camel-mem-stream.c \ 64 67 tny-session-camel.c 65 68 trunk/libtinymail-camel/tny-camel-msg.c
r1339 r1347 112 112 if (retval) 113 113 g_object_ref (G_OBJECT (retval)); 114 else { 115 CamelMimeMessage *msg; 116 priv->header = tny_camel_header_new (); 117 msg = _tny_camel_msg_get_camel_mime_message (TNY_CAMEL_MSG (self)); 118 _tny_camel_header_set_camel_mime_message 119 (TNY_CAMEL_HEADER (priv->header), msg); 120 retval = priv->header; 121 } 114 122 g_mutex_unlock (priv->header_lock); 115 123 … … 146 154 CamelMimeMessage *msg; 147 155 TnyCamelMsgPriv *priv = TNY_CAMEL_MSG_GET_PRIVATE (self); 156 CamelInternetAddress *from, *recipients, *replyto; 157 const gchar *str; 148 158 149 159 g_assert (TNY_IS_CAMEL_HEADER (header)); … … 157 167 priv->header = header; 158 168 159 msg = _tny_camel_msg_get_camel_mime_message (TNY_CAMEL_MSG (self)); 160 _tny_camel_header_set_camel_mime_message (TNY_CAMEL_HEADER (priv->header), 161 msg); 169 if (((TnyCamelHeader *)header)->write) 170 { 171 TnyCamelMimePartPriv *ppriv = TNY_CAMEL_MIME_PART_GET_PRIVATE (self); 172 g_mutex_lock (ppriv->part_lock); 173 if (ppriv->part) 174 camel_object_unref (CAMEL_OBJECT (ppriv->part)); 175 /* Add a reference? */ 176 ppriv->part = (CamelMimePart *) ((WriteInfo*)((TnyCamelHeader *)header)->info)->msg; 177 g_mutex_unlock (ppriv->part_lock); 178 } else { 179 msg = _tny_camel_msg_get_camel_mime_message (TNY_CAMEL_MSG (self)); 180 _tny_camel_header_set_camel_mime_message 181 (TNY_CAMEL_HEADER (priv->header), msg); 182 } 183 184 /* 185 from = camel_internet_address_new (); 186 str = tny_header_get_from (header); 187 _foreach_email_add_to_inet_addr (str, from); 188 camel_mime_message_set_from (msg, from); 189 camel_object_unref (CAMEL_OBJECT (from)); 190 191 replyto = camel_internet_address_new (); 192 str = tny_header_get_replyto (header); 193 _foreach_email_add_to_inet_addr (str, replyto); 194 camel_mime_message_set_from (msg, replyto); 195 camel_object_unref (CAMEL_OBJECT (replyto)); 196 197 recipients = camel_internet_address_new (); 198 str = tny_header_get_to (header); 199 _foreach_email_add_to_inet_addr (str, recipients); 200 camel_mime_message_set_recipients (msg, CAMEL_RECIPIENT_TYPE_TO, recipients); 201 camel_object_unref (CAMEL_OBJECT (recipients)); 202 203 str = tny_header_get_cc (header); 204 _foreach_email_add_to_inet_addr (str, recipients); 205 camel_mime_message_set_recipients (msg, CAMEL_RECIPIENT_TYPE_CC, recipients); 206 camel_object_unref (CAMEL_OBJECT (recipients)); 207 208 str = tny_header_get_bcc (header); 209 _foreach_email_add_to_inet_addr (str, recipients); 210 camel_mime_message_set_recipients (msg, CAMEL_RECIPIENT_TYPE_BCC, recipients); 211 camel_object_unref (CAMEL_OBJECT (recipients)); 212 213 camel_mime_message_set_subject (msg ,tny_header_get_subject (header)); 214 */ 162 215 163 216 g_mutex_unlock (priv->header_lock); trunk/libtinymail-camel/tny-camel-stream.c
r1240 r1347 40 40 41 41 #include <tny-camel-shared.h> 42 #include "tny-camel-stream-priv.h" 42 43 43 44 static GObjectClass *parent_class = NULL; 44 45 45 46 typedef struct _TnyCamelStreamPriv TnyCamelStreamPriv;47 48 struct _TnyCamelStreamPriv49 {50 CamelStream *stream;51 };52 53 #define TNY_CAMEL_STREAM_GET_PRIVATE(o) \54 (G_TYPE_INSTANCE_GET_PRIVATE ((o), TNY_TYPE_CAMEL_STREAM, TnyCamelStreamPriv))55 46 56 47 static gssize trunk/tests/functional
- Property svn:ignore changed from msg-transfer folder-lister-async tags Makefile.in folder-lister .svnignore stamp-h1 config.h .libs .deps Makefile to msg-sender msg-transfer folder-lister-async tags Makefile.in folder-lister .svnignore stamp-h1 config.h .libs .deps Makefile
trunk/tests/functional/.svnignore
r1201 r1347 1 msg-sender 1 2 msg-transfer 2 3 folder-lister-async trunk/tests/functional/Makefile.am
r1179 r1347 16 16 endif 17 17 18 bin_PROGRAMS = folder-lister folder-lister-async msg-transfer 18 bin_PROGRAMS = folder-lister folder-lister-async msg-transfer msg-sender 19 20 msg_sender_SOURCES = msg-sender.c 21 msg_sender_LDADD = \ 22 $(TINYMAIL_LIBS) $(LIBTINYMAIL_GNOME_DESKTOP_LIBS) \ 23 $(top_builddir)/libtinymail/libtinymail-$(API_VERSION).la \ 24 $(top_builddir)/libtinymailui/libtinymailui-$(API_VERSION).la \ 25 $(top_builddir)/libtinymailui-gtk/libtinymailui-gtk-$(API_VERSION).la \ 26 $(top_builddir)/libtinymail-camel/libtinymail-camel-$(API_VERSION).la \ 27 $(top_builddir)/tests/shared/libtestsshared.a 19 28 20 29 folder_lister_SOURCES = folder-lister.c trunk/tests/functional/folder-lister-async.c
r1336 r1347 130 130 131 131 132 if (mainloop)132 if (mainloop) 133 133 { 134 134 g_print ("Using the Gtk+ mainloop (will wait 4 seconds in the loop)\n"); trunk/tests/shared/account-store.c
r1336 r1347 101 101 { 102 102 TnyTestAccountStore *me = (TnyTestAccountStore *) self; 103 TnyAccount *account = TNY_ACCOUNT (tny_camel_store_account_new ());103 TnyAccount *account; 104 104 105 105 /* Dear visitor of the SVN-web. This is indeed a fully functional and 106 106 working IMAP account. This does not mean that you need to fuck it up */ 107 107 108 tny_camel_account_set_session (TNY_CAMEL_ACCOUNT (account), me->session); 109 camel_session_set_online ((CamelSession*)me->session, me->force_online); 110 tny_camel_account_set_online_status (TNY_CAMEL_ACCOUNT (account), !me->force_online); 111 112 tny_account_set_proto (account, "imap"); 113 tny_account_set_name (account, "unit test account"); 114 tny_account_set_user (account, "tinymailunittest"); 115 tny_account_set_hostname (account, "mail.tinymail.org"); 116 tny_account_set_id (account, "unique"); 117 tny_account_set_forget_pass_func (account, per_account_forget_pass_func); 118 tny_account_set_pass_func (account, per_account_get_pass_func); 119 120 tny_list_prepend (list, (GObject*)account); 121 g_object_unref (G_OBJECT (account)); 108 if (types == TNY_ACCOUNT_STORE_STORE_ACCOUNTS || types == TNY_ACCOUNT_STORE_BOTH) 109 { 110 account = tny_camel_store_account_new (); 111 112 tny_camel_account_set_session (TNY_CAMEL_ACCOUNT (account), me->session); 113 camel_session_set_online ((CamelSession*)me->session, me->force_online); 114 tny_camel_account_set_online_status (TNY_CAMEL_ACCOUNT (account), !me->force_online); 115 116 tny_account_set_proto (account, "imap"); 117 tny_account_set_name (account, "unit test account"); 118 tny_account_set_user (account, "tinymailunittest"); 119 tny_account_set_hostname (account, "mail.tinymail.org"); 120 tny_account_set_id (account, "unique_imap"); 121 tny_account_set_forget_pass_func (account, per_account_forget_pass_func); 122 tny_account_set_pass_func (account, per_account_get_pass_func); 123 124 tny_list_prepend (list, (GObject*)account); 125 g_object_unref (G_OBJECT (account)); 126 } 127 128 if (types == TNY_ACCOUNT_STORE_TRANSPORT_ACCOUNTS || types == TNY_ACCOUNT_STORE_BOTH) 129 { 130 account = tny_camel_transport_account_new (); 131 132 tny_camel_account_set_session (TNY_CAMEL_ACCOUNT (account), me->session); 133 camel_session_set_online ((CamelSession*)me->session, me->force_online); 134 tny_camel_account_set_online_status (TNY_CAMEL_ACCOUNT (account), !me->force_online); 135 136 tny_account_set_proto (account, "smtp"); 137 tny_account_set_name (account, "unit test account"); 138 tny_account_set_id (account, "unique_smtp"); 139 tny_account_set_url_string (account, "smtp://tinymailunittest;auth=PLAIN@mail.tinymail.org/;use_ssl=always"); 140 141 tny_account_set_forget_pass_func (account, per_account_forget_pass_func); 142 tny_account_set_pass_func (account, per_account_get_pass_func); 143 144 tny_list_prepend (list, (GObject*)account); 145 g_object_unref (G_OBJECT (account)); 146 } 122 147 123 148 return; trunk/tests/shared/platfact.c
r1336 r1347 29 29 #include <tny-msg-view.h> 30 30 #include <tny-gtk-msg-view.h> 31 #include <tny-camel-header.h> 32 #include <tny-camel-mime-part.h> 33 #include <tny-camel-msg.h> 31 34 32 35 … … 38 41 { 39 42 return; 43 } 44 45 46 47 static TnyMsg* 48 tny_test_platform_factory_new_msg (TnyPlatformFactory *self) 49 { 50 return tny_camel_msg_new (); 51 } 52 53 54 static TnyMimePart* 55 tny_test_platform_factory_new_mime_part (TnyPlatformFactory *self) 56 { 57 return tny_camel_mime_part_new (); 58 } 59 60 61 static TnyHeader* 62 tny_test_platform_factory_new_header (TnyPlatformFactory *self) 63 { 64 return tny_camel_header_new (); 40 65 } 41 66 … … 93 118 klass->new_device_func = tny_test_platform_factory_new_device; 94 119 klass->new_msg_view_func = tny_test_platform_factory_new_msg_view; 120 klass->new_msg_func = tny_test_platform_factory_new_msg; 121 klass->new_mime_part_func = tny_test_platform_factory_new_mime_part; 122 klass->new_header_func = tny_test_platform_factory_new_header; 95 123 96 124 return;
