~jelmer/ubuntu/natty/evolution-mapi/513394-recurring-events

« back to all changes in this revision

Viewing changes to debian/patches/01_openchange_compat

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2011-02-01 13:07:04 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20110201130704-d4k0hahuxh8e0kyo
Tags: 0.32.1-0ubuntu1
* New upstream release.
* Update watch file for 0.32.
* 01_openchange_compat: Add patch to fix compatibility with current
  OpenChange.
* Fix library dependencies. LP: #693573

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
=== modified file 'configure.ac'
 
2
--- old/configure.ac    2010-09-27 10:28:11 +0000
 
3
+++ new/configure.ac    2011-01-25 18:44:56 +0000
 
4
@@ -253,6 +253,20 @@
 
5
 fi
 
6
 
 
7
 dnl ****************************
 
8
+dnl Check for MAPIInitialize function with two params
 
9
+dnl ****************************
 
10
+AC_MSG_CHECKING([libmapi MAPIInitialize function with two params])
 
11
+save_cflags=$CFLAGS; CFLAGS=$LIBMAPI_CFLAGS
 
12
+save_libs=$LIBS; LIBS="$LIBMAPI_LIBS"
 
13
+AC_LINK_IFELSE([AC_LANG_PROGRAM(
 
14
+       [[#include <libmapi/libmapi.h>]],
 
15
+       [[MAPIInitialize (NULL, NULL)]])],
 
16
+       [AC_DEFINE(HAVE_LIBMAPI_CONTEXT_PARAM, 1, [libmapi uses context parameters]) ac_cv_have_lcp=yes],[ac_cv_have_lcp=no])
 
17
+CFLAGS=$save_cflags
 
18
+LIBS=$save_libs
 
19
+AC_MSG_RESULT([$ac_cv_have_lcp])
 
20
+
 
21
+dnl ****************************
 
22
 dnl Expose version information
 
23
 dnl ****************************
 
24
 API_VERSION=$EDS_PACKAGE
 
25
 
 
26
=== modified file 'src/libexchangemapi/exchange-mapi-connection.c'
 
27
--- old/src/libexchangemapi/exchange-mapi-connection.c  2010-10-19 10:33:25 +0000
 
28
+++ new/src/libexchangemapi/exchange-mapi-connection.c  2011-01-25 19:24:59 +0000
 
29
@@ -143,6 +143,10 @@
 
30
        g_propagate_error (perror, error);
 
31
 }
 
32
 
 
33
+#ifdef HAVE_LIBMAPI_CONTEXT_PARAM
 
34
+struct mapi_context *mapi_ctx = NULL;
 
35
+#endif
 
36
+
 
37
 typedef struct _ExchangeMapiConnectionPrivate ExchangeMapiConnectionPrivate;
 
38
 
 
39
 struct _ExchangeMapiConnectionPrivate {
 
40
@@ -2808,7 +2812,11 @@
 
41
 
 
42
        mapi_object_init(&obj_folder_src);
 
43
        mapi_object_init(&obj_folder_dst);
 
44
-       mapi_id_array_init(&msg_id_array);
 
45
+       mapi_id_array_init (
 
46
+               #ifdef HAVE_LIBMAPI_CONTEXT_PARAM
 
47
+               mapi_ctx,
 
48
+               #endif
 
49
+               &msg_id_array);
 
50
 
 
51
        for (l = mid_list; l != NULL; l = g_slist_next (l))
 
52
                mapi_id_array_add_id (&msg_id_array, *((mapi_id_t *)l->data));
 
53
@@ -3602,7 +3610,11 @@
 
54
                }
 
55
        }
 
56
 
 
57
-       ms = MAPIInitialize (profpath);
 
58
+       ms = MAPIInitialize (
 
59
+               #ifdef HAVE_LIBMAPI_CONTEXT_PARAM
 
60
+               &mapi_ctx,
 
61
+               #endif
 
62
+               profpath);
 
