aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2002-06-03 10:56:35 +0800
committerMichael Zucci <zucchi@src.gnome.org>2002-06-03 10:56:35 +0800
commitd0a6ed17b65560ed07ed005b38fab449dc507aef (patch)
tree11288ede158ffadd5a00ac0e3c6f527deb99221c /camel/providers/imap
parentaa3bfbe4224ff1c99d358aeac464ce7e9f0963a8 (diff)
downloadgsoc2013-evolution-d0a6ed17b65560ed07ed005b38fab449dc507aef.tar.gz
gsoc2013-evolution-d0a6ed17b65560ed07ed005b38fab449dc507aef.tar.zst
gsoc2013-evolution-d0a6ed17b65560ed07ed005b38fab449dc507aef.zip
setup/free the mech string.
2002-06-02 Not Zed <NotZed@Ximian.com> * camel-sasl.c (camel_sasl_new): (camel_sasl_finalize): setup/free the mech string. * camel-sasl.h: Added 'mech' mechanism string. 2002-06-01 Not Zed <NotZed@Ximian.com> * providers/imap/camel-imap-folder.c (imap_getv): Implement. Only the object_description arg. (camel_imap_folder_get_type): Init parent_class holder. * providers/local/camel-local-folder.c (local_getv): Implement, object_description arg. * camel-folder.c (folder_getv): Implement, add a bunch of args you can get -> camel_folder_get_unread_count etc will be going RSN i hope. (camel_folder_finalize): Free cached description string. * camel-object.c (cobject_getv): Implement CAMEL_OBJECT_ARG_DESCRIPTION, just return the classname of the object. (camel_object_getv): (camel_object_get): (camel_object_setv): (camel_object_set): Take object = void *, to simplify usage. (camel_object_setv): Removed unecessary locals. (camel_object_getv): Same. (camel_object_free): New method, free an arg, upto implementations whether args are static/const or not. (cobject_free): Implement a dummy do nothing free. 2002-05-31 Not Zed <NotZed@Ximian.com> * camel-vee-folder.c (camel_vee_folder_get_location): new function to get the real location (folder) (and uid) of a vfolder object. Using the folderinfo, since we already have it, maybe it should use the uid. svn path=/trunk/; revision=17073
Diffstat (limited to 'camel/providers/imap')
-rw-r--r--camel/providers/imap/camel-imap-folder.c46
1 files changed, 45 insertions, 1 deletions
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index 076066782f..1855ce2e8b 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -76,6 +76,8 @@
static CamelDiscoFolderClass *disco_folder_class = NULL;
static void imap_finalize (CamelObject *object);
+static int imap_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args);
+
static void imap_rescan (CamelFolder *folder, int exists, CamelException *ex);
static void imap_refresh_info (CamelFolder *folder, CamelException *ex);
static void imap_sync_online (CamelFolder *folder, CamelException *ex);
@@ -119,6 +121,8 @@ static void imap_search_free (CamelFolder *folder, GPtrArray *uid
static void imap_thaw (CamelFolder *folder);
+static CamelObjectClass *parent_class;
+
GData *parse_fetch_response (CamelImapFolder *imap_folder, char *msg_att);
static void
@@ -130,6 +134,8 @@ camel_imap_folder_class_init (CamelImapFolderClass *camel_imap_folder_class)
disco_folder_class = CAMEL_DISCO_FOLDER_CLASS (camel_type_get_global_classfuncs (camel_disco_folder_get_type ()));
/* virtual method overload */
+ ((CamelObjectClass *)camel_imap_folder_class)->getv = imap_getv;
+
camel_folder_class->get_message = imap_get_message;
camel_folder_class->rename = imap_rename;
camel_folder_class->search_by_expression = imap_search_by_expression;
@@ -180,8 +186,9 @@ camel_imap_folder_get_type (void)
static CamelType camel_imap_folder_type = CAMEL_INVALID_TYPE;
if (camel_imap_folder_type == CAMEL_INVALID_TYPE) {
+ parent_class = camel_disco_folder_get_type();
camel_imap_folder_type =
- camel_type_register (CAMEL_DISCO_FOLDER_TYPE, "CamelImapFolder",
+ camel_type_register (parent_class, "CamelImapFolder",
sizeof (CamelImapFolder),
sizeof (CamelImapFolderClass),
(CamelObjectClassInitFunc) camel_imap_folder_class_init,
@@ -387,6 +394,43 @@ imap_finalize (CamelObject *object)
g_free(imap_folder->priv);
}
+static int
+imap_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
+{
+ CamelFolder *folder = (CamelFolder *)object;
+ int i, count=args->argc;
+ guint32 tag;
+
+ for (i=0;i<args->argc;i++) {
+ CamelArgGet *arg = &args->argv[i];
+
+ tag = arg->tag;
+
+ switch (tag & CAMEL_ARG_TAG) {
+ /* CamelObject args */
+ case CAMEL_OBJECT_ARG_DESCRIPTION:
+ if (folder->description == NULL) {
+ CamelURL *uri = ((CamelService *)folder->parent_store)->url;
+
+ /* what if the full name doesn't incclude /'s? does it matter? */
+ folder->description = g_strdup_printf("%s@%s:%s", uri->user, uri->host, folder->full_name);
+ }
+ *arg->ca_str = folder->description;
+ break;
+ default:
+ count--;
+ continue;
+ }
+
+ arg->tag = (tag & CAMEL_ARG_TYPE) | CAMEL_ARG_IGNORE;
+ }
+
+ if (count)
+ return ((CamelObjectClass *)parent_class)->getv(object, ex, args);
+
+ return 0;
+}
+
static void
imap_rename (CamelFolder *folder, const char *new)
{