aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-component.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-05-13 11:12:09 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-05-13 11:12:09 +0800
commit6c7aa314e8c8e87ea3db30d5d935ea45e95b7543 (patch)
tree1663d86fca3054af20e51038795dd6f30a91cb7b /mail/mail-component.c
parent6653fc8be6ca8e43589662b188ec3cf7d3a6f478 (diff)
downloadgsoc2013-evolution-6c7aa314e8c8e87ea3db30d5d935ea45e95b7543.tar.gz
gsoc2013-evolution-6c7aa314e8c8e87ea3db30d5d935ea45e95b7543.tar.zst
gsoc2013-evolution-6c7aa314e8c8e87ea3db30d5d935ea45e95b7543.zip
added "email" to the uri_schema's attribute.
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. svn path=/trunk/; revision=25893
Diffstat (limited to 'mail/mail-component.c')
-rw-r--r--mail/mail-component.c33
1 files changed, 33 insertions, 0 deletions
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);
+ }
}
}