summaryrefslogtreecommitdiff
path: root/extra/mail-notification/mail-notification-5.4-evolution.patch
blob: 87514c22d01871e2d61162f27d8be3be694e6f9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
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
--- mail-notification-5.4/build/src/mn-evolution-folder-tree-server.c	2008-05-22 19:47:48.000000000 +0400
+++ mail-notification-5.4-OK/build/src/mn-evolution-folder-tree-server.c	2010-10-12 16:50:15.000000000 +0400
@@ -25,7 +25,10 @@
 #line 24 "src/mn-evolution-folder-tree-server.gob"
 
 #include <dbus/dbus.h>
+#include <libedataserver/eds-version.h>
+#if !EDS_CHECK_VERSION(2,29,0)
 #include <mail/mail-component.h>
+#endif
 #include <mail/em-folder-tree.h>
 #include "mn-evolution-plugin.h"
 #include "mn-evolution.h"
@@ -441,10 +444,17 @@
 {
 #line 61 "src/mn-evolution-folder-tree-server.gob"
 	
+#if EDS_CHECK_VERSION(2,91,0)
+    selfp->session = e_mail_session_new();
+    selfp->tree = em_folder_tree_new(selfp->session);
+#elif EDS_CHECK_VERSION(2,29,0)
+    selfp->tree = em_folder_tree_new();
+#else
     EMFolderTreeModel *model;
 
     model = mail_component_peek_tree_model(mail_component_peek());
     selfp->tree = em_folder_tree_new_with_model(model);
+#endif
 
     selfp->plug = gtk_plug_new((GdkNativeWindow) selfp->id);
     gtk_container_add(GTK_CONTAINER(selfp->plug), selfp->tree);
@@ -469,6 +479,10 @@
 {
 #line 80 "src/mn-evolution-folder-tree-server.gob"
 	
+#if EDS_CHECK_VERSION(2,91,0)
+    g_object_unref(selfp->session);
+    selfp->session = NULL;
+#endif
     g_signal_handlers_disconnect_by_func(selfp->plug, self_plug_destroy_h, self);
   }}
 #line 475 "mn-evolution-folder-tree-server.c"
diff -Nrbu mail-notification-5.4/build/src/mn-evolution-server.c mail-notification-5.4-OK/build/src/mn-evolution-server.c
--- mail-notification-5.4/build/src/mn-evolution-server.c	2008-05-22 19:47:48.000000000 +0400
+++ mail-notification-5.4-OK/build/src/mn-evolution-server.c	2010-10-12 16:50:40.000000000 +0400
@@ -27,12 +27,22 @@
 #include <stdio.h>
 #include <libintl.h>
 #include <gobject/gvaluecollector.h>
+#include <libedataserver/eds-version.h>
 #include <camel/camel-folder.h>
+#if EDS_CHECK_VERSION(2,29,0)
+#include <shell/e-shell.h>
+#include <mail/e-mail-browser.h>
+#else
 #include <mail/em-folder-view.h>
 #include <mail/em-format.h>
 #include <mail/em-message-browser.h>
+#endif
 #include <mail/em-utils.h>
+#if EDS_CHECK_VERSION(2,91,0)
+#include <mail/e-mail-session.h>
+#else
 #include <mail/mail-session.h>
+#endif
 #include <mail/mail-tools.h>
 #include "mn-evolution.h"
 #include "mn-evolution-folder-tree-server.h"
@@ -391,10 +397,18 @@
     info = g_new0(FolderInfo, 1);
     info->uri = g_strdup(uri);
     info->folder = folder;
+#if EDS_CHECK_VERSION(2,31,0)
+    g_object_ref(folder);
+#else
     camel_object_ref(folder);
+#endif
 
     /* uncache the folder when it is deleted */
+#if EDS_CHECK_VERSION(2,31,0)
+    g_signal_connect(folder, "deleted", G_CALLBACK(self_folder_deleted_cb), info);
+#else
     camel_object_hook_event(folder, "deleted", self_folder_deleted_cb, info);
+#endif
 
     g_hash_table_replace(folders, info->uri, info);
   }}
@@ -413,8 +427,13 @@
 {
 #line 105 "src/mn-evolution-server.gob"
 	
+#if EDS_CHECK_VERSION(2,31,0)
+    g_signal_handlers_disconnect_by_func(info->folder, self_folder_deleted_cb, info);
+    g_object_unref(info->folder);
+#else
     camel_object_unhook_event(info->folder, "deleted", self_folder_deleted_cb, info);
     camel_object_unref(info->folder);
+#endif
     g_free(info->uri);
     g_free(info);
   }}
@@ -461,7 +480,11 @@
 	if (info)
 	  {
 	    folder = info->folder;
+#if EDS_CHECK_VERSION(2,31,0)
+	    g_object_ref(folder);
+#else
 	    camel_object_ref(folder);
+#endif
 	  }
       }
     else
