mirror of
https://github.com/profanity-im/profanity.git
synced 2024-11-03 19:37:16 -05:00
Link against libsignal-protocol-c
This commit is contained in:
parent
6b064cfde4
commit
4a5b672f95
@ -69,6 +69,7 @@ unittest_sources = \
|
|||||||
src/ui/ui.h \
|
src/ui/ui.h \
|
||||||
src/otr/otr.h \
|
src/otr/otr.h \
|
||||||
src/pgp/gpg.h \
|
src/pgp/gpg.h \
|
||||||
|
src/omemo/omemo.h \
|
||||||
src/command/cmd_defs.h src/command/cmd_defs.c \
|
src/command/cmd_defs.h src/command/cmd_defs.c \
|
||||||
src/command/cmd_funcs.h src/command/cmd_funcs.c \
|
src/command/cmd_funcs.h src/command/cmd_funcs.c \
|
||||||
src/command/cmd_ac.h src/command/cmd_ac.c \
|
src/command/cmd_ac.h src/command/cmd_ac.c \
|
||||||
@ -168,6 +169,9 @@ otr3_sources = \
|
|||||||
otr4_sources = \
|
otr4_sources = \
|
||||||
src/otr/otrlib.h src/otr/otrlibv4.c src/otr/otr.h src/otr/otr.c
|
src/otr/otrlib.h src/otr/otrlibv4.c src/otr/otr.h src/otr/otr.c
|
||||||
|
|
||||||
|
omemo_sources = \
|
||||||
|
src/omemo/omemo.h src/omemo/omemo.c
|
||||||
|
|
||||||
if BUILD_PYTHON_API
|
if BUILD_PYTHON_API
|
||||||
core_sources += $(python_sources)
|
core_sources += $(python_sources)
|
||||||
unittest_sources += $(python_sources)
|
unittest_sources += $(python_sources)
|
||||||
@ -204,6 +208,10 @@ core_sources += $(otr4_sources)
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if BUILD_OMEMO
|
||||||
|
core_sources += $(omemo_sources)
|
||||||
|
endif
|
||||||
|
|
||||||
AM_CFLAGS = @AM_CFLAGS@ -I$(srcdir)/src
|
AM_CFLAGS = @AM_CFLAGS@ -I$(srcdir)/src
|
||||||
|
|
||||||
bin_PROGRAMS = profanity
|
bin_PROGRAMS = profanity
|
||||||
|
13
configure.ac
13
configure.ac
@ -60,6 +60,8 @@ AC_ARG_ENABLE([otr],
|
|||||||
[AS_HELP_STRING([--enable-otr], [enable otr encryption])])
|
[AS_HELP_STRING([--enable-otr], [enable otr encryption])])
|
||||||
AC_ARG_ENABLE([pgp],
|
AC_ARG_ENABLE([pgp],
|
||||||
[AS_HELP_STRING([--enable-pgp], [enable pgp])])
|
[AS_HELP_STRING([--enable-pgp], [enable pgp])])
|
||||||
|
AC_ARG_ENABLE([omemo],
|
||||||
|
[AS_HELP_STRING([--enable-omemo], [enable omemo encryption])])
|
||||||
AC_ARG_WITH([xscreensaver],
|
AC_ARG_WITH([xscreensaver],
|
||||||
[AS_HELP_STRING([--with-xscreensaver], [use libXScrnSaver to determine idle time])])
|
[AS_HELP_STRING([--with-xscreensaver], [use libXScrnSaver to determine idle time])])
|
||||||
AC_ARG_WITH([themes],
|
AC_ARG_WITH([themes],
|
||||||
@ -264,6 +266,17 @@ if test "x$enable_otr" != xno; then
|
|||||||
[AC_MSG_NOTICE([libotr not found, otr encryption support not enabled])])])
|
[AC_MSG_NOTICE([libotr not found, otr encryption support not enabled])])])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
AM_CONDITIONAL([BUILD_OMEMO], [false])
|
||||||
|
if test "x$enable_omemo" != xno; then
|
||||||
|
AC_CHECK_LIB([signal-protocol-c], [signal_context_create],
|
||||||
|
[AM_CONDITIONAL([BUILD_OMEMO], [true])
|
||||||
|
AC_DEFINE([HAVE_LIBSIGNAL_PROTOCOL], [1], [Have omemo]),
|
||||||
|
LIBS="-lsignal-protocol-c $LIBS"],
|
||||||
|
[AS_IF([test "x$enable_omemo" = xyes],
|
||||||
|
[AC_MSG_ERROR([libsignal-protocol-c is required for omemo support])],
|
||||||
|
[AC_MSG_NOTICE([libsignal-protocol-c not found, omemo support not enabled])])])
|
||||||
|
fi
|
||||||
|
|
||||||
AS_IF([test "x$with_themes" = xno],
|
AS_IF([test "x$with_themes" = xno],
|
||||||
[THEMES_INSTALL="false"],
|
[THEMES_INSTALL="false"],
|
||||||
[THEMES_INSTALL="true"])
|
[THEMES_INSTALL="true"])
|
||||||
|
@ -2328,7 +2328,25 @@ static struct cmd_t command_defs[] =
|
|||||||
CMD_EXAMPLES(
|
CMD_EXAMPLES(
|
||||||
"/cmd list",
|
"/cmd list",
|
||||||
"/cmd exec ping")
|
"/cmd exec ping")
|
||||||
}
|
},
|
||||||
|
|
||||||
|
{ "/omemo",
|
||||||
|
parse_args, 1, 3, NULL,
|
||||||
|
CMD_SUBFUNCS(
|
||||||
|
{ "init", cmd_omemo_init })
|
||||||
|
CMD_NOMAINFUNC
|
||||||
|
CMD_TAGS(
|
||||||
|
CMD_TAG_CHAT,
|
||||||
|
CMD_TAG_UI)
|
||||||
|
CMD_SYN(
|
||||||
|
"/omemo init")
|
||||||
|
CMD_DESC(
|
||||||
|
"Omemo commands to manage keys, and perform encryption during chat sessions.")
|
||||||
|
CMD_ARGS(
|
||||||
|
{ "init", "Initialize omemo" })
|
||||||
|
CMD_EXAMPLES(
|
||||||
|
"/omemo init")
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static GHashTable *search_index;
|
static GHashTable *search_index;
|
||||||
|
@ -85,6 +85,10 @@
|
|||||||
#include "pgp/gpg.h"
|
#include "pgp/gpg.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBSIGNAL_PROTOCOL
|
||||||
|
#include "omemo/omemo.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_GTK
|
#ifdef HAVE_GTK
|
||||||
#include "ui/tray.h"
|
#include "ui/tray.h"
|
||||||
#endif
|
#endif
|
||||||
@ -7872,3 +7876,22 @@ _cmd_set_boolean_preference(gchar *arg, const char *const command,
|
|||||||
g_string_free(enabled, TRUE);
|
g_string_free(enabled, TRUE);
|
||||||
g_string_free(disabled, TRUE);
|
g_string_free(disabled, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cmd_omemo_init(ProfWin *window, const char *const command, gchar **args)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_LIBSIGNAL_PROTOCOL
|
||||||
|
if (connection_get_status() != JABBER_CONNECTED) {
|
||||||
|
cons_show("You must be connected with an account to initialize omemo");
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
ProfAccount *account = accounts_get_account(session_get_account_name());
|
||||||
|
omemo_init(account);
|
||||||
|
cons_show("Initialized omemo");
|
||||||
|
return TRUE;
|
||||||
|
#else
|
||||||
|
cons_show("This version of Profanity has not been built with Omemo support enabled");
|
||||||
|
return TRUE;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
@ -214,4 +214,6 @@ gboolean cmd_wins_swap(ProfWin *window, const char *const command, gchar **args)
|
|||||||
|
|
||||||
gboolean cmd_form_field(ProfWin *window, char *tag, gchar **args);
|
gboolean cmd_form_field(ProfWin *window, char *tag, gchar **args);
|
||||||
|
|
||||||
|
gboolean cmd_omemo_init(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
10
src/omemo/omemo.c
Normal file
10
src/omemo/omemo.c
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#include <signal/signal_protocol.h>
|
||||||
|
|
||||||
|
#include "config/account.h"
|
||||||
|
|
||||||
|
void
|
||||||
|
omemo_init(ProfAccount *account)
|
||||||
|
{
|
||||||
|
signal_context *global_context;
|
||||||
|
signal_context_create(&global_context, NULL);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user