[evolution-kolab/ek-wip-acl: 19/21] CamelImapxAcl: implemented MYRIGHTS updater
- From: Christian Hilberg <chilberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-kolab/ek-wip-acl: 19/21] CamelImapxAcl: implemented MYRIGHTS updater
- Date: Thu, 11 Oct 2012 14:52:57 +0000 (UTC)
commit 134c46434b696f3e35d110aa642fe43930d9c802
Author: Christian Hilberg <hilberg kernelconcepts de>
Date: Thu Oct 11 12:33:32 2012 +0200
CamelImapxAcl: implemented MYRIGHTS updater
* implemented function which updates the CamelImapxAcl
hash table that holds the MYRIGHTS strings for the
mailboxes
src/libekolab/camel-imapx-acl.c | 22 +++++++++++++++++++++-
1 files changed, 21 insertions(+), 1 deletions(-)
---
diff --git a/src/libekolab/camel-imapx-acl.c b/src/libekolab/camel-imapx-acl.c
index 9948d71..20a2281 100644
--- a/src/libekolab/camel-imapx-acl.c
+++ b/src/libekolab/camel-imapx-acl.c
@@ -576,15 +576,35 @@ camel_imapx_acl_update_myrights (CamelImapxAcl *acl,
const gchar *rights,
GError **err)
{
+ GError *tmp_err = NULL;
+ gboolean ok = FALSE;
+
g_return_val_if_fail (acl != NULL, FALSE);
+ g_return_val_if_fail (acl->myrights != NULL, FALSE);
g_return_val_if_fail (mbox_name != NULL, FALSE);
/* rights may be NULL (used for deletion) */
g_return_val_if_fail (err == NULL || *err == NULL, FALSE);
+ if (rights != NULL) {
+ ok = imapx_acl_entry_validate_rights (rights,
+ &tmp_err);
+ if (! ok) {
+ g_propagate_error (err, tmp_err);
+ return FALSE;
+ }
+ }
+
/* (acquire acl lock) */
g_mutex_lock (&(acl->lock));
- g_warning ("%s()[%u] FIXME implement me", __func__, __LINE__);
+ if (rights != NULL) {
+ g_hash_table_replace (acl->myrights,
+ g_strdup (mbox_name),
+ g_strdup (rights));
+ } else {
+ g_hash_table_remove (acl->myrights,
+ mbox_name);
+ }
/* (release acl lock) */
g_mutex_unlock (&(acl->lock));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]