buc a0d145d
diff -Nrbu mail-notification-5.4/build/src/mn-evolution-folder-tree-server.c mail-notification-5.4-OK/build/src/mn-evolution-folder-tree-server.c
buc a0d145d
--- mail-notification-5.4/build/src/mn-evolution-folder-tree-server.c	2008-05-22 19:47:48.000000000 +0400
Dmitry Butskoy 0a002dd
+++ mail-notification-5.4-OK/build/src/mn-evolution-folder-tree-server.c	2010-10-12 16:50:15.000000000 +0400
buc a0d145d
@@ -25,7 +25,10 @@
buc a0d145d
 #line 24 "src/mn-evolution-folder-tree-server.gob"
af3298d
 
b70a7a9
 #include <dbus/dbus.h>
b70a7a9
+#include <libedataserver/eds-version.h>
b70a7a9
+#if !EDS_CHECK_VERSION(2,29,0)
b70a7a9
 #include <mail/mail-component.h>
b70a7a9
+#endif
b70a7a9
 #include <mail/em-folder-tree.h>
b70a7a9
 #include "mn-evolution-plugin.h"
b70a7a9
 #include "mn-evolution.h"
100efaf
@@ -441,10 +444,17 @@
buc a0d145d
 {
buc a0d145d
 #line 61 "src/mn-evolution-folder-tree-server.gob"
b70a7a9
 	
100efaf
+#if EDS_CHECK_VERSION(2,91,0)
100efaf
+    selfp->session = e_mail_session_new();
100efaf
+    selfp->tree = em_folder_tree_new(selfp->session);
100efaf
+#elif EDS_CHECK_VERSION(2,29,0)
b70a7a9
+    selfp->tree = em_folder_tree_new();
b70a7a9
+#else
b70a7a9
     EMFolderTreeModel *model;
buc a0d145d
 
b70a7a9
     model = mail_component_peek_tree_model(mail_component_peek());
b70a7a9
     selfp->tree = em_folder_tree_new_with_model(model);
b70a7a9
+#endif
b70a7a9
 
b70a7a9
     selfp->plug = gtk_plug_new((GdkNativeWindow) selfp->id);
buc a0d145d
     gtk_container_add(GTK_CONTAINER(selfp->plug), selfp->tree);
100efaf
@@ -469,6 +479,10 @@
100efaf
 {
100efaf
 #line 80 "src/mn-evolution-folder-tree-server.gob"
100efaf
 	
100efaf
+#if EDS_CHECK_VERSION(2,91,0)
100efaf
+    g_object_unref(selfp->session);
100efaf
+    selfp->session = NULL;
100efaf
+#endif
100efaf
     g_signal_handlers_disconnect_by_func(selfp->plug, self_plug_destroy_h, self);
100efaf
   }}
100efaf
 #line 475 "mn-evolution-folder-tree-server.c"
buc a0d145d
diff -Nrbu mail-notification-5.4/build/src/mn-evolution-server.c mail-notification-5.4-OK/build/src/mn-evolution-server.c
buc a0d145d
--- mail-notification-5.4/build/src/mn-evolution-server.c	2008-05-22 19:47:48.000000000 +0400
Dmitry Butskoy 0a002dd
+++ mail-notification-5.4-OK/build/src/mn-evolution-server.c	2010-10-12 16:50:40.000000000 +0400
100efaf
@@ -27,12 +27,22 @@
buc a0d145d
 #include <stdio.h>
buc a0d145d
 #include <libintl.h>
b70a7a9
 #include <gobject/gvaluecollector.h>
buc a0d145d
+#include <libedataserver/eds-version.h>
b70a7a9
 #include <camel/camel-folder.h>
b70a7a9
+#if EDS_CHECK_VERSION(2,29,0)
b70a7a9
+#include <shell/e-shell.h>
b70a7a9
+#include <mail/e-mail-browser.h>
b70a7a9
+#else
b70a7a9
 #include <mail/em-folder-view.h>
b70a7a9
 #include <mail/em-format.h>
b70a7a9
 #include <mail/em-message-browser.h>
b70a7a9
+#endif
b70a7a9
 #include <mail/em-utils.h>
100efaf
+#if EDS_CHECK_VERSION(2,91,0)
100efaf
+#include <mail/e-mail-session.h>
100efaf
+#else
b70a7a9
 #include <mail/mail-session.h>
100efaf
+#endif
b70a7a9
 #include <mail/mail-tools.h>
100efaf
 #include "mn-evolution.h"
100efaf
 #include "mn-evolution-folder-tree-server.h"
buc a0d145d
@@ -391,10 +397,18 @@
buc a0d145d
     info = g_new0(FolderInfo, 1);
buc a0d145d
     info->uri = g_strdup(uri);
buc a0d145d
     info->folder = folder;
buc a0d145d
+#if EDS_CHECK_VERSION(2,31,0)
buc a0d145d
+    g_object_ref(folder);
buc a0d145d
+#else
buc a0d145d
     camel_object_ref(folder);
