aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog10
-rw-r--r--mail/GNOME_Evolution_Mail.server.in.in1
-rw-r--r--mail/mail-component.c33
3 files changed, 44 insertions, 0 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 948a11156f..23dd57e3e7 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,13 @@
+2004-05-13 Not Zed <NotZed@Ximian.com>
+
+ * GNOME_Evolution_Mail.server.in.in: added "email" to the
+ uri_schema's attribute.
+
+ * mail-component.c (impl_handleURI): handle email: uri's, specify
+ opening a message on a folder.
+ (handleuri_got_folder): open the message. For some 1337 s3Kr3t
+ ha0x.
+
2004-05-12 Not Zed <NotZed@Ximian.com>
** See bug #58302.
diff --git a/mail/GNOME_Evolution_Mail.server.in.in b/mail/GNOME_Evolution_Mail.server.in.in
index 8ddebd765a..7f30d64381 100644
--- a/mail/GNOME_Evolution_Mail.server.in.in
+++ b/mail/GNOME_Evolution_Mail.server.in.in
@@ -38,6 +38,7 @@
<oaf_attribute name="evolution:uri_schemas" type="stringv">
<item value="mailto"/>
+ <item value="email"/>
</oaf_attribute>
</oaf_server>
diff --git a/mail/mail-component.c b/mail/mail-component.c
index 9fa4eafb99..7310b12a35 100644
--- a/mail/mail-component.c
+++ b/mail/mail-component.c
@@ -41,6 +41,7 @@
#include "em-format.h"
#include "em-folder-tree.h"
#include "em-folder-browser.h"
+#include "em-message-browser.h"
#include "em-folder-selector.h"
#include "em-folder-selection.h"
#include "em-migrate.h"
@@ -728,6 +729,26 @@ impl_requestCreateItem (PortableServer_Servant servant,
}
static void
+handleuri_got_folder(char *uri, CamelFolder *folder, void *data)
+{
+ CamelURL *url = data;
+ EMMessageBrowser *emmb;
+
+ if (folder != NULL) {
+ emmb = (EMMessageBrowser *)em_message_browser_window_new();
+ /*message_list_set_threaded(((EMFolderView *)emmb)->list, emfv->list->threaded);*/
+ /* FIXME: session needs to be passed easier than this */
+ em_format_set_session((EMFormat *)((EMFolderView *)emmb)->preview, session);
+ em_folder_view_set_folder((EMFolderView *)emmb, folder, uri);
+ em_folder_view_set_message((EMFolderView *)emmb, camel_url_get_param(url, "uid"), FALSE);
+ gtk_widget_show(emmb->window);
+ } else {
+ g_warning("Couldn't open folder '%s'", uri);
+ }
+ camel_url_free(url);
+}
+
+static void
impl_handleURI (PortableServer_Servant servant, const char *uri, CORBA_Environment *ev)
{
if (!strncmp (uri, "mailto:", 7)) {
@@ -735,6 +756,18 @@ impl_handleURI (PortableServer_Servant servant, const char *uri, CORBA_Environme
return;
em_utils_compose_new_message_with_mailto (uri, NULL);
+ } else if (!strncmp(uri, "email:", 6)) {
+ CamelURL *url = camel_url_new(uri, NULL);
+
+ if (camel_url_get_param(url, "uid") != NULL) {
+ char *curi = em_uri_to_camel(uri);
+
+ mail_get_folder(curi, 0, handleuri_got_folder, url, mail_thread_new);
+ g_free(curi);
+ } else {
+ g_warning("email uri's must include a uid parameter");
+ camel_url_free(url);
+ }
}
}