ports/telephony/asterisk/18/patches/patch-apps_app_voicemail_c

71 lines
1.7 KiB
Text
Raw Normal View History

2023-08-16 22:26:55 +00:00
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
@@ -60,6 +60,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"
@@ -3305,7 +3308,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;
@@ -3315,22 +3322,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)