63
        if (ms == MAPI_E_SESSION_LIMIT) {
 
64
                /* do nothing, the profile store is already initialized */
 
65
                /* but this shouldn't happen */
 
66
@@ -3664,15 +3676,31 @@
 
67
        /* Initialize libmapi logger*/
 
68
        if (g_getenv ("MAPI_DEBUG")) {
 
69
                debug_log_level = atoi (g_getenv ("MAPI_DEBUG"));
 
70
-               SetMAPIDumpData(TRUE);
 
71
-               SetMAPIDebugLevel(debug_log_level);
 
72
+               SetMAPIDumpData (
 
73
+                       #ifdef HAVE_LIBMAPI_CONTEXT_PARAM
 
74
+                       mapi_ctx,
 
75
+                       #endif
 
76
+                       TRUE);
 
77
+               SetMAPIDebugLevel (
 
78
+                       #ifdef HAVE_LIBMAPI_CONTEXT_PARAM
 
79
+                       mapi_ctx,
 
80
+                       #endif
 
81
+                       debug_log_level);
 
82
        }
 
83
 
 
84
        g_debug("Loading profile %s ", profname);
 
85
 
 
86
-       ms = MapiLogonEx (&session, profname, password);
 
87
+       ms = MapiLogonEx (
 
88
+               #ifdef HAVE_LIBMAPI_CONTEXT_PARAM
 
89
+               mapi_ctx,
 
90
+               #endif
 
91
+               &session, profname, password);
 
92
        if (ms == MAPI_E_NOT_FOUND && try_create_profile (profname, password))
 
93
-               ms = MapiLogonEx (&session, profname, password);
 
94
+               ms = MapiLogonEx (
 
95
+                       #ifdef HAVE_LIBMAPI_CONTEXT_PARAM
 
96
+                       mapi_ctx,
 
97
+                       #endif
 
98
+                       &session, profname, password);
 
99
 
 
100
        if (ms != MAPI_E_SUCCESS) {
 
101
                make_mapi_error (perror, "MapiLogonEx", ms);
 
102
@@ -3717,34 +3745,60 @@
 
103
        profname = exchange_mapi_util_profile_name (username, domain, server, TRUE);
 
104
 
 
105
        /* Delete any existing profiles with the same profilename */
 
106
-       ms = DeleteProfile (profname);
 
107
+       ms = DeleteProfile (
 
108
+               #ifdef HAVE_LIBMAPI_CONTEXT_PARAM
 
109
+               mapi_ctx,
 
110
+               #endif
 
111
+               profname);
 
112
        /* don't bother to check error - it would be valid if we got an error */
 
113
 
 
114
-       ms = CreateProfile (profname, username, password, OC_PROFILE_NOPASSWORD);
 
115
+       ms = CreateProfile (
 
116
+               #ifdef HAVE_LIBMAPI_CONTEXT_PARAM
 
117
+               mapi_ctx,
 
118
+               #endif
 
119
+               profname, username, password, OC_PROFILE_NOPASSWORD);
 
120
        if (ms != MAPI_E_SUCCESS) {
 
121
                make_mapi_error (perror, "CreateProfile", ms);
 
122
                goto cleanup;
 
123
        }
 
124
 
 
125
-       mapi_profile_add_string_attr(profname, "binding", server);
 
126
-       mapi_profile_add_string_attr(profname, "workstation", workstation);
 
127
-       mapi_profile_add_string_attr(profname, "domain", domain);
 
128
+       #ifdef HAVE_LIBMAPI_CONTEXT_PARAM
 
129
+       #define add_string_attr(_prof,_aname,_val)                              \
 
130
+               mapi_profile_add_string_attr (mapi_ctx, _prof, _aname, _val)
 
131
+       #else
 
132
+       #define add_string_attr(_prof,_aname,_val)                              \
 
133
+               mapi_profile_add_string_attr (_prof, _aname, _val)
 
134
+       #endif
 
135
+
 
136
+       add_string_attr (profname, "binding", server);
 
137
+       add_string_attr (profname, "workstation", workstation);
 
138
+       add_string_attr (profname, "domain", domain);
 
139
 
 
140
        if ((flags & CREATE_PROFILE_FLAG_USE_SSL) != 0)
 
141
-               mapi_profile_add_string_attr (profname, "seal", "true");
 
142
+               add_string_attr (profname, "seal", "true");
 
143
 
 
144
        /* This is only convenient here and should be replaced at some point */
 
145
-       mapi_profile_add_string_attr(profname, "codepage", "0x4e4");
 
146
-       mapi_profile_add_string_attr(profname, "language", "0x409");
 
147
-       mapi_profile_add_string_attr(profname, "method", "0x409");
 
148
+       add_string_attr (profname, "codepage", "0x4e4");
 
149
+       add_string_attr (profname, "language", "0x409");
 
150
+       add_string_attr (profname, "method", "0x409");
 
151
+
 
152
+       #undef add_string_attr
 
153
 
 
154
        /* Login now */
 
155
        g_debug("Logging into the server... ");
 
156
-       ms = MapiLogonProvider (&session, profname, password, PROVIDER_ID_NSPI);
 
157
+       ms = MapiLogonProvider (
 
158
+               #ifdef HAVE_LIBMAPI_CONTEXT_PARAM
 
159
+               mapi_ctx,
 
160
+               #endif
 
161
+               &session, profname, password, PROVIDER_ID_NSPI);
 
162
        if (ms != MAPI_E_SUCCESS) {
 
163
                make_mapi_error (perror, "MapiLogonProvider", ms);
 
164
                g_debug ("Deleting profile %s ", profname);
 
165
-               DeleteProfile (profname);
 
166
+               DeleteProfile (
 
167
+                       #ifdef HAVE_LIBMAPI_CONTEXT_PARAM
 
168
+                       mapi_ctx,
 
169
+                       #endif
 
170
+                       profname);
 
171
                goto cleanup;
 
172
        }
 
173
        g_debug("MapiLogonProvider : succeeded \n");
 
174
@@ -3753,7 +3807,11 @@
 
175
        if (ms != MAPI_E_SUCCESS) {
 
176
                make_mapi_error (perror, "ProcessNetworkProfile", ms);
 
177
                g_debug ("Deleting profile %s ", profname);
 
178
-               DeleteProfile (profname);
 
179
+               DeleteProfile (
 
180
+                       #ifdef HAVE_LIBMAPI_CONTEXT_PARAM
 
181
+                       mapi_ctx,
 
182
+                       #endif
 
183
+                       profname);
 
184
                goto cleanup;
 
185
        }
 
186
        g_debug("ProcessNetworkProfile : succeeded \n");
 
187
@@ -3807,7 +3865,11 @@
 
188
 
 
189
                g_debug ("Deleting profile %s ", profile);
 
190
 
 
191
-               ms = DeleteProfile (profile);
 
192
+               ms = DeleteProfile (
 
193
+                       #ifdef HAVE_LIBMAPI_CONTEXT_PARAM
 
194
+                       mapi_ctx,
 
195
+                       #endif
 
196
+                       profile);
 
197
                if (ms == MAPI_E_SUCCESS) {
 
198
                        result = TRUE;
 
199
                } else {
 
200
@@ -3820,4 +3882,21 @@
 
201
        return result;
 
202
 }
 
203
 
 
204
+void
 
205
+exchange_mapi_rename_profile (const gchar *old_name, const gchar *new_name)
 
206
+{
 
207
+       g_return_if_fail (old_name != NULL);
 
208
+       g_return_if_fail (new_name != NULL);
 
209
+
 
210
+       g_static_rec_mutex_lock (&profile_mutex);
 
211
+
 
212
+       RenameProfile (
 
213
+               #ifdef HAVE_LIBMAPI_CONTEXT_PARAM
 
214
+               mapi_ctx,
 
215
+               #endif
 
216
+               old_name, new_name);
 
217
+
 
218
+       g_static_rec_mutex_unlock (&profile_mutex);
 
219
+}
 
220
+
 
221
 /* profile related functions - end */
 
222
 
 
223
=== modified file 'src/libexchangemapi/exchange-mapi-connection.h'
 
224
--- old/src/libexchangemapi/exchange-mapi-connection.h  2010-08-02 22:02:21 +0000
 
225
+++ new/src/libexchangemapi/exchange-mapi-connection.h  2011-01-25 18:44:56 +0000
 
226
@@ -240,6 +240,7 @@
 
227
                                       mapi_profile_callback_t cb, gpointer data, GError **perror);
 
228
 
 
229
 gboolean               exchange_mapi_delete_profile (const gchar *profile, GError **perror);
 
230
+void                   exchange_mapi_rename_profile (const gchar *old_name, const gchar *new_name);
 
231
 
 
232
 /* utility functions */
 
233
 
 
234
 
 
235
=== modified file 'src/libexchangemapi/exchange-mapi-utils.c'
 
236
--- old/src/libexchangemapi/exchange-mapi-utils.c       2010-11-02 17:03:41 +0000
 
237
+++ new/src/libexchangemapi/exchange-mapi-utils.c       2011-01-25 18:44:56 +0000
 
238
@@ -947,7 +947,7 @@
 
239
                old_name = g_strdup_printf ("%s@%s", username, domain);
 
240
                old_name = g_strcanon (old_name, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@", '_');
 
241
 
 
242
-               RenameProfile (old_name, res);
 
243
+               exchange_mapi_rename_profile (old_name, res);
 
244
 
 
245
                g_free (old_name);
 
246
        }
 
247