Changeset 3687
- Timestamp:
- 06/03/08 18:03:34
- Files:
-
- trunk/ChangeLog (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/camel-data-cache.c (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/camel-data-cache.h (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/camel-folder.c (modified) (3 diffs)
- trunk/libtinymail-camel/camel-lite/camel/camel-folder.h (modified) (2 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c (modified) (3 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-message-cache.c (modified) (2 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-message-cache.h (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/providers/local/camel-maildir-folder.c (modified) (5 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/nntp/camel-nntp-folder.c (modified) (2 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/pop3/camel-pop3-folder.c (modified) (3 diffs)
- trunk/libtinymail-camel/tny-camel-folder-priv.h (modified) (1 diff)
- trunk/libtinymail-camel/tny-camel-folder.c (modified) (1 diff)
- trunk/libtinymail-camel/tny-camel-msg.c (modified) (3 diffs)
- trunk/libtinymail-camel/tny-camel-msg.h (modified) (1 diff)
- trunk/libtinymail/tny-msg.c (modified) (1 diff)
- trunk/libtinymail/tny-msg.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r3683 r3687 1 2008-06-03 Jose Dapena Paz <jdapena@igalia.com> 2 3 * libtinymail/tny-msg.[ch]: 4 New virtual methods get/set allow external images, to store 5 user acceptation to allow mail client to fetch external images 6 referenced in a message. 7 8 * libtinymail-camel/tny-camel-msg.[ch]: 9 Implement new public methods get/set allow external images 10 available in TnyMsg interface. It uses TnyCamelFolder for 11 implementation of storage of the flag. 12 13 * libtinymail-camel/tny-camel-folder.c, 14 libtinymail-camel/tny-camel-folder-priv.h: 15 In camel we delegate on folder for storing the "get external 16 images" flag. Then we expose a private method for this, that 17 will be called in TnyMsg public implementation. 18 19 * libtinymail-camel/camel-lite/camel/camel-folder.[ch]: 20 Add new virtual methods (not implemented here) for getting 21 and setting "get external images" flag for each message. 22 23 * libtinymail-camel/camel-lite/camel/camel-data-cache.[ch]: 24 Implementation of storage of "get external images" flag in 25 data cache. It stores a file with extension getimages in the 26 same folder the message contents are retrieved. 27 28 * libtinymail-camel/camel-lite/camel/providers/nntp/camel-nntp-folder.c: 29 Implement get/set allow external images methods. It stores 30 it in the camel data cache using the methods the cache 31 exposes for this. 32 33 * libtinymail-camel/camel-lite/camel/providers/pop3/camel-pop3-folder.c: 34 Implement get/set allow external images methods. It also uses 35 the data cache as nntp provider. 36 37 * libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c: 38 Implement get/set allow external images methods. It relies on 39 proper implementation in imap messages cache. 40 41 * libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-message-cache.[ch]: 42 Add storage of allow external images flag. It saves an empty 43 file with extension getimages per allowed file (similar to 44 is partial flag approach). 45 46 * libtinymail-camel/camel-lite/camel/providers/local/camel-maildir-folder.c: 47 Implement get/set allow external images methods. It stores 48 an empty file for each message in the folder maildir metadata 49 directory (the one on top of cur, new and tmp). 50 1 51 2008-05-26 Philip Van Hoof <pvanhoof@gnome.org> 2 52 trunk/libtinymail-camel/camel-lite/camel/camel-data-cache.c
r3300 r3687 315 315 } 316 316 317 gboolean 318 camel_data_cache_get_allow_external_images (CamelDataCache *cdc, const char *path, 319 const char *uid) 320 { 321 gboolean retval = FALSE; 322 gchar *mpath; char *dir; 323 guint32 hash; 324 hash = g_str_hash(uid); 325 hash = (hash>>5)&CAMEL_DATA_CACHE_MASK; 326 dir = alloca(strlen(cdc->path) + strlen(path) + 8); 327 sprintf(dir, "%s/%s/%02x", cdc->path, path, hash); 328 329 mpath = g_strdup_printf ("%s/%s.getimages", dir, uid); 330 331 retval = g_file_test (mpath, G_FILE_TEST_IS_REGULAR); 332 333 g_free (mpath); 334 335 return retval; 336 } 337 338 339 void 340 camel_data_cache_set_allow_external_images (CamelDataCache *cdc, const char *path, 341 const char *uid, gboolean allow) 342 { 343 int fd; char *dir; 344 gchar *mpath; 345 guint32 hash; 346 hash = g_str_hash(uid); 347 hash = (hash>>5)&CAMEL_DATA_CACHE_MASK; 348 dir = alloca(strlen(cdc->path) + strlen(path) + 8); 349 sprintf(dir, "%s/%s/%02x", cdc->path, path, hash); 350 351 mpath = g_strdup_printf ("%s/%s.getimages", dir, uid); 352 353 if (!allow) 354 { 355 if (g_file_test (mpath, G_FILE_TEST_IS_REGULAR)) 356 g_unlink (mpath); 357 } else { 358 if (!g_file_test (mpath, G_FILE_TEST_IS_REGULAR)) 359 { 360 fd = g_open (mpath, O_RDWR | O_CREAT | O_TRUNC | O_BINARY, 0600); 361 if (fd != -1) 362 close (fd); 363 } 364 } 365 366 g_free (mpath); 367 368 } 369 317 370 318 371 /* Since we have to stat the directory anyway, we use this opportunity to trunk/libtinymail-camel/camel-lite/camel/camel-data-cache.h
r2950 r3687 96 96 void camel_data_cache_set_partial (CamelDataCache *cache, const char *path, 97 97 const char *uid, gboolean partial); 98 gboolean camel_data_cache_get_allow_external_images (CamelDataCache *cache, const char *path, 99 const char *uid); 100 void camel_data_cache_set_allow_external_images (CamelDataCache *cache, const char *path, 101 const char *uid, gboolean allow); 98 102 void camel_data_cache_delete_attachments (CamelDataCache *cdc, const char *path, 99 103 const char *key); trunk/libtinymail-camel/camel-lite/camel/camel-folder.c
r3635 r3687 181 181 static void 182 182 rewrite_cache (CamelFolder *folder, const char *uid, CamelMimeMessage *msg) 183 { 184 } 185 186 static gboolean 187 get_allow_external_images (CamelFolder *folder, const char *uid) 188 { 189 return FALSE; 190 } 191 192 static void 193 set_allow_external_images (CamelFolder *folder, const char *uid, gboolean allow) 183 194 { 184 195 } … … 247 258 camel_folder_class->delete_attachments = delete_attachments; 248 259 camel_folder_class->rewrite_cache = rewrite_cache; 260 camel_folder_class->get_allow_external_images = get_allow_external_images; 261 camel_folder_class->set_allow_external_images = set_allow_external_images; 249 262 250 263 /* virtual method overload */ … … 413 426 414 427 CF_CLASS (folder)->rewrite_cache (folder, uid, msg); 428 429 return; 430 } 431 432 gboolean 433 camel_folder_get_allow_external_images (CamelFolder *folder, const char *uid) 434 { 435 g_return_val_if_fail (CAMEL_IS_FOLDER (folder), FALSE); 436 437 return CF_CLASS (folder)->get_allow_external_images (folder, uid); 438 } 439 440 void 441 camel_folder_set_allow_external_images (CamelFolder *folder, const char *uid, gboolean allow) 442 { 443 g_return_if_fail (CAMEL_IS_FOLDER (folder)); 444 445 CF_CLASS (folder)->set_allow_external_images (folder, uid, allow); 415 446 416 447 return; trunk/libtinymail-camel/camel-lite/camel/camel-folder.h
r3070 r3687 217 217 void (*rewrite_cache) (CamelFolder *folder, const char *uid, CamelMimeMessage *msg); 218 218 219 gboolean (*get_allow_external_images) (CamelFolder *folder, const char *uid); 220 void (*set_allow_external_images) (CamelFolder *folder, const char *uid, gboolean allow); 221 219 222 char* (*get_cache_filename) (CamelFolder *folder, const char *uid, const char *spec, CamelFolderPartState *state); 220 223 char* (*fetch) (CamelFolder *folder, const char *uid, const char *spec, gboolean *binary, CamelException *ex); … … 381 384 void camel_folder_rewrite_cache (CamelFolder *folder, const char *uid, CamelMimeMessage *msg); 382 385 386 gboolean camel_folder_get_allow_external_images (CamelFolder *folder, const char *uid); 387 void camel_folder_set_allow_external_images (CamelFolder *folder, const char *uid, gboolean allow); 388 383 389 char* camel_folder_fetch (CamelFolder *folder, const char *uid, const char *spec, gboolean *binary, CamelException *ex); 384 390 char* camel_folder_fetch_structure (CamelFolder *folder, const char *uid, CamelException *ex); trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c
r3682 r3687 177 177 static void imap_rewrite_cache (CamelFolder *folder, const char *uid, CamelMimeMessage *msg); 178 178 179 static gboolean imap_get_allow_external_images (CamelFolder *folder, const char *uid); 180 static void imap_set_allow_external_images (CamelFolder *folder, const char *uid, gboolean allow); 179 181 180 182 static void stop_gmsgstore_from_idle (CamelImapFolder *imap_folder); … … 215 217 camel_folder_class->delete_attachments = imap_delete_attachments; 216 218 camel_folder_class->rewrite_cache = imap_rewrite_cache; 219 camel_folder_class->get_allow_external_images = imap_get_allow_external_images; 220 camel_folder_class->set_allow_external_images = imap_set_allow_external_images; 217 221 218 222 camel_disco_folder_class->refresh_info_online = imap_refresh_info; … … 377 381 /* camel_imap_message_cache_remove (cache, uid); */ 378 382 /* camel_imap_message_cache_replace_cache (cache, uid, NULL, uid, ".purgetmp"); */ 383 return; 384 } 385 386 static gboolean 387 imap_get_allow_external_images (CamelFolder *folder, const char *uid) 388 { 389 CamelImapMessageCache *cache = CAMEL_IMAP_FOLDER (folder)->cache; 390 391 return camel_imap_message_cache_get_allow_external_images (cache, uid); 392 } 393 394 static void 395 imap_set_allow_external_images (CamelFolder *folder, const char *uid, gboolean allow) 396 { 397 CamelImapMessageCache *cache = CAMEL_IMAP_FOLDER (folder)->cache; 398 399 camel_imap_message_cache_set_allow_external_images (cache, uid, allow); 400 379 401 return; 380 402 } trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-message-cache.c
r3300 r3687 33 33 34 34 #include <string.h> 35 #include <sys/stat.h> 35 36 #include <sys/types.h> 36 37 … … 395 396 396 397 g_free (path); 398 } 399 400 gboolean 401 camel_imap_message_cache_get_allow_external_images (CamelImapMessageCache *cache, const char *uid) 402 { 403 gchar *path = g_strdup_printf ("%s/%s.getimages", cache->path, uid); 404 gboolean retval = FALSE; 405 406 retval = g_file_test (path, G_FILE_TEST_IS_REGULAR); 407 408 g_free (path); 409 410 return retval; 411 } 412 413 void 414 camel_imap_message_cache_set_allow_external_images (CamelImapMessageCache *cache, const char *uid, gboolean allow) 415 { 416 gchar *path = g_strdup_printf ("%s/%s.getimages", cache->path, uid); 417 int fd; 418 419 if (!allow) 420 { 421 if (g_file_test (path, G_FILE_TEST_IS_REGULAR)) 422 g_unlink (path); 423 } else { 424 if (!g_file_test (path, G_FILE_TEST_IS_REGULAR)) 425 { 426 fd = g_open (path, O_RDWR | O_CREAT | O_TRUNC | O_BINARY, 0600); 427 if (fd != -1) 428 close (fd); 429 } 430 } 431 432 g_free (path); 397 433 } 398 434 trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-message-cache.h
r2950 r3687 111 111 const char *dest_uid, const char *dest_part_spec); 112 112 113 gboolean camel_imap_message_cache_get_allow_external_images (CamelImapMessageCache *cache, const char *uid); 114 void camel_imap_message_cache_set_allow_external_images (CamelImapMessageCache *cache, const char *uid, gboolean allow); 115 113 116 void 114 117 camel_imap_message_cache_replace_with_wrapper (CamelImapMessageCache *cache, trunk/libtinymail-camel/camel-lite/camel/providers/local/camel-maildir-folder.c
r3523 r3687 34 34 35 35 #include <glib/gi18n-lib.h> 36 #include <glib/gstdio.h> 36 37 37 38 #include "camel-data-wrapper.h" … … 39 40 #include "camel-mime-message.h" 40 41 #include "camel-stream-fs.h" 42 #include "camel-file-utils.h" 41 43 42 44 #include "camel-maildir-folder.h" … … 60 62 61 63 static void maildir_transfer_messages_to (CamelFolder *source, GPtrArray *uids, CamelFolder *dest, GPtrArray **transferred_uids, gboolean delete_originals, CamelException *ex); 64 65 static gboolean maildir_get_allow_external_images (CamelFolder *folder, const char *uid); 66 static void maildir_set_allow_external_images (CamelFolder *folder, const char *uid, gboolean allow); 62 67 63 68 … … 108 113 camel_folder_class->get_message = maildir_get_message; 109 114 camel_folder_class->rewrite_cache = maildir_rewrite_cache; 115 camel_folder_class->get_allow_external_images = maildir_get_allow_external_images; 116 camel_folder_class->set_allow_external_images = maildir_set_allow_external_images; 110 117 111 118 //camel_folder_class->transfer_messages_to = maildir_transfer_messages_to; … … 408 415 g_free (dest); 409 416 } 417 418 static gboolean 419 maildir_get_allow_external_images (CamelFolder *folder, const char *uid) 420 { 421 CamelLocalFolder *lf = (CamelLocalFolder *) folder; 422 char *name = NULL; 423 gboolean retval; 424 425 /* write it out to tmp, use the uid we got from the summary */ 426 name = g_strdup_printf("%s/%s.getimages", lf->folder_path, uid); 427 retval = g_file_test (name, G_FILE_TEST_IS_REGULAR); 428 g_free (name); 429 return retval; 430 } 431 432 static void 433 maildir_set_allow_external_images (CamelFolder *folder, const char *uid, gboolean allow) 434 { 435 CamelLocalFolder *lf = (CamelLocalFolder *) folder; 436 char *name = NULL; 437 int fd; 438 439 /* write it out to tmp, use the uid we got from the summary */ 440 name = g_strdup_printf("%s/%s.getimages", lf->folder_path, uid); 441 442 if (!allow) 443 { 444 if (g_file_test (name, G_FILE_TEST_IS_REGULAR)) 445 g_unlink (name); 446 } else { 447 if (!g_file_test (name, G_FILE_TEST_IS_REGULAR)) 448 { 449 fd = g_open (name, O_RDWR | O_CREAT | O_TRUNC | O_BINARY, 0600); 450 if (fd != -1) 451 close (fd); 452 } 453 } 454 455 g_free (name); 456 } 457 trunk/libtinymail-camel/camel-lite/camel/providers/nntp/camel-nntp-folder.c
r2950 r3687 407 407 } 408 408 409 static gboolean 410 nntp_folder_get_allow_external_images (CamelFolder *folder, const char *uid) 411 { 412 gboolean retval; 413 CamelNNTPStore *nntp_store; 414 415 nntp_store = (CamelNNTPStore *) folder->parent_store; 416 retval = camel_data_cache_get_allow_external_images (nntp_store->cache, "cache", uid); 417 418 return retval; 419 } 420 421 static gboolean 422 nntp_folder_set_allow_external_images (CamelFolder *folder, const char *uid, gboolean allow) 423 { 424 CamelNNTPStore *nntp_store; 425 426 nntp_store = (CamelNNTPStore *) folder->parent_store; 427 camel_data_cache_set_allow_external_images (nntp_store->cache, "cache", uid, allow); 428 429 return; 430 } 431 409 432 static void 410 433 nntp_folder_init (CamelNNTPFolder *nntp_folder, CamelNNTPFolderClass *klass) … … 461 484 camel_folder_class->search_by_uids = nntp_folder_search_by_uids; 462 485 camel_folder_class->search_free = nntp_folder_search_free; 486 camel_folder_class->get_allow_external_images = nntp_folder_get_allow_external_images; 487 camel_folder_class->set_allow_external_images = nntp_folder_set_allow_external_images; 463 488 } 464 489 trunk/libtinymail-camel/camel-lite/camel/providers/pop3/camel-pop3-folder.c
r3670 r3687 81 81 82 82 static void pop3_delete_attachments (CamelFolder *folder, const char *uid); 83 static gboolean pop3_get_allow_external_images (CamelFolder *folder, const char *uid); 84 static void pop3_set_allow_external_images (CamelFolder *folder, const char *uid, gboolean allow); 83 85 84 86 static void … … 1070 1072 } 1071 1073 1074 static gboolean 1075 pop3_get_allow_external_images (CamelFolder *folder, const char *uid) 1076 { 1077 gboolean retval; 1078 CamelPOP3Store *pop3_store = CAMEL_POP3_STORE (folder->parent_store); 1079 retval = camel_data_cache_get_allow_external_images (pop3_store->cache, "cache", uid); 1080 return retval; 1081 } 1082 1083 static void 1084 pop3_set_allow_external_images (CamelFolder *folder, const char *uid, gboolean allow) 1085 { 1086 gboolean retval; 1087 CamelPOP3Store *pop3_store = CAMEL_POP3_STORE (folder->parent_store); 1088 camel_data_cache_set_allow_external_images (pop3_store->cache, "cache", uid, allow); 1089 return; 1090 } 1091 1072 1092 static CamelMimeMessage * 1073 1093 pop3_get_message (CamelFolder *folder, const char *uid, CamelFolderReceiveType type, gint param, CamelException *ex) … … 1822 1842 camel_folder_class->set_message_flags = pop3_set_message_flags; 1823 1843 camel_folder_class->delete_attachments = pop3_delete_attachments; 1844 camel_folder_class->get_allow_external_images = pop3_get_allow_external_images; 1845 camel_folder_class->set_allow_external_images = pop3_set_allow_external_images; 1824 1846 1825 1847 camel_disco_folder_class->refresh_info_online = pop3_refresh_info; trunk/libtinymail-camel/tny-camel-folder-priv.h
r3574 r3687 79 79 void _tny_camel_folder_rewrite_cache (TnyCamelFolder *self, const gchar *uid, CamelMimeMessage *msg); 80 80 81 gboolean _tny_camel_folder_get_allow_external_images (TnyCamelFolder *self, const gchar *uid); 82 void _tny_camel_folder_set_allow_external_images (TnyCamelFolder *self, const gchar *uid, gboolean allow); 83 81 84 void _tny_camel_folder_remove_folder_actual (TnyFolderStore *self, TnyFolder *folder, TnyFolderStoreChange *change, GError **err); 82 85 trunk/libtinymail-camel/tny-camel-folder.c
r3672 r3687 667 667 } 668 668 669 669 gboolean 670 _tny_camel_folder_get_allow_external_images (TnyCamelFolder *self, const gchar *uid) 671 { 672 TnyCamelFolderPriv *priv = TNY_CAMEL_FOLDER_GET_PRIVATE (self); 673 gboolean retval; 674 675 g_static_rec_mutex_lock (priv->folder_lock); 676 677 if (!priv->folder || !priv->loaded || !CAMEL_IS_FOLDER (priv->folder)) 678 if (!load_folder_no_lock (priv)) 679 { 680 g_static_rec_mutex_unlock (priv->folder_lock); 681 return FALSE; 682 } 683 684 retval = camel_folder_get_allow_external_images (priv->folder, uid); 685 686 g_static_rec_mutex_unlock (priv->folder_lock); 687 return retval; 688 } 689 690 void 691 _tny_camel_folder_set_allow_external_images (TnyCamelFolder *self, const gchar *uid, gboolean allow) 692 { 693 TnyCamelFolderPriv *priv = TNY_CAMEL_FOLDER_GET_PRIVATE (self); 694 gboolean retval; 695 696 g_static_rec_mutex_lock (priv->folder_lock); 697 698 if (!priv->folder || !priv->loaded || !CAMEL_IS_FOLDER (priv->folder)) 699 if (!load_folder_no_lock (priv)) 700 { 701 g_static_rec_mutex_unlock (priv->folder_lock); 702 return; 703 } 704 705 camel_folder_set_allow_external_images (priv->folder, uid, allow); 706 707 g_static_rec_mutex_unlock (priv->folder_lock); 708 } 670 709 671 710 static gboolean trunk/libtinymail-camel/tny-camel-msg.c
r3666 r3687 229 229 } 230 230 231 static gboolean 232 tny_camel_msg_get_allow_external_images_default (TnyMsg *self) 233 { 234 TnyCamelMsgPriv *priv = TNY_CAMEL_MSG_GET_PRIVATE (self); 235 gboolean allow = FALSE; 236 237 if (priv->folder && priv->header) { 238 gchar *uid; 239 uid = tny_header_dup_uid (priv->header); 240 allow = _tny_camel_folder_get_allow_external_images (TNY_CAMEL_FOLDER(priv->folder), 241 uid); 242 g_free (uid); 243 } 244 return allow; 245 } 246 247 static gboolean 248 tny_camel_msg_get_allow_external_images (TnyMsg *self) 249 { 250 return TNY_CAMEL_MSG_GET_CLASS (self)->get_allow_external_images (self); 251 } 252 253 static void 254 tny_camel_msg_set_allow_external_images_default (TnyMsg *self, gboolean allow) 255 { 256 TnyCamelMsgPriv *priv = TNY_CAMEL_MSG_GET_PRIVATE (self); 257 258 if (priv->folder && priv->header) { 259 gchar *uid; 260 uid = tny_header_dup_uid (priv->header); 261 _tny_camel_folder_set_allow_external_images (TNY_CAMEL_FOLDER(priv->folder), 262 uid, allow); 263 g_free (uid); 264 } 265 return; 266 } 267 268 static void 269 tny_camel_msg_set_allow_external_images (TnyMsg *self, gboolean allow) 270 { 271 TNY_CAMEL_MSG_GET_CLASS (self)->set_allow_external_images (self, allow); 272 return; 273 } 274 231 275 static TnyHeader* 232 276 tny_camel_msg_get_header_default (TnyMsg *self) … … 360 404 klass->uncache_attachments= tny_camel_msg_uncache_attachments; 361 405 klass->rewrite_cache= tny_camel_msg_rewrite_cache; 406 klass->get_allow_external_images = tny_camel_msg_get_allow_external_images; 407 klass->set_allow_external_images = tny_camel_msg_set_allow_external_images; 362 408 363 409 return; … … 377 423 class->uncache_attachments= tny_camel_msg_uncache_attachments_default; 378 424 class->rewrite_cache= tny_camel_msg_rewrite_cache_default; 425 class->get_allow_external_images = tny_camel_msg_get_allow_external_images_default; 426 class->set_allow_external_images = tny_camel_msg_set_allow_external_images_default; 379 427 380 428 object_class->finalize = tny_camel_msg_finalize; trunk/libtinymail-camel/tny-camel-msg.h
r3304 r3687 57 57 void (*uncache_attachments) (TnyMsg *self); 58 58 void (*rewrite_cache) (TnyMsg *self); 59 gboolean (*get_allow_external_images) (TnyMsg *self); 60 void (*set_allow_external_images) (TnyMsg *self, gboolean allow); 59 61 }; 60 62 trunk/libtinymail/tny-msg.c
r3666 r3687 89 89 90 90 return; 91 } 92 93 /** 94 * tny_msg_set_allow_external_images: 95 * @self: a #TnyMsg 96 * @allow: a #gboolean 97 * 98 * API WARNING: This API might change 99 * 100 * Set if views should fetch external images referenced 101 * in this message or not. 102 * 103 * since: 1.0 104 * audience: application-developer 105 **/ 106 void 107 tny_msg_set_allow_external_images (TnyMsg *self, gboolean allow) 108 { 109 #ifdef DBC /* require */ 110 g_assert (TNY_IS_MSG (self)); 111 g_assert (TNY_MSG_GET_IFACE (self)->get_allow_external_images != NULL); 112 #endif 113 114 TNY_MSG_GET_IFACE (self)->set_allow_external_images (self, allow); 115 116 #ifdef DBC /* ensure */ 117 #endif 118 119 return; 120 } 121 122 123 /** 124 * tny_msg_get_allow_external_images: 125 * @self: a #TnyMsg 126 * 127 * API WARNING: This API might change 128 * 129 * Get if views should fetch external images into message. 130 * 131 * Returns: a #gboolean 132 * 133 * since: 1.0 134 * audience: application-developer 135 **/ 136 gboolean 137 tny_msg_get_allow_external_images (TnyMsg *self) 138 { 139 gboolean retval; 140 #ifdef DBC /* require */ 141 g_assert (TNY_IS_MSG (self)); 142 g_assert (TNY_MSG_GET_IFACE (self)->get_allow_external_images != NULL); 143 #endif 144 145 retval = TNY_MSG_GET_IFACE (self)->get_allow_external_images (self); 146 147 #ifdef DBC /* ensure */ 148 #endif 149 150 return retval; 91 151 } 92 152 trunk/libtinymail/tny-msg.h
r3304 r3687 48 48 void (*uncache_attachments) (TnyMsg *self); 49 49 void (*rewrite_cache) (TnyMsg *self); 50 gboolean (*get_allow_external_images) (TnyMsg *self); 51 void (*set_allow_external_images) (TnyMsg *self, gboolean allow); 50 52 51 53 }; … … 58 60 void tny_msg_uncache_attachments (TnyMsg *self); 59 61 void tny_msg_rewrite_cache (TnyMsg *self); 62 gboolean tny_msg_get_allow_external_images (TnyMsg *self); 63 void tny_msg_set_allow_external_images (TnyMsg *self, gboolean allow); 60 64 61 65 G_END_DECLS
