Top | ![]() |
![]() |
![]() |
![]() |
CamelIMAPXNamespaceResponse encapsulates an IMAP NAMESPACE response, which consists of a set of CamelIMAPXNamespace objects grouped by CamelIMAPXNamespaceCategory.
CamelIMAPXNamespaceResponse * camel_imapx_namespace_response_new (CamelIMAPXInputStream *stream
,GCancellable *cancellable
,GError **error
);
Attempts to parse an IMAP NAMESPACE response from stream
and, if
successful, stores the response data in a new CamelIMAPXNamespaceResponse.
If an error occurs, the function sets error
and returns NULL
.
stream |
a CamelIMAPXInputStream |
|
cancellable |
optional GCancellable object, or |
|
error |
return location for a GError, or |
Since: 3.12
CamelIMAPXNamespaceResponse *
camel_imapx_namespace_response_faux_new
(CamelIMAPXListResponse *list_response
);
Fabricates a new CamelIMAPXNamespaceResponse from list_response
.
The returned CamelIMAPXNamespaceResponse will consist of a single
personal CamelIMAPXNamespace with an empty mailbox prefix string,
and a mailbox separator character taken from list_response
.
Use this function when the IMAP server does not list the "NAMESPACE" keyword in its CAPABILITY response.
Since: 3.12
GList *
camel_imapx_namespace_response_list (CamelIMAPXNamespaceResponse *response
);
Returns a list of IMAP namespaces in the order received from the IMAP server, which means they are grouped by CamelIMAPXNamespaceCategory.
The namespaces returned in the list are referenced for thread-safety.
They must each be unreferenced with g_object_unref()
when finished with
them. Free the returned list itself with g_list_free()
.
An easy way to free the list properly in one step is as follows:
1 |
g_list_free_full (list, g_object_unref); |
Since: 3.12
void camel_imapx_namespace_response_add (CamelIMAPXNamespaceResponse *response
,CamelIMAPXNamespace *namespace
);
void camel_imapx_namespace_response_remove (CamelIMAPXNamespaceResponse *response
,CamelIMAPXNamespace *namespace
);
Removes namespace
from the list of namespaces in the response
.
If no such namespace exists then does nothing.
Since: 3.16
CamelIMAPXNamespace * camel_imapx_namespace_response_lookup (CamelIMAPXNamespaceResponse *response
,const gchar *mailbox_name
,gchar separator
);
Attempts to match mailbox_name
and separator
to a known IMAP namespace
and returns a CamelIMAPXNamespace, or NULL
if no match was found.
The returned CamelIMAPXNamespace is referenced for thread-safety and
should be unreferenced with g_object_unref()
when finished with it.
Since: 3.12
CamelIMAPXNamespace * camel_imapx_namespace_response_lookup_for_path (CamelIMAPXNamespaceResponse *response
,const gchar *folder_path
);
Attempts to match folder_path
to a known IMAP namespace and returns a
CamelIMAPXNamespace, or NULL
if no match was found.
If the result is ambiguous, meaning folder_path
could belong to one of
several IMAP namespaces, the namespace with the longest matching prefix
string is preferred. This has the effect of giving a namespace with an
empty prefix the lowest priority.
The returned CamelIMAPXNamespace is referenced for thread-safety and
should be unreferenced with g_object_unref()
when finished with it.
Since: 3.12
struct CamelIMAPXNamespaceResponse { };
Contains only private data that should be read and manipulated using the functions below.
Since: 3.12