70 lines
1.7 KiB
Text
70 lines
1.7 KiB
Text
test for alpine-2.22's c-client and cope with API change.
|
|
parts borrowed from slackware patch for PHP with alpine-2.22.
|
|
|
|
Index: apps/app_voicemail.c
|
|
--- apps/app_voicemail.c.orig
|
|
+++ apps/app_voicemail.c
|
|
@@ -93,6 +93,9 @@
|
|
#include <c-client/c-client.h>
|
|
#include <c-client/imap4r1.h>
|
|
#include <c-client/linkage.h>
|
|
+#if defined (HAVE_IMAP_ALPINE2_22)
|
|
+char *cpystr(const char *str); /* from c-client/misc.h but that has namespace problems */
|
|
+#endif
|
|
#else
|
|
#include "c-client.h"
|
|
#include "imap4r1.h"
|
|
@@ -3401,7 +3404,11 @@ void mm_dlog(char *string)
|
|
}
|
|
|
|
|
|
+#if defined(HAVE_IMAP_ALPINE2_22)
|
|
+void mm_login(NETMBX * mb, char *user, char **pwd, long trial)
|
|
+#else
|
|
void mm_login(NETMBX * mb, char *user, char *pwd, long trial)
|
|
+#endif
|
|
{
|
|
struct ast_vm_user *vmu;
|
|
|
|
@@ -3411,22 +3418,41 @@ void mm_login(NETMBX * mb, char *user, char *pwd, long
|
|
|
|
/* We should only do this when necessary */
|
|
if (!ast_strlen_zero(authpassword)) {
|
|
+#if defined(HAVE_IMAP_ALPINE2_22)
|
|
+ *pwd = cpystr(authpassword);
|
|
+#else
|
|
ast_copy_string(pwd, authpassword, MAILTMPLEN);
|
|
+#endif
|
|
} else {
|
|
AST_LIST_TRAVERSE(&users, vmu, list) {
|
|
if (!strcasecmp(mb->user, vmu->imapuser)) {
|
|
+#if defined(HAVE_IMAP_ALPINE2_22)
|
|
+ *pwd = cpystr(vmu->imappassword);
|
|
+#else
|
|
ast_copy_string(pwd, vmu->imappassword, MAILTMPLEN);
|
|
+#endif
|
|
break;
|
|
}
|
|
}
|
|
if (!vmu) {
|
|
if ((vmu = find_user_realtime_imapuser(mb->user))) {
|
|
+#if defined(HAVE_IMAP_ALPINE2_22)
|
|
+ *pwd = cpystr(vmu->imappassword);
|
|
+#else
|
|
ast_copy_string(pwd, vmu->imappassword, MAILTMPLEN);
|
|
+#endif
|
|
free_user(vmu);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
+
|
|
+#if defined(HAVE_IMAP_ALPINE2_22)
|
|
+void mm_login_method(NETMBX *mb, char *user, void *pwd, long trial, char *method)
|
|
+{
|
|
+ return;
|
|
+}
|
|
+#endif
|
|
|
|
|
|
void mm_critical(MAILSTREAM * stream)
|