[evolution-data-server] Add camel_imapx_list_response_get_oldname().



commit 583e62c2923e035f8a341a005a31007fef8fe64a
Author: Matthew Barnes <mbarnes redhat com>
Date:   Fri Aug 30 08:38:28 2013 -0400

    Add camel_imapx_list_response_get_oldname().
    
    Convenience function returns the value of the "OLDNAME" extended data
    item, or NULL if no such extended data item is present.

 camel/camel-imapx-list-response.c       |   30 ++++++++++++++++++++++++++++++
 camel/camel-imapx-list-response.h       |    2 ++
 docs/reference/camel/camel-sections.txt |    1 +
 3 files changed, 33 insertions(+), 0 deletions(-)
---
diff --git a/camel/camel-imapx-list-response.c b/camel/camel-imapx-list-response.c
index 27ec415..cb718e0 100644
--- a/camel/camel-imapx-list-response.c
+++ b/camel/camel-imapx-list-response.c
@@ -736,6 +736,36 @@ camel_imapx_list_response_ref_extended_item (CamelIMAPXListResponse *response,
 }
 
 /**
+ * camel_imapx_list_response_get_oldname:
+ * @response: a #CamelIMAPXListResponse
+ *
+ * Convenience function returns the value of the "OLDNAME" extended data
+ * item, or %NULL if no such extended data item is present.
+ *
+ * The presence of this extended data item indicates the mailbox has been
+ * renamed.  See <ulink url="http://tools.ietf.org/html/rfc5465#section-5.4";>
+ * RFC 5465 Section 5.4</ulink> for further details.
+ *
+ * Returns: the old mailbox name, or %NULL
+ *
+ * Since: 3.12
+ **/
+const gchar *
+camel_imapx_list_response_get_oldname (CamelIMAPXListResponse *response)
+{
+       GHashTable *extended_items;
+       GVariant *value;
+
+       g_return_val_if_fail (CAMEL_IS_IMAPX_LIST_RESPONSE (response), NULL);
+
+       extended_items = response->priv->extended_items;
+
+       value = g_hash_table_lookup (extended_items, "OLDNAME");
+
+       return (value != NULL) ? g_variant_get_string (value, NULL) : NULL;
+}
+
+/**
  * camel_imapx_list_response_get_summary_flags:
  * @response: a #CamelIMAPXListResponse
  *
diff --git a/camel/camel-imapx-list-response.h b/camel/camel-imapx-list-response.h
index c15c49a..aef81f3 100644
--- a/camel/camel-imapx-list-response.h
+++ b/camel/camel-imapx-list-response.h
@@ -112,6 +112,8 @@ GHashTable *        camel_imapx_list_response_dup_attributes
 GVariant *     camel_imapx_list_response_ref_extended_item
                                        (CamelIMAPXListResponse *response,
                                         const gchar *extended_item_tag);
+const gchar *  camel_imapx_list_response_get_oldname
+                                       (CamelIMAPXListResponse *response);
 CamelStoreInfoFlags
                camel_imapx_list_response_get_summary_flags
                                        (CamelIMAPXListResponse *response);
diff --git a/docs/reference/camel/camel-sections.txt b/docs/reference/camel/camel-sections.txt
index 27dddef..9c076bb 100644
--- a/docs/reference/camel/camel-sections.txt
+++ b/docs/reference/camel/camel-sections.txt
@@ -848,6 +848,7 @@ camel_imapx_list_response_add_attribute
 camel_imapx_list_response_has_attribute
 camel_imapx_list_response_dup_attributes
 camel_imapx_list_response_ref_extended_item
+camel_imapx_list_response_get_oldname
 camel_imapx_list_response_get_summary_flags
 <SUBSECTION Standard>
 CAMEL_IMAPX_LIST_RESPONSE


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]