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

first step to remove libmesode

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
This commit is contained in:
Steffen Jaeckel 2021-10-27 15:05:39 +02:00
parent b4d65335f6
commit ffc0b49ab1
17 changed files with 4 additions and 125 deletions

View File

@ -134,21 +134,14 @@ LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
AS_IF([test "x$PTHREAD_CC" != x], [ CC="$PTHREAD_CC" ])
### Check for libmesode, fall back to libstrophe
### TODO libmesode support will be removed in the future, rewrite this section
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])],
[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])],
[XMPP_LIB=""])])
### Check for libstrophe
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])],
[XMPP_LIB=""])
AC_MSG_CHECKING([whether ${XMPP_LIB} works])
AC_LINK_IFELSE([AC_LANG_SOURCE([[
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#else
#include <strophe.h>
#endif
int main() {
xmpp_initialize();

View File

@ -177,7 +177,6 @@ cmd_execute_connect(ProfWin* window, const char* const account)
gboolean
cmd_tls_certpath(ProfWin* window, const char* const command, gchar** args)
{
#ifdef HAVE_LIBMESODE
if (g_strcmp0(args[1], "set") == 0) {
if (args[2] == NULL) {
cons_bad_cmd_usage(command);
@ -212,16 +211,11 @@ cmd_tls_certpath(ProfWin* window, const char* const command, gchar** args)
cons_bad_cmd_usage(command);
return TRUE;
}
#else
cons_show("Certificate path setting only supported when built with libmesode.");
return TRUE;
#endif
}
gboolean
cmd_tls_trust(ProfWin* window, const char* const command, gchar** args)
{
#ifdef HAVE_LIBMESODE
jabber_conn_status_t conn_status = connection_get_status();
if (conn_status != JABBER_CONNECTED) {
cons_show("You are currently not connected.");
@ -245,16 +239,11 @@ cmd_tls_trust(ProfWin* window, const char* const command, gchar** args)
tlscerts_add(cert);
tlscerts_free(cert);
return TRUE;
#else
cons_show("Manual certificate trust only supported when built with libmesode.");
return TRUE;
#endif
}
gboolean
cmd_tls_trusted(ProfWin* window, const char* const command, gchar** args)
{
#ifdef HAVE_LIBMESODE
GList* certs = tlscerts_list();
GList* curr = certs;
@ -272,16 +261,11 @@ cmd_tls_trusted(ProfWin* window, const char* const command, gchar** args)
}
g_list_free_full(certs, (GDestroyNotify)tlscerts_free);
return TRUE;
#else
cons_show("Manual certificate trust only supported when built with libmesode.");
return TRUE;
#endif
}
gboolean
cmd_tls_revoke(ProfWin* window, const char* const command, gchar** args)
{
#ifdef HAVE_LIBMESODE
if (args[1] == NULL) {
cons_bad_cmd_usage(command);
} else {
@ -293,16 +277,11 @@ cmd_tls_revoke(ProfWin* window, const char* const command, gchar** args)
}
}
return TRUE;
#else
cons_show("Manual certificate trust only supported when built with libmesode.");
return TRUE;
#endif
}
gboolean
cmd_tls_cert(ProfWin* window, const char* const command, gchar** args)
{
#ifdef HAVE_LIBMESODE
if (args[1]) {
TLSCertificate* cert = tlscerts_get_trusted(args[1]);
if (!cert) {
@ -332,10 +311,6 @@ cmd_tls_cert(ProfWin* window, const char* const command, gchar** args)
tlscerts_free(cert);
return TRUE;
}
#else
cons_show("Certificate fetching not supported.");
return TRUE;
#endif
}
gboolean

View File

@ -125,12 +125,7 @@ main(int argc, char** argv)
g_print("Build information:\n");
#ifdef HAVE_LIBMESODE
g_print("XMPP library: libmesode\n");
#endif
#ifdef HAVE_LIBSTROPHE
g_print("XMPP library: libstrophe\n");
#endif
if (is_notify_enabled()) {
g_print("Desktop notification support: Enabled\n");

View File

@ -38,13 +38,7 @@
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif
#include <glib.h>

View File

@ -41,13 +41,7 @@
#include <string.h>
#include <glib.h>
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif
#include "common.h"
#include "log.h"

View File

@ -45,13 +45,7 @@
#include <glib.h>
#include <glib/gstdio.h>
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif
#include "common.h"
#include "log.h"

View File

@ -38,13 +38,7 @@
#include "config.h"
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif
#include "xmpp/xmpp.h"

View File

@ -43,13 +43,7 @@
#include <glib.h>
#include <glib/gstdio.h>
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif
#include "common.h"
#include "log.h"

View File

@ -38,13 +38,7 @@
#include <string.h>
#include <stdlib.h>
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif
#include <glib.h>

View File

@ -36,13 +36,7 @@
#ifndef XMPP_FORM_H
#define XMPP_FORM_H
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif
#include "xmpp/xmpp.h"

View File

@ -44,13 +44,7 @@
#include <stdio.h>
#include <glib.h>
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif
#include "profanity.h"
#include "log.h"

View File

@ -39,13 +39,7 @@
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif
#include "profanity.h"
#include "log.h"

View File

@ -42,13 +42,7 @@
#include <glib.h>
#include <glib/gprintf.h>
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif
#include "profanity.h"
#include "log.h"

View File

@ -41,13 +41,7 @@
#include <glib.h>
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif
#include "profanity.h"
#include "log.h"

View File

@ -48,13 +48,7 @@
#include <glib.h>
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif
#include "common.h"
#include "log.h"

View File

@ -38,13 +38,7 @@
#include "config.h"
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif
#include <xmpp/xmpp.h>

View File

@ -40,13 +40,7 @@
#include "config.h"
#ifdef HAVE_LIBMESODE
#include <mesode.h>
#endif
#ifdef HAVE_LIBSTROPHE
#include <strophe.h>
#endif
#include "config/accounts.h"
#include "config/tlscerts.h"