evolution r36190 - branches/mail-dbus-remoting/mail
- From: abharath svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution r36190 - branches/mail-dbus-remoting/mail
- Date: Fri, 29 Aug 2008 06:58:13 +0000 (UTC)
Author: abharath
Date: Fri Aug 29 06:58:13 2008
New Revision: 36190
URL: http://svn.gnome.org/viewvc/evolution?rev=36190&view=rev
Log:
Some more camel_folder_remote_* funcs
Modified:
branches/mail-dbus-remoting/mail/camel-folder-remote-impl.c
branches/mail-dbus-remoting/mail/camel-folder-remote.c
branches/mail-dbus-remoting/mail/camel-folder-remote.h
Modified: branches/mail-dbus-remoting/mail/camel-folder-remote-impl.c
==============================================================================
--- branches/mail-dbus-remoting/mail/camel-folder-remote-impl.c (original)
+++ branches/mail-dbus-remoting/mail/camel-folder-remote-impl.c Fri Aug 29 06:58:13 2008
@@ -157,19 +157,84 @@
} else if (strcmp(method, "camel_folder_set_message_flags") == 0) {
gboolean ret, is_set;
const char *uid;
- unsigned int flags, set;
+ guint32 flags, set;
ret = dbus_message_get_args (message, NULL,
DBUS_TYPE_STRING, &folder_hash_key,
DBUS_TYPE_STRING, &uid,
- DBUS_TYPE_INT32, &flags,
- DBUS_TYPE_INT32, &set,
+ DBUS_TYPE_UINT32, &flags,
+ DBUS_TYPE_UINT32, &set,
DBUS_TYPE_INVALID);
folder = g_hash_table_lookup (folder_hash, folder_hash_key);
is_set = camel_folder_set_message_flags (folder, uid, flags, set);
dbus_message_append_args (return_val, DBUS_TYPE_INT32, &is_set, DBUS_TYPE_INVALID);
+ } else if (strcmp(method, "camel_folder_get_folder_flags") == 0) {
+ gboolean ret;
+ guint32 folder_flags;
+
+ ret = dbus_message_get_args (message, NULL,
+ DBUS_TYPE_STRING, &folder_hash_key,
+ DBUS_TYPE_INVALID);
+ folder = g_hash_table_lookup (folder_hash, folder_hash_key);
+
+ folder_flags = folder->folder_flags;
+ dbus_message_append_args (return_val, DBUS_TYPE_UINT32, &folder_flags, DBUS_TYPE_INVALID);
+ } else if (strcmp(method, "camel_folder_get_message_user_flag") == 0) {
+ gboolean ret, user_flag;
+ const char *uid, *name;
+
+ ret = dbus_message_get_args (message, NULL,
+ DBUS_TYPE_STRING, &folder_hash_key,
+ DBUS_TYPE_STRING, &uid,
+ DBUS_TYPE_STRING, &name,
+ DBUS_TYPE_INVALID);
+ folder = g_hash_table_lookup (folder_hash, folder_hash_key);
+
+ user_flag = camel_folder_get_message_user_flag (folder, uid, name);
+ dbus_message_append_args (return_val, DBUS_TYPE_INT32, &user_flag, DBUS_TYPE_INVALID);
+ } else if (strcmp(method, "camel_folder_set_message_user_flag") == 0) {
+ gboolean ret, user_flag;
+ const char *uid, *name;
+
+ ret = dbus_message_get_args (message, NULL,
+ DBUS_TYPE_STRING, &folder_hash_key,
+ DBUS_TYPE_STRING, &uid,
+ DBUS_TYPE_STRING, &name,
+ DBUS_TYPE_INT32, &user_flag,
+ DBUS_TYPE_INVALID);
+ folder = g_hash_table_lookup (folder_hash, folder_hash_key);
+
+ camel_folder_set_message_user_flag (folder, uid, name, user_flag);
+ dbus_message_append_args (return_val, DBUS_TYPE_INVALID);
+ } else if (strcmp(method, "camel_folder_get_message_user_tag") == 0) {
+ gboolean ret;
+ const char *uid, *name, user_tag;
+
+ ret = dbus_message_get_args (message, NULL,
+ DBUS_TYPE_STRING, &folder_hash_key,
+ DBUS_TYPE_STRING, &uid,
+ DBUS_TYPE_STRING, &name,
+ DBUS_TYPE_INVALID);
+ folder = g_hash_table_lookup (folder_hash, folder_hash_key);
+
+ user_tag = camel_folder_get_message_user_tag (folder, uid, name);
+ dbus_message_append_args (return_val, DBUS_TYPE_STRING, &user_tag, DBUS_TYPE_INVALID);
+ } else if (strcmp(method, "camel_folder_set_message_user_tag") == 0) {
+ gboolean ret;
+ const char *uid, *name, *user_tag;
+
+ ret = dbus_message_get_args (message, NULL,
+ DBUS_TYPE_STRING, &folder_hash_key,
+ DBUS_TYPE_STRING, &uid,
+ DBUS_TYPE_STRING, &name,
+ DBUS_TYPE_STRING, &user_tag,
+ DBUS_TYPE_INVALID);
+ folder = g_hash_table_lookup (folder_hash, folder_hash_key);
+
+ camel_folder_set_message_user_tag (folder, uid, name, user_tag);
+ dbus_message_append_args (return_val, DBUS_TYPE_INVALID);
} else if (strncmp (method, "camel_object", 12) == 0) {
return camel_object_signal_handler (connection, message, user_data, CAMEL_ROT_FOLDER);
} else
Modified: branches/mail-dbus-remoting/mail/camel-folder-remote.c
==============================================================================
--- branches/mail-dbus-remoting/mail/camel-folder-remote.c (original)
+++ branches/mail-dbus-remoting/mail/camel-folder-remote.c Fri Aug 29 06:58:13 2008
@@ -259,20 +259,144 @@
CAMEL_FOLDER_INTERFACE,
"camel_folder_set_message_flags",
&error,
- "ssii=>i", folder->object_id, uid, flags, set, &is_set);
+ "ssuu=>i", folder->object_id, uid, flags, set, &is_set);
if (!ret) {
- g_warning ("Error: Camel folder sync: %s\n", error.message);
+ g_warning ("Error: Camel folder set message flags: %s\n", error.message);
return 0;
}
- d(printf("Camel folder sync remotely\n"));
+ d(printf("Camel folder set message flags remotely\n"));
return is_set;
}
-guint32 camel_folder_remote_get_folder_flags (CamelFolderRemote *folder)
+guint32
+camel_folder_remote_get_folder_flags (CamelFolderRemote *folder)
{
- return 0;
+ gboolean ret;
+ DBusError error;
+ guint32 folder_flags;
+
+ dbus_error_init (&error);
+ /* Invoke the appropriate dbind call to MailSessionRemoteImpl */
+ ret = dbind_context_method_call (evolution_dbus_peek_context(),
+ CAMEL_DBUS_NAME,
+ CAMEL_FOLDER_OBJECT_PATH,
+ CAMEL_FOLDER_INTERFACE,
+ "camel_folder_get_folder_flags",
+ &error,
+ "s=>u", folder->object_id, &folder_flags);
+
+ if (!ret) {
+ g_warning ("Error: Camel folder get folder flags: %s\n", error.message);
+ return 0;
+ }
+
+ d(printf("Camel folder get folder flags remotely\n"));
+
+ return folder_flags;
+}
+
+gboolean
+camel_folder_remote_get_message_user_flag (CamelFolderRemote *folder, const char *uid,
+ const char *name)
+{
+ gboolean ret, user_flag;
+ DBusError error;
+
+ dbus_error_init (&error);
+ /* Invoke the appropriate dbind call to MailSessionRemoteImpl */
+ ret = dbind_context_method_call (evolution_dbus_peek_context(),
+ CAMEL_DBUS_NAME,
+ CAMEL_FOLDER_OBJECT_PATH,
+ CAMEL_FOLDER_INTERFACE,
+ "camel_folder_get_message_user_flag",
+ &error,
+ "sss=>i", folder->object_id, uid, name, &user_flag);
+
+ if (!ret) {
+ g_warning ("Error: Camel folder get message user flag: %s\n", error.message);
+ return 0;
+ }
+
+ d(printf("Camel folder get message user flag remotely\n"));
+ return user_flag;
+}
+
+void
+camel_folder_remote_set_message_user_flag (CamelFolderRemote *folder, const char *uid,
+ const char *name, gboolean value)
+{
+ gboolean ret;
+ DBusError error;
+
+ dbus_error_init (&error);
+ /* Invoke the appropriate dbind call to MailSessionRemoteImpl */
+ ret = dbind_context_method_call (evolution_dbus_peek_context(),
+ CAMEL_DBUS_NAME,
+ CAMEL_FOLDER_OBJECT_PATH,
+ CAMEL_FOLDER_INTERFACE,
+ "camel_folder_set_message_user_flag",
+ &error,
+ "sssi", folder->object_id, uid, name, value);
+
+ if (!ret) {
+ g_warning ("Error: Camel folder set message user flag: %s\n", error.message);
+ return;
+ }
+
+ d(printf("Camel folder set message user flag remotely\n"));
}
+const char *
+camel_folder_remote_get_message_user_tag (CamelFolderRemote *folder, const char *uid, const char *name)
+{
+ gboolean ret;
+ const char *user_tag;
+ DBusError error;
+
+ dbus_error_init (&error);
+ /* Invoke the appropriate dbind call to MailSessionRemoteImpl */
+ ret = dbind_context_method_call (evolution_dbus_peek_context(),
+ CAMEL_DBUS_NAME,
+ CAMEL_FOLDER_OBJECT_PATH,
+ CAMEL_FOLDER_INTERFACE,
+ "camel_folder_get_message_user_flag",
+ &error,
+ "sss=>s", folder->object_id, uid, name, &user_tag);
+
+ if (!ret) {
+ g_warning ("Error: Camel folder get message user tag: %s\n", error.message);
+ return NULL;
+ }
+
+ d(printf("Camel folder get message user tag remotely\n"));
+ return user_tag;
+}
+
+void
+camel_folder_remote_set_message_user_tag (CamelFolderRemote *folder, const char *uid, const char *name, const char *value)
+{
+ gboolean ret;
+ DBusError error;
+
+ dbus_error_init (&error);
+ /* Invoke the appropriate dbind call to MailSessionRemoteImpl */
+ ret = dbind_context_method_call (evolution_dbus_peek_context(),
+ CAMEL_DBUS_NAME,
+ CAMEL_FOLDER_OBJECT_PATH,
+ CAMEL_FOLDER_INTERFACE,
+ "camel_folder_set_message_user_tag",
+ &error,
+ "ssss", folder->object_id, uid, name, value);
+
+ if (!ret) {
+ g_warning ("Error: Camel folder set message user tag: %s\n", error.message);
+ return;
+ }
+
+ d(printf("Camel folder set message user tag remotely\n"));
+}
+
+
Modified: branches/mail-dbus-remoting/mail/camel-folder-remote.h
==============================================================================
--- branches/mail-dbus-remoting/mail/camel-folder-remote.h (original)
+++ branches/mail-dbus-remoting/mail/camel-folder-remote.h Fri Aug 29 06:58:13 2008
@@ -29,4 +29,14 @@
guint32 camel_folder_remote_get_folder_flags (CamelFolderRemote *folder);
+gboolean camel_folder_remote_get_message_user_flag (CamelFolderRemote *folder, const char *uid,
+ const char *name);
+
+void camel_folder_remote_set_message_user_flag (CamelFolderRemote *folder, const char *uid,
+ const char *name, gboolean value);
+
+const char *camel_folder_remote_get_message_user_tag (CamelFolderRemote *folder, const char *uid, const char *name);
+
+void camel_folder_remote_set_message_user_tag (CamelFolderRemote *folder, const char *uid, const char *name, const char *value);
+
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]