Index: calendar/gui/GNOME_Evolution_Calendar.server.in.in
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/GNOME_Evolution_Calendar.server.in.in,v
retrieving revision 1.20
diff -u -p -r1.20 GNOME_Evolution_Calendar.server.in.in
--- calendar/gui/GNOME_Evolution_Calendar.server.in.in	12 Jan 2006 15:08:40 -0000	1.20
+++ calendar/gui/GNOME_Evolution_Calendar.server.in.in	12 Oct 2006 23:32:36 -0000
@@ -49,6 +49,11 @@
 	<oaf_attribute name="evolution:button_tooltips" type="string" _value="Calendars"/>
         <oaf_attribute name="evolution:button_icon" type="string" value="stock_calendar"/>
 	<oaf_attribute name="evolution:button_sort_order" type="string" value="-8"/>
+
+        <oaf_attribute name="evolution:uri_schemas" type="stringv">
+          <item value="calendar"/>
+        </oaf_attribute>
+
 </oaf_server>
 
 <oaf_server iid="OAFIID:GNOME_Evolution_Tasks_Component:@VERSION@"
@@ -69,6 +74,11 @@
 	<oaf_attribute name="evolution:button_tooltips" type="string" _value="Tasks"/>
         <oaf_attribute name="evolution:button_icon" type="string" value="stock_todo"/>
 	<oaf_attribute name="evolution:button_sort_order" type="string" value="-8"/>
+
+        <oaf_attribute name="evolution:uri_schemas" type="stringv">
+          <item value="task"/>
+        </oaf_attribute>
+
 </oaf_server>
 
 <oaf_server iid="OAFIID:GNOME_Evolution_Memos_Component:@VERSION@"
Index: calendar/gui/e-calendar-table.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-calendar-table.c,v
retrieving revision 1.156
diff -u -p -r1.156 e-calendar-table.c
--- calendar/gui/e-calendar-table.c	10 Aug 2006 07:34:29 -0000	1.156
+++ calendar/gui/e-calendar-table.c	12 Oct 2006 23:32:40 -0000
@@ -604,7 +604,7 @@ e_calendar_table_open_selected (ECalenda
 	comp_data = e_calendar_table_get_selected_comp (cal_table);
 	prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_ATTENDEE_PROPERTY);
 	if (comp_data != NULL)
-		e_calendar_table_open_task (cal_table, comp_data, prop ? TRUE : FALSE);
+		e_calendar_table_open_task (cal_table, comp_data->client, comp_data->icalcomp, prop ? TRUE : FALSE);
 }
 
 /**
@@ -1020,30 +1020,30 @@ e_calendar_table_paste_clipboard (ECalen
 
 /* Opens a task in the task editor */
 void
-e_calendar_table_open_task (ECalendarTable *cal_table, ECalModelComponent *comp_data, gboolean assign)
+e_calendar_table_open_task (ECalendarTable *cal_table, ECal *client, icalcomponent *icalcomp, gboolean assign)
 {
 	CompEditor *tedit;
 	const char *uid;
 	guint32 flags = 0;
 	
-	uid = icalcomponent_get_uid (comp_data->icalcomp);
+	uid = icalcomponent_get_uid (icalcomp);
 
 	tedit = e_comp_editor_registry_find (comp_editor_registry, uid);
 	if (tedit == NULL) {
 		ECalComponent *comp;
 
 		comp = e_cal_component_new ();
-		e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (comp_data->icalcomp));
+		e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (icalcomp));
 
 		if (assign) {
 			flags |= COMP_EDITOR_IS_ASSIGNED;
 
-			if (itip_organizer_is_user (comp, comp_data->client) || 
+			if (itip_organizer_is_user (comp, client) || 
 					!e_cal_component_has_attendees (comp))
 				flags |= COMP_EDITOR_USER_ORG;
 		}
 
-		tedit = COMP_EDITOR (task_editor_new (comp_data->client, flags));
+		tedit = COMP_EDITOR (task_editor_new (client, flags));
 		comp_editor_edit_comp (tedit, comp);
 	
 		if (flags & COMP_EDITOR_IS_ASSIGNED)
@@ -1063,7 +1063,7 @@ open_task_by_row (ECalendarTable *cal_ta
 
 	comp_data = e_cal_model_get_component_at (cal_table->model, row);
 	prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_ATTENDEE_PROPERTY);
-	e_calendar_table_open_task (cal_table, comp_data, prop ? TRUE : FALSE);
+	e_calendar_table_open_task (cal_table, comp_data->client, comp_data->icalcomp, prop ? TRUE : FALSE);
 }
 
 static void
