Skip to content

Commit

Permalink
Depend on libstrophe-0.10.0+
Browse files Browse the repository at this point in the history
libstrophe-0.10.0 introduces global timed handlers which we use for
re-connection logic.
  • Loading branch information
pasis committed Sep 15, 2020
1 parent 764572f commit ed545c7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions src/xmppconsole.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
#include <string.h>
#include <strophe.h>

/* #define HAVE_NEW_LIBSTROPHE 1 */

#define XC_RECONNECT_TIMER 3000

static int xc_reconnect_cb(xmpp_ctx_t *xmpp_ctx, void *userdata);
Expand Down Expand Up @@ -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 */
}
}
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit ed545c7

Please sign in to comment.