aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-tools.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-11-10 03:36:03 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-11-10 03:36:03 +0800
commit056f54ee2814a37f40294c45fc78e49bfb40c358 (patch)
treedf663422f31f329fb5213f8d75cf4482d3598fc8 /mail/mail-tools.c
parentf47013c7c1b957703016880140f2fff4c1a9583c (diff)
downloadgsoc2013-evolution-056f54ee2814a37f40294c45fc78e49bfb40c358.tar
gsoc2013-evolution-056f54ee2814a37f40294c45fc78e49bfb40c358.tar.gz
gsoc2013-evolution-056f54ee2814a37f40294c45fc78e49bfb40c358.tar.bz2
gsoc2013-evolution-056f54ee2814a37f40294c45fc78e49bfb40c358.tar.lz
gsoc2013-evolution-056f54ee2814a37f40294c45fc78e49bfb40c358.tar.xz
gsoc2013-evolution-056f54ee2814a37f40294c45fc78e49bfb40c358.tar.zst
gsoc2013-evolution-056f54ee2814a37f40294c45fc78e49bfb40c358.zip
Was x_evolution_message_parse from folder-browser.c. A space char is no
2001-11-08 Jeffrey Stedfast <fejj@ximian.com> * mail-tools.c (mail_tools_x_evolution_message_parse): Was x_evolution_message_parse from folder-browser.c. A space char is no longer used to separate the folder URI and the first uid, instead this is now done with a nul-char so update to parse the newer/better format. * component-factory.c (destination_folder_handle_drop): Update to parse the new/better format. * folder-browser.c (x_evolution_message_parse): Moved to mail-tools.c (message_list_drag_data_get): Instead of placing a space char after the folder URI, instead use a nul-char. svn path=/trunk/; revision=14645
Diffstat (limited to 'mail/mail-tools.c')
-rw-r--r--mail/mail-tools.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/mail/mail-tools.c b/mail/mail-tools.c
index f403514c66..9d94fb1e78 100644
--- a/mail/mail-tools.c
+++ b/mail/mail-tools.c
@@ -396,3 +396,45 @@ mail_tool_forward_message (CamelMimeMessage *message, gboolean quoted)
g_free (body);
return ret;
}
+
+
+/**
+ * mail_tools_x_evolution_message_parse:
+ * @in: GtkSelectionData->data
+ * @inlen: GtkSelectionData->length
+ * @uids: pointer to a gptrarray that will be filled with uids on success
+ *
+ * Parses the GtkSelectionData and returns a CamelFolder and a list of
+ * UIDs specified by the selection.
+ **/
+CamelFolder *
+mail_tools_x_evolution_message_parse (char *in, unsigned int inlen, GPtrArray **uids)
+{
+ /* format: "uri\0uid1\0uid2\0uid3\0...\0uidn" */
+ char *inptr, *inend;
+ CamelFolder *folder;
+
+ if (in == NULL)
+ return NULL;
+
+ folder = mail_tool_uri_to_folder (in, 0, NULL);
+
+ if (!folder)
+ return NULL;
+
+ /* split the uids */
+ inend = in + inlen;
+ inptr = in + strlen (in) + 1;
+ *uids = g_ptr_array_new ();
+ while (inptr < inend) {
+ char *start = inptr;
+
+ while (inptr < inend && *inptr)
+ inptr++;
+
+ g_ptr_array_add (*uids, g_strndup (start, inptr - start));
+ inptr++;
+ }
+
+ return folder;
+}