buc a0d145d
+#endif
buc a0d145d
 
buc a0d145d
     /* uncache the folder when it is deleted */
buc a0d145d
+#if EDS_CHECK_VERSION(2,31,0)
buc a0d145d
+    g_signal_connect(folder, "deleted", G_CALLBACK(self_folder_deleted_cb), info);
buc a0d145d
+#else
buc a0d145d
     camel_object_hook_event(folder, "deleted", self_folder_deleted_cb, info);
buc a0d145d
+#endif
buc a0d145d
 
buc a0d145d
     g_hash_table_replace(folders, info->uri, info);
buc a0d145d
   }}
buc a0d145d
@@ -413,8 +427,13 @@
buc a0d145d
 {
buc a0d145d
 #line 105 "src/mn-evolution-server.gob"
buc a0d145d
 	
buc a0d145d
+#if EDS_CHECK_VERSION(2,31,0)
buc a0d145d
+    g_signal_handlers_disconnect_by_func(info->folder, self_folder_deleted_cb, info);
buc a0d145d
+    g_object_unref(info->folder);
buc a0d145d
+#else
buc a0d145d
     camel_object_unhook_event(info->folder, "deleted", self_folder_deleted_cb, info);
buc a0d145d
     camel_object_unref(info->folder);
buc a0d145d
+#endif
buc a0d145d
     g_free(info->uri);
buc a0d145d
     g_free(info);
buc a0d145d
   }}
buc a0d145d
@@ -461,7 +480,11 @@
buc a0d145d
 	if (info)
buc a0d145d
 	  {
buc a0d145d
 	    folder = info->folder;
buc a0d145d
+#if EDS_CHECK_VERSION(2,31,0)
buc a0d145d
+	    g_object_ref(folder);
buc a0d145d
+#else
buc a0d145d
 	    camel_object_ref(folder);
buc a0d145d
+#endif
buc a0d145d
 	  }
buc a0d145d
       }
buc a0d145d
     else
Dmitry Butskoy 0a002dd
@@ -469,7 +492,11 @@
Dmitry Butskoy 0a002dd
 
Dmitry Butskoy 0a002dd
     if (! folder)
Dmitry Butskoy 0a002dd
       {
Dmitry Butskoy 0a002dd
-	folder = mail_tool_uri_to_folder(uri, 0, NULL);
Dmitry Butskoy 0a002dd
+	folder = mail_tool_uri_to_folder(uri, 0,
Dmitry Butskoy 0a002dd
+#if EDS_CHECK_VERSION(2,91,0)
Dmitry Butskoy 0a002dd
+	      NULL,
Dmitry Butskoy 0a002dd
+#endif
Dmitry Butskoy 0a002dd
+	      NULL);
Dmitry Butskoy 0a002dd
 	if (folder)
Dmitry Butskoy 0a002dd
 	  self_cache_folder(uri, folder);
Dmitry Butskoy 0a002dd
 	else
Dmitry Butskoy 0a002dd
@@ -595,14 +622,23 @@
buc a0d145d
 
buc a0d145d
 	for (i = 0; i < summary->len; i++)
buc a0d145d
 	  {
buc a0d145d
+#if EDS_CHECK_VERSION(2,23,5)
buc a0d145d
+	    char *uid = summary->pdata[i];
buc a0d145d
+	    CamelMessageInfo *info = camel_folder_get_message_info(folder, uid);
buc a0d145d
+#else
buc a0d145d
 	    CamelMessageInfo *info = summary->pdata[i];
buc a0d145d
+#endif
buc a0d145d
 
Erik van Pienbroek b732e43
-	    if ((camel_message_info_flags(info) & CAMEL_MESSAGE_SEEN) == 0)
Erik van Pienbroek b732e43
+	    if (info && (camel_message_info_flags(info) & CAMEL_MESSAGE_SEEN) == 0)
buc a0d145d
 	      g_ptr_array_add(*ret, self_camel_message_info_to_dbus_struct(info));
buc a0d145d
 	  }
buc a0d145d
 
buc a0d145d
 	camel_folder_free_summary(folder, summary);
buc a0d145d
+#if EDS_CHECK_VERSION(2,31,0)
buc a0d145d
+	g_object_unref(folder);
buc a0d145d
+#else
buc a0d145d
 	camel_object_unref(folder);
buc a0d145d
+#endif
buc a0d145d
       }
buc a0d145d
 
buc a0d145d
     GDK_THREADS_LEAVE();
Dmitry Butskoy 0a002dd
@@ -638,7 +674,11 @@
buc a0d145d
     if (folder)
buc a0d145d
       {
buc a0d145d
 	*ret = g_strdup(camel_folder_get_name(folder));
buc a0d145d
+#if EDS_CHECK_VERSION(2,31,0)
buc a0d145d
+	g_object_unref(folder);
buc a0d145d
+#else
buc a0d145d
 	camel_object_unref(folder);
buc a0d145d
+#endif
buc a0d145d
       }
