Changeset 1368
- Timestamp:
- 01/08/07 16:48:31
- Files:
-
- trunk/ChangeLog (modified) (1 diff)
- trunk/libtinymail-camel/Makefile.am (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c (modified) (17 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.h (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-wrapper.c (modified) (2 diffs)
- trunk/libtinymail-camel/tny-camel-account.c (modified) (21 diffs)
- trunk/libtinymail-camel/tny-camel-account.h (modified) (1 diff)
- trunk/libtinymail-camel/tny-camel-folder-priv.h (modified) (1 diff)
- trunk/libtinymail-camel/tny-camel-folder.c (modified) (2 diffs)
- trunk/libtinymail-camel/tny-camel-pop-folder.c (modified) (4 diffs)
- trunk/libtinymail-camel/tny-camel-pop-store-account-priv.h (added)
- trunk/libtinymail-camel/tny-camel-pop-store-account.c (modified) (3 diffs)
- trunk/libtinymail-camel/tny-camel-transport-account.c (modified) (1 diff)
- trunk/libtinymailui-gtk/tny-gtk-msg-view.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r1366 r1368 1 2007-01-08 Philip Van Hoof <pvanhoof@gnome.org> 2 3 * Implemented first pieces of the partial message retrieval 4 * Further implemented TnyCamelPopFolder and TnyCamelPopAccount 5 1 6 2007-01-04 Philip Van Hoof <pvanhoof@gnome.org> 2 7 trunk/libtinymail-camel/Makefile.am
r1359 r1368 33 33 34 34 libtinymail_camel_priv_headers = \ 35 tny-camel-pop-store-account-priv.h \ 35 36 tny-session-camel-priv.h \ 36 37 tny-camel-common.c \ trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c
r1366 r1368 136 136 static CamelObjectClass *parent_class; 137 137 138 138 139 static GData *parse_fetch_response (CamelImapFolder *imap_folder, char *msg_att); 140 141 static GData *parse_partial_fetch_response (CamelImapFolder *imap_folder, char *response, GData *data, const gchar *part_spec); 139 142 140 143 #ifdef G_OS_WIN32 … … 1719 1722 const char *uid, 1720 1723 CamelMessageContentInfo *ci, 1721 CamelException *ex);1724 gboolean full, CamelException *ex); 1722 1725 1723 1726 struct _part_spec_stack { … … 1840 1843 g_free(part_spec); 1841 1844 1842 stream = camel_imap_folder_fetch_data (imap_folder, uid, spec, FALSE, ex); 1845 /* TNY TODO: partial message retrieval exception */ 1846 stream = camel_imap_folder_fetch_data (imap_folder, uid, spec, FALSE, TRUE, ex); 1843 1847 if (stream) { 1844 1848 ret = camel_data_wrapper_construct_from_stream (CAMEL_DATA_WRAPPER (body_mp), stream); … … 1877 1881 while (ci) { 1878 1882 sprintf (child_spec + speclen, "%d.MIME", num++); 1879 stream = camel_imap_folder_fetch_data (imap_folder, uid, child_spec, FALSE, ex); 1883 /* TNY TODO: partial message retrieval exception */ 1884 stream = camel_imap_folder_fetch_data (imap_folder, uid, child_spec, FALSE, TRUE, ex); 1880 1885 if (stream) { 1881 1886 int ret; … … 1933 1938 return (CamelDataWrapper *) body_mp; 1934 1939 } else if (camel_content_type_is (ci->type, "message", "rfc822")) { 1935 content = (CamelDataWrapper *) get_message (imap_folder, uid, ci->childs, ex); 1940 /* TNY TODO: partial message retrieval exception */ 1941 content = (CamelDataWrapper *) get_message (imap_folder, uid, ci->childs, TRUE, ex); 1936 1942 g_free (part_spec); 1937 1943 return content; … … 1957 1963 get_message (CamelImapFolder *imap_folder, const char *uid, 1958 1964 CamelMessageContentInfo *ci, 1959 CamelException *ex)1965 gboolean full, CamelException *ex) 1960 1966 { 1961 1967 CamelImapStore *store = CAMEL_IMAP_STORE (CAMEL_FOLDER (imap_folder)->parent_store); … … 1971 1977 store->server_level >= IMAP_LEVEL_IMAP4REV1 ? "HEADER" : "0"); 1972 1978 1973 stream = camel_imap_folder_fetch_data (imap_folder, uid, section_text, FALSE, ex); 1979 /* TNY: partial message retrieval */ 1980 stream = camel_imap_folder_fetch_data (imap_folder, uid, section_text, FALSE, full, ex); 1974 1981 g_free (section_text); 1975 1982 g_free(part_spec); … … 2011 2018 static CamelMimeMessage * 2012 2019 get_message_simple (CamelImapFolder *imap_folder, const char *uid, 2013 CamelStream *stream, CamelException *ex)2020 CamelStream *stream, gboolean full, CamelException *ex) 2014 2021 { 2015 2022 CamelMimeMessage *msg; … … 2018 2025 if (!stream) { 2019 2026 stream = camel_imap_folder_fetch_data (imap_folder, uid, "", 2020 FALSE, ex);2027 FALSE, full, ex); 2021 2028 if (!stream) 2022 2029 return NULL; … … 2077 2084 /* If its cached in full, just get it as is, this is only a shortcut, 2078 2085 since we get stuff from the cache anyway. It affects a busted connection though. */ 2079 if ( (stream = camel_imap_folder_fetch_data(imap_folder, uid, "", TRUE, NULL))2080 && (msg = get_message_simple(imap_folder, uid, stream, ex)))2086 if ( (stream = camel_imap_folder_fetch_data(imap_folder, uid, "", TRUE, full, NULL)) 2087 && (msg = get_message_simple(imap_folder, uid, stream, full, ex))) 2081 2088 goto done; 2082 2089 … … 2095 2102 #endif 2096 2103 || (!content_info_incomplete(mi->info.content) && !mi->info.content->childs)) { 2097 msg = get_message_simple (imap_folder, uid, NULL, ex);2104 msg = get_message_simple (imap_folder, uid, NULL, full, ex); 2098 2105 } else { 2099 2106 if (content_info_incomplete (mi->info.content)) { … … 2161 2168 */ 2162 2169 if (content_info_incomplete (mi->info.content)) 2163 msg = get_message_simple (imap_folder, uid, NULL, ex);2170 msg = get_message_simple (imap_folder, uid, NULL, full, ex); 2164 2171 else 2165 msg = get_message (imap_folder, uid, mi->info.content, ex);2172 msg = get_message (imap_folder, uid, mi->info.content, full, ex); 2166 2173 } 2167 2174 } while (msg == NULL … … 2185 2192 CamelStream *stream; 2186 2193 2187 stream = camel_imap_folder_fetch_data (imap_folder, uid, "", FALSE, ex); 2194 /* TNY TODO: partial message retrieval exception */ 2195 stream = camel_imap_folder_fetch_data (imap_folder, uid, "", FALSE, TRUE, ex); 2188 2196 if (stream) 2189 2197 camel_object_unref (CAMEL_OBJECT (stream)); … … 2683 2691 } 2684 2692 2693 typedef struct { 2694 const gchar *part_spec; 2695 GData *data; 2696 } PartialRetrieveInfo; 2685 2697 2686 2698 CamelStream * 2687 2699 camel_imap_folder_fetch_data (CamelImapFolder *imap_folder, const char *uid, 2688 2700 const char *section_text, gboolean cache_only, 2689 CamelException *ex)2701 gboolean full, CamelException *ex) 2690 2702 { 2691 2703 CamelFolder *folder = CAMEL_FOLDER (imap_folder); … … 2693 2705 CamelImapResponse *response; 2694 2706 CamelStream *stream; 2695 GData *fetch_data ;2696 char *found_uid ;2697 int i; 2707 GData *fetch_data=NULL; 2708 char *found_uid = NULL, *boundary = NULL; 2709 int i; gboolean free_fuid = FALSE; 2698 2710 2699 2711 /* EXPUNGE responses have to modify the cache, which means … … 2709 2721 CAMEL_IMAP_FOLDER_REC_LOCK (imap_folder, cache_lock); 2710 2722 stream = camel_imap_message_cache_get (imap_folder->cache, uid, section_text, ex); 2711 if (!stream && (!strcmp (section_text, "HEADER") || !strcmp (section_text, "0"))) { 2723 if (!stream && (!strcmp (section_text, "HEADER") || !strcmp (section_text, "0"))) 2724 { 2712 2725 camel_exception_clear (ex); 2713 2726 stream = camel_imap_message_cache_get (imap_folder->cache, uid, "", ex); … … 2732 2745 2733 2746 camel_exception_clear (ex); 2734 if (store->server_level < IMAP_LEVEL_IMAP4REV1 && !*section_text) { 2747 2748 if (full) 2749 { 2750 if (store->server_level < IMAP_LEVEL_IMAP4REV1 && !*section_text) { 2751 response = camel_imap_command (store, folder, ex, 2752 "UID FETCH %s RFC822.PEEK", 2753 uid); 2754 } else { 2755 response = camel_imap_command (store, folder, ex, 2756 "UID FETCH %s BODY.PEEK[%s]", 2757 uid, section_text); 2758 } 2759 /* We won't need the connect_lock again after this. */ 2760 CAMEL_SERVICE_REC_UNLOCK (store, connect_lock); 2761 2762 if (!response) { 2763 CAMEL_IMAP_FOLDER_REC_UNLOCK (imap_folder, cache_lock); 2764 return NULL; 2765 } 2766 2767 for (i = 0; i < response->untagged->len; i++) { 2768 fetch_data = parse_fetch_response (imap_folder, response->untagged->pdata[i]); 2769 found_uid = g_datalist_get_data (&fetch_data, "UID"); 2770 stream = g_datalist_get_data (&fetch_data, "BODY_PART_STREAM"); 2771 if (found_uid && stream && !strcmp (uid, found_uid)) 2772 break; 2773 2774 g_datalist_clear (&fetch_data); 2775 stream = NULL; 2776 } 2777 camel_imap_response_free (store, response); 2778 } else 2779 { 2780 2781 /* Partial message retrieval feature 2782 { HEADER boundary 1.HEADER 1 boundary } */ 2783 2784 int t = 0, boundary_len = 0; 2785 PartialRetrieveInfo infos[3] = { 2786 { "HEADER", NULL }, 2787 { "1.HEADER", NULL }, 2788 { "1", NULL }, 2789 }; 2790 2791 /* TODO: It's better to use BODYSTRUCTURE to get 1.HEADER (Cyrus doesn't support 1.HEADER, Courier does) 2792 * * 1 FETCH (BODYSTRUCTURE (("TEXT" "PLAIN" NIL NIL NIL "7BIT" 144 9 NIL NIL NIL)("IMAGE" "PNG" ("NAME" "drawing.png") NIL NIL "BASE64" 1005522 NIL ("ATTACHMENT" ("FILENAME" "drawing.png")) NIL) "MIXED" ("BOUNDARY" "=-7wX60rl1FvrW91cX0wLC") NIL NIL)) 2793 */ 2794 for (t=0; t < 3; t++) 2795 { 2735 2796 response = camel_imap_command (store, folder, ex, 2736 "UID FETCH %s RFC822.PEEK", 2737 uid); 2738 } else { 2739 response = camel_imap_command (store, folder, ex, 2740 "UID FETCH %s BODY.PEEK[%s]", 2741 uid, section_text); 2742 } 2743 /* We won't need the connect_lock again after this. */ 2744 CAMEL_SERVICE_REC_UNLOCK (store, connect_lock); 2745 2746 if (!response) { 2797 "UID FETCH %s BODY.PEEK[%s]", uid, infos[t].part_spec); 2798 2799 if (!response) 2800 goto errorh; 2801 2802 for (i = 0; i < response->untagged->len; i++) 2803 infos[t].data = parse_partial_fetch_response (imap_folder, response->untagged->pdata[0], infos[t].data, infos[t].part_spec); 2804 camel_imap_response_free (store, response); 2805 2806 if (!boundary) { 2807 boundary = g_strdup (g_datalist_get_data (&(infos[t].data), "BOUNDARY")); 2808 if (boundary) boundary_len = strlen (boundary); 2809 } 2810 if (!found_uid) { 2811 found_uid = g_strdup (g_datalist_get_data (&(infos[t].data), "UID")); 2812 free_fuid = TRUE; 2813 } 2814 } 2815 2816 2817 CAMEL_SERVICE_REC_UNLOCK (store, connect_lock); 2818 2819 stream = NULL; 2820 2821 if (found_uid) 2822 { 2823 CAMEL_IMAP_FOLDER_REC_LOCK (imap_folder, cache_lock); 2824 2825 for (t=0; t < 3; t++) 2826 { 2827 gchar *data = g_datalist_get_data (&(infos[t].data), "PART_BODY"); 2828 size_t len = GPOINTER_TO_INT (g_datalist_get_data (&(infos[t].data), "PART_LEN")); 2829 2830 if (!stream) 2831 { 2832 stream = camel_imap_message_cache_insert (imap_folder->cache, 2833 found_uid, "", (len>0&&data)?data:"", len, NULL); 2834 if (stream == NULL) 2835 stream = camel_stream_mem_new_with_buffer ((len>0&&data)?data:"", len); 2836 if (stream == NULL) { /* wtf? */ 2837 int x=0; 2838 for (x=0; x < 3; x++) 2839 g_datalist_clear (&(infos[x].data)); 2840 goto errorh; 2841 } 2842 } else 2843 { 2844 camel_seekable_stream_seek (CAMEL_SEEKABLE_STREAM (stream), 0, CAMEL_STREAM_END); 2845 2846 if (boundary && !strcmp (infos[t].part_spec, "1.HEADER")) 2847 { 2848 camel_stream_write (stream, "\n--", 3); 2849 camel_stream_write (stream, boundary, boundary_len); 2850 camel_stream_write (stream, "\n", 1); 2851 } 2852 camel_stream_write (stream, data, len); 2853 if (boundary && !strcmp (infos[t].part_spec, "1")) 2854 { 2855 camel_stream_write (stream, "\n--", 3); 2856 camel_stream_write (stream, boundary, boundary_len); 2857 camel_stream_write (stream, "\n", 1); 2858 } 2859 } 2860 2861 g_datalist_clear (&(infos[t].data)); 2862 } 2863 2864 if (stream) 2865 camel_stream_reset (stream); 2866 2747 2867 CAMEL_IMAP_FOLDER_REC_UNLOCK (imap_folder, cache_lock); 2868 } else { 2869 int x=0; 2870 for (x=0; x < 3; x++) 2871 g_datalist_clear (&(infos[x].data)); 2872 goto errorh; 2873 } 2874 2875 } 2876 2877 errorh: 2878 2879 CAMEL_IMAP_FOLDER_REC_UNLOCK (imap_folder, cache_lock); 2880 2881 if (!stream) camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, 2882 _("Could not find message body in FETCH response.")); 2883 2884 if (free_fuid) 2885 g_free (found_uid); 2886 2887 if (boundary) 2888 g_free (boundary); 2889 2890 return stream; 2891 } 2892 2893 2894 2895 static GData * 2896 parse_partial_fetch_response (CamelImapFolder *imap_folder, char *response, GData *data, const gchar *part_spec) 2897 { 2898 if (*response != '(') 2899 { 2900 long seq; 2901 2902 if (*response != '*' || *(response + 1) != ' ') 2903 return NULL; 2904 seq = strtol (response + 2, &response, 10); 2905 if (seq == 0) 2906 return NULL; 2907 if (g_ascii_strncasecmp (response, " FETCH (", 8) != 0) 2908 return NULL; 2909 response += 7; 2910 } 2911 2912 do { 2913 /* Skip the initial '(' or the ' ' between elements */ 2914 response++; 2915 2916 if (!g_ascii_strncasecmp (response, "FLAGS ", 6)) 2917 response += 6; 2918 else if (!g_ascii_strncasecmp (response, "RFC822.SIZE ", 12)) 2919 { /* REMOVE THIS? */ 2920 unsigned long size; 2921 response += 12; 2922 size = strtoul (response, &response, 10); 2923 g_datalist_set_data (&data, "RFC822.SIZE", GUINT_TO_POINTER (size)); 2924 } else if (!g_ascii_strncasecmp (response, "BODY[", 5) || 2925 !g_ascii_strncasecmp (response, "RFC822 ", 7)) 2926 { 2927 char *body = NULL, *p = NULL, *boundary = NULL; 2928 size_t body_len = 0; 2929 2930 if (*response == 'B') 2931 { 2932 response += 5; 2933 p = strchr (response, ']'); 2934 if (!p || *(p + 1) != ' ') 2935 break; 2936 response = p + 2; 2937 } else 2938 response += 7; 2939 2940 body = imap_parse_nstring ((const char **) &response, &body_len); 2941 2942 if (!response) break; 2943 if (!body) body = g_strdup (""); 2944 2945 if (!strcmp (part_spec, "HEADER")) 2946 { 2947 CamelContentType *ct = NULL; 2948 const char *bound=NULL; 2949 char *pstr = (char*)strcasestr (body, "Content-Type:"); 2950 2951 if (pstr) { 2952 pstr = strchr (pstr, ':'); 2953 if (pstr) { pstr++; 2954 ct = camel_content_type_decode(pstr); } 2955 } 2956 2957 if (ct) { 2958 bound = camel_content_type_param(ct, "boundary"); 2959 if (bound) { 2960 boundary = g_strdup (bound); 2961 g_datalist_set_data_full (&data, "BOUNDARY", boundary, g_free); 2962 } 2963 } 2964 } 2965 2966 g_datalist_set_data_full (&data, "PART_BODY", body, g_free); 2967 g_datalist_set_data (&data, "PART_LEN", GINT_TO_POINTER (body_len)); 2968 2969 2970 } else if (!g_ascii_strncasecmp (response, "UID ", 4)) 2971 { 2972 int len = strcspn (response + 4, " )"); 2973 char *uid = g_strndup (response + 4, len); 2974 g_datalist_set_data_full (&data, "UID", uid, g_free); 2975 response += 4 + len; 2976 } else { 2977 g_warning ("Unexpected FETCH response from server: (%s", response); 2978 break; 2979 } 2980 } while (response && *response != ')'); 2981 2982 if (!response || *response != ')') 2983 { 2984 g_warning ("Unexpected FETCH response from server: (%s", response); 2985 g_datalist_clear (&data); 2748 2986 return NULL; 2749 2987 } 2750 2988 2751 for (i = 0; i < response->untagged->len; i++) { 2752 fetch_data = parse_fetch_response (imap_folder, response->untagged->pdata[i]); 2753 found_uid = g_datalist_get_data (&fetch_data, "UID"); 2754 stream = g_datalist_get_data (&fetch_data, "BODY_PART_STREAM"); 2755 if (found_uid && stream && !strcmp (uid, found_uid)) 2756 break; 2757 2758 g_datalist_clear (&fetch_data); 2759 stream = NULL; 2760 } 2761 camel_imap_response_free (store, response); 2762 CAMEL_IMAP_FOLDER_REC_UNLOCK (imap_folder, cache_lock); 2763 if (!stream) { 2764 camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, 2765 _("Could not find message body in FETCH response.")); 2766 } else { 2767 camel_object_ref (CAMEL_OBJECT (stream)); 2768 g_datalist_clear (&fetch_data); 2769 } 2770 2771 return stream; 2989 return data; 2772 2990 } 2773 2991 trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.h
r1052 r1368 81 81 const char *section_text, 82 82 gboolean cache_only, 83 CamelException *ex);83 gboolean full, CamelException *ex); 84 84 85 85 /* Standard Camel function */ trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c
r1063 r1368 673 673 } 674 674 675 676 /* Tinymail hack: always use IMAP4, not IMAP4rev1 (sorry) */ 677 678 force_imap4 = TRUE; 679 store->braindamaged = TRUE; 680 681 /* end of hack :) */ 682 675 683 g_free (buf); 676 684 trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-wrapper.c
r1014 r1368 142 142 CamelStream *datastream; 143 143 144 /* TNY TODO: partial message retrieval exception */ 144 145 datastream = camel_imap_folder_fetch_data ( 145 146 imap_wrapper->folder, imap_wrapper->uid, 146 imap_wrapper->part_spec, FALSE, NULL);147 imap_wrapper->part_spec, FALSE, TRUE, NULL); 147 148 if (!datastream) { 148 149 CAMEL_IMAP_WRAPPER_UNLOCK (imap_wrapper, lock); … … 189 190 190 191 /* Try the cache. */ 192 /* TNY TODO: Partial message retrieval exception */ 191 193 stream = camel_imap_folder_fetch_data (imap_folder, uid, part_spec, 192 TRUE, NULL);194 TRUE, TRUE, NULL); 193 195 if (stream) { 194 196 imap_wrapper_hydrate (imap_wrapper, stream); trunk/libtinymail-camel/tny-camel-account.c
r1305 r1368 52 52 tny_camel_account_get_account_type (TnyAccount *self) 53 53 { 54 return TNY_CAMEL_ACCOUNT_GET_CLASS (self)->get_account_type_func (self); 55 } 56 57 static TnyAccountType 58 tny_camel_account_get_account_type_default (TnyAccount *self) 59 { 54 60 TnyCamelAccountPriv *priv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (self); 55 61 … … 70 76 tny_camel_account_add_option (TnyCamelAccount *self, const gchar *option) 71 77 { 78 TNY_CAMEL_ACCOUNT_GET_CLASS (self)->add_option_func (self, option); 79 } 80 81 void 82 tny_camel_account_add_option_default (TnyCamelAccount *self, const gchar *option) 83 { 72 84 TnyCamelAccountPriv *priv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (self); 73 85 … … 82 94 static void 83 95 tny_camel_account_set_url_string (TnyAccount *self, const gchar *url_string) 96 { 97 TNY_CAMEL_ACCOUNT_GET_CLASS (self)->set_url_string_func (self, url_string); 98 } 99 100 static void 101 tny_camel_account_set_url_string_default (TnyAccount *self, const gchar *url_string) 84 102 { 85 103 TnyCamelAccountPriv *priv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (self); … … 101 119 tny_camel_account_get_url_string (TnyAccount *self) 102 120 { 121 return TNY_CAMEL_ACCOUNT_GET_CLASS (self)->get_url_string_func (self); 122 } 123 124 static const gchar* 125 tny_camel_account_get_url_string_default (TnyAccount *self) 126 { 103 127 TnyCamelAccountPriv *priv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (self); 104 128 … … 109 133 static void 110 134 tny_camel_account_set_name (TnyAccount *self, const gchar *name) 135 { 136 TNY_CAMEL_ACCOUNT_GET_CLASS (self)->set_name_func (self, name); 137 } 138 139 static void 140 tny_camel_account_set_name_default (TnyAccount *self, const gchar *name) 111 141 { 112 142 TnyCamelAccountPriv *priv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (self); … … 122 152 static const gchar* 123 153 tny_camel_account_get_name (TnyAccount *self) 154 { 155 return TNY_CAMEL_ACCOUNT_GET_CLASS (self)->get_name_func (self); 156 } 157 158 static const gchar* 159 tny_camel_account_get_name_default (TnyAccount *self) 124 160 { 125 161 TnyCamelAccountPriv *priv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (self); … … 212 248 tny_camel_account_is_connected (TnyAccount *self) 213 249 { 250 return TNY_CAMEL_ACCOUNT_GET_CLASS (self)->is_connected_func (self); 251 } 252 253 static gboolean 254 tny_camel_account_is_connected_default (TnyAccount *self) 255 { 214 256 TnyCamelAccountPriv *priv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (self); 215 257 return priv->connected; … … 238 280 } 239 281 240 241 282 static void 242 283 tny_camel_account_set_id (TnyAccount *self, const gchar *id) 284 { 285 TNY_CAMEL_ACCOUNT_GET_CLASS (self)->set_id_func (self, id); 286 } 287 288 static void 289 tny_camel_account_set_id_default (TnyAccount *self, const gchar *id) 243 290 { 244 291 TnyCamelAccountPriv *priv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (self); … … 259 306 tny_camel_account_set_proto (TnyAccount *self, const gchar *proto) 260 307 { 308 TNY_CAMEL_ACCOUNT_GET_CLASS (self)->set_proto_func (self, proto); 309 } 310 311 static void 312 tny_camel_account_set_proto_default (TnyAccount *self, const gchar *proto) 313 { 261 314 TnyCamelAccountPriv *priv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (self); 262 315 … … 278 331 tny_camel_account_set_user (TnyAccount *self, const gchar *user) 279 332 { 333 TNY_CAMEL_ACCOUNT_GET_CLASS (self)->set_user_func (self, user); 334 } 335 336 static void 337 tny_camel_account_set_user_default (TnyAccount *self, const gchar *user) 338 { 280 339 TnyCamelAccountPriv *priv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (self); 281 340 … … 297 356 tny_camel_account_set_hostname (TnyAccount *self, const gchar *host) 298 357 { 358 TNY_CAMEL_ACCOUNT_GET_CLASS (self)->set_hostname_func (self, host); 359 } 360 361 static void 362 tny_camel_account_set_hostname_default (TnyAccount *self, const gchar *host) 363 { 299 364 TnyCamelAccountPriv *priv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (self); 300 365 … … 315 380 static void 316 381 tny_camel_account_set_pass_func (TnyAccount *self, TnyGetPassFunc get_pass_func) 382 { 383 TNY_CAMEL_ACCOUNT_GET_CLASS (self)->set_pass_func_func (self, get_pass_func); 384 } 385 386 static void 387 tny_camel_account_set_pass_func_default (TnyAccount *self, TnyGetPassFunc get_pass_func) 317 388 { 318 389 TnyCamelAccountPriv *priv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (self); … … 337 408 tny_camel_account_set_forget_pass_func (TnyAccount *self, TnyForgetPassFunc get_forget_pass_func) 338 409 { 410 TNY_CAMEL_ACCOUNT_GET_CLASS (self)->set_forget_pass_func_func (self, get_forget_pass_func); 411 } 412 413 static void 414 tny_camel_account_set_forget_pass_func_default (TnyAccount *self, TnyForgetPassFunc get_forget_pass_func) 415 { 339 416 TnyCamelAccountPriv *priv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (self); 340 417 … … 353 430 tny_camel_account_get_id (TnyAccount *self) 354 431 { 432 return TNY_CAMEL_ACCOUNT_GET_CLASS (self)->get_id_func (self); 433 } 434 435 static const gchar* 436 tny_camel_account_get_id_default (TnyAccount *self) 437 { 355 438 TnyCamelAccountPriv *priv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (self); 356 439 const gchar *retval; … … 366 449 tny_camel_account_get_proto (TnyAccount *self) 367 450 { 451 return TNY_CAMEL_ACCOUNT_GET_CLASS (self)->get_proto_func (self); 452 } 453 454 static const gchar* 455 tny_camel_account_get_proto_default (TnyAccount *self) 456 { 368 457 TnyCamelAccountPriv *priv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (self); 369 458 const gchar *retval; … … 379 468 tny_camel_account_get_user (TnyAccount *self) 380 469 { 470 return TNY_CAMEL_ACCOUNT_GET_CLASS (self)->get_user_func (self); 471 } 472 473 static const gchar* 474 tny_camel_account_get_user_default (TnyAccount *self) 475 { 381 476 TnyCamelAccountPriv *priv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (self); 382 477 const gchar *retval; … … 391 486 static const gchar* 392 487 tny_camel_account_get_hostname (TnyAccount *self) 488 { 489 return TNY_CAMEL_ACCOUNT_GET_CLASS (self)->get_hostname_func (self); 490 } 491 492 static const gchar* 493 tny_camel_account_get_hostname_default (TnyAccount *self) 393 494 { 394 495 TnyCamelAccountPriv *priv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (self); … … 405 506 tny_camel_account_get_pass_func (TnyAccount *self) 406 507 { 508 return TNY_CAMEL_ACCOUNT_GET_CLASS (self)->get_pass_func_func (self); 509 } 510 511 static TnyGetPassFunc 512 tny_camel_account_get_pass_func_default (TnyAccount *self) 513 { 407 514 TnyCamelAccountPriv *priv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (self); 408 515 TnyGetPassFunc retval; … … 417 524 static TnyForgetPassFunc 418 525 tny_camel_account_get_forget_pass_func (TnyAccount *self) 526 { 527 return TNY_CAMEL_ACCOUNT_GET_CLASS (self)->get_forget_pass_func_func (self); 528 } 529 530 static TnyForgetPassFunc 531 tny_camel_account_get_forget_pass_func_default (TnyAccount *self) 419 532 { 420 533 TnyCamelAccountPriv *priv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (self); … … 492 605 void 493 606 tny_camel_account_set_online_status (TnyCamelAccount *self, gboolean offline) 607 { 608 TNY_CAMEL_ACCOUNT_GET_CLASS (self)->set_online_status_func (self, offline); 609 } 610 611 void 612 tny_camel_account_set_online_status_default (TnyCamelAccount *self, gboolean offline) 494 613 { 495 614 TnyCamelAccountPriv *priv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (self); … … 636 755 object_class = (GObjectClass*) class; 637 756 757 758 class->get_hostname_func = tny_camel_account_get_hostname_default; 759 class->set_hostname_func = tny_camel_account_set_hostname_default; 760 class->get_proto_func = tny_camel_account_get_proto_default; 761 class->set_proto_func = tny_camel_account_set_proto_default; 762 class->get_user_func = tny_camel_account_get_user_default; 763 class->set_user_func = tny_camel_account_set_user_default; 764 class->get_pass_func_func = tny_camel_account_get_pass_func_default; 765 class->set_pass_func_func = tny_camel_account_set_pass_func_default; 766 class->get_forget_pass_func_func = tny_camel_account_get_forget_pass_func_default; 767 class->set_forget_pass_func_func = tny_camel_account_set_forget_pass_func_default; 768 class->set_id_func = tny_camel_account_set_id_default; 769 class->get_id_func = tny_camel_account_get_id_default; 770 class->is_connected_func = tny_camel_account_is_connected_default; 771 class->set_url_string_func = tny_camel_account_set_url_string_default; 772 class->get_url_string_func = tny_camel_account_get_url_string_default; 773 class->get_name_func = tny_camel_account_get_name_default; 774 class->set_name_func = tny_camel_account_set_name_default; 775 class->get_account_type_func = tny_camel_account_get_account_type_default; 776 777 class->add_option_func = tny_camel_account_add_option_default; 778 class->set_online_status_func = tny_camel_account_set_online_status_default; 779 638 780 object_class->finalize = tny_camel_account_finalize; 639 781 trunk/libtinymail-camel/tny-camel-account.h
r1148 r1368 53 53 54 54 void (*reconnect_func) (TnyCamelAccount *self); 55 56 /* Virtual methods */ 57 58 gboolean (*is_connected_func)(TnyAccount *self); 59 void (*set_id_func) (TnyAccount *self, const gchar *id); 60 void (*set_name_func) (TnyAccount *self, const gchar *name); 61 void (*set_proto_func) (TnyAccount *self, const gchar *proto); 62 void (*set_user_func) (TnyAccount *self, const gchar *user); 63 void (*set_hostname_func) (TnyAccount *self, const gchar *host); 64 void (*set_url_string_func) (TnyAccount *self, const gchar *url_string); 65 void (*set_pass_func_func) (TnyAccount *self, TnyGetPassFunc get_pass_func); 66 void (*set_forget_pass_func_func) (TnyAccount *self, TnyForgetPassFunc get_forget_pass_func); 67 TnyGetPassFunc (*get_pass_func_func) (TnyAccount *self); 68 TnyForgetPassFunc (*get_forget_pass_func_func) (TnyAccount *self); 69 const gchar* (*get_id_func) (TnyAccount *self); 70 const gchar* (*get_name_func) (TnyAccount *self); 71 const gchar* (*get_proto_func) (TnyAccount *self); 72 const gchar* (*get_user_func) (TnyAccount *self); 73 const gchar* (*get_hostname_func) (TnyAccount *self); 74 const gchar* (*get_url_string_func) (TnyAccount *self); 75 TnyAccountType (*get_account_type_func) (TnyAccount *self); 76 77 void (*add_option_func) (TnyCamelAccount *self, const gchar *option); 78 void (*set_online_status_func) (TnyCamelAccount *self, gboolean offline); 79 55 80 }; 56 81 trunk/libtinymail-camel/tny-camel-folder-priv.h
r1359 r1368 65 65 void _tny_camel_folder_set_iter (TnyCamelFolder *folder, CamelFolderInfo *iter); 66 66 void _tny_camel_folder_set_account (TnyCamelFolder *self, TnyAccount *account); 67 67 gboolean _tny_camel_folder_load_folder_no_lock (TnyCamelFolderPriv *priv); 68 68 void _tny_camel_folder_set_folder (TnyCamelFolder *self, CamelFolder *camel_folder); 69 69 trunk/libtinymail-camel/tny-camel-folder.c
r1359 r1368 220 220 221 221 return TRUE; 222 } 223 224 gboolean 225 _tny_camel_folder_load_folder_no_lock (TnyCamelFolderPriv *priv) 226 { 227 return load_folder_no_lock (priv); 222 228 } 223 229 … … 2319 2325 2320 2326 priv->remove_strat = tny_camel_msg_remove_strategy_new (); 2321 priv->receive_strat = tny_camel_ full_msg_receive_strategy_new ();2327 priv->receive_strat = tny_camel_partial_msg_receive_strategy_new (); 2322 2328 2323 2329 return; trunk/libtinymail-camel/tny-camel-pop-folder.c
r900 r1368 18 18 */ 19 19 20 /* TODO: Refactor to a TnyPOPStoreAccount, TnyPOPStoreAccount and21 TnyNNTPStoreAccount. Maybe also add a TnyExchangeStoreAccount? This file can22 stay as an abstract TnyStoreAccount type. */23 20 24 21 #include <config.h> … … 38 35 39 36 #include <tny-folder.h> 37 #include <tny-camel-pop-store-account.h> 40 38 41 39 #include "tny-camel-account-priv.h" … … <
