1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Add required OMEMO stub for unit-test

This commit is contained in:
Paul Fariello 2019-03-26 23:19:53 +01:00
parent 4a1c3c8c1e
commit daf84ced0c
4 changed files with 73 additions and 3 deletions

View File

@ -175,6 +175,9 @@ omemo_sources = \
src/omemo/omemo.h src/omemo/omemo.c src/omemo/crypto.h src/omemo/crypto.c \
src/omemo/store.h src/omemo/store.c src/xmpp/omemo.h src/xmpp/omemo.c
omemo_unittest_sources = \
tests/unittests/omemo/stub_omemo.c
if BUILD_PYTHON_API
core_sources += $(python_sources)
unittest_sources += $(python_sources)
@ -213,6 +216,7 @@ endif
if BUILD_OMEMO
core_sources += $(omemo_sources)
unittest_sources += $(omemo_unittest_sources)
endif
AM_CFLAGS = @AM_CFLAGS@ -I$(srcdir)/src

View File

@ -58,10 +58,12 @@ void chat_log_init(void) {}
void chat_log_msg_out(const char * const barejid, const char * const msg) {}
void chat_log_otr_msg_out(const char * const barejid, const char * const msg) {}
void chat_log_pgp_msg_out(const char * const barejid, const char * const msg) {}
void chat_log_omemo_msg_out(const char *const barejid, const char *const msg) {}
void chat_log_msg_in(const char * const barejid, const char * const msg, GDateTime *timestamp) {}
void chat_log_otr_msg_in(const char * const barejid, const char * const msg, gboolean was_decrypted, GDateTime *timestamp) {}
void chat_log_pgp_msg_in(const char * const barejid, const char * const msg, GDateTime *timestamp) {}
void chat_log_omemo_msg_in(const char *const barejid, const char *const msg, GDateTime *timestamp) {}
void chat_log_close(void) {}
GSList * chat_log_get_previous(const gchar * const login,
@ -71,5 +73,7 @@ GSList * chat_log_get_previous(const gchar * const login,
}
void groupchat_log_init(void) {}
void groupchat_log_chat(const gchar * const login, const gchar * const room,
const gchar * const nick, const gchar * const msg) {}
void groupchat_log_msg_in(const gchar *const room, const gchar *const nick, const gchar *const msg) {}
void groupchat_log_msg_out(const gchar *const room, const gchar *const msg) {}
void groupchat_log_omemo_msg_in(const gchar *const room, const gchar *const nick, const gchar *const msg) {}
void groupchat_log_omemo_msg_out(const gchar *const room, const gchar *const msg) {}

View File

@ -0,0 +1,61 @@
#include <glib.h>
#include "config/account.h"
#include "ui/ui.h"
void omemo_init(void) {}
char*
omemo_fingerprint_autocomplete(const char *const search_str, gboolean previous)
{
return NULL;
}
void omemo_fingerprint_autocomplete_reset(void) {}
char *
omemo_format_fingerprint(const char *const fingerprint)
{
return NULL;
}
void omemo_generate_crypto_materials(ProfAccount *account) {}
gboolean
omemo_is_trusted_identity(const char *const jid, const char *const fingerprint)
{
return TRUE;
}
GList *
omemo_known_device_identities(const char *const jid)
{
return NULL;
}
gboolean
omemo_loaded(void)
{
return TRUE;
}
void omemo_on_connect(ProfAccount *account) {}
void omemo_on_disconnect(void) {}
char *
omemo_on_message_send(ProfWin *win, const char *const message, gboolean request_receipt, gboolean muc)
{
return NULL;
}
char *
omemo_own_fingerprint(gboolean formatted)
{
return NULL;
}
void omemo_start_muc_sessions(const char *const roomjid) {}
void omemo_start_session(const char *const barejid) {}
void omemo_trust(const char *const jid, const char *const fingerprint_formatted) {}
void omemo_untrust(const char *const jid, const char *const fingerprint_formatted) {}
void omemo_devicelist_publish(GList *device_list) {}

View File

@ -190,7 +190,8 @@ void mucwin_occupant_role_and_affiliation_change(ProfMucWin *mucwin, const char
const char * const affiliation, const char * const actor, const char * const reason) {}
void mucwin_roster(ProfMucWin *mucwin, GList *occupants, const char * const presence) {}
void mucwin_history(ProfMucWin *mucwin, const char * const nick, GDateTime *timestamp, const char * const message) {}
void mucwin_message(ProfMucWin *mucwin, const char *const nick, const char *const message, GSList *mentions, GList *triggers) {}
void mucwin_incoming_msg(ProfMucWin *mucwin, const char *const nick, const char *const message, GSList *mentions, GList *triggers, prof_enc_t enc_mode) {}
void mucwin_outgoing_msg(ProfMucWin *mucwin, const char *const message, prof_enc_t enc_mode) {}
void mucwin_subject(ProfMucWin *mucwin, const char * const nick, const char * const subject) {}
void mucwin_requires_config(ProfMucWin *mucwin) {}
void ui_room_destroy(const char * const roomjid) {}