1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Require libstrophe/libmesode 0.10.0

This commit is contained in:
Michael Vetter 2020-09-30 19:29:35 +02:00
parent 3d082bfb66
commit 0a9200e268
2 changed files with 2 additions and 18 deletions

View File

@ -131,19 +131,11 @@ AS_IF([test "x$PTHREAD_CC" != x], [ CC="$PTHREAD_CC" ])
### Check for libmesode, fall back to libstrophe ### Check for libmesode, fall back to libstrophe
### TODO libmesode support will be removed in the future, rewrite this section ### TODO libmesode support will be removed in the future, rewrite this section
PKG_CHECK_MODULES([libmesode], [libmesode >= 0.9.3], PKG_CHECK_MODULES([libmesode], [libmesode >= 0.10.0],
[LIBS="$libmesode_LIBS $LIBS" CFLAGS="$CFLAGS $libmesode_CFLAGS" XMPP_LIB="libmesode" AC_DEFINE([HAVE_LIBMESODE], [1], [libmesode])], [LIBS="$libmesode_LIBS $LIBS" CFLAGS="$CFLAGS $libmesode_CFLAGS" XMPP_LIB="libmesode" AC_DEFINE([HAVE_LIBMESODE], [1], [libmesode])],
[PKG_CHECK_MODULES([libstrophe], [libstrophe >= 0.9.3], [PKG_CHECK_MODULES([libstrophe], [libstrophe >= 0.10.0],
[LIBS="$libstrophe_LIBS $LIBS" CFLAGS="$CFLAGS $libstrophe_CFLAGS" XMPP_LIB="libstrophe" AC_DEFINE([HAVE_LIBSTROPHE], [1], [libstrophe])], [LIBS="$libstrophe_LIBS $LIBS" CFLAGS="$CFLAGS $libstrophe_CFLAGS" XMPP_LIB="libstrophe" AC_DEFINE([HAVE_LIBSTROPHE], [1], [libstrophe])],
[XMPP_LIB=""])]) [XMPP_LIB=""])])
if test "x$XMPP_LIB" = x; then
PKG_CHECK_MODULES([libmesode], [libmesode >= 0.9.2],
[LIBS="$libmesode_LIBS $LIBS" CFLAGS="$CFLAGS $libmesode_CFLAGS" XMPP_LIB="libmesode" AC_DEFINE([HAVE_LIBMESODE], [1], [libmesode])],
[PKG_CHECK_MODULES([libstrophe], [libstrophe >= 0.9.2],
[LIBS="$libstrophe_LIBS $LIBS" CFLAGS="$CFLAGS $libstrophe_CFLAGS" XMPP_LIB="libstrophe" AC_DEFINE([HAVE_LIBSTROPHE], [1], [libstrophe])],
[AC_MSG_ERROR([libstrophe-0.9.2 or later is required for profanity])])])
AC_DEFINE([HAVE_LIBSTROPHE_LT_0_9_3], [1], [Old libstrophe is present])
fi
AC_MSG_CHECKING([whether ${XMPP_LIB} works]) AC_MSG_CHECKING([whether ${XMPP_LIB} works])
AC_LINK_IFELSE([AC_LANG_SOURCE([[ AC_LINK_IFELSE([AC_LANG_SOURCE([[

View File

@ -193,13 +193,7 @@ connection_connect(const char* const jid, const char* const passwd, const char*
} }
if (auth_policy && (g_strcmp0(auth_policy, "legacy") == 0)) { if (auth_policy && (g_strcmp0(auth_policy, "legacy") == 0)) {
#ifdef HAVE_LIBSTROPHE_LT_0_9_3
log_warning("Legacy authentication is requested, but it hasn't been "
"built. Update libstrophe and rebuild Profanity.");
cons_show("Legacy authentication is requested, but it hasn't been built.");
#else
flags |= XMPP_CONN_FLAG_LEGACY_AUTH; flags |= XMPP_CONN_FLAG_LEGACY_AUTH;
#endif /* HAVE_LIBSTROPHE_LT_0_9_3 */
} }
xmpp_conn_set_flags(conn.xmpp_conn, flags); xmpp_conn_set_flags(conn.xmpp_conn, flags);
@ -215,9 +209,7 @@ connection_connect(const char* const jid, const char* const passwd, const char*
LOG_FLAG_IF_SET(XMPP_CONN_FLAG_TRUST_TLS); LOG_FLAG_IF_SET(XMPP_CONN_FLAG_TRUST_TLS);
LOG_FLAG_IF_SET(XMPP_CONN_FLAG_DISABLE_TLS); LOG_FLAG_IF_SET(XMPP_CONN_FLAG_DISABLE_TLS);
LOG_FLAG_IF_SET(XMPP_CONN_FLAG_LEGACY_SSL); LOG_FLAG_IF_SET(XMPP_CONN_FLAG_LEGACY_SSL);
#ifndef HAVE_LIBSTROPHE_LT_0_9_3
LOG_FLAG_IF_SET(XMPP_CONN_FLAG_LEGACY_AUTH); LOG_FLAG_IF_SET(XMPP_CONN_FLAG_LEGACY_AUTH);
#endif /* HAVE_LIBSTROPHE_LT_0_9_3 */
#undef LOG_FLAG_IF_SET #undef LOG_FLAG_IF_SET
} }