diff options
author | Michael Vetter <jubalh@iodoru.org> | 2019-04-11 10:58:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-11 10:58:22 +0200 |
commit | 61df0c8e8513a1aa9912e37019a63778ec3ed06c (patch) | |
tree | a52850f2f5fc225759c2287d1672ed22b5ef7f0a /tests | |
parent | 6b064cfde4456c25bd9dbcbfe0a79262ebcb3599 (diff) | |
parent | f75e1d7a7b05c68f03b6b13163ac9f2b8824e7df (diff) | |
download | profani-tty-61df0c8e8513a1aa9912e37019a63778ec3ed06c.tar.gz |
Merge pull request #1039 from paulfariello/feature/omemo
Add basic OMEMO support.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unittests/log/stub_log.c | 8 | ||||
-rw-r--r-- | tests/unittests/omemo/stub_omemo.c | 68 | ||||
-rw-r--r-- | tests/unittests/ui/stub_ui.c | 4 | ||||
-rw-r--r-- | tests/unittests/xmpp/stub_xmpp.c | 5 |
4 files changed, 81 insertions, 4 deletions
diff --git a/tests/unittests/log/stub_log.c b/tests/unittests/log/stub_log.c index e7d744b3..dfbec2bd 100644 --- a/tests/unittests/log/stub_log.c +++ b/tests/unittests/log/stub_log.c @@ -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) {} diff --git a/tests/unittests/omemo/stub_omemo.c b/tests/unittests/omemo/stub_omemo.c new file mode 100644 index 00000000..5b1d02df --- /dev/null +++ b/tests/unittests/omemo/stub_omemo.c @@ -0,0 +1,68 @@ +#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_jid(const char *const jid) +{ + return TRUE; +} + +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) {} +void omemo_publish_crypto_materials(void) {} diff --git a/tests/unittests/ui/stub_ui.c b/tests/unittests/ui/stub_ui.c index 855dca22..361a42e2 100644 --- a/tests/unittests/ui/stub_ui.c +++ b/tests/unittests/ui/stub_ui.c @@ -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, const char *const id, GSList *mentions, GList *triggers, prof_enc_t enc_mode) {} +void mucwin_outgoing_msg(ProfMucWin *mucwin, const char *const message, const char *const id, 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) {} @@ -337,6 +338,7 @@ void cons_show_presence_prefs(void) {} void cons_show_connection_prefs(void) {} void cons_show_otr_prefs(void) {} void cons_show_pgp_prefs(void) {} +void cons_show_omemo_prefs(void) {} void cons_show_account(ProfAccount *account) { diff --git a/tests/unittests/xmpp/stub_xmpp.c b/tests/unittests/xmpp/stub_xmpp.c index bc2c50db..53a729e6 100644 --- a/tests/unittests/xmpp/stub_xmpp.c +++ b/tests/unittests/xmpp/stub_xmpp.c @@ -114,7 +114,10 @@ char* message_send_chat_pgp(const char * const barejid, const char * const msg, } void message_send_private(const char * const fulljid, const char * const msg, const char *const oob_url) {} -void message_send_groupchat(const char * const roomjid, const char * const msg, const char *const oob_url) {} +char* message_send_groupchat(const char * const roomjid, const char * const msg, const char *const oob_url) +{ + return NULL; +} void message_send_groupchat_subject(const char * const roomjid, const char * const subject) {} void message_send_inactive(const char * const barejid) {} |