Changeset 2069
- Timestamp:
- 06/03/07 13:34:36
- Files:
-
- trunk/ChangeLog (modified) (2 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/pop3/camel-pop3-folder.c (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/providers/pop3/camel-pop3-store.c (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/providers/pop3/camel-pop3-store.h (modified) (1 diff)
- trunk/libtinymail-camel/tny-camel-full-msg-receive-strategy.c (modified) (1 diff)
- trunk/libtinymail-camel/tny-camel-msg-header-priv.h (modified) (1 diff)
- trunk/libtinymail-camel/tny-camel-msg-header.c (modified) (3 diffs)
- trunk/libtinymail-camel/tny-camel-partial-msg-receive-strategy.c (modified) (1 diff)
- trunk/libtinymail-camel/tny-camel-pop-store-account-priv.h (modified) (1 diff)
- trunk/libtinymail-camel/tny-camel-pop-store-account.c (modified) (3 diffs)
- trunk/libtinymail-camel/tny-camel-pop-store-account.h (modified) (1 diff)
- trunk/libtinymail-camel/tny-camel-send-queue-priv.h (modified) (1 diff)
- trunk/libtinymail-camel/tny-camel-send-queue.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r2068 r2069 1 2007-06-03 Philip Van Hoof <pvanhoof@gnome.org> 2 3 * Support for removing messages from a POP server after retrieval 4 * Support for tny_header_get_uid on TnyMsg's header instance 5 6 * This was a major API change 7 1 8 2007-06-01 Murray Cumming <murrayc@murrayc.com> 2 9 … … 15 22 the on_connection_event() signal handler. This always seems to indicate 16 23 failure on Maemo Bora, but maybe it works properly in later versions. 17 It is OK for this to block because the Maemo connection dialog is totally18 modal anyway, and because most applications will not be able to do anything19 sensible while waiting, because the user is already waiting for an operation20 that he has initiated.24 It is OK for this to block because the Maemo connection dialog is 25 totally modal anyway, and because most applications will not be able 26 to do anything sensible while waiting, because the user is already 27 waiting for an operation that he has initiated. 21 28 22 29 * libtinymail/tny-folder.c: (tny_folder_get_all_count): Warn when this 23 is not implemented. Maybe not very necessary, but I seem to have had this24 in my local checkout and maybe things crash without the check. Can be removed25 later if you like.30 is not implemented. Maybe not very necessary, but I seem to have had 31 this in my local checkout and maybe things crash without the check. 32 Can be removed later if you like. 26 33 27 34 2007-05-29 Philip Van Hoof <pvanhoof@gnome.org> trunk/libtinymail-camel/camel-lite/camel/providers/pop3/camel-pop3-folder.c
r2037 r2069 840 840 camel_object_unref((CamelObject *)message); 841 841 message = NULL; 842 } else { 843 if (type & CAMEL_FOLDER_RECEIVE_FULL && pop3_store->immediate_delete_after) 844 { 845 struct _CamelPOP3Command *cmd = NULL; 846 cmd = camel_pop3_engine_command_new(pop3_store->engine, 0, NULL, NULL, "DELE %u\r\n", uid); 847 while (camel_pop3_engine_iterate(pop3_store->engine, cmd) > 0); 848 camel_pop3_engine_command_free(pop3_store->engine, cmd); 849 } 842 850 } 843 851 trunk/libtinymail-camel/camel-lite/camel/providers/pop3/camel-pop3-store.c
r2063 r2069 879 879 camel_pop3_store_init (gpointer object, gpointer klass) 880 880 { 881 CamelPOP3Store *store = (CamelPOP3Store *) object; 882 883 store->immediate_delete_after = FALSE; 881 884 882 885 return; trunk/libtinymail-camel/camel-lite/camel/providers/pop3/camel-pop3-store.h
r1943 r2069 47 47 struct _CamelDataCache *cache; 48 48 guint delete_after; 49 gboolean immediate_delete_after; 49 50 gchar *storage_path, *base_url; 50 51 gboolean connected; trunk/libtinymail-camel/tny-camel-full-msg-receive-strategy.c
r1920 r2069 82 82 message = tny_camel_msg_new (); 83 83 _tny_camel_msg_set_folder (TNY_CAMEL_MSG (message), folder); 84 TNY_CAMEL_MSG_HEADER (nheader)->old_uid = g_strdup (tny_header_get_uid (header)); 84 85 _tny_camel_msg_set_header (TNY_CAMEL_MSG (message), nheader); 85 86 _tny_camel_mime_part_set_part (TNY_CAMEL_MIME_PART (message), trunk/libtinymail-camel/tny-camel-msg-header-priv.h
r1700 r2069 49 49 TnyFolder *folder; 50 50 CamelMimeMessage *msg; 51 gchar *mime_from ;51 gchar *mime_from, *old_uid; 52 52 }; 53 53 trunk/libtinymail-camel/tny-camel-msg-header.c
r1920 r2069 322 322 tny_camel_msg_header_get_uid (TnyHeader *self) 323 323 { 324 return NULL; 324 TnyCamelMsgHeader *me = TNY_CAMEL_MSG_HEADER (self); 325 326 if (!me->old_uid) 327 { 328 g_warning ("tny_header_get_uid: This is a header instance for a new message. " 329 "The uid of it is therefore not available. This indicates a problem " 330 "in the software."); 331 } 332 333 return me->old_uid; 325 334 } 326 335 … … 328 337 tny_camel_msg_header_finalize (GObject *object) 329 338 { 339 TnyCamelMsgHeader *me = (TnyCamelMsgHeader *) object; 340 341 if (me->old_uid) 342 g_free (me->old_uid); 343 330 344 (*parent_class->finalize) (object); 331 345 … … 353 367 and remove it in the finalize. Same for folder. */ 354 368 369 self->old_uid = NULL; 355 370 self->msg = msg; 356 371 self->folder = folder; trunk/libtinymail-camel/tny-camel-partial-msg-receive-strategy.c
r1926 r2069 82 82 message = tny_camel_msg_new (); 83 83 _tny_camel_msg_set_folder (TNY_CAMEL_MSG (message), folder); 84 TNY_CAMEL_MSG_HEADER (nheader)->old_uid = g_strdup (tny_header_get_uid (header)); 84 85 _tny_camel_msg_set_header (TNY_CAMEL_MSG (message), nheader); 85 86 _tny_camel_mime_part_set_part (TNY_CAMEL_MIME_PART (message), trunk/libtinymail-camel/tny-camel-pop-store-account-priv.h
r1383 r2069 27 27 TnyFolder *inbox; 28 28 GMutex *lock; 29 gboolean delete_originals;30 29 }; 31 30 trunk/libtinymail-camel/tny-camel-pop-store-account.c
r1997 r2069 37 37 #include <camel/camel-session.h> 38 38 #include <camel/camel-store.h> 39 #include <camel/providers/pop3/camel-pop3-store.h> 39 40 40 41 #ifndef CAMEL_FOLDER_TYPE_SENT … … 166 167 } 167 168 169 168 170 /** 169 * tny_camel_pop_store_account_ get_delete_originals:171 * tny_camel_pop_store_account_set_leave_messages_on_server: 170 172 * @self: a TnyCamelPOPStoreAccount 171 * 172 * Get the delete originals property of @self. 173 * 174 * Return value: Whether or not to delete original messages from the service 175 **/ 176 gboolean 177 tny_camel_pop_store_account_get_delete_originals (TnyCamelPOPStoreAccount *self) 178 { 179 TnyCamelPopStoreAccountPriv *priv = TNY_CAMEL_POP_STORE_ACCOUNT_GET_PRIVATE (self); 180 181 return priv->delete_originals; 182 } 183 184 /** 185 * tny_camel_pop_store_account_set_delete_originals: 186 * @self: a TnyCamelPOPStoreAccount 187 * @delete_originals: Whether or not to delete original messages from the service 188 * 189 * Set the delete originals property of @self. 190 * 173 * @enabled: whether to leave messages on the server 174 * 175 * Set whether messages should be left on the server. The initialization value 176 * of @enabled is TRUE (so by default, messages are left on the server). 191 177 **/ 192 178 void 193 tny_camel_pop_store_account_set_ delete_originals (TnyCamelPOPStoreAccount *self, gboolean delete_originals)194 { 195 TnyCamelPopStoreAccountPriv *priv = TNY_CAMEL_POP_STORE_ACCOUNT_GET_PRIVATE (self);196 197 g_warning ("tny_camel_pop_store_account_set_delete_originals is not yet supported\n"); 198 199 priv->delete_originals = delete_originals; 200 } 179 tny_camel_pop_store_account_set_leave_messages_on_server (TnyCamelPOPStoreAccount *self, gboolean enabled) 180 { 181 const CamelService *service = _tny_camel_account_get_service (TNY_CAMEL_ACCOUNT (self)); 182 CamelPOP3Store *pop3_store = (CamelPOP3Store *) service; 183 184 pop3_store->immediate_delete_after = !enabled; 185 } 186 201 187 202 188 static void … … 204 190 { 205 191 TnyCamelPopStoreAccountPriv *priv = TNY_CAMEL_POP_STORE_ACCOUNT_GET_PRIVATE (instance); 206 192 const CamelService *service = _tny_camel_account_get_service (TNY_CAMEL_ACCOUNT (instance)); 193 CamelPOP3Store *pop3_store = (CamelPOP3Store *) service; 194 195 pop3_store->immediate_delete_after = FALSE; 207 196 priv->lock = g_mutex_new (); 208 197 priv->inbox = NULL; 209 priv->delete_originals = FALSE;210 198 211 199 return; trunk/libtinymail-camel/tny-camel-pop-store-account.h
r1383 r2069 52 52 TnyStoreAccount* tny_camel_pop_store_account_new (void); 53 53 54 gboolean tny_camel_pop_store_account_get_delete_originals (TnyCamelPOPStoreAccount *self); 55 void tny_camel_pop_store_account_set_delete_originals (TnyCamelPOPStoreAccount *self, gboolean delete_originals); 54 void tny_camel_pop_store_account_set_leave_messages_on_server (TnyCamelPOPStoreAccount *self, gboolean enabled); 56 55 57 56 G_END_DECLS trunk/libtinymail-camel/tny-camel-send-queue-priv.h
r1407 r2069 34 34 GMutex *todo_lock, *sending_lock; 35 35 gboolean creating_spin; 36 gboolean do_continue ;36 gboolean do_continue, is_running; 37 37 }; 38 38 trunk/libtinymail-camel/tny-camel-send-queue.c
r2047 r2069 102 102 TnyList *list; 103 103 104 priv->is_running = TRUE; 104 105 priv->creating_spin = FALSE; 105 106 … … 233 234 errorhandler: 234 235 236 priv->is_running = FALSE; 237 235 238 g_object_unref (G_OBJECT (sentbox)); 236 239 g_object_unref (G_OBJECT (outbox)); … … 248 251 TnyCamelSendQueuePriv *priv = TNY_CAMEL_SEND_QUEUE_GET_PRIVATE (self); 249 252 250 while (priv->creating_spin); 251 252 priv->creating_spin = TRUE; 253 254 priv->thread = g_thread_create (thread_main, g_object_ref (self), 255 TRUE, NULL); 253 if (!priv->is_running) 254 { 255 while (priv->creating_spin); 256 priv->creating_spin = TRUE; 257 priv->thread = g_thread_create (thread_main, 258 g_object_ref (self), TRUE, NULL); 259 } 256 260 257 261 return; … … 609 613 * @self: a valid #TnyCamelSendQueue instance 610 614 * 611 * (try to) flush the messages which are currently in this send queue 612 * (persisted in the outbox folder) 613 * 615 * Flush the messages which are currently in this send queue 614 616 **/ 615 617 void … … 617 619 { 618 620 TnyCamelSendQueuePriv *priv; 619 621 620 622 g_return_if_fail (TNY_IS_CAMEL_SEND_QUEUE(self)); 621 623 … … 690 692 priv->sending_lock = g_mutex_new (); 691 693 priv->do_continue = FALSE; 694 priv->is_running = FALSE; 692 695 693 696 return;
