From cf83976b51dd103a17b75dd77f326f64166199bc Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Mon, 30 May 2022 18:04:36 +0200 Subject: [PATCH 1/7] Add basic qrcode functions --- configure.ac | 8 ++++++++ src/command/cmd_ac.c | 1 + src/command/cmd_defs.c | 3 ++- src/command/cmd_funcs.c | 12 ++++++++++++ src/command/cmd_funcs.h | 1 + src/ui/console.c | 34 ++++++++++++++++++++++++++++++++++ src/ui/ui.h | 4 ++++ tests/unittests/ui/stub_ui.c | 11 +++++++++++ 8 files changed, 73 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 2cf3e026..0f997dde 100644 --- a/configure.ac +++ b/configure.ac @@ -67,6 +67,8 @@ AC_ARG_ENABLE([icons-and-clipboard], [AS_HELP_STRING([--enable-icons-and-clipboard], [enable GTK tray icons and clipboard paste support])]) AC_ARG_ENABLE([gdk-pixbuf], [AS_HELP_STRING([--enable-gdk-pixbuf], [enable GDK Pixbuf support to scale avatars before uploading])]) +AC_ARG_ENABLE([omemo-qrcode], + [AS_HELP_STRING([--enable-omemo-qrcode], [enable ability to display omemo qr code])]) # Required dependencies @@ -345,6 +347,12 @@ AS_IF([test "x$with_themes" = xno -o "x$with_themes" = xyes -o "x$with_themes" = AC_SUBST(THEMES_PATH) AM_CONDITIONAL([THEMES_INSTALL], "$THEMES_INSTALL") +dnl feature: omemo qrcode +AS_IF([test "x$omemo_qrcode" != xno], + [PKG_CHECK_MODULES([libqrencode], [libqrencode], + [AC_DEFINE([HAVE_QRENCODE], [1], [qrcode module])] + [LIBS="-lqrencode $LIBS"]], [])) + ## Tests # cmocka is required only for tests, profanity shouldn't be linked with it diff --git a/src/command/cmd_ac.c b/src/command/cmd_ac.c index 9fc70a1d..531d189b 100644 --- a/src/command/cmd_ac.c +++ b/src/command/cmd_ac.c @@ -700,6 +700,7 @@ cmd_ac_init(void) autocomplete_add(omemo_ac, "policy"); autocomplete_add(omemo_ac, "trustmode"); autocomplete_add(omemo_ac, "char"); + autocomplete_add(omemo_ac, "qrcode"); omemo_log_ac = autocomplete_new(); autocomplete_add(omemo_log_ac, "on"); diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c index 57d90226..ac226544 100644 --- a/src/command/cmd_defs.c +++ b/src/command/cmd_defs.c @@ -2312,7 +2312,8 @@ static struct cmd_t command_defs[] = { { "fingerprint", cmd_omemo_fingerprint }, { "char", cmd_omemo_char }, { "policy", cmd_omemo_policy }, - { "clear_device_list", cmd_omemo_clear_device_list }) + { "clear_device_list", cmd_omemo_clear_device_list }, + { "qrcode", cmd_omemo_qrcode }) CMD_NOMAINFUNC CMD_TAGS( CMD_TAG_CHAT, diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index 2a8331d1..29c8a29a 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -9035,6 +9035,18 @@ cmd_omemo_policy(ProfWin* window, const char* const command, gchar** args) #endif } +gboolean +cmd_omemo_qrcode(ProfWin* window, const char* const command, gchar** args) +{ +#ifdef HAVE_OMEMO + cons_show_omemo_qrcode("some text from me"); + return TRUE; +#else + cons_show("This version of Profanity has not been built with OMEMO support enabled"); + return TRUE; +#endif +} + gboolean cmd_save(ProfWin* window, const char* const command, gchar** args) { diff --git a/src/command/cmd_funcs.h b/src/command/cmd_funcs.h index 621dd1c6..adc6793d 100644 --- a/src/command/cmd_funcs.h +++ b/src/command/cmd_funcs.h @@ -227,6 +227,7 @@ gboolean cmd_omemo_untrust(ProfWin* window, const char* const command, gchar** a gboolean cmd_omemo_trust_mode(ProfWin* window, const char* const command, gchar** args); gboolean cmd_omemo_policy(ProfWin* window, const char* const command, gchar** args); gboolean cmd_omemo_clear_device_list(ProfWin* window, const char* const command, gchar** args); +gboolean cmd_omemo_qrcode(ProfWin* window, const char* const command, gchar** args); gboolean cmd_save(ProfWin* window, const char* const command, gchar** args); gboolean cmd_reload(ProfWin* window, const char* const command, gchar** args); diff --git a/src/ui/console.c b/src/ui/console.c index 3e7a0844..ae1f796d 100644 --- a/src/ui/console.c +++ b/src/ui/console.c @@ -48,6 +48,10 @@ #include #endif +#ifdef HAVE_QRENCODE +#include +#endif + #include "common.h" #include "log.h" #include "config/preferences.h" @@ -862,6 +866,36 @@ cons_show_disco_contact_information(GHashTable* addresses) } } +void +cons_show_omemo_qrcode(const char* const text) +{ +#ifdef HAVE_QRENCODE + static const size_t ZOOM_SIZE = 10; + QRcode *qrcode = QRcode_encodeString(text, 0, QR_ECLEVEL_L, QR_MODE_8, 1); + + int width = (qrcode->width * ZOOM_SIZE); + unsigned char *data = qrcode->data; + + ProfWin* console = wins_get_console(); + + for (size_t y = 0; y < width; y+=ZOOM_SIZE) { + //size_t y_index = y * width; + for (size_t x = 0; x < width; x+=ZOOM_SIZE) { + if (x==0) { + win_print(console, THEME_DEFAULT, "", "%s", (*data & 1) ? "A" : "B"); + } else { + win_append(console, THEME_DEFAULT, "", "%s", (*data & 1) ? "A" : "B"); + } + + data++; + } + win_println(console, THEME_DEFAULT, "", ""); + } + + QRcode_free(qrcode); +#endif +} + void cons_show_status(const char* const barejid) { diff --git a/src/ui/ui.h b/src/ui/ui.h index 5f31354f..8615045a 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -277,7 +277,11 @@ void cons_show_bookmarks(const GList* list); void cons_show_bookmarks_ignore(gchar** list, gsize len); void cons_show_disco_items(GSList* items, const char* const jid); void cons_show_disco_info(const char* from, GSList* identities, GSList* features); + void cons_show_disco_contact_information(GHashTable* addresses); + +void cons_show_omemo_qrcode(const char* const text); + void cons_show_room_invite(const char* const invitor, const char* const room, const char* const reason); void cons_check_version(gboolean not_available_msg); void cons_show_typing(const char* const barejid); diff --git a/tests/unittests/ui/stub_ui.c b/tests/unittests/ui/stub_ui.c index 768e654b..a1bb7d61 100644 --- a/tests/unittests/ui/stub_ui.c +++ b/tests/unittests/ui/stub_ui.c @@ -923,27 +923,38 @@ void cons_show_disco_items(GSList* items, const char* const jid) { } + void cons_show_disco_info(const char* from, GSList* identities, GSList* features) { } + +void +cons_show_omemo_qrcode(const char* const text) +{ +} + void cons_show_room_invite(const char* const invitor, const char* const room, const char* const reason) { } + void cons_check_version(gboolean not_available_msg) { } + void cons_show_typing(const char* const barejid) { } + void cons_show_incoming_room_message(const char* const nick, const char* const room, const int win_index, gboolean mention, GList* triggers, int unread, ProfWin* const window) { } + void cons_show_incoming_message(const char* const short_from, const int win_index, int unread, ProfWin* const window) { From 9a9a97868d0366408d7a310de3fa7158a294854e Mon Sep 17 00:00:00 2001 From: swirl Date: Fri, 27 May 2022 15:25:28 -0400 Subject: [PATCH 2/7] implement working OMEMO QR code TODO: We need to find a way to switch the colors of the QR code, so that more QR readers can detect it, without "blending" the edges of the QR code with the surrounding terminal window. Signed-off-by: swirl --- src/command/cmd_funcs.c | 14 +++++++++++++- src/ui/console.c | 13 ++++++------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index 29c8a29a..81293c15 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -9039,7 +9039,18 @@ gboolean cmd_omemo_qrcode(ProfWin* window, const char* const command, gchar** args) { #ifdef HAVE_OMEMO - cons_show_omemo_qrcode("some text from me"); + if (connection_get_status() != JABBER_CONNECTED) { + cons_show("You must be connected with an account to load OMEMO information."); + return TRUE; + } + + if (!omemo_loaded()) { + win_println(window, THEME_DEFAULT, "!", "You have not generated or loaded a cryptographic materials, use '/omemo gen'"); + return TRUE; + } + + char* fingerprint = omemo_own_fingerprint(TRUE); + cons_show_omemo_qrcode(fingerprint); return TRUE; #else cons_show("This version of Profanity has not been built with OMEMO support enabled"); @@ -9767,3 +9778,4 @@ cmd_mood(ProfWin* window, const char* const command, gchar** args) } return TRUE; } + diff --git a/src/ui/console.c b/src/ui/console.c index ae1f796d..e0b0fa4d 100644 --- a/src/ui/console.c +++ b/src/ui/console.c @@ -878,18 +878,16 @@ cons_show_omemo_qrcode(const char* const text) ProfWin* console = wins_get_console(); + char buf[(width * 4) + 1]; + memset(buf, 0, sizeof buf); for (size_t y = 0; y < width; y+=ZOOM_SIZE) { - //size_t y_index = y * width; for (size_t x = 0; x < width; x+=ZOOM_SIZE) { - if (x==0) { - win_print(console, THEME_DEFAULT, "", "%s", (*data & 1) ? "A" : "B"); - } else { - win_append(console, THEME_DEFAULT, "", "%s", (*data & 1) ? "A" : "B"); - } + strcat(buf, (*data & 1) ? "\u2588\u2588" : "\u2800\u2800"); data++; } - win_println(console, THEME_DEFAULT, "", ""); + win_println(console, THEME_DEFAULT, "", "%s", buf); + memset(buf, 0, sizeof buf); } QRcode_free(qrcode); @@ -2928,3 +2926,4 @@ cons_remove_alert(ProfWin* window) g_list_free_full(item, g_free); free(win_name); } + From d64cb38240bd6db10135b6007f42dab6851ca559 Mon Sep 17 00:00:00 2001 From: swirl Date: Fri, 27 May 2022 15:45:38 -0400 Subject: [PATCH 3/7] Reverse QR code colors and add padding All QR scanners should be able to recognize this, as it is now the correct color with some padding to prevent blending. Signed-off-by: swirl --- src/command/cmd_funcs.c | 1 - src/ui/console.c | 26 +++++++++++++++++++------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index 81293c15..1a4d4bf1 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -9778,4 +9778,3 @@ cmd_mood(ProfWin* window, const char* const command, gchar** args) } return TRUE; } - diff --git a/src/ui/console.c b/src/ui/console.c index e0b0fa4d..89c3cf29 100644 --- a/src/ui/console.c +++ b/src/ui/console.c @@ -871,24 +871,37 @@ cons_show_omemo_qrcode(const char* const text) { #ifdef HAVE_QRENCODE static const size_t ZOOM_SIZE = 10; - QRcode *qrcode = QRcode_encodeString(text, 0, QR_ECLEVEL_L, QR_MODE_8, 1); + QRcode* qrcode = QRcode_encodeString(text, 0, QR_ECLEVEL_L, QR_MODE_8, 1); int width = (qrcode->width * ZOOM_SIZE); - unsigned char *data = qrcode->data; + unsigned char* data = qrcode->data; ProfWin* console = wins_get_console(); char buf[(width * 4) + 1]; memset(buf, 0, sizeof buf); - for (size_t y = 0; y < width; y+=ZOOM_SIZE) { - for (size_t x = 0; x < width; x+=ZOOM_SIZE) { - strcat(buf, (*data & 1) ? "\u2588\u2588" : "\u2800\u2800"); + + char tmp[(width * 4) + 5]; + memset(tmp, 0, sizeof tmp); + + for (int i = 0; i < width + 2 * ZOOM_SIZE; i += ZOOM_SIZE) { + strcat(tmp, "\u2588\u2588"); + } + + win_println(console, THEME_DEFAULT, "", tmp); + for (size_t y = 0; y < width; y += ZOOM_SIZE) { + for (size_t x = 0; x < width; x += ZOOM_SIZE) { + strcat(buf, !(*data & 1) ? "\u2588\u2588" : "\u2800\u2800"); data++; } - win_println(console, THEME_DEFAULT, "", "%s", buf); + + // The extra squares are for padding, so that the QR code doesn't + // "blend in" with the rest of the terminal window. + win_println(console, THEME_DEFAULT, "", "\u2588\u2588%s\u2588\u2588", buf); memset(buf, 0, sizeof buf); } + win_println(console, THEME_DEFAULT, "", "%s", tmp); QRcode_free(qrcode); #endif @@ -2926,4 +2939,3 @@ cons_remove_alert(ProfWin* window) g_list_free_full(item, g_free); free(win_name); } - From 42fb8f86d9b3d1fd3c51a942f4d2fe17c9dc0b79 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Sun, 29 May 2022 17:51:33 +0200 Subject: [PATCH 4/7] Add command help for omemo qrcode --- src/command/cmd_defs.c | 6 ++++-- src/ui/console.c | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c index ac226544..411de396 100644 --- a/src/command/cmd_defs.c +++ b/src/command/cmd_defs.c @@ -2328,7 +2328,8 @@ static struct cmd_t command_defs[] = { "/omemo char ", "/omemo trustmode manual|firstusage|blind", "/omemo policy manual|automatic|always", - "/omemo clear_device_list") + "/omemo clear_device_list", + "/omemo qrcode") CMD_DESC( "OMEMO commands to manage keys, and perform encryption during chat sessions.") CMD_ARGS( @@ -2345,7 +2346,8 @@ static struct cmd_t command_defs[] = { { "policy manual", "Set the global OMEMO policy to manual, OMEMO sessions must be started manually." }, { "policy automatic", "Set the global OMEMO policy to opportunistic, an OMEMO session will be attempted upon starting a conversation." }, { "policy always", "Set the global OMEMO policy to always, an error will be displayed if an OMEMO session cannot be initiated upon starting a conversation." }, - { "clear_device_list", "Clear your own device list on server side. Each client will reannounce itself when connected back."}) + { "clear_device_list", "Clear your own device list on server side. Each client will reannounce itself when connected back."}, + { "qrcode", "Display QR code of your OMEMO fingerprint"}) CMD_EXAMPLES( "/omemo gen", "/omemo start odin@valhalla.edda", diff --git a/src/ui/console.c b/src/ui/console.c index 89c3cf29..32575a15 100644 --- a/src/ui/console.c +++ b/src/ui/console.c @@ -904,6 +904,8 @@ cons_show_omemo_qrcode(const char* const text) win_println(console, THEME_DEFAULT, "", "%s", tmp); QRcode_free(qrcode); +#else + cons_show("This version of Profanity has not been built with libqrencode"); #endif } From 0c7350e2e637aa07b4b1e926e84192030df8ff50 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Mon, 30 May 2022 18:06:13 +0200 Subject: [PATCH 5/7] Make qrencode optional and add to CI --- Dockerfile.arch | 3 ++- Dockerfile.debian | 3 ++- Dockerfile.fedora | 3 ++- Dockerfile.tumbleweed | 3 ++- Dockerfile.ubuntu | 3 ++- ci-build.sh | 4 ++-- configure.ac | 15 ++++++++++----- 7 files changed, 22 insertions(+), 12 deletions(-) diff --git a/Dockerfile.arch b/Dockerfile.arch index 7a7b2553..d4c4e0a1 100644 --- a/Dockerfile.arch +++ b/Dockerfile.arch @@ -27,7 +27,8 @@ RUN pacman -Syu --noconfirm && pacman -S --needed --noconfirm \ python \ wget \ sqlite \ - gdk-pixbuf2 + gdk-pixbuf2 \ + qrencode RUN mkdir -p /usr/src/{stabber,profanity} diff --git a/Dockerfile.debian b/Dockerfile.debian index ae002148..6da1f414 100644 --- a/Dockerfile.debian +++ b/Dockerfile.debian @@ -28,7 +28,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ python3-dev \ python-dev-is-python3 \ libsqlite3-dev \ - libgdk-pixbuf-2.0-dev + libgdk-pixbuf-2.0-dev \ + libqrencode-dev RUN mkdir -p /usr/src/{stabber,libstrophe,profanity} WORKDIR /usr/src diff --git a/Dockerfile.fedora b/Dockerfile.fedora index 8238fd48..b885bebb 100644 --- a/Dockerfile.fedora +++ b/Dockerfile.fedora @@ -35,7 +35,8 @@ RUN dnf install -y \ readline-devel \ openssl-devel \ sqlite-devel \ - gdk-pixbuf2-devel + gdk-pixbuf2-devel \ + qrencode-devel # https://github.com/openSUSE/docker-containers-build/issues/26 ENV LANG en_US.UTF-8 diff --git a/Dockerfile.tumbleweed b/Dockerfile.tumbleweed index 8c75e8a4..5fc134dc 100644 --- a/Dockerfile.tumbleweed +++ b/Dockerfile.tumbleweed @@ -35,7 +35,8 @@ RUN zypper --non-interactive in --no-recommends \ python38-devel \ readline-devel \ sqlite3-devel \ - gdk-pixbuf-devel + gdk-pixbuf-devel \ + qrencode-devel # https://github.com/openSUSE/docker-containers-build/issues/26 ENV LANG en_US.UTF-8 diff --git a/Dockerfile.ubuntu b/Dockerfile.ubuntu index 6ca0d721..853544c0 100644 --- a/Dockerfile.ubuntu +++ b/Dockerfile.ubuntu @@ -29,7 +29,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ python3-dev \ python-dev-is-python3 \ libsqlite3-dev \ - libgdk-pixbuf-2.0-dev + libgdk-pixbuf-2.0-dev \ + libqrencode-dev RUN mkdir -p /usr/src/{stabber,libstrophe,profanity} WORKDIR /usr/src diff --git a/ci-build.sh b/ci-build.sh index a26693f2..0e84cae9 100755 --- a/ci-build.sh +++ b/ci-build.sh @@ -44,7 +44,7 @@ case $(uname | tr '[:upper:]' '[:lower:]') in tests=( "--enable-notifications --enable-icons-and-clipboard --enable-otr --enable-pgp --enable-omemo --enable-plugins --enable-c-plugins - --enable-python-plugins --with-xscreensaver --enable-gdk-pixbuf" + --enable-python-plugins --with-xscreensaver --enable-omemo-qrcode --enable-gdk-pixbuf" "--disable-notifications --disable-icons-and-clipboard --disable-otr --disable-pgp --disable-omemo --disable-plugins --disable-c-plugins --disable-python-plugins --without-xscreensaver" @@ -52,7 +52,7 @@ case $(uname | tr '[:upper:]' '[:lower:]') in "--disable-icons-and-clipboard" "--disable-otr" "--disable-pgp" - "--disable-omemo" + "--disable-omemo --disable-omemo-qrcode" "--disable-pgp --disable-otr" "--disable-pgp --disable-otr --disable-omemo" "--disable-plugins" diff --git a/configure.ac b/configure.ac index 0f997dde..8fe1ff4a 100644 --- a/configure.ac +++ b/configure.ac @@ -347,11 +347,16 @@ AS_IF([test "x$with_themes" = xno -o "x$with_themes" = xyes -o "x$with_themes" = AC_SUBST(THEMES_PATH) AM_CONDITIONAL([THEMES_INSTALL], "$THEMES_INSTALL") -dnl feature: omemo qrcode -AS_IF([test "x$omemo_qrcode" != xno], - [PKG_CHECK_MODULES([libqrencode], [libqrencode], - [AC_DEFINE([HAVE_QRENCODE], [1], [qrcode module])] - [LIBS="-lqrencode $LIBS"]], [])) +if test "x$enable_omemo_qrcode" != xno; then + AC_DEFINE([HAVE_QRENCODE], [1], [Have QRencode]) + + PKG_CHECK_MODULES([libqrencode], [libqrencode], + [LIBS="$libqrencode_LIBS $LIBS" CFLAGS="$libqrencode_CFLAGS $cflags"], + [AC_DEFINE([HAVE_QRENCODE], [0], [Dont have QRencode]) + AS_IF([test "x$enable_qrcode" = xyes], + [AC_MSG_ERROR([libqrencode not found])], + [AC_MSG_NOTICE([librencode not found])])]) +fi ## Tests From 1a7017e44cd1f6bc2ba16f46c7e92b6c0252e5c7 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Mon, 30 May 2022 17:59:56 +0200 Subject: [PATCH 6/7] build: set HAVE_QRENCODE only once and use CLFAGS not cflags --- configure.ac | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 8fe1ff4a..9f78d7ec 100644 --- a/configure.ac +++ b/configure.ac @@ -348,10 +348,8 @@ AC_SUBST(THEMES_PATH) AM_CONDITIONAL([THEMES_INSTALL], "$THEMES_INSTALL") if test "x$enable_omemo_qrcode" != xno; then - AC_DEFINE([HAVE_QRENCODE], [1], [Have QRencode]) - PKG_CHECK_MODULES([libqrencode], [libqrencode], - [LIBS="$libqrencode_LIBS $LIBS" CFLAGS="$libqrencode_CFLAGS $cflags"], + [AC_DEFINE([HAVE_QRENCODE], [1], [Have QRencode]) LIBS="$libqrencode_LIBS $LIBS" CFLAGS="$libqrencode_CFLAGS $CFLAGS"], [AC_DEFINE([HAVE_QRENCODE], [0], [Dont have QRencode]) AS_IF([test "x$enable_qrcode" = xyes], [AC_MSG_ERROR([libqrencode not found])], From 3557e46b6d1e99491be0dc4ee85fe157475c0ae3 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Tue, 31 May 2022 08:50:44 +0200 Subject: [PATCH 7/7] build: dont define HAVE_QRENCODE at all in case not present Before we got an error when libqrencode was not installed: `src/ui/console.c:52:10: fatal error: qrencode.h: No such file or directory` Which looked like HAVE_QRENCODE was true. config.status showed: `config.status:D["HAVE_QRENCODE"]=" 0"` Holger pointed to me that there is not just true and false but defined and undefined. So one solution was to use `#if HAVE_QRENCODE == 1` to check for the actual value. Or dont define HAVE_QRENCODE in the non present case at all. In all the other HAVE_ variables we use this approach. I think i at first chose the wrong way out of confusion with BUILD_ and HAVE_. --- configure.ac | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 9f78d7ec..96495386 100644 --- a/configure.ac +++ b/configure.ac @@ -350,8 +350,7 @@ AM_CONDITIONAL([THEMES_INSTALL], "$THEMES_INSTALL") if test "x$enable_omemo_qrcode" != xno; then PKG_CHECK_MODULES([libqrencode], [libqrencode], [AC_DEFINE([HAVE_QRENCODE], [1], [Have QRencode]) LIBS="$libqrencode_LIBS $LIBS" CFLAGS="$libqrencode_CFLAGS $CFLAGS"], - [AC_DEFINE([HAVE_QRENCODE], [0], [Dont have QRencode]) - AS_IF([test "x$enable_qrcode" = xyes], + [AS_IF([test "x$enable_qrcode" = xyes], [AC_MSG_ERROR([libqrencode not found])], [AC_MSG_NOTICE([librencode not found])])]) fi