@@ -1088,7 +1088,7 @@ e_calendar_table_on_open_task (EPopup *e
 	comp_data = e_calendar_table_get_selected_comp (cal_table);
 	prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_ATTENDEE_PROPERTY);
 	if (comp_data)
-		e_calendar_table_open_task (cal_table, comp_data, prop ? TRUE : FALSE);
+		e_calendar_table_open_task (cal_table, comp_data->client, comp_data->icalcomp, prop ? TRUE : FALSE);
 }
 
 static void
@@ -1168,7 +1168,7 @@ e_calendar_table_on_assign (EPopup *ep, 
 
 	comp_data = e_calendar_table_get_selected_comp (cal_table);
 	if (comp_data)
-		e_calendar_table_open_task (cal_table, comp_data, TRUE);
+		e_calendar_table_open_task (cal_table, comp_data->client, comp_data->icalcomp, TRUE);
 }
 
 static void
Index: calendar/gui/e-calendar-table.h
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-calendar-table.h,v
retrieving revision 1.30
diff -u -p -r1.30 e-calendar-table.h
--- calendar/gui/e-calendar-table.h	8 Feb 2006 13:06:02 -0000	1.30
+++ calendar/gui/e-calendar-table.h	12 Oct 2006 23:32:40 -0000
@@ -105,7 +105,8 @@ void       e_calendar_table_set_status_m
 						const gchar *message,
 						int percent);
 void 	   e_calendar_table_open_task (ECalendarTable *cal_table, 
-				       ECalModelComponent *comp_data, 
+				       ECal *client,
+				       icalcomponent *icalcomp,
 				       gboolean assign);
 ECalModelComponent * e_calendar_table_get_selected_comp (ECalendarTable *cal_table);
 void e_calendar_table_hide_completed_tasks (ECalendarTable *table, GList *clients_list, gboolean config_changed);
Index: calendar/gui/e-tasks.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-tasks.c,v
retrieving revision 1.132
diff -u -p -r1.132 e-tasks.c
--- calendar/gui/e-tasks.c	30 Jun 2006 09:46:10 -0000	1.132
+++ calendar/gui/e-tasks.c	12 Oct 2006 23:32:46 -0000
@@ -1415,6 +1415,43 @@ e_tasks_discard_view_menus (ETasks *task
 	priv->view_menus = NULL;
 }
 
+void
+e_tasks_open_task_id (ETasks *tasks,
+		      const char *src_uid,
+		      const char *comp_uid,
+		      const char *comp_rid)
+{
+	ECal *client = NULL;
+	GList *l;
+	icalcomponent* icalcomp = NULL;
+	icalproperty *attendee_prop = NULL;
+
+	if (!src_uid || !comp_uid)
+		return;
+	
+	for (l = tasks->priv->clients_list; l != NULL; l = l->next) {
+		client = l->data;
+		ESource *client_src = e_cal_get_source (client);
+
+		if (!strcmp (src_uid, e_source_peek_uid (client_src)))
+			break;
+	}
+
+	if (!client) 
+		return;
+
+	e_cal_get_object (client, comp_uid, comp_rid, &icalcomp, NULL);
+
+	if (!icalcomp)
+		return;
+
+	attendee_prop = icalcomponent_get_first_property (icalcomp, ICAL_ATTENDEE_PROPERTY);
+	e_calendar_table_open_task (E_CALENDAR_TABLE (tasks->priv->tasks_view), client, icalcomp, attendee_prop);
+	icalcomponent_free (icalcomp);
+
+	return;
+}
+
 /**
  * e_tasks_get_calendar_table:
  * @tasks: A tasks widget.
Index: calendar/gui/e-tasks.h
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-tasks.h,v
retrieving revision 1.26
diff -u -p -r1.26 e-tasks.h
--- calendar/gui/e-tasks.h	6 Oct 2005 18:21:51 -0000	1.26
+++ calendar/gui/e-tasks.h	12 Oct 2006 23:32:46 -0000
@@ -73,6 +73,10 @@ gboolean   e_tasks_set_default_source (E
 ECal      *e_tasks_get_default_client    (ETasks *tasks);
 
 void       e_tasks_open_task         (ETasks		*tasks);
+void       e_tasks_open_task_id      (ETasks		*tasks,
+				      const char *src_uid,
+				      const char *comp_uid,
+				      const char *comp_rid);
 void       e_tasks_new_task          (ETasks            *tasks);
 void       e_tasks_complete_selected (ETasks            *tasks);
 void       e_tasks_delete_selected   (ETasks            *tasks);
Index: calendar/gui/tasks-component.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/tasks-component.c,v
retrieving revision 1.99
diff -u -p -r1.99 tasks-component.c
--- calendar/gui/tasks-component.c	8 Jul 2006 13:29:35 -0000	1.99
+++ calendar/gui/tasks-component.c	12 Oct 2006 23:32:48 -0000
@@ -32,6 +32,7 @@
 #include <gconf/gconf-client.h>
 #include <libecal/e-cal.h>
 #include <libedataserver/e-data-server-util.h>
+#include <libedataserver/e-url.h>
 #include <libedataserverui/e-source-selector.h>
 #include <shell/e-user-creatable-items-handler.h>
 #include <shell/e-component-view.h>
@@ -1154,6 +1155,79 @@ impl_createView (PortableServer_Servant 
 	return BONOBO_OBJREF(ecv);
 }
 
+static void
+impl_handleURI (PortableServer_Servant servant, const char *uri, CORBA_Environment *ev)
+{
+	TasksComponent *tasks_component = TASKS_COMPONENT (bonobo_object_from_servant (servant));
+	TasksComponentPrivate *priv;
+	GList *l;
+	TasksComponentView *view = NULL;
+
+	char *src_uid = NULL;
+	char *uid = NULL;
+	char *rid = NULL;
+
+	priv = tasks_component->priv;
+
+	l = g_list_last (priv->views);
+	if (!l)
+		return;
+
+	view = l->data;
+
+	if (!strncmp (uri, "task:", 5)) {
+		EUri *euri = e_uri_new (uri);
+		const char *p;
+		char *header, *content;
+		size_t len, clen;
+
+		p = euri->query;
+		if (p) {
+			while (*p) {
+				len = strcspn (p, "=&");
+			
+				/* If it's malformed, give up. */
+				if (p[len] != '=')
+					break;
+			
+				header = (char *) p;
+				header[len] = '\0';
+				p += len + 1;
+			
+				clen = strcspn (p, "&");
+			
+				content = g_strndup (p, clen);
+				if (!g_ascii_strcasecmp (header, "source-uid")) {
+					src_uid = g_strdup (content);
+				} else if (!g_ascii_strcasecmp (header, "comp-uid")) {
+					uid = g_strdup (content);
+				} else if (!g_ascii_strcasecmp (header, "comp-rid")) {
+					rid = g_strdup (content);
+				}
+				g_free (content);
+
+				p += clen;
+				if (*p == '&') {
+					p++;
+					if (!strcmp (p, "amp;"))
+						p += 4;
+				}
+			}
+
+			if (uid && src_uid) {
+				e_tasks_open_task_id (view->tasks, src_uid, uid, rid);
+			}
+				
+			g_free (src_uid);
+			g_free (uid);
+			g_free (rid);
+		}
+		e_uri_free (euri);
+	}
+
+	return;
+}
+
 static GNOME_Evolution_CreatableItemTypeList *
 impl__get_userCreatableItems (PortableServer_Servant servant,
 			      CORBA_Environment *ev)
@@ -1285,6 +1359,7 @@ tasks_component_class_init (TasksCompone
 	epv->createView		     = impl_createView;
 	epv->_get_userCreatableItems = impl__get_userCreatableItems;
 	epv->requestCreateItem       = impl_requestCreateItem;
+	epv->handleURI               = impl_handleURI;
 
 	object_class->dispose = impl_dispose;
 	object_class->finalize = impl_finalize;
Index: calendar/gui/tasks-control.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/tasks-control.c,v
retrieving revision 1.88
diff -u -p -r1.88 tasks-control.c
--- calendar/gui/tasks-control.c	10 Aug 2006 07:34:30 -0000	1.88
+++ calendar/gui/tasks-control.c	12 Oct 2006 23:32:51 -0000
@@ -521,7 +521,7 @@ tasks_control_assign_cmd (BonoboUICompon
               cal_table = e_tasks_get_calendar_table (tasks);
               comp_data = e_calendar_table_get_selected_comp (cal_table);
  	       if (comp_data)
-              e_calendar_table_open_task (cal_table, comp_data, TRUE);
+              e_calendar_table_open_task (cal_table, comp_data->client, comp_data->icalcomp, TRUE);
 }
 
 static void
