From ed545c73efb42f99ca7ba4c7fa8d12c396f5f3c1 Mon Sep 17 00:00:00 2001 From: Dmitry Podgorny Date: Wed, 16 Sep 2020 01:20:42 +0300 Subject: [PATCH] Depend on libstrophe-0.10.0+ libstrophe-0.10.0 introduces global timed handlers which we use for re-connection logic. --- README.md | 2 +- configure.ac | 4 ++-- src/xmppconsole.c | 8 -------- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 1bea7f6..e87a21a 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Build requirements xmppconsole has only 1 required dependency: -* [libstrophe](https://github.com/strophe/libstrophe) +* [libstrophe](https://github.com/strophe/libstrophe) version 0.10.0 or higher You will need the following dependencies in order to build optional UI modules. diff --git a/configure.ac b/configure.ac index a85e560..af6f4d9 100644 --- a/configure.ac +++ b/configure.ac @@ -6,12 +6,12 @@ AC_CONFIG_FILES([Makefile]) AC_PROG_CC AM_PROG_CC_C_O -PKG_CHECK_MODULES([libstrophe], [libstrophe >= 0.9.0], +PKG_CHECK_MODULES([libstrophe], [libstrophe >= 0.10.0], [ LIBS="$libstrophe_LIBS $LIBS" CFLAGS="$CFLAGS $libstrophe_CFLAGS" ], - [AC_MSG_ERROR([libstrophe is required])]) + [AC_MSG_ERROR([libstrophe 0.10.0 or higher is required])]) # # Ncurses UI module diff --git a/src/xmppconsole.c b/src/xmppconsole.c index 4c814d2..aa13dba 100644 --- a/src/xmppconsole.c +++ b/src/xmppconsole.c @@ -37,8 +37,6 @@ #include #include -/* #define HAVE_NEW_LIBSTROPHE 1 */ - #define XC_RECONNECT_TIMER 3000 static int xc_reconnect_cb(xmpp_ctx_t *xmpp_ctx, void *userdata); @@ -66,11 +64,9 @@ static void xc_conn_handler(xmpp_conn_t *conn, if (signalled || xc_ui_is_done(ctx->c_ui)) xc_ui_quit(ctx->c_ui); else { -#ifdef HAVE_NEW_LIBSTROPHE xmpp_global_timed_handler_add(ctx->c_ctx, xc_reconnect_cb, XC_RECONNECT_TIMER, ctx); -#endif /* HAVE_NEW_LIBSTROPHE */ } } } @@ -193,12 +189,8 @@ int main(int argc, char **argv) xc_ui_ctx_set(&ui, &ctx); rc = xc_connect(xmpp_conn, &ctx); if (rc != 0) { -#ifdef HAVE_NEW_LIBSTROPHE xmpp_global_timed_handler_add(xmpp_ctx, xc_reconnect_cb, XC_RECONNECT_TIMER, &ctx); -#else - (void)xc_reconnect_cb; -#endif /* HAVE_NEW_LIBSTROPHE */ } g_ctx = &ctx;