[evolution-data-server/imap-notify: 1/23] Add camel_imapx_list_response_get_oldname().



commit c10262c43a74fde2e85ef00f21ccbfc8d26dd4d2
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 f99b8e8..3f6f62c 100644
--- a/docs/reference/camel/camel-sections.txt
+++ b/docs/reference/camel/camel-sections.txt
@@ -843,6 +843,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]