buc a0d145d
 
buc a0d145d
     GDK_THREADS_LEAVE();
Dmitry Butskoy 0a002dd
@@ -673,6 +713,19 @@
b70a7a9
     folder = self_lookup_folder(folder_uri, err);
b70a7a9
     if (folder)
b70a7a9
       {
b70a7a9
+#if EDS_CHECK_VERSION(2,29,0)
b70a7a9
+	EShell *shell;
b70a7a9
+	EShellBackend *shell_backend;
b70a7a9
+	GtkWidget *browser;
b70a7a9
+
b70a7a9
+	shell = e_shell_get_default ();
b70a7a9
+	shell_backend = e_shell_get_backend_by_name (shell, "mail");
b70a7a9
+
b70a7a9
+	browser = e_mail_browser_new (shell_backend);
b70a7a9
+	e_mail_reader_set_folder (E_MAIL_READER (browser), folder, folder_uri);
b70a7a9
+	e_mail_reader_set_message (E_MAIL_READER (browser), message_uid);
b70a7a9
+	gtk_widget_show (browser);
b70a7a9
+#else
b70a7a9
 	GtkWidget *browser;
b70a7a9
 
b70a7a9
 	/* modelled after Evolution's handleuri_got_folder() */
Dmitry Butskoy 0a002dd
@@ -683,8 +736,13 @@
b70a7a9
 	em_folder_view_set_folder((EMFolderView *) browser, folder, folder_uri);
b70a7a9
 	em_folder_view_set_message((EMFolderView *) browser, message_uid, FALSE);
b70a7a9
 	gtk_widget_show(((EMMessageBrowser *) browser)->window);
b70a7a9
+#endif
b70a7a9
 
buc a0d145d
+#if EDS_CHECK_VERSION(2,31,0)
buc a0d145d
+	g_object_unref(folder);
buc a0d145d
+#else
b70a7a9
 	camel_object_unref(folder);
buc a0d145d
+#endif
b70a7a9
       }
buc a0d145d
 
buc a0d145d
     GDK_THREADS_LEAVE();
Dmitry Butskoy 0a002dd
@@ -721,7 +779,11 @@
buc a0d145d
     if (folder)
buc a0d145d
       {
buc a0d145d
 	status = camel_folder_set_message_flags(folder, message_uid, flags, flags);
buc a0d145d
+#if EDS_CHECK_VERSION(2,31,0)
buc a0d145d
+	g_object_unref(folder);
buc a0d145d
+#else
buc a0d145d
 	camel_object_unref(folder);
buc a0d145d
+#endif
buc a0d145d
 
buc a0d145d
 	if (! status)
buc a0d145d
 	  g_set_error(err,
buc a0d145d
diff -Nrbu mail-notification-5.4/src/mn-evolution-plugin.c mail-notification-5.4-OK/src/mn-evolution-plugin.c
buc a0d145d
--- mail-notification-5.4/src/mn-evolution-plugin.c	2008-05-22 19:45:35.000000000 +0400
Dmitry Butskoy 0a002dd
+++ mail-notification-5.4-OK/src/mn-evolution-plugin.c	2010-10-12 16:50:15.000000000 +0400
buc a0d145d
@@ -204,7 +204,7 @@
b70a7a9
 }
b70a7a9
 
b70a7a9
 int
b70a7a9
-e_plugin_lib_enable (EPluginLib *ep, int enable)
b70a7a9
+e_plugin_lib_enable (EPlugin *ep, int enable)
b70a7a9
 {
b70a7a9
   static gboolean enabled = FALSE;
b70a7a9
   GError *err = NULL;
100efaf
--- mail-notification-5.4/build/src/mn-evolution-folder-tree-server-private.h.orig	2010-11-13 13:55:01.571934066 +0100
100efaf
+++ mail-notification-5.4/build/src/mn-evolution-folder-tree-server-private.h	2010-11-13 13:56:07.019487418 +0100
100efaf
@@ -4,6 +4,10 @@
100efaf
 #define __MN_EVOLUTION_FOLDER_TREE_SERVER_PRIVATE_H__
100efaf
 
100efaf
 #include "mn-evolution-folder-tree-server.h"
100efaf
+#include <libedataserver/eds-version.h>
100efaf
+#if EDS_CHECK_VERSION(2,91,0)
100efaf
+#include <mail/e-mail-session.h>
100efaf
+#endif
100efaf
 
100efaf
 #ifdef __cplusplus
100efaf
 extern "C" {
100efaf
@@ -23,6 +23,9 @@
100efaf
 #line 41 "src/mn-evolution-folder-tree-server.gob"
100efaf
 	GtkWidget * tree;
100efaf
 #line 26 "mn-evolution-folder-tree-server-private.h"
100efaf
+#if EDS_CHECK_VERSION(2,91,0)
100efaf
+       EMailSession * session;
100efaf
+#endif
100efaf
 };
100efaf
 
100efaf
 #ifdef __cplusplus