@@ -469,7 +492,11 @@
 
     if (! folder)
       {
-	folder = mail_tool_uri_to_folder(uri, 0, NULL);
+	folder = mail_tool_uri_to_folder(uri, 0,
+#if EDS_CHECK_VERSION(2,91,0)
+	      NULL,
+#endif
+	      NULL);
 	if (folder)
 	  self_cache_folder(uri, folder);
 	else
@@ -595,14 +622,23 @@
 
 	for (i = 0; i < summary->len; i++)
 	  {
+#if EDS_CHECK_VERSION(2,23,5)
+	    char *uid = summary->pdata[i];
+	    CamelMessageInfo *info = camel_folder_get_message_info(folder, uid);
+#else
 	    CamelMessageInfo *info = summary->pdata[i];
+#endif
 
 	    if ((camel_message_info_flags(info) & CAMEL_MESSAGE_SEEN) == 0)
 	      g_ptr_array_add(*ret, self_camel_message_info_to_dbus_struct(info));
 	  }
 
 	camel_folder_free_summary(folder, summary);
+#if EDS_CHECK_VERSION(2,31,0)
+	g_object_unref(folder);
+#else
 	camel_object_unref(folder);
+#endif
       }
 
     GDK_THREADS_LEAVE();
@@ -638,7 +674,11 @@
     if (folder)
       {
 	*ret = g_strdup(camel_folder_get_name(folder));
+#if EDS_CHECK_VERSION(2,31,0)
+	g_object_unref(folder);
+#else
 	camel_object_unref(folder);
+#endif
       }
 
     GDK_THREADS_LEAVE();
@@ -673,6 +713,19 @@
     folder = self_lookup_folder(folder_uri, err);
     if (folder)
       {
+#if EDS_CHECK_VERSION(2,29,0)
+	EShell *shell;
+	EShellBackend *shell_backend;
+	GtkWidget *browser;
+
+	shell = e_shell_get_default ();
+	shell_backend = e_shell_get_backend_by_name (shell, "mail");
+
+	browser = e_mail_browser_new (shell_backend);
+	e_mail_reader_set_folder (E_MAIL_READER (browser), folder, folder_uri);
+	e_mail_reader_set_message (E_MAIL_READER (browser), message_uid);
+	gtk_widget_show (browser);
+#else
 	GtkWidget *browser;
 
 	/* modelled after Evolution's handleuri_got_folder() */
@@ -683,8 +736,13 @@
 	em_folder_view_set_folder((EMFolderView *) browser, folder, folder_uri);
 	em_folder_view_set_message((EMFolderView *) browser, message_uid, FALSE);
 	gtk_widget_show(((EMMessageBrowser *) browser)->window);
+#endif
 
+#if EDS_CHECK_VERSION(2,31,0)
+	g_object_unref(folder);
+#else
 	camel_object_unref(folder);
+#endif
       }
 
     GDK_THREADS_LEAVE();
@@ -721,7 +779,11 @@
     if (folder)
       {
 	status = camel_folder_set_message_flags(folder, message_uid, flags, flags);
+#if EDS_CHECK_VERSION(2,31,0)
+	g_object_unref(folder);
+#else
 	camel_object_unref(folder);
+#endif
 
 	if (! status)
 	  g_set_error(err,
diff -Nrbu mail-notification-5.4/src/mn-evolution-plugin.c mail-notification-5.4-OK/src/mn-evolution-plugin.c
--- mail-notification-5.4/src/mn-evolution-plugin.c	2008-05-22 19:45:35.000000000 +0400
+++ mail-notification-5.4-OK/src/mn-evolution-plugin.c	2010-10-12 16:50:15.000000000 +0400
@@ -204,7 +204,7 @@
 }
 
 int
-e_plugin_lib_enable (EPluginLib *ep, int enable)
+e_plugin_lib_enable (EPlugin *ep, int enable)
 {
   static gboolean enabled = FALSE;
   GError *err = NULL;
--- mail-notification-5.4/build/src/mn-evolution-folder-tree-server-private.h.orig	2010-11-13 13:55:01.571934066 +0100
+++ mail-notification-5.4/build/src/mn-evolution-folder-tree-server-private.h	2010-11-13 13:56:07.019487418 +0100
@@ -4,6 +4,10 @@
 #define __MN_EVOLUTION_FOLDER_TREE_SERVER_PRIVATE_H__
 
 #include "mn-evolution-folder-tree-server.h"
+#include <libedataserver/eds-version.h>
+#if EDS_CHECK_VERSION(2,91,0)
+#include <mail/e-mail-session.h>
+#endif
 
 #ifdef __cplusplus
 extern "C" {
@@ -23,6 +23,9 @@
 #line 41 "src/mn-evolution-folder-tree-server.gob"
 	GtkWidget * tree;
 #line 26 "mn-evolution-folder-tree-server-private.h"
+#if EDS_CHECK_VERSION(2,91,0)
+       EMailSession * session;
+#endif
 };
 
 #ifdef __